Some useful utilities offered by NCO are their arithmetic manipulators that allow you to add, multiply, divide and subtract data between files . The default for ncbo is to subtract.
Here is an example command:
ncbo --op_typ=sbt ncesAvg1997.nc ncesAvg1998.nc sbt19978.nc
This will create a file called sbt19978.nc that contains the difference between ncesAvg1997.nc and ncesAvg1998.nc.
ncbo is the command and --op_typ=sbt means that the operation to be preformed is subtraction. Instructions can be found here http://nco.sourceforge.net/nco.html .
Other options include add for addition, mlt for multiplication, and dvd for division.
The following image shows the sea surface temperature data that results when the average files for the years 1997 and 1998 are subtracted.
Standard deviation can also be calculated using the nco utilites. If we have a file called in.nc of which we want to find the standard deviation of some variables we can do these three commands to get it.
- 1. ncwa –v variable_name in.nc out.nc
- 2. ncbo –v variable_name in.nc out.nc out.nc
- 3. ncwa –y rmssdn out.nc out.nc
To see your answer do ncdump out.nc and find the value for your variable_name.
It is also relatively easy to create a graph of standard deviation over time. Fist you will need to concatenate your files together using the nce/ncrcat commands that are described above. Once you have a concatenated file follow these steps:
1. Find the mean of your concatenated files
- ncwa catfile.nc mean.nc
- ncbo catfile.nc mean.nc difference.nc
- ncwa –y rmssdn –a lat,lon difference.nc output.nc
Now you have a file that contains the standard deviation over time.