MatchUpDatabase¶
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.
- Dependencies [External]:
os, re, sqlite, csv
- Dependencies [Internal]:
waveval.Geomtery, waveval.TimeFuncs, waveval.ObsData, waveval.ModelData
- MatchUpDatabase.construct_rscd_mdb(db_path: str, db_name: str, rscdpath: str, rscddataset: str, months: list, buoypath: str, buoydataset: str, buoydatafmt: str, bfilt=None, chunkSize=500)[source]¶
- MatchUpDatabase.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
- MatchUpDatabase.insert_buoy_records(db_conn, records)[source]¶
Create a new record in the rscd_files table
- Parameters:
db_conn –
record –
- Returns:
row count
- MatchUpDatabase.insert_match_record(db_conn, records)[source]¶
Create a new record in the match_files table
- Parameters:
db_conn –
records –
- Returns:
row count
- MatchUpDatabase.insert_rscd_records(db_conn, records)[source]¶
Create a new record in the rscd_files table
- Parameters:
db_conn –
records –
- Returns:
row count
- MatchUpDatabase.load_buoy_archive(db_conn, archivePath: str, dataSet: str, dataFmt: str, recFilter=None, chunkSize=500, verbose=False)[source]¶