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