Skip to content

Commit

Permalink
updated S1 validation tables and presentation materials
Browse files Browse the repository at this point in the history
  • Loading branch information
mbonnema committed Sep 11, 2024
1 parent 8c42140 commit 6ad638e
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 113 deletions.
106 changes: 53 additions & 53 deletions dswx_verification/data/validation_table.csv

Large diffs are not rendered by default.

105 changes: 53 additions & 52 deletions dswx_verification/data/validation_table.geojson

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions notebooks/1_Verification_Metrics_at_Validation_Site.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.1
# jupytext_version: 1.16.4
# kernelspec:
# display_name: dswx_val
# language: python
Expand All @@ -33,7 +33,9 @@
get_equal_samples_per_label,
generate_random_indices_for_classes,
get_all_metrics_for_one_trial,
get_geopandas_features_from_array)
get_geopandas_features_from_array,
get_localized_validation_table,
get_path_of_validation_geojson)
from dswx_verification.data_models import VerificationParameters
from dswx_verification.constants import OSW_ACCURACY_REQ, PSW_ACCURACY_REQ
import yaml
Expand All @@ -59,7 +61,7 @@
# We load a parameter file so it can be shared throughout the workflow.

# %% tags=["parameters"]
site_name = '3_4'
site_name = '4_9'
yaml_file = 'verification_parameters.yml'

# %% [markdown]
Expand Down Expand Up @@ -525,3 +527,7 @@ def write_one(file_name: str, raster: np.ndarray, profile: dict, colormap: dict

# %% editable=true slideshow={"slide_type": ""}
json.dump(json_data_f, open(site_dir / 'trial_stats.json', 'w'), indent=2)

# %%

# %%
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.1
# jupytext_version: 1.16.4
# kernelspec:
# display_name: dswx_val
# language: python
Expand Down
2 changes: 1 addition & 1 deletion notebooks/3_Aggregate_Data_across_Validation_Sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.1
# jupytext_version: 1.16.4
# kernelspec:
# display_name: dswx_val
# language: python
Expand Down
2 changes: 1 addition & 1 deletion notebooks/4_Generate_Beamer_Slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.1
# jupytext_version: 1.16.4
# kernelspec:
# display_name: dswx_val
# language: python
Expand Down
2 changes: 1 addition & 1 deletion notebooks/Dataset_Accounting_Optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.1
# jupytext_version: 1.16.4
# kernelspec:
# display_name: dswx_val
# language: python
Expand Down
2 changes: 1 addition & 1 deletion notebooks/verification_parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ verification_parameters:
data_dir: out/latest
input_product: s1
confidence_classes_to_strictly_include:
rel_dswx_db_dir_path:
rel_dswx_db_dir_path:
presentation_parameters:
presentation_dir: presentation_material
18 changes: 18 additions & 0 deletions notebooks/verify_all_dswx.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: -all
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.16.4
# ---

# %%
from pathlib import Path

# %%
import click
import papermill as pm
from dswx_verification import get_localized_validation_table
from tqdm import tqdm


# %%
repo_dir = Path(__file__).parent.resolve().parent
SITE_NOTEBOOKS_RELATIVE_PATHS = [repo_dir / 'notebooks/1_Verification_Metrics_at_Validation_Site.ipynb',
repo_dir / 'notebooks/2_Summarize_and_Visualize_Data_at_Validation_Site.ipynb',
]


# %%
@click.option('--yaml_config',
required=True,
type=str,
Expand Down Expand Up @@ -39,6 +55,7 @@ def main(yaml_config: str,

df_val = get_localized_validation_table()
site_names = df_val.site_name.tolist()
#site_names.remove('2_1')
if sites:
valid_sites = [site in site_names for site in sites]
if not all(valid_sites):
Expand Down Expand Up @@ -71,5 +88,6 @@ def main(yaml_config: str,
parameters=dict(yaml_file=yaml_config))


# %%
if __name__ == '__main__':
main()

0 comments on commit 6ad638e

Please sign in to comment.