... | @@ -72,11 +72,65 @@ sbatch run_gridding.slurm |
... | @@ -72,11 +72,65 @@ sbatch run_gridding.slurm |
|
|
|
|
|
For more information on the processing workflow of this script read the following [jupyter notebook](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/notebooks/cci_at_buoy_coord_results.ipynb)
|
|
For more information on the processing workflow of this script read the following [jupyter notebook](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/notebooks/cci_at_buoy_coord_results.ipynb)
|
|
|
|
|
|
Computing time series
|
|
After the re-gridding of data this can be downloaded to either your local pc, or you can run the rest of the scripts in a sci-server in JASMIN. There is no need for a cluster, and the scripts can be run locally.
|
|
---------------------
|
|
|
|
|
|
|
|
|
|
However, you always need to activate the same environment.
|
|
|
|
|
|
|
|
|
|
|
|
Computing time series differences
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
We want to know compare the two data sets produced in the previous section and calculate the following:
|
|
|
|
|
|
|
|
- Moving averages over time from each data set (monthly, yearly or quarterly averages)
|
|
|
|
|
|
|
|
- The differences' cell by cell between the time averaged sst values of both data sets.
|
|
|
|
|
|
|
|
|
|
|
|
Both tasks happen in the script ``~/scripts/sst_differences.py``
|
|
|
|
|
|
|
|
To run this you should follow the next steps:
|
|
|
|
|
|
|
|
1. Make sure you activate your environment and have change the paths to the re-gridding data output in the [configuration file, see link](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/config.ini#L15-22), and assign an output path for this script under the variable ``time_series``:
|
|
|
|
|
|
|
|
~~~
|
|
|
|
vim ~/orchestra_sst/config.ini
|
|
|
|
~~~
|
|
|
|
|
|
|
|
2. Modify in `sst_diferences.py` the type of data to process and the time average that you want ([lines 25-27](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/scripts/sst_differences.py#L25-27)):
|
|
|
|
|
|
|
|
~~~
|
|
|
|
# Input specified resolution in space and time
|
|
|
|
# Here we will process 1x1 degree resolution data
|
|
|
|
res = 1
|
|
|
|
# We will calculate a time series based on a monthly average.
|
|
|
|
alias = '1M'
|
|
|
|
~~~
|
|
|
|
|
|
|
|
**[res](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/scripts/sst_differences.py#L26)**: the resolution of the data set to analysed (e.g. 1 or 2 degree)
|
|
|
|
|
|
|
|
|
|
|
|
**[alias](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/scripts/sst_differences.py#L27)**: is the time average offset used by [xarray.resample](http://xarray.pydata.org/en/v0.7.1/generated/xarray.DataArray.resample.html#r21) function to compute the average over time. The format of the alias has to be the same the ones used by xarray and pandas. More information about offsets can also be read in this [pandas documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#dateoffset-objects). For this project we only use monthly averages (`1M`), yearly averages (`1Y`) and quarterly starting in January (`QS-JAN`).
|
|
|
|
|
|
|
|
3. The script now can be run by:
|
|
|
|
|
|
|
|
~~~
|
|
|
|
(sst_env)$ python sst_diferences.py
|
|
|
|
~~~
|
|
|
|
|
|
|
|
The output of this script is a .csv file with the sst differences over the southern ocean.
|
|
|
|
|
|
|
|
A detail explanation of the processing can be found in this [jupyter notebook](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/notebooks/computing_time_series.ipynb) and in the [workflow python module](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/sst_tools/workflow_sst.py).
|
|
|
|
|
|
Saving output as netcdf
|
|
Saving output as netcdf
|
|
----------------------- |
|
-----------------------
|
|
\ No newline at end of file |
|
|
|
|
|
We don't just one a time series average but sometimes a gridded product of the time series, to play around later with the difference between the two data sets. A gridded time series data set is processed by the script: ``~/scripts/combined_data_to_netcdf.py``.
|
|
|
|
|
|
|
|
Like the script above you need to specify a path output in the ``config.ini`` file under the variable [combined_data](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/config.ini#L30).
|
|
|
|
|
|
|
|
And you also need to specify in ``combined_data_to_netcdf.py`` the [alias and resolution](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/scripts/combined_data_to_netcdf.py#L25-29) to process.
|
|
|
|
|
|
|
|
The output is a netcdf file with the time series averages and bin statistics of the two sst data sets (CCI SST coarse and CCI SST interpolated to the buoy coordinates and average on that same coarse resolution).
|
|
|
|
|
|
|
|
The analysis of the time series and main conclusions are explained in the following [jupyter notebook](https://git.noc.ac.uk/brecinosrivas/orchestra-sst/-/blob/master/notebooks/analysing_time_series.ipynb). |
|
|
|
\ No newline at end of file |