diff --git a/docs/oslo_ws24_collocated_ts.png b/docs/oslo_ws24_collocated_ts.png new file mode 100644 index 00000000..235053f3 Binary files /dev/null and b/docs/oslo_ws24_collocated_ts.png differ diff --git a/docs/oslo_ws24_filters_1.png b/docs/oslo_ws24_filters_1.png new file mode 100644 index 00000000..b0ec9b8a Binary files /dev/null and b/docs/oslo_ws24_filters_1.png differ diff --git a/docs/oslo_ws24_filters_2.png b/docs/oslo_ws24_filters_2.png new file mode 100644 index 00000000..d085a63b Binary files /dev/null and b/docs/oslo_ws24_filters_2.png differ diff --git a/docs/oslo_ws24_filters_3.png b/docs/oslo_ws24_filters_3.png new file mode 100644 index 00000000..2903fcc6 Binary files /dev/null and b/docs/oslo_ws24_filters_3.png differ diff --git a/docs/oslo_ws24_filters_4.png b/docs/oslo_ws24_filters_4.png new file mode 100644 index 00000000..d8e61c3b Binary files /dev/null and b/docs/oslo_ws24_filters_4.png differ diff --git a/docs/oslo_ws24_gridding_map.png b/docs/oslo_ws24_gridding_map.png new file mode 100644 index 00000000..9587e022 Binary files /dev/null and b/docs/oslo_ws24_gridding_map.png differ diff --git a/docs/oslo_ws24_gridding_nb_collocated.png b/docs/oslo_ws24_gridding_nb_collocated.png new file mode 100644 index 00000000..1bc1fa65 Binary files /dev/null and b/docs/oslo_ws24_gridding_nb_collocated.png differ diff --git a/docs/oslo_ws24_gridding_rmsd.png b/docs/oslo_ws24_gridding_rmsd.png new file mode 100644 index 00000000..03f35964 Binary files /dev/null and b/docs/oslo_ws24_gridding_rmsd.png differ diff --git a/docs/oslo_ws24_insitu.png b/docs/oslo_ws24_insitu.png new file mode 100644 index 00000000..33efd828 Binary files /dev/null and b/docs/oslo_ws24_insitu.png differ diff --git a/docs/oslo_ws24_model_map.png b/docs/oslo_ws24_model_map.png new file mode 100644 index 00000000..6c42eb29 Binary files /dev/null and b/docs/oslo_ws24_model_map.png differ diff --git a/docs/oslo_ws24_sat_map.png b/docs/oslo_ws24_sat_map.png new file mode 100644 index 00000000..7abc9b7e Binary files /dev/null and b/docs/oslo_ws24_sat_map.png differ diff --git a/docs/oslo_ws24_sat_ts.png b/docs/oslo_ws24_sat_ts.png new file mode 100644 index 00000000..fc78dde1 Binary files /dev/null and b/docs/oslo_ws24_sat_ts.png differ diff --git a/docs/workshop_latest.rst b/docs/workshop_latest.rst index 4f96d6b4..2689fd5a 100644 --- a/docs/workshop_latest.rst +++ b/docs/workshop_latest.rst @@ -307,6 +307,16 @@ Using the quicklook function you can quickly visualize the data you have retriev >>> sco.quicklook(m=True) # for a map >>> sco.quicklook(a=True) # for all +.. |ex1| image:: ./oslo_ws24_sat_ts.png + :scale: 50 +.. |ex2| image:: ./oslo_ws24_sat_map.png + :scale: 50 + ++-------------------+------------------+ +| |ex1| | |ex2| | +| | | ++-------------------+------------------+ + Exercise: ********* @@ -329,12 +339,20 @@ In-situ observations can also be imported using the insitu_module module. You ca >>> ico = ic(nID=nID, sd=sd, ed=ed, varalias=varalias, name=sensor) >>> ico = ico.populate() +You can have a look at the obtained time series: + +.. code-block:: python3 + + >>> sco.quicklook(ts=True) + + +.. image:: ./oslo_ws24_insitu.png + :scale: 80 + 5. access/read model data ######################### -Model output can be accessed and read using the model_module module. The model_module config file model_cfg.yaml needs adjustments if you want to include a model that is not present as default. Given that the model output file you would like to read follows the cf-conventions and standard_names are unique, the minimum information you have to provide are usually: - -TO COMPLETE +Model output can be accessed and read using the model_module module. The model_module config file model_cfg.yaml needs adjustments if you want to include a model that is not present as default. You can then import model data as follows: @@ -348,6 +366,14 @@ You can then import model data as follows: >>> mco = mc(nID=nID, sd=sd).populate() # one time slice >>> mco_p = mc(nID=nID, sd=sd, ed=ed).populate() # time period +And again it is possible to visualize the data: + +.. code-block:: python3 + + >>> sco.quicklook(m=True) + +.. image:: ./oslo_ws24_model_map.png + :scale: 80 6. Collocating model and observations ##################################### @@ -385,6 +411,13 @@ Collocation of satellite and wave model Using the quicklook function again (*cco.quicklook(a=True)*) will enable three plots this time, a time series plot (*ts=True*), a map plot (*m=True*), and a scatter plot (*sc=True*). +.. code-block:: python3 + + >>> cco.quicklook(ts=True) + +.. image:: ./oslo_ws24_collocated_ts.png + :scale: 80 + 7. Validate the collocated time series ####################################### @@ -464,6 +497,9 @@ Now the gridder can be applied as follows: >>> mask_metric_llim=1, >>> title='') +.. image:: ./oslo_ws24_gridding_map.png + :scale: 80 + Information of the grid and the values from observations and model can also be obtained directly from the gridder_class object: .. code-block:: python3 @@ -491,7 +527,17 @@ It is also possible to grid the collocated data. >>> # plot all validation metrics on grid >>> gco.quicklook(val_grid=var_gridded_dict, lon_grid=lon_grid, lat_grid=lat_grid, metric='all') - +.. |ex3| image:: ./oslo_ws24_gridding_nb_collocated.png + :scale: 50 +.. |ex4| image:: ./oslo_ws24_gridding_rmsd.png + :scale: 50 + ++-------------------+------------------+ +| |ex3| | |ex4| | +| | | ++-------------------+------------------+ + + 9. Applying filters ################### Finally, it is possible to apply some filters to the data. Let us try it on some @@ -515,6 +561,9 @@ You can have a first look at the data: >>> sco.quicklook(a=True, land_mask_resolution='f') +.. image:: ./oslo_ws24_filters_1.png + :scale: 80 + There could be some land interactions with the satellite track. It is possible to filter it using *sco.filter_landMask()* function. Additionnally points closer than a certain distance to the coast can be defined using *sco.filter_distance_to_coast()* with *llim* argument. If specifics (range gate resolution and height over ground) about the satellite intsrument are known one can compute a possible foot print land interaction based on the size of the pulse limited footprint size byt adding *.filter_footprint_land_interaction()*. Finally, values under threshold (resp. over) can also be discarder using the *sco.apply_limits()* method with *llim* argument (resp. *ulim*). The corresponding code is the following: @@ -526,12 +575,19 @@ The corresponding code is the following: ... .filter_footprint_land_interaction()\ ... .apply_limits(llim=0.1) + +.. image:: ./oslo_ws24_filters_2.png + :scale: 80 + Some additional despiking method can be applied with *sco.despike_blockStd()*. .. code-block:: python3 >>> sco = sco.despike_blockStd(slider=20, sigma=2, chunk_min=5, sampling_rate_Hz=20) +.. image:: ./oslo_ws24_filters_3.png + :scale: 80 + In order to show the computed x-track pulse-limited footprint size one can add: .. code-block:: python3 @@ -543,7 +599,8 @@ Another operation you can perform is smoothing the time serie, using a running m .. code-block:: python3 >>> sco = sco.filter_runmean(window=5, chunk_min=5, sampling_rate_Hz=20) - + + 10. Saving data to netcdf ######################### It is possible to save the data from the different wavy objects to .nc files. If diff --git a/wavy/quicklookmod.py b/wavy/quicklookmod.py index 761a545b..d36037fb 100755 --- a/wavy/quicklookmod.py +++ b/wavy/quicklookmod.py @@ -257,11 +257,15 @@ def quicklook(self, a=False, projection=None, **kwargs): label=self.nID, marker='o',alpha=.5,ms=2) try: + if 'model' in vars(self): + label_scdplot = self.model + else: + label_scdplot = self.nID ax.plot(self.vars['time'], plot_var_model, color=colors[1], linestyle=kwargs.get('linestyle',''), - label=self.nID, + label=label_scdplot, marker='o',alpha=.5,ms=2) except Exception as e: pass