source: lmdz_wrf/trunk/tools/documentation/ncmanage/intro.html @ 2828

Last change on this file since 2828 was 1494, checked in by lfita, 8 years ago

Adding new `maskvar'

File size: 13.5 KB
Line 
1<HTML>
2  <HEAD>
3    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"/>
4    <LINK REL="stylesheet" TYPE="text/css" HREF="../PyNCplot.css"/>
5  </HEAD>
6
7  <BODY>
8    <DIV CLASS="valheader">
9      netCDF managing functions
10    </DIV>
11    <DIV CLASS="valintro">
12      List of available functions to manage netCDD files. Most of them follow a similar structure:<BR>
13      <PRE><CODE>
14        $ python nc_var.py -o [operation] -f [file(or files)] -S [values] -v [variables]
15      </CODE></PRE>
16      In most of the cases <SPAN CLASS="codetxt">[values]</SPAN> is a string which contains a list of values separated by a character <SPAN CLASS="codetxt">[sep]</SPAN>, becomming the value as:
17      <PRE><CODE>
18      [values]=[val1][sep][val2][sep][...[valN]]</CODE></PRE>
19      One can obtain all the list of operations and their instructions by demanding to the script:
20      <PRE><CODE>
21        $ python nc_var.py -o list_operations
22      </CODE></PRE>
23      For almost all operations, one can obtain all the help of a specific operation by:
24      <PRE><CODE>
25        $ python nc_var.py -o [operation] -S h
26      </CODE></PRE>
27      One should be able to obtain an example of execution by
28      <PRE><CODE>
29        $ cat nc_var.py | grep [operation] | grep 'e.g.'
30      </CODE></PRE>
31      The netcdf-managing script has two steps:
32      <OL>
33       <LI><SPAN CLASS="codetxt">nc_var.py:</SPAN> Main script which mainly gets the values
34       <LI><SPAN CLASS="codetxt">nc_var_tools.py:</SPAN> Script which perform the operations and its used by <SPAN CLASS="codetxt">nc_var.py</SPAN>
35       <LI><SPAN CLASS="codetxt">generic_tools.py:</SPAN> Script which contains generic operations and it is used by both scripts</LI>
36      </OL>
37      In order to use some of the functions, is necessary to compile previously the related Fortran subroutines and link them to python. It is already prepared for different computers via specific <SPAN CLASS="codetxt">Makefile.[machine].[compiler]</SPAN><BR>
38      Available functions:
39      <UL>
40        <LI><SPAN CLASS="codetxt">addvals:</SPAN> Function to add values to a given variable at a given dimension</LI>
41        <LI><SPAN CLASS="codetxt">CDO_toCF:</SPAN> Function to pass a CDO output file to CF-conventions</LI>
42        <LI><SPAN CLASS="codetxt">chdimname:</SPAN> Changing the name of the dimension</LI>
43        <LI><SPAN CLASS="codetxt">changevartype:</SPAN> Function to change the type of a variable (when possible)</LI>
44        <LI><SPAN CLASS="codetxt">checkallvars:</SPAN> Function to check all variables of a file</LI>
45        <LI><SPAN CLASS="codetxt">checkAllValues:</SPAN> Function to check for variables with along all their dimensions with the same value in a file</LI>
46        <LI><SPAN CLASS="codetxt">checkNaNs:</SPAN> Function to check for NaN values over all variables in a file</LI>
47        <LI><SPAN CLASS="codetxt">chgtimestep:</SPAN> Function to change the values of a given time-step of a variable inside a netCDF for values from a nother file</LI>
48        <LI><SPAN CLASS="codetxt">chvarname:</SPAN> Changing the name of the variable</LI>
49        <LI><SPAN CLASS="codetxt">cleaning_varsfile:</SPAN> Function to keep a list of variabales from a file</LI>
50        <LI><SPAN CLASS="codetxt">compute_opersvarsfiles:</SPAN> Function to compute opersvarfiles: operation of variables from different files (OPER1.FILE1_VAR1 OPER2.FILE2_VAR2), operations are going to be sequentially made</LI>
51        <LI><SPAN CLASS="codetxt">curve_section:</SPAN> Function to provide a section of a file following a given curve</LI>
52        <LI><SPAN CLASS="codetxt">DatesFiles:</SPAN> Function to find different time values on a series of WRF files in a folder</LI>
53        <LI><SPAN CLASS="codetxt">DataSetSection:</SPAN> Function to get a section (values along a dimension) of a given data-set</LI>
54        <LI><SPAN CLASS="codetxt">DataSetSection_multidims:</SPAN> Function to get a section (values along multiple dimensions) of a given data-set</LI>
55        <LI><SPAN CLASS="codetxt">DataSetSection_multivars:</SPAN> Function to get a section (values along multiple variables) of a given data-set</LI>
56        <LI><SPAN CLASS="codetxt">dimToUnlimited:</SPAN> Operation to create an unlimited dimension from an existing one</LI>
57        <LI><SPAN CLASS="codetxt">dimVar_creation:</SPAN> Function to add a 1D variable with the size of a given dimension in a file</LI>
58        <LI><SPAN CLASS="codetxt">fattradd:</SPAN> Adding attributes from a reference file</LI>
59        <LI><SPAN CLASS="codetxt">fdimadd:</SPAN> Adding dimension from another reference file </LI>
60        <LI><SPAN CLASS="codetxt">fgaddattr:</SPAN> Adding global attributes from a reference file</LI>
61        <LI><SPAN CLASS="codetxt">field_stats:</SPAN> Function to retrieve statistics from a field</LI>
62        <LI><SPAN CLASS="codetxt">field_stats_dim:</SPAN> Function to retrieve statistics from a field along dimensions</LI>
63        <LI><SPAN CLASS="codetxt">file_creation:</SPAN> Operation to create a file with one variable with a given set of dimensions</LI>
64        <LI><SPAN CLASS="codetxt">file_oper_alongdims:</SPAN> Function to operate a file along different dimensions of a variable</LI>
65        <LI><SPAN CLASS="codetxt">filter_2dim:</SPAN> Function to filter along 2 dimensions (moving grid-box means of a given size) values of the netCDF file</LI>
66        <LI><SPAN CLASS="codetxt">flipdim:</SPAN> flips the value following one dimension</LI>
67        <LI><SPAN CLASS="codetxt">fvaradd:</SPAN> Adding variable (and all its attributes and dimensions) from a reference file to a file</LI>
68        <LI><SPAN CLASS="codetxt">gaddattrk:</SPAN> Add a global attribute to a netCDF caring about the type. Removes previous attribute if it exist</LI>
69        <LI><SPAN CLASS="codetxt">gaddattr:</SPAN> Add a global attribute to a netCDF. Removes previous attribute if it exist</LI>
70        <LI><SPAN CLASS="codetxt">get_attribute:</SPAN> Function to get an attribute from a netCDF file</LI>
71        <LI><SPAN CLASS="codetxt">get_namelist_vars:</SPAN> Function to get namelist-like  values ([varname] = [value]) </LI>
72        <LI><SPAN CLASS="codetxt">get_Variables:</SPAN> Function to get a list of variables from an existing file</LI>
73        <LI><SPAN CLASS="codetxt">getvalues_lonlat:</SPAN> Function to retrieve the values from the closest grid point to a set of longitude, latitude values</LI>
74        <LI><SPAN CLASS="codetxt">grattr:</SPAN> Function to read a global attribute</LI>
75        <LI><SPAN CLASS="codetxt">grmattr:</SPAN> Removing a global attribute</LI>
76        <LI><SPAN CLASS="codetxt">idims:</SPAN> Give all the dimensions names of a file</LI>
77        <LI><SPAN CLASS="codetxt">igattrs:</SPAN> Give all the global attributes of a file</LI>
78        <LI><SPAN CLASS="codetxt">increaseDimvar:</SPAN> Function to increase with 1 dimension an existing variable within a netcdf file. Values of the variable will be repeated along the new dimension</LI>
79        <LI><SPAN CLASS="codetxt">isgattrs:</SPAN> Give a single global attribute of a file and its type</LI>
80        <LI><SPAN CLASS="codetxt">isvattrs:</SPAN> Give a single attribute of a variable</LI>
81        <LI><SPAN CLASS="codetxt">ivars:</SPAN> Give all the variable names of a file</LI>
82        <LI><SPAN CLASS="codetxt">ivattrs:</SPAN> Give all the attributes of a variable and its type</LI>
83        <LI><SPAN CLASS="codetxt">LMDZ_toCF:</SPAN> Function to pass a LMDZ original file to CF-conventions</LI>
84        <LI><SPAN CLASS="codetxt">maskvar:</SPAN> Function to mask a variable using another variable to mask it. Only need to share at least 1 dimension with the same size (no need same name) </LI>
85        <LI><SPAN CLASS="codetxt">model_characteristics:</SPAN> Function to provide major characteristics of a given model output</LI>
86        <LI><SPAN CLASS="codetxt">ncreplace:</SPAN> Function to replace something from a netCDF file</LI>
87        <LI><SPAN CLASS="codetxt">ncstepdiff:</SPAN> Function to compute differences between time-steps (de-accumulate) a netCDF file</LI>
88        <LI><SPAN CLASS="codetxt">netcdf_concatenation:</SPAN> Function to concatenate netCDF files for a given set of variables</LI>
89        <LI><SPAN CLASS="codetxt">netcdf_fold_concatenation:</SPAN> Function to concatenate netCDF files in a given folder for a given set of variables</LI>
90        <LI><SPAN CLASS="codetxt">netcdf_fold_concatenation_HMT:</SPAN> Function to concatenate netCDF files in a given folder for a given set of variables giving Header, Middle, Tail for the name files</LI>
91        <LI><SPAN CLASS="codetxt">reproject:</SPAN> Function to re-project values to another one</LI>
92        <LI><SPAN CLASS="codetxt">Partialmap_Entiremap:</SPAN> Function to transform from a partial global map (e.g.: only land points) to an entire one Coincidence of points is done throughout a first guess from fractions of the total domain of search</LI>
93        <LI><SPAN CLASS="codetxt">Partialmap_EntiremapFor:</SPAN> Function to transform from a partial global map (e.g.: only land points) to an entire one using Fortran code Coincidence of points is done throughout a first guess from fractions of the total domain of search</LI>
94        <LI><SPAN CLASS="codetxt">Partialmap_EntiremapForExact:</SPAN> Function to transform from a partial global map (e.g.: only land points) to an entire one using Fortran code with exact location Coincidence of points is done throughout a first guess from fractions of the total domain of search</LI>
95        <LI><SPAN CLASS="codetxt">pinterp:</SPAN> Function to vertically interpolate using subroutines from the p_interp.F90 NCAR program</LI>
96        <LI><SPAN CLASS="codetxt">remapnn:</SPAN> Function to remap to the nearest neighbor a variable using projection from another file</LI>
97        <LI><SPAN CLASS="codetxt">seasmean:</SPAN> Function to compute the seasonal mean of a variable</LI>
98        <LI><SPAN CLASS="codetxt">sellonlatbox:</SPAN> Function to select a lotlan box from a data-set</LI>
99        <LI><SPAN CLASS="codetxt">sellonlatlevbox:</SPAN> Function to select a lotlan box and a given level from a data-set</LI>
100        <LI><SPAN CLASS="codetxt">selvar:</SPAN> Function to select a series of variables from a netcdf file. Variables with </LI>
101        <LI><SPAN CLASS="codetxt">setvar_asciivalues:</SPAN> Function to set the values of a variable with an ASCII file (common </LI>
102        <LI><SPAN CLASS="codetxt">sorttimesmat:</SPAN> Function to sort the time values of a given file</LI>
103        <LI><SPAN CLASS="codetxt">spacemean:</SPAN> Function to retrieve a space mean series from a multidimensional variable of a file</LI>
104        <LI><SPAN CLASS="codetxt">SpatialWeightedMean:</SPAN> Function to compute the spatial mean using weights from a netCDF file</LI>
105        <LI><SPAN CLASS="codetxt">statcompare_files:</SPAN> Python script to statistically compare two different files</LI>
106        <LI><SPAN CLASS="codetxt">subbasin:</SPAN> Function to retrieve the subbasin (all the sub-flows until a a given lon,lat)</LI>
107        <LI><SPAN CLASS="codetxt">submns:</SPAN> Function to retrieve a series of months from a file</LI>
108        <LI><SPAN CLASS="codetxt">subyrs:</SPAN> Function to retrieve a series of years from a file</LI>
109        <LI><SPAN CLASS="codetxt">TimeInf:</SPAN> Function to print all the information from the variable time</LI>
110        <LI><SPAN CLASS="codetxt">time_reset:</SPAN> Function to re-set the time axis of a file</LI>
111        <LI><SPAN CLASS="codetxt">TimeSplitmat:</SPAN> Function to transform a file with CFtimes to a matrix [Nyear,Nmonth,Nday,Nhour,Nminute,Nsecond] </LI>
112        <LI><SPAN CLASS="codetxt">timemean:</SPAN> Function to retrieve a time mean series from a multidimensional variable of a file</LI>
113        <LI><SPAN CLASS="codetxt">valmod:</SPAN> Function to modify the value of a variable</LI>
114        <LI><SPAN CLASS="codetxt">valmod_dim:</SPAN> Function to modify the value of a variable at a given dimension and value</LI>
115        <LI><SPAN CLASS="codetxt">varaddattrk:</SPAN> Add an attribute to a variable caring about the type</LI>
116        <LI><SPAN CLASS="codetxt">varaddattr:</SPAN> Add an attribute to a variable. Removes previous attribute if it exists</LI>
117        <LI><SPAN CLASS="codetxt">varaddref:</SPAN> Function to add a variable in an existing file copying characteristics from an existing one</LI>
118        <LI><SPAN CLASS="codetxt">var_creation:</SPAN> Operation to create a new variable in a file with a given set of dimensions</LI>
119        <LI><SPAN CLASS="codetxt">varout:</SPAN> Function when we want to output variable values</LI>
120        <LI><SPAN CLASS="codetxt">varrmattr:</SPAN> Removing an attribute from a variable</LI>
121        <LI><SPAN CLASS="codetxt">varrm:</SPAN> Removing a variable from a file</LI>
122        <LI><SPAN CLASS="codetxt">VarVal_FillValue:</SPAN> Function to transform a given value from a given variable to _FillValue in a netCDF file</LI>
123        <LI><SPAN CLASS="codetxt">vrattr:</SPAN> Function to remove an attribute from a variable</LI>
124        <LI><SPAN CLASS="codetxt">WRF_d0Nref:</SPAN> Function for the generation of an extra WRF domain from a given one </LI>
125        <LI><SPAN CLASS="codetxt">WRF_CFlonlat_creation:</SPAN> Function to add a CF-convention longitude/latitude variables in a WRF file</LI>
126        <LI><SPAN CLASS="codetxt">WRF_CFtime_creation:</SPAN> Function to add a CF-convention time unit in a WRF file</LI>
127        <LI><SPAN CLASS="codetxt">WRF_CFxtime_creation:</SPAN> Function to add a CF-convention time unit in a WRF file using variable 'XTIME'</LI>
128        <LI><SPAN CLASS="codetxt">WRF_toCF:</SPAN> Function to pass a WRF original file to CF-conventions</LI>
129      </UL>
130    </DIV>
131   
132  </BODY>
133</HTML>
134
Note: See TracBrowser for help on using the repository browser.