From 748c4acec9910c5aca4662c1136d2abed1af6f85 Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Mon, 14 Jun 2021 18:27:20 -0400 Subject: [PATCH 1/7] minor fix on search_datasets function --- erddap_app/plots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erddap_app/plots.py b/erddap_app/plots.py index 7340aea..344b568 100644 --- a/erddap_app/plots.py +++ b/erddap_app/plots.py @@ -47,7 +47,7 @@ def search_datasets(e, standard_name, cdm_data_type, min_time, max_time, skip_da continue except HTTPError: - df = [] + pass return df From 0265d7e05f04d84eac20aa1ec8b0c33c692c7ea9 Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Mon, 14 Jun 2021 18:31:49 -0400 Subject: [PATCH 2/7] add UNH_CML to skip_datasets list --- erddap_app/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erddap_app/config.py b/erddap_app/config.py index ce2f65e..9d93b61 100644 --- a/erddap_app/config.py +++ b/erddap_app/config.py @@ -45,6 +45,6 @@ "zoom": 6, "max_time": now, "min_time": now.subtract(weeks=2), - "skip_datasets": ["cwwcNDBCMet"], + "skip_datasets": ["cwwcNDBCMet", "UNH_CML"], }, } From 583e08b5527fe67186b93a6b9558304b70ad1e4b Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Mon, 14 Jun 2021 18:33:56 -0400 Subject: [PATCH 3/7] add altitude to skip_stdnames --- erddap_app/plots.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erddap_app/plots.py b/erddap_app/plots.py index 344b568..16b3488 100644 --- a/erddap_app/plots.py +++ b/erddap_app/plots.py @@ -164,6 +164,7 @@ def remove_qcstdnames(standard_names): "station_name", "time", "offset_time", + "altitude", ] skip_stdnames.extend(qc_stdnames) From 5ac127550bb9e67452cf405f76b4185ebca9a158 Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Mon, 14 Jun 2021 19:09:27 -0400 Subject: [PATCH 4/7] add UNH_WBD to skip_datasets --- erddap_app/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erddap_app/config.py b/erddap_app/config.py index 9d93b61..9ec1ff8 100644 --- a/erddap_app/config.py +++ b/erddap_app/config.py @@ -45,6 +45,6 @@ "zoom": 6, "max_time": now, "min_time": now.subtract(weeks=2), - "skip_datasets": ["cwwcNDBCMet", "UNH_CML"], + "skip_datasets": ["cwwcNDBCMet", "UNH_CML", "UNH_WBD"], }, } From 39157ec2c646d99a362ae74b780c408f569f9632 Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Thu, 1 Jul 2021 16:07:54 -0400 Subject: [PATCH 5/7] small fixes to search_datasets --- erddap_app/plots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erddap_app/plots.py b/erddap_app/plots.py index 16b3488..ea45925 100644 --- a/erddap_app/plots.py +++ b/erddap_app/plots.py @@ -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: - pass + df = pd.DataFrame([]) return df From 9dff0dab794f10de04a4fedcb79cd1d53cf4bf1f Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Thu, 1 Jul 2021 16:12:44 -0400 Subject: [PATCH 6/7] add stdnames to skip_stdnames list --- erddap_app/plots.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erddap_app/plots.py b/erddap_app/plots.py index ea45925..ffdb4ca 100644 --- a/erddap_app/plots.py +++ b/erddap_app/plots.py @@ -165,6 +165,9 @@ def remove_qcstdnames(standard_names): "time", "offset_time", "altitude", + "battery_voltage", + "panel_temperature", + "webcam", ] skip_stdnames.extend(qc_stdnames) @@ -174,7 +177,7 @@ def remove_qcstdnames(standard_names): try: standard_names.remove(skip_stdname) except ValueError: - continue + pass del skip_stdname return standard_names From 58e3a8a9c71dd8a890093dc39ade3298f006fa69 Mon Sep 17 00:00:00 2001 From: Ana Krelling Date: Thu, 1 Jul 2021 16:23:04 -0400 Subject: [PATCH 7/7] improve readability on get_valid_stdnames --- erddap_app/plots.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/erddap_app/plots.py b/erddap_app/plots.py index ffdb4ca..b720a89 100644 --- a/erddap_app/plots.py +++ b/erddap_app/plots.py @@ -218,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], @@ -241,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