ocmw.dataman.ww3WavesMatchUpDatabase module¶
Tools for generating an SQLite matchup database from a set of model extracts and an archive of wavebuoy data.
These tools are tied to the ResourceCode WaveWatch III model hindcast data, but the undelying functions for opening, populating and querying and SQLite dataase are generic.
Writes database match-ups based on location and time query to a CSV file. |
|
Create a database connection to the SQLite database specified by db_file. |
|
Release connection to database. |
|
Create the ResourceCode hindcast database table. |
|
Create the wavebuoy database table. |
|
Create a new record in the rscd_files table |
|
Create a new record in the rscd_files table |
|
Get database match-up records based on supplied sql query. |
|
Create a new record in the match_files table |
|
Loop across the ResourceCode WW3 hindcast data archive extracting metadata and adding records to database. |
|
Loop across the buoy data archive extracting metadata and adding records to database. |
|
Construct the ResourceCode Match-up Database. |
Tools for generating an SQLite matchup database from a set of model extracts and an archive of wavebuoy data.
These tools are tied to the ResourceCode WaveWatch III model hindcast data, but the undelying functions for opening, populating and querying and SQLite dataase are generic.
- ocmw.dataman.ww3WavesMatchUpDatabase.db_match_to_csv(db_path, db_name, csv_path, csv_fname)[source]¶
Writes database match-ups based on location and time query to a CSV file.
- ocmw.dataman.ww3WavesMatchUpDatabase.create_connection(db_file)[source]¶
Create a database connection to the SQLite database specified by db_file.
- Parameters:
db_file – database file
- Returns:
Connection object or None
- ocmw.dataman.ww3WavesMatchUpDatabase.close_database(db_conn)[source]¶
Release connection to database.
- ocmw.dataman.ww3WavesMatchUpDatabase.create_rscd_table(db_conn)[source]¶
Create the ResourceCode hindcast database table.
- ocmw.dataman.ww3WavesMatchUpDatabase.create_buoy_table(db_conn)[source]¶
Create the wavebuoy database table.
- ocmw.dataman.ww3WavesMatchUpDatabase.insert_rscd_records(db_conn, records)[source]¶
Create a new record in the rscd_files table
- Parameters:
db_conn
records
- Returns:
row count
- ocmw.dataman.ww3WavesMatchUpDatabase.insert_buoy_records(db_conn, records)[source]¶
Create a new record in the rscd_files table
- Parameters:
db_conn
record
- Returns:
row count
- ocmw.dataman.ww3WavesMatchUpDatabase.get_match_records(db_path, db_name, sql_query)[source]¶
Get database match-up records based on supplied sql query.
- ocmw.dataman.ww3WavesMatchUpDatabase.insert_match_record(db_conn, records)[source]¶
Create a new record in the match_files table
- Parameters:
db_conn
records
- Returns:
row count
- ocmw.dataman.ww3WavesMatchUpDatabase.load_rscd_archive(db_conn, archivePath, dataSet, chunkSize=500)[source]¶
Loop across the ResourceCode WW3 hindcast data archive extracting metadata and adding records to database.