[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 20020513: Troulbe running metar2nc
- Subject: Re: 20020513: Troulbe running metar2nc
- Date: Mon, 13 May 2002 16:08:52 -0600 (MDT)
John,
The problem is that the metar2nc decoder isn't smart enough to understand
the variable name changes in your the metar.cdl file. If you use the
distribution metar.cdl file, I sure it would work. The metar2nc decoder
reads the cdl to figure out the record size and info that should be
written to the *.nc file based on the variable name. I know that's hard
coding names but that's the way it was done. You could use your var names
but then you would have to replace every occurance in the metar2nc
decoder, ie SPD -> windSpeed, etc. I didn't make up the names, they come
from the NUWG standard, doesn't mean that they are correct or user
friendly but it is the standard. One can comment out vars and their
attibutes with the "//" . A side note, NetCDF is very particular about
the record size, so make modifications carefully.
Robb...
On Mon, 13 May 2002, John C. Nordlie wrote:
> Hi, Robb.
> I adjusted the pqact.conf entry as per your instructions,
> but the result is still the same. All the .nc files are the same
> length, and look to contain only headder info. Here is a dump of one:
>
> > ncdump 02051414_metar.nc | more
> netcdf 02051414_metar {
> dimensions:
> maxAutoStaLen = 6 ;
> maxAutoWeather = 5 ;
> maxAutoWeaLen = 12 ;
> maxRepLen = 6 ;
> maxMETARLen = 256 ;
> maxSkyCover = 6 ;
> maxSkyLen = 8 ;
> maxStaNamLen = 5 ;
> maxWeatherNum = 5 ;
> maxWeatherLen = 25 ;
> recNum = UNLIMITED ; // (0 currently)
> variables:
> int wmoId(recNum) ;
> wmoId:long_name = "numeric WMO identification" ;
> wmoId:_FillValue = -2147483647 ;
> wmoId:valid_range = 1, 89999 ;
> wmoId:reference = "station table" ;
> char stationName(recNum, maxStaNamLen) ;
> stationName:long_name = "alphanumeric station
> identification" ;
> stationName:reference = "station table" ;
> float latitude(recNum) ;
> latitude:long_name = "latitude" ;
> latitude:units = "degree_north" ;
> latitude:_FillValue = 3.402823e+38f ;
> latitude:reference = "station table" ;
> float longitude(recNum) ;
> longitude:long_name = "longitude" ;
> longitude:units = "degree_east" ;
> longitude:_FillValue = 3.402823e+38f ;
> longitude:reference = "station table" ;
> float elevation(recNum) ;
> elevation:long_name = "elevation" ;
> elevation:units = "meter" ;
> elevation:_FillValue = 3.402823e+38f ;
> elevation:reference = "station table" ;
> double timeObs(recNum) ;
> timeObs:long_name = "time of observation" ;
> timeObs:units = "seconds since 1-1-1970" ;
> timeObs:_FillValue = 1.79769313486232e+308 ;
> double timeNominal(recNum) ;
> timeNominal:long_name = "METAR hour" ;
> timeNominal:units = "seconds since 1-1-1970" ;
> timeNominal:_FillValue = 1.79769313486232e+308 ;
> char reportType(recNum, maxRepLen) ;
> reportType:long_name = "report type" ;
> reportType:reference = "FMH-1" ;
> char autoStationType(recNum, maxAutoStaLen) ;
> autoStationType:long_name = "automated station type" ;
> autoStationType:reference = "FMH-1" ;
> char skyCover(recNum, maxSkyCover, maxSkyLen) ;
> skyCover:long_name = "sky cover" ;
> skyCover:reference = "FMH-1" ;
> float skyLayerBase(recNum, maxSkyCover) ;
> skyLayerBase:long_name = "sky cover layer base" ;
> skyLayerBase:units = "meter" ;
> skyLayerBase:_FillValue = 3.402823e+38f ;
> skyLayerBase:valid_min = 0 ;
> float visibility(recNum) ;
> visibility:long_name = "visibility" ;
> visibility:units = "meter" ;
> visibility:_FillValue = 3.402823e+38f ;
> visibility:valid_min = 0. ;
> char presWeather(recNum, maxWeatherLen) ;
> presWeather:long_name = "present weather" ;
> presWeather:reference = "FMH-1" ;
> float seaLevelPress(recNum) ;
> seaLevelPress:long_name = "sea level pressure" ;
> seaLevelPress:units = "pascal" ;
> seaLevelPress:_FillValue = 3.402823e+38f ;
> float temperature(recNum) ;
> temperature:long_name = "temperature" ;
> temperature:units = "kelvin" ;
> temperature:_FillValue = 3.402823e+38f ;
> float tempFromTenths(recNum) ;
> tempFromTenths:long_name = "temperature from tenths of a
> degree Celsius" ;
> tempFromTenths:units = "kelvin" ;
> tempFromTenths:_FillValue = 3.402823e+38f ;
> float dewpoint(recNum) ;
> dewpoint:long_name = "dewpoint" ;
> dewpoint:units = "kelvin" ;
> dewpoint:_FillValue = 3.402823e+38f ;
> float dpFromTenths(recNum) ;
> dpFromTenths:long_name = "dewpoint from tenths of a degree
> Celsius" ;
> dpFromTenths:units = "kelvin" ;
> dpFromTenths:_FillValue = 3.402823e+38f ;
> float windDir(recNum) ;
> windDir:long_name = "wind direction" ;
> windDir:units = "degree" ;
> windDir:_FillValue = 3.402823e+38f ;
> float windSpeed(recNum) ;
> windSpeed:long_name = "wind speed" ;
> windSpeed:units = "meter/sec" ;
> windSpeed:_FillValue = 3.402823e+38f ;
> windSpeed:valid_min = 0 ;
> float windGust(recNum) ;
> windGust:long_name = "wind gust" ;
> windGust:units = "meter/sec" ;
> windGust:_FillValue = 3.402823e+38f ;
> windGust:valid_min = 0 ;
> float altimeter(recNum) ;
> altimeter:long_name = "altimeter setting" ;
> altimeter:units = "pascal" ;
> altimeter:_FillValue = 3.402823e+38f ;
> altimeter:valid_min = 0. ;
> float minTemp24Hour(recNum) ;
> minTemp24Hour:long_name = "24 hour min temperature" ;
> minTemp24Hour:units = "kelvin" ;
> minTemp24Hour:_FillValue = 3.402823e+38f ;
> float maxTemp24Hour(recNum) ;
> maxTemp24Hour:long_name = "24 hour max temperature" ;
> maxTemp24Hour:units = "kelvin" ;
> maxTemp24Hour:_FillValue = 3.402823e+38f ;
> float precip1Hour(recNum) ;
> precip1Hour:long_name = "1 hour precipitation" ;
> precip1Hour:units = "meter" ;
> precip1Hour:_FillValue = 3.402823e+38f ;
> precip1Hour:valid_min = 0. ;
> float precip3Hour(recNum) ;
> precip3Hour:long_name = "3 hour precipitation" ;
> precip3Hour:units = "meter" ;
> precip3Hour:_FillValue = 3.402823e+38f ;
> precip3Hour:valid_min = 0. ;
> float precip6Hour(recNum) ;
> precip6Hour:long_name = "6 hour precipitation" ;
> precip6Hour:units = "meter" ;
> precip6Hour:_FillValue = 3.402823e+38f ;
> precip6Hour:valid_min = 0. ;
> float precip24Hour(recNum) ;
> precip24Hour:long_name = "24 hour precipitation" ;
> precip24Hour:units = "meter" ;
> precip24Hour:_FillValue = 3.402823e+38f ;
> precip24Hour:valid_min = 0. ;
> short pressChangeChar(recNum) ;
> pressChangeChar:long_name = "character of pressure
> change" ;
> pressChangeChar:_FillValue = -32767s ;
> pressChangeChar:reference = "FMH-1" ;
> float pressChange3Hour(recNum) ;
> pressChange3Hour:long_name = "3 hour pressure change" ;
> pressChange3Hour:units = "pascal" ;
> pressChange3Hour:_FillValue = 3.402823e+38f ;
> pressChange3Hour:valid_min = 0. ;
> float snowCover(recNum) ;
> snowCover:long_name = "snow cover" ;
> snowCover:units = "meter" ;
> snowCover:_FillValue = 3.402823e+38f ;
> snowCover:valid_min = 0. ;
> int correction(recNum) ;
> correction:long_name = "corrected METAR indicator" ;
> correction:_FillValue = -2147483647 ;
> char rawMETAR(recNum, maxMETARLen) ;
> rawMETAR:long_name = "raw METAR message" ;
> data:
> }
> >
>
> ------------------------------------------------------------------------------
>
> Finally, here's a snippet from a log file (the whole file is nearly a meg,
> so I'll not send it all):
>
> > more metarLog.84937.log
> Opening data/newton/surface/sao/02051318_metar.nc with ncid 4
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 2.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KBGM 131816Z 13014KT 3SM RA BR OVC001 10/10 A2959
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 3.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KMFD 131815Z 36014KT 8SM -RA SCT007 OVC012 09/08 A2973
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 4.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KCMH 131823Z 32010KT 7SM -RA BKN009 BKN016 OVC024 10/08 A2976
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 5.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KTYS 131823Z 29009KT 2 1/2SM +TSRA BR BKN009CB BKN020 OVC042
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 6.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KFIR 131805Z AUTO 27006G11KT 15/M04
> AO1 RH 26
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 7.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KSIB 131808Z AUTO 14006G08KT 17/M04
> AO1 RH 23
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 8.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> NFTL 131800Z 00000KT 40KM FEW018 26/24 Q1009
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 8.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> NFTV 131800Z 02006KT 40KM SCT014 26/25 Q1009
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 9.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> FCBB 131800Z VRB03KT 6000 SKC 31/21 Q1012 NOSIG
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 9.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> FCPP 131800Z 22004KT 6000 FEW010 28/26 Q1010 NOSIG
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 9.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> FEFF 131800Z 00000KT CAVOK 32/21 Q1011 NOSIG
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 9.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> FKKD 131800Z 29003KT 9999 FEW020 FEW023CB BKN133 29/28 Q1009 RETS
> NOSIG
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 9.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> FZAA 131800Z 00000KT 9999 FEW024 28/21 Q1010 NOSIG
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 10.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> FNLU 131800Z 23005KT CAVOK 26/24 Q1011 NOSIG
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 11.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> KCMS 131806Z AUTO 05003G06KT 17/M03
> AO1 RH 25
> Opening data/newton/surface/sao/02051314_metar.nc with ncid 5
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 12.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051314_metar.nc
> SBFN 131400Z 131806 16008KT 9999 SCT017 SCT100 PROB30 1821 8000
> SCT016 BKN080 T28/18Z T26/06Z
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 13.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051318_metar.nc
> SBCR 131800Z 09008KT 9999 FEW020 SCT250 33/22 Q1010
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 14.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051314_metar.nc
> SBMO 131400Z 131818 15006KT 9999 SCT018 PROB30 1821 8000 SCT012
> SCT020 BECMG 0002 00000KT T24/06Z T29/15Z
>
> perl/netCDF record mismatch at decoders/metar2nc line 518, <STDIN> chunk
> 14.
> NetCDF::recput result = -1
> data/newton/surface/sao/02051314_metar.nc
> SBTE 131400Z 131806 14003KT 9999 FEW030 BECMG 2123 36003KT CAVOK
> T32/18Z T24/06Z
>
>
> <snip>
>
> On Mon, 13 May 2002, Robb Kambic wrote:
>
> > On Sun, 12 May 2002, Unidata Support wrote:
> >
> > >
> > > ------- Forwarded Message
> > >
> > > >To: address@hidden
> > > >From: "John C. Nordlie" <address@hidden>
> > > >Subject: Troulbe running metar2nc
> > > >Organization: UCAR/Unidata
> > > >Keywords: 200205111920.g4BJKQa26185
> > >
> > > This message is in MIME format. The first part should be readable text,
> > > while the remaining parts are likely unreadable without MIME-aware
> > > tools.
> > > Send mail to address@hidden for more info.
> > >
> > > --0-920348257-1021144825=:54722
> > > Content-Type: TEXT/PLAIN; charset=US-ASCII
> > >
> > > I'm having some problems with the metar2nc decoder. I've installed
> > > the latest version of the decoder and netcdf-perl, but most of the
> > > rawmetar.XXXX.nc files are empty. I've attached the only one that
> > > actually has data in it (just a few lines). I've also attached one of
> > > the typical log files being generated by metar2nc, and a XXXXXXXX_metar.nc
> > > file referenced by it. Finally, here is my pqact.conf entry which
> > > activates the decoder:
> > >
> > > DDS|IDS ^S[AP].* .... ([0-3][0-9])([0-2][0-9])
> > > PIPE decoders/metar2nc decoders/metar.cdl
> > > data/newton/surface/sao
> >
> >
> > John,
> >
> > pqact entry should look like this:
> >
> > #
> > # metar decoder, creates NetCDF files formated
> > # data/decoded/yymmddhh_metar.nc
> > #
> > # All aviation reports including metar tests
> > DDS|IDS ^S(A....|P....|XUS8.) .... ([0-3][0-9])
> > PIPE decoders/metar2nc
> > etc/metar.cdl
> > data/decoded
> > (\2:yy)(\2:mm)
> >
> > I couldn't read your mime attachments. The rawmetars files are metars
> > that were not contructed correctly for some reason, so they are saved as
> > parts. The only reason to save the raws was in case someone really needed
> > that report. I couldn't read the log or the *.nc file. I would look at
> > the decoded reports with ncdump, ie
> >
> > % ncdump 02051301_metar.nc | more
> >
> > The file format should be yymmddhh
> >
> > Let me know if you still have problem, just the log file info section
> > should be fine.
> >
> > Robb...
> >
> >
> >
> > >
> > > Any ideas?
> > >
> > > =========================================================================
> > > ==)---------- | ----------(==
> > > John Nordlie N0RNB | Regional Weather Information Center
> > > address@hidden | University of North Dakota
> > > http://blizzard.rwic.und.edu/~nordlie/
> > > ==)---------- #include <std.disclaimer.h> ----------(==
> > > =========================================================================
> > >
>
>
===============================================================================
Robb Kambic Unidata Program Center
Software Engineer III Univ. Corp for Atmospheric Research
address@hidden WWW: http://www.unidata.ucar.edu/
===============================================================================