Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds a couple of datasets to skip_datasets #35

Merged
merged 7 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion erddap_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"zoom": 6,
"max_time": now,
"min_time": now.subtract(weeks=2),
"skip_datasets": ["cwwcNDBCMet"],
"skip_datasets": ["cwwcNDBCMet", "UNH_CML", "UNH_WBD"],
},
}
36 changes: 17 additions & 19 deletions erddap_app/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def search_datasets(e, standard_name, cdm_data_type, min_time, max_time, skip_da
row = df.loc[df["Dataset ID"] == skip_dataset].index[0]
df.drop(row, inplace=True)
except IndexError: # this error arises when the stdname doesn't have any datasets to be skipped.
continue
pass

except HTTPError:
df = []
df = pd.DataFrame([])

return df

Expand Down Expand Up @@ -164,6 +164,10 @@ def remove_qcstdnames(standard_names):
"station_name",
"time",
"offset_time",
"altitude",
"battery_voltage",
"panel_temperature",
"webcam",
]

skip_stdnames.extend(qc_stdnames)
Expand All @@ -173,7 +177,7 @@ def remove_qcstdnames(standard_names):
try:
standard_names.remove(skip_stdname)
except ValueError:
continue
pass
del skip_stdname

return standard_names
Expand Down Expand Up @@ -214,20 +218,16 @@ def get_valid_stdnames(server_name):
elif count == (len(standard_names)):
print("Done!")

try:

features, datasets = stdname2geojson(
e,
standard_name,
server.get("cdm_data_type"),
server.get("min_time"),
server.get("max_time"),
server.get("skip_datasets"),
)
except NameError: # this error arises when there is no df for this stdname.
continue
features, datasets = stdname2geojson(
e,
standard_name,
server.get("cdm_data_type"),
server.get("min_time"),
server.get("max_time"),
server.get("skip_datasets"),
)

try:
if len(datasets) > 0: # if there is at least one dataset with this data

var = e.get_var_by_attr(
dataset_id=datasets[0],
Expand All @@ -237,9 +237,7 @@ def get_valid_stdnames(server_name):
if var != []:
valid_standard_names.append(standard_name)

except IndexError: # this error arises when the only dataset available for this stdname was skipped.
del features, datasets
continue
del features, datasets

return valid_standard_names, server, e

Expand Down