-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from kthyng/proto
Updates for working prototype!
- Loading branch information
Showing
19 changed files
with
1,641 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*.png | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
approach: "stations" | ||
loc_model: "https://thredds.cencoos.org/thredds/dodsC/CENCOOS_CA_ROMS_FCST.nc" | ||
axds: | ||
bbox: | ||
criteria: | ||
salt: | ||
name: | ||
"sea_water_practical_salinity$" | ||
erddap: | ||
figname_map: "local_cli.png" | ||
figname_data_prefix: "local_cli_" | ||
local: | ||
filenames: | ||
- "edu_humboldt_tdp.csv" | ||
- "bodega-bay-bml_wts.nc" | ||
only_search: false | ||
only_searchplot: false | ||
parallel: true | ||
readers: | ||
- "local" | ||
run_qc: false | ||
skip_units: true | ||
stations: | ||
time_range: | ||
- "2021-9-1" | ||
- "2021-9-8" | ||
var_def: | ||
salt: | ||
units: "psu" | ||
fail_span: | ||
- -10 | ||
- 60 | ||
suspect_span: | ||
- -1 | ||
- 45 | ||
variables: | ||
- "salt" | ||
xarray_kwargs: | ||
chunks: | ||
time: | ||
1 | ||
depth: | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
approach: "stations" | ||
loc_model: "https://thredds.cencoos.org/thredds/dodsC/CENCOOS_CA_ROMS_FCST.nc" | ||
axds: | ||
bbox: | ||
criteria: | ||
salt: | ||
name: | ||
"sea_water_practical_salinity$" | ||
erddap: | ||
known_server: | ||
"ioos" | ||
figname_map: "nonlocal_cli.png" | ||
figname_data_prefix: "nonlocal_cli_" | ||
local: | ||
only_search: false | ||
only_searchplot: false | ||
parallel: true | ||
readers: | ||
- "erddap" | ||
run_qc: false | ||
skip_units: true | ||
stations: | ||
- "edu_humboldt_tdp" | ||
- "bodega-bay-bml_wts" | ||
time_range: | ||
- "2021-9-1" | ||
- "2021-9-8" | ||
var_def: | ||
salt: | ||
units: "psu" | ||
fail_span: | ||
- -10 | ||
- 60 | ||
suspect_span: | ||
- -1 | ||
- 45 | ||
variables: | ||
- "salt" | ||
xarray_kwargs: | ||
chunks: | ||
time: | ||
1 | ||
depth: | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
approach: "region" | ||
loc_model: "https://thredds.cencoos.org/thredds/dodsC/CENCOOS_CA_ROMS_FCST.nc" | ||
axds: | ||
bbox: | ||
- -124.5 | ||
- 40 | ||
- -123.5 | ||
- 42 | ||
criteria: | ||
salt: | ||
name: | ||
"sea_water_practical_salinity$" | ||
erddap: | ||
known_server: | ||
"ioos" | ||
figname_map: "nonlocal_cli_region.png" | ||
figname_data_prefix: "nonlocal_cli__region" | ||
local: | ||
only_search: false | ||
only_searchplot: false | ||
parallel: true | ||
readers: | ||
- "erddap" | ||
run_qc: false | ||
skip_units: true | ||
stations: | ||
time_range: | ||
- "2021-9-1" | ||
- "2021-9-8" | ||
var_def: | ||
salt: | ||
units: "psu" | ||
fail_span: | ||
- -10 | ||
- 60 | ||
suspect_span: | ||
- -1 | ||
- 45 | ||
variables: | ||
- "salt" | ||
xarray_kwargs: | ||
chunks: | ||
time: | ||
1 | ||
depth: | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
""" | ||
Command Line Interface. | ||
""" | ||
|
||
import argparse | ||
|
||
import ocean_data_gateway as odg | ||
import yaml | ||
|
||
import ocean_model_skill_assessor as omsa | ||
|
||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"config_file", help="Give path to configuration file. Should be yaml." | ||
) | ||
|
||
args = parser.parse_args() | ||
config_file = args.config_file | ||
|
||
with open(config_file, "r") as ymlfile: | ||
cfg = yaml.load(ymlfile) | ||
|
||
approach = cfg["approach"] | ||
loc_model = cfg["loc_model"] | ||
axds = cfg["axds"] | ||
bbox = cfg["bbox"] | ||
criteria = cfg["criteria"] | ||
erddap = cfg["erddap"] | ||
figname_map = cfg["figname_map"] | ||
figname_data_prefix = cfg["figname_data_prefix"] | ||
local = cfg["local"] | ||
only_search = cfg["only_search"] | ||
only_searchplot = cfg["only_searchplot"] | ||
parallel = cfg["parallel"] | ||
readers = cfg["readers"] | ||
run_qc = cfg["run_qc"] | ||
skip_units = cfg["skip_units"] | ||
stations = cfg["stations"] | ||
time_range = cfg["time_range"] | ||
var_def = cfg["var_def"] | ||
variables = cfg["variables"] | ||
xarray_kwargs = cfg["xarray_kwargs"] | ||
|
||
omsa.set_criteria(criteria) | ||
|
||
if readers is not None: | ||
input_readers = readers | ||
readers = [] | ||
if "local" in input_readers: | ||
readers.append(odg.local) | ||
if "erddap" in input_readers: | ||
readers.append(odg.erddap) | ||
if "axds" in input_readers: | ||
readers.append(odg.axds) | ||
|
||
search = omsa.run( | ||
approach=approach, | ||
loc_model=loc_model, | ||
axds=axds, | ||
bbox=bbox, | ||
criteria=criteria, | ||
erddap=erddap, | ||
figname_map=figname_map, | ||
figname_data_prefix=figname_data_prefix, | ||
local=local, | ||
only_search=only_search, | ||
only_searchplot=only_searchplot, | ||
parallel=parallel, | ||
readers=readers, | ||
run_qc=run_qc, | ||
skip_units=skip_units, | ||
time_range=time_range, | ||
stations=stations, | ||
var_def=var_def, | ||
variables=variables, | ||
xarray_kwargs=xarray_kwargs, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.