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 | </HEAD> |
---|
8 | <BODY> |
---|
9 | <DIV CLASS="valheader"> |
---|
10 | create_OBSnetcdf |
---|
11 | </DIV> |
---|
12 | <DIV CLASS="valimg"> |
---|
13 | Python script to create a netCDF file from observational ASCII files<BR> |
---|
14 | <BR> |
---|
15 | <P STYLE="text-align:left;font-size:0.9em;"> |
---|
16 | netCDF files are generated from a given ASCII file with observational data. Observational data can be of different types:<BR></P> |
---|
17 | <UL> |
---|
18 | <P STYLE="text-align:left;font-size:0.9em;"> |
---|
19 | <LI><B>stations-map:</B> multiple individual punctual observations at no fixed locations and not fixed times (e.g., lightning strikes)</LI> |
---|
20 | <LI><B>multi-points:</B> multiple observations at fixed locations and fixed times</LI> |
---|
21 | <LI><B>single-station:</B> multiple observations on a single station at different times</LI> |
---|
22 | <LI><B>trajectory:</B> multiple observations following a trajectory</LI> |
---|
23 | </UL></P> |
---|
24 | <P STYLE="text-align:left;font-size:0.9em;"> |
---|
25 | Transformation is controlled by an ASCII file with the description of the data. As example a template of this file called <CODE>description.dat.template</CODE> is provided.<BR></P> |
---|
26 | <P STYLE="text-align:left;font-size:0.9em;"> |
---|
27 | Observational ASCII file is expected to contain measurements of different variables at a same time like:<BR></P> |
---|
28 | <P STYLE="text-align:left;font-size:0.9em;"> |
---|
29 | <CODE>[Time1] [Var1] [Var2] [Var3] ... [varN]<BR> |
---|
30 | (...)<BR> |
---|
31 | [TimeM] [Var1] [Var2] [Var3] ... [varN]</CODE><BR></P> |
---|
32 | <P STYLE="text-align:left;font-size:0.9em;"> |
---|
33 | According to the type of observation file might contain observations at different locations, fixed or time-changing</P> |
---|
34 | </P> |
---|
35 | </DIV> |
---|
36 | <DIV CLASS="valhelp"> |
---|
37 | diagnostics.py -c [comvals] -d [descobsfilen] -e [endcol] -f [ASCIIobsfilen] -g [dbg] -k [obskind] -s [stvals] -f [cftimeval] |
---|
38 | Script has the following attributes to be used with: |
---|
39 | <CODE>[comvals]</CODE>':' separated list of characters used for comments inside the <BR> |
---|
40 | ASCII observational file<BR> |
---|
41 | <CODE>[descobsfilen]</CODE>name of the file with the description of the ASCII file with the <BR> |
---|
42 | observations to transform<BR> |
---|
43 | <CODE>[endcol]</CODE>character to indicate end of the column for each observed <BR> |
---|
44 | variable. There are two special cases:<BR> |
---|
45 | <CODE>'space'</CODE>, for spaces <BR> |
---|
46 | <CODE>'None',[fixcoljumps]</CODE> for files with the measurements provided by fixed size columns<BR> |
---|
47 | <CODE>[fixcoljumps]</CODE>: ',' separated list of positions of column ends within the line<BR> |
---|
48 | <CODE>[ASCIIobsfilen]</CODE> ASCII file with the observations<BR> |
---|
49 | <CODE>[dbg]</CODE> whether debug is required ('false', 'true')<BR> |
---|
50 | <CODE>[obskind]</CODE>kind of observations one of: <CODE>'stations-map'</CODE>, <CODE>'multi-points'</CODE>,<BR> |
---|
51 | <CODE>'single-station'</CODE>, <CODE>'trajectory'</CODE><BR> |
---|
52 | <CODE>[stvals]=[stname],[stlong],[stlat],[stheight]</CODE> Values to describe the station, <BR> |
---|
53 | only valid for <CODE>'single-station'</CODE>:<BR> |
---|
54 | <CODE>[stname]</CODE> name of the station ('!' for spaces)<BR> |
---|
55 | <CODE>[stlon]</CODE> longitude of the station<BR> |
---|
56 | <CODE>[stlat]</CODE> latitude of the station<BR> |
---|
57 | <CODE>[stheight]</CODE> height of the station<BR> |
---|
58 | <CODE>[cftimeval]=[Refdate],[tunits]</CODE> values to generate the time following <BR> |
---|
59 | CF conventions with reference date in <CODE>[YYYY][MM][DD][HH][MI][SS]</CODE> format and <BR> |
---|
60 | time units: 'weeks', 'days', 'hours', 'miuntes', 'seconds'<BR> |
---|
61 | <BR> |
---|
62 | Inside the description file, user has to specify:<BR> |
---|
63 | <CODE>institution=</CODE>Institution who creates the data<BR> |
---|
64 | <CODE>department=</CODE>Department within the institution<BR> |
---|
65 | <CODE>scientists=</CODE>names of the data producers<BR> |
---|
66 | <CODE>contact=</CODE>contact of the data producers<BR> |
---|
67 | <CODE>description=</CODE>description of the observations<BR> |
---|
68 | <CODE>acknowledgement=</CODE>sentence of acknowlegement<BR> |
---|
69 | <CODE>comment=</CODE>comment for the measurements<BR> |
---|
70 | |
---|
71 | <CODE>MissingValue=</CODE>'|' list of ASCII values for missing values within the data <BR> |
---|
72 | (as they appear!, 'empty' for no value at all)<BR> |
---|
73 | <CODE>comment=</CODE>comments<BR> |
---|
74 | |
---|
75 | <CODE>varN=</CODE>'|' separated list of variable names (<A CLASS="lc" HREF="http://cfconventions.org/" TARGET="_blank">CF conventions</A> recommended)<BR> |
---|
76 | <CODE>varLN=</CODE>'|' list of long variable names<BR> |
---|
77 | <CODE>varU=</CODE>'|' list units of the variables (<A CLASS="lc" HREF="http://cfconventions.org/" TARGET="_blank">CF conventions</A> recommended)<BR> |
---|
78 | <B>NOTE:</B> in case observation is tabulled following a WMO code, <BR> |
---|
79 | user can use <CODE>wmo_code_[NUM]</CODE> as units and if <BR> |
---|
80 | a given file called <CODE>wmo_[NUM].code</CODE> exists (already available: <BR> |
---|
81 | 0200, 020012, 0509, 4561, 0513, 4677, 0500, 0515) additional dimensions and <BR> |
---|
82 | variables will be added (see below):<BR> |
---|
83 | <CODE>wmo_code_[NUM]</CODE>: Values of the code<BR> |
---|
84 | <CODE>wmo_code_[NUM]_meaning</CODE>: meaning of each code<BR> |
---|
85 | <CODE>varBUFR=</CODE>'|' list BUFR code of the variables (optional, can not be provided)<BR> |
---|
86 | <CODE>varTYPE=</CODE>'|' list of variable types ('D', 'F', 'I', 'I64', 'S')<BR> |
---|
87 | <CODE>varOPER=</CODE>'|' list of operations to do to the variables to meet their <BR> |
---|
88 | units ([oper],[val]) (optional)<BR> |
---|
89 | [oper]:<BR> |
---|
90 | -, nothing<BR> |
---|
91 | sumc, add [val]<BR> |
---|
92 | subc, rest [val]<BR> |
---|
93 | mulc, multiply by [val]<BR> |
---|
94 | divc, divide by [val]<BR> |
---|
95 | rmchar,[val],[pos], remove [val] characters from [pos]='B', beginning, 'E', end<BR> |
---|
96 | <CODE>NAMElon=</CODE>name of the variable (from <CODE>varN</CODE>, if applicable) with the longitude <BR> |
---|
97 | (x position)<BR> |
---|
98 | <CODE>NAMElat=</CODE>name of the variable (from <CODE>varN</CODE>, if applicable) with the latitude <BR> |
---|
99 | (y position)<BR> |
---|
100 | <CODE>NAMEheight=</CODE>name of the variable (from <CODE>varN</CODE>, if applicable) with the height <BR> |
---|
101 | (z position)<BR> |
---|
102 | <CODE>NAMEtime=</CODE>name of the varibale with the time (from <CODE>varN</CODE>) <BR> |
---|
103 | <B>NOTE:</B> It can be a combination of different variables from <CODE>varN</CODE> separated <BR> |
---|
104 | by '@' character (e.g.: date@time) |
---|
105 | <CODE>FMTtime=</CODE>format of the time (as in 'C' (e.g.: %Y-%m-%d@%H:%M:%S), or use <BR> |
---|
106 | <CODE>'CFtime'</CODE> for observational times which are already in CF-like format)<BR> |
---|
107 | |
---|
108 | ------- ------ ----- ---- --- -- -<BR> |
---|
109 | <CODE>wmo_[NUM].code</CODE> file with structure: <BR> |
---|
110 | <CODE>reference|</CODE>web page, document reference with the code<BR> |
---|
111 | <CODE>short_description|</CODE>main description of the code <CODE>wmo_code|</CODE>[NUM]<BR> |
---|
112 | <CODE>long_description|</CODE>long description of the code<BR> |
---|
113 | <CODE>codeTYPE|</CODE>type of the code (andy of 'D', 'F', 'I', 'S')<BR> |
---|
114 | <CODE>@| Values</CODE>line giving the start of the values<BR> |
---|
115 | <CODE>[val1]|</CODE>[meaning of first value]<BR> |
---|
116 | <CODE>(...)</CODE><BR> |
---|
117 | <CODE>[valN]|</CODE>[meaning of last value]<BR> |
---|
118 | </DIV> |
---|
119 | <DIV CLASS="valins"> |
---|
120 | * Observations at a single station:<BR> |
---|
121 | python create_OBSnetcdf.py -c '#' -e None,8,17,22,28,30,33,35,40,45,51,59,67,72,78,82,87,92,94,96,99,102 <BR> |
---|
122 | -d <A CLASS="lc" HREF="docs/description_sfc_DCAO_horarios.txt" TARGET="_blank">description_sfc_DCAO_horarios.txt</A> -f <A CLASS="lc" HREF="docs/1995_01_SMN_HORARIOS_87576.txt">1995_01_SMN_HORARIOS_87576.txt</A> <BR> |
---|
123 | -k single-station -s 'Ezeiza!airport,-58.534,-34.817,20.' -t 19490101000000,minutes<BR> |
---|
124 | * Observations following a trajectory:<BR> |
---|
125 | python create_OBSnetcdf.py -c '#' -d <A CLASS="lc" HREF="docs/description.ATRCore.txt" TARGET="_blank">description.ATRCore.txt</A> -e space <BR> |
---|
126 | -f <A CLASS="lc" HREF="docs/ATR_1Hz-HYMEXBDD-SOP1-v3_20121018_as120051.txt" TARGET="_blank">ATR_1Hz-HYMEXBDD-SOP1-v3_20121018_as120051.txt</A> -k trajectory<BR> |
---|
127 | * Observations at multiple points:<BR> |
---|
128 | python create_OBSnetcdf.py -c '#' -d <A CLASS="lc" HREF="docs/description.ATDnet.txt" TARGET="_blank">description.ATDnet.txt</A> -e space <BR> |
---|
129 | -f <A CLASS="lc" HREF="docs/ATDnet_data_121018.csv" TARGET="_blank">ATDnet_data_121018.csv</A> -t 19491201000000,seconds -k 'multi-points' |
---|
130 | </DIV> |
---|
131 | </BODY> |
---|
132 | </HTML> |
---|
133 | |
---|