| 1 | == ncap2 == |
| 2 | |
| 3 | the most powerful and quickly evolving tool from the nco set of functions |
| 4 | |
| 5 | See the file of exemples : {{:reunions_orchidee:ncap2.pdf| ncap2 file}} or search what you are looking on this growing list of answers [[http://sourceforge.net/search/index.php?words=&sort=posted_date&sortdir=desc&offset=0&group_id=3331&type_of_search=forums|forum nco]] |
| 6 | |
| 7 | A simple exemple showing different capacities (creation of a variable, use of a mask, call to an attribute, count the total and the size of the field (we can restrict this operation to a dimension as shown on the second line) |
| 8 | |
| 9 | <code> |
| 10 | ncap2 -O -s 'missing_flag[$y,$x]=0;where(t2m_daily!=t2m_daily@missing_value) missing_flag=1;missing_count=float(missing_flag.total())/missing_flag.size();print(missing_count)' stomate_restart.nc ~/foo.nc |
| 11 | ncap2 -O -s 'missing_flag[$y,$x]=0;where(t2m_daily!=t2m_daily@missing_value) missing_flag=1;missing_count=float(missing_flag.total($x))/missing_flag.size($x);print(missing_count)' stomate_restart.nc ~/foo.nc |
| 12 | </code> |
| 13 | |
| 14 | |
| 15 | == cdo == |
| 16 | |
| 17 | A command that handle many operations one would like to do when working on outputs of models of the Earth System : |
| 18 | * changing of time axis |
| 19 | * regridding (many grid are already implemented and it is an even more versatile tool) |
| 20 | * complex operations... |
| 21 | |
| 22 | See the website of the project {{https://code.zmaw.de/projects/cdo/wiki}} or the doc : {{:reunions_orchidee:cdo-manual.pdf| CDO Manual}} and the {{:reunions_orchidee:cdo_refcard.pdf | quickref}} |
| 23 | |
| 24 | <code> |
| 25 | cdo -v # print list of available operators |
| 26 | cdo -V # version (if very old, think of downloading the source and install a new version, as it is a tool that is evolving quickly |
| 27 | cdo -h remapcon # informations about a command |
| 28 | cdo remapcon,my_grid my_climatology.nc my_regridded_climatology.nc # conservative regridding to an other resolution |
| 29 | </code> |
| 30 | |
| 31 | my_grid could be a file like :<code> |
| 32 | gridtype = lonlat |
| 33 | gridsize = 220 |
| 34 | xname = longitude |
| 35 | xunits = degrees_east |
| 36 | yname = latitude |
| 37 | yunits = degrees_north |
| 38 | xsize = 20 |
| 39 | ysize = 11 |
| 40 | xfirst = -18.75 |
| 41 | xinc = 3.75 |
| 42 | yfirst = 20 |