Changeset 259 in lmdz_wrf for trunk/tools

Timestamp:
Feb 19, 2015, 9:54:36 AM (10 years ago)
Author:
lfita
Message:

Adding python script to generate netCDF files from ASCII column basd observations

The python script is called as:

python create_OBSnetcdf.py -c [Comchar] -d [DescFile?] -e [Endchar] -f [obsFile] -g [debugFlag] -t [CFreftime],[CFunits] -k [obskind] -s [stloc]

[Comchar]: which characters (':', list) can be used as comment inside the observations file
[DescFile?]: ASCII file with all the information of the observational data-set
[Endchar]: character of end of column
[obsFile]: observatinoal ASCII file with data in columns
[debugFlag]: boolean flag for debugging
[CFreftime],[CFunits]: reference and time-units to transform the date to CF convention
[obskind]: kind of observation, up to now:

'multi-points': multiple individual punctual obs (e.g., lightning strikes)

A new variale called 'obsmap' with the number of observations at a grid mesh of 100x100 will be added

'single-station': single station on a fixed position
'trajectory': following a trajectory

A new variale called 'obstrj' with the number of observations at a grid mesh of 100x100x100 will be

added

[stloc]: only with [obskind]='single-station', a ',' list of longitude,latitude,height will be used to

add new variables on the netCDF file with the given values ('lon','lat','height') or with 'st' header
if these variables already exist

Inside the [DescFile?] you will find:

institution=Institution who creates the data
department=Department within the institution
scientists=names of the data producers
contact=contact of the data producers
description=description of the observations
acknowledgement=sentence of acknowlegement
comment=comment for the measurements

MissingValue?='|' list of missing values (strings as they are in the ASCII file) within the data
comment=comments

varN='|' list of variable names
varLN='|' list of long variable names
varU='|' list units of the variables
varBUFR='|' list BUFR code of the variables
varTYPE='|' list of variable types ('D', 'F', 'I', 'I64', 'S')

NAMElon=name of the variable with the longitude (x position)
NAMElat=name of the variable with the latitude (y position)
NAMEheight=name of the variable with the heights (z position)
NAMEtime=name of the varibale with the time
FMTtime=format of the time (available: as in 'C'[%Y,...], 'CFtime' for already CF-like time)

  • All the values before 'varN' are stored as global attributes
  • All the content as 'var[N/LN/U/BUFR/TYPE]' is used to transform the data
  • [MissingValue?] is used during the transformation of data and then accordingly to the variable type the correspondant '_FillValue' is assigned
  • NAME[lon/lat/height/time]: are used as reference for the netCFD file (in this version only 'NAMEtime')

[NAMEtime] is used to compute the CF-time axis. It can be a combination of different columns (see atached files), whereas [FMTtime] will be used to transform the correspondant time. (How ever, python can not deal with the 7th decimal of the microseconds, so anbything smalloer is lost during the conversion. For all the rest I think is fine). For times already in CF-compilant, FMTtime=CFtime

As always is easier if you see and example (see atached). I called it in this case as:

python create_OBSnetcdf.py -c '#' -d description.dat -e space -f ATDnet_data_121018.csv -t 19491201000000,seconds -k multi-stations

File:
1 added

Note: See TracChangeset for help on using the changeset viewer.