This script is capable of reading recursively a bunch of netcdf files and generate 3 types of climatologies: yearly, monthly, and seasonal.
The unique requirement for the data is to be organized in the following structure:
[EXPERIMENT NAME]
------ [MONITORING DATA]
------ ####.nc
To obtain this file structure, you can use fileOrganize.sh script.
- (Required) dirName: Path of the directory that contains the files and path to save the output files (cell array)
- (Optional) type: yearly
- (Optional) extra: This param contains extra configuration options, such as, var2Read (variable to be read, use 'ncdump -h' command from bash to get the variable names) and range of years (use 'f' to specify the lowest year, 'l' to specify the top year, and 'vec' to specify a vector of year)s (cell array)
- log file: File that contains the list of property processed .nc files and the errors
- [Experiment-Name]-[var2Read].dat file: File that contains a 2-Dimensional structure with the values point by point
- [Experiment-Name].eps file: File that contains a plot of the data in high resolution
Reads all the .nc files from SOURCE_PATH and generates yearly climatology
climatology({'SOURCE_PATH','SAVE_PATH'});
Same as above
climatology({'SOURCE_PATH','SAVE_PATH'},{'yearly'});
Reads all the .nc files wich contain the variable pr from SOURCE_PATH and generates daily climatology
climatology({'SOURCE_PATH','SAVE_PATH'},{'yearly'},{'var2Read',{'pr'}});
Same as above, but the lowest data to be read is from 1950
climatology({'SOURCE_PATH','SAVE_PATH'},{'yearly'},{'var2Read',{'pr'},'f',1950});
Same as above, but the data to be read is from the range 1950 to 2000
climatology({'SOURCE_PATH','SAVE_PATH'},{'yearly'},{'var2Read',{'pr'},'f',1950,'l',2000});
Same as above, but the data to be read is from the years 1956,1988, and 2004
climatology({'SOURCE_PATH','SAVE_PATH'},{'yearly'},{'var2Read',{'pr'},'vec',[1988,2004,1956]});
The optional parameter var2Read can take one of the following forms:
... {'var2Read',{'pr','tasmax'}, ...}
... {'var2Read',{'pr','tasmax','tasmean'}, ...}
... {'var2Read',{'pr','tasmax','tasmean','tasmin'}, ...}
- (Required) dirName: Path of the directory that contains the files and path to save the output files (cell array)
- (Optional) type: monthly
- (Optional) extra: This param contains extra configuration options, such as, var2Read (variable to be read, use 'ncdump -h' command from bash to get the variable names) and range of years (use 'f' to specify the lowest year, 'l' to specify the top year, and 'vec' to specify a vector of year)s (cell array)
- log file: File that contains the list of property processed .nc files and the errors
- [Experiment-Name]-[Month].dat file: File that contains a 2-Dimensional structure with the values point by point
- [Experiment-Name]-[Month].eps file: File that contains a plot of the data in high resolution
Reads all the .nc files from SOURCE_PATH and generates monthly climatology
climatology({'SOURCE_PATH','SAVE_PATH'},{'monthly'});
Reads all the .nc files wich contain the variable pr from SOURCE_PATH and generates monthly climatology
climatology({'SOURCE_PATH','SAVE_PATH'},{'monthly'},{'var2Read',{'pr'}});
Same as above, but the lowest data to be read is from 1950
climatology({'SOURCE_PATH','SAVE_PATH'},{'monthly'},{'var2Read',{'pr'},'f',1950});
Same as above, but the data to be read is from the range 1950 to 2000
climatology({'SOURCE_PATH','SAVE_PATH'},{'monthly'},{'var2Read',{'pr'},'f',1950,'l',2000});
Same as above, but the data to be read is from the years 1956,1988, and 2004
climatology({'SOURCE_PATH','SAVE_PATH'},{'monthly'},{'var2Read',{'pr'},'vec',[1988,2004,1956]});
Since the latest version of the script, is possible to generate the climatologies for specific months. Using the following convention:
| Month | Param | Month | Param |
| ----- | ----- | --- | --- |
| January | jan | July | jul |
| February| feb | August | aug |
| March | mar | September | sep |
| April | apr | October | oct |
| May | may | November | nov |
| June | jun | December | dec |
Then, the parameter {'monthly'} can be replace by:
...{'jan'}...
...{'jan','feb'}...
...{'jan','dec','mar','apr'}...
...{'oct','jun'}...
- (Required) dirName: Path of the directory that contains the files and path to save the output files (cell array)
- (Optional) type: seasonal
- (Optional) extra: This param contains extra configuration options, such as, var2Read (variable to be read, use 'ncdump -h' command from bash to get the variable names) and range of years (use 'f' to specify the lowest year, 'l' to specify the top year, and 'vec' to specify a vector of year)s (cell array)
- log file: File that contains the list of property processed .nc files and the errors
- [Experiment-Name]-[Season].dat file: File that contains a 2-Dimensional structure with the values point by point
- [Experiment-Name]-[Season].eps file: File that contains a plot of the data in high resolution
Reads all the .nc files from SOURCE_PATH and generates seasonal climatology
climatology({'SOURCE_PATH','SAVE_PATH'},{'seasonal'});
Reads all the .nc files wich contain the variable pr from SOURCE_PATH and generates monthly climatology
climatology({'SOURCE_PATH','SAVE_PATH'},{'seasonal'},{'var2Read',{'pr'}});
Same as above, but the lowest data to be read is from 1950
climatology({'SOURCE_PATH','SAVE_PATH'},{'seasonal'},{'var2Read',{'pr'},'f',1950});
Same as above, but the data to be read is from the range 1950 to 2000
climatology({'SOURCE_PATH','SAVE_PATH'},{'seasonal'},{'var2Read',{'pr'},'f',1950,'l',2000});
Same as above, but the data to be read is from the years 1956,1988, and 2004
climatology({'SOURCE_PATH','SAVE_PATH'},{'seasonal'},{'var2Read',{'pr'},'vec',[1988,2004,1956]});
Since the latest version of the script, is possible to generate the climatologies for specific months. Using the following convention:
| Season | Param |
| ----- | ----- |
| Summer | sum |
| Winter | win |
| Fall | fal |
| Spring | spr |
Then, the parameter {'seasonal'} can be replace by:
...{'sum'}...
...{'win','sum'}...
...{'sum','win','spr'}...
...{'spr','sum'}...
To read the data from .dat files, you can use the command:
data = dlmread('MyData.dat');
CIGEFI Centre for Geophysical Research
Universidad de Costa Rica ©2016