Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Use case #9 using the CLI

Norman Fomferra edited this page Oct 12, 2016 · 51 revisions

This page is outdated

The up-to-date information provided here is in UC9 CLI Demo.


This page describes how use case #9 workflow can be executed using the ECT CLI.
For all CLI commands see CLI command overview.

1. Data product selection

ect ds list -n ozone
ect ds list -n cloud

ect ws new
ect res open cl07 esacci.CLOUD.mon.L3C.CLD_PRODUCTS.AVHRR.NOAA-15.AVHRR_NOAA.1-0.r1 2007-01-01 2007-12-30
ect res open oz07 esacci.OZONE.mon.L3.NP.multi-sensor.multi-platform.MERGED.fv0002.r1 2007-01-01 2007-12-30

The ect res open command automatically downloads the data, if it not already available on the local computer. This process, called syncing, can be invoked manually, too:

ect ds sync esacci.CLOUD.mon.L3C.CLD_PRODUCTS.AVHRR.NOAA-15.AVHRR_NOAA.1-0.r1 2007-01-01 2007-12-30
ect ds sync esacci.OZONE.mon.L3.NP.multi-sensor.multi-platform.MERGED.fv0002.r1 2007-01-01 2007-12-30

2.

To select particular geophysical quantities to work with, use the 'select_var' operation:

ect res set cc_tot select_var ds=cl07 var=cc_total
ect res set oz_tot select_var ds=oz07 var=O3_du_tot

3. Co-Registration

ect op list --tag geom

will list all commands that have a tag that matches 'geom'.

4.

ect op info coregister

will print help and list all parameters of operation ect.ops.coregistration.coregister.

5.

ect res set oz_tot_res coregister ds_master=cc_tot ds_slave=oz_tot

6. to 8. Spatial Filtering

according to 2. to 4.

ect res set oz_africa subset_spatial ds=oz_tot_res lat_min=20 lat_max=30 lon_min=25 lon_max=40
ect res set cc_africa subset_spatial ds=cc_tot lat_min=20 lat_max=30 lon_min=25 lon_max=40

9.

n.a

10. to 12. Temporal Filtering

according to 2. to 4.

ect res set oz_africa_janoct subset_temporal ds=oz_africa time_min='2007-01-01' time_max='2007-10-30'

If on Linux, quotes enclosing datetime strings should be additionally escaped:

ect res set oz_africa_janoct subset_temporal ds=oz_africa time_min=\'2007-01-01\' time_max=\'2007-10-30\'

The clouds dataset does not use datetime for time definition. Hence subset by indices

ect res set cc_africa_janoct subset_temporal_index ds=cc_africa time_ind_min=0 time_ind_max=9

13. Extract time series

We'll extract spatial mean timeseries from both datasets.

ect res set cc_africa_ts tseries_mean ds=cc_africa_janoct var=cc_total
ect res set oz_africa_ts tseries_mean ds=oz_africa_janoct var=O3_du_tot

This creates datasets that are like respective *_janoct datasets in all aspects with additional one dimensional (time) timeseries dataset variable, such as cc_total_ts_mean.

14. to 17. Time Series Plot

ect op list -t plot
ect op help ect.ops.timeseriesplot

ect run --write tsplot.png ect.ops.timeseriesplot cloud2007ga.aerosol_optical_depth cloud2007.cloud_cover lat=13 lon=42 multiple_datasets=true

An alternative way would be to assign the timeseries plot in a first step to a resource name and plot it in a second step.

ect res set tsplot ect.ops.timeseriesplot ds=aero2007.aerosol_optical_depth,cloud2007ga.cloud_cover lat=13 lon=42 multiple_datasets=true
ect res write tsplot tsplot.png

18. to 22. Product-Moment Correlation (Pearson)

ect op list --tag correlation
ect op help pearson_correlation
ect res set pearson pearson_correlation ds_y=cc_africa_ts ds_x=oz_africa_ts var_y=cc_total var_x=O3_du_tot file=pearson.txt
ect res write pearson pearson.nc

23. to 27. Spatial Filtering

ect op list --tag filter
ect op help ect.ops.spatial_filter
ect res set aero2007_sub ect.ops.spatial_filter ds=aero2007.aerosol_optical_depth region=POLYGON((......))
ect res set cloud2007_sub ect.ops.spatial_filter ds=cloud2007ga.cloud_cover region=POLYGON((......))

28. to 32. Animated Map

ect op list --tag animation
ect op help ect.ops.animated_map
ect run --write animation.gif ect.ops.animated_map ds=aero2007_sub,cloud2007_sub multiple_datasets=true

33. to 37. Product-Moment Correlation (Pearson)

ect run --write correlation_map.png, correlation.txt ect.ops.pearson ds1=aero2007_sub ds2=cloud2007_sub mode=grid_map

Here the alternative pattern would be:

ect res set correlation ect.ops.pearson ds1=aero2007_sub ds2=cloud2007_sub mode=grid_map
ect res write correlation map=correlation_map.png
ect res write correlation stat=correlation_statistics.txt
Clone this wiki locally