[Met_help] [rt.rap.ucar.edu #58065] History for Error with ascii2nc

Paul Oldenburg via RT met_help at ucar.edu
Wed Sep 26 12:36:30 MDT 2012


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------


Hi Paul, I am creating the nc file from the ascii observations. I have attached files. When I run my ascii2nc , following error is encountered.  
open_met_ascii() -> line number 88 doesn't contain the expected number of columns (10):
open_met_ascii() -> line number 118 doesn't contain the expected number of columns (10):

Creating NetCDF Observation file: /oprn/model/wrf3/utils/met/METv3.0/myascii2nc/full/precip24_2011080600.nc
Reading ASCII Observation file: precip24_2011080600.ascii
N_items        = 9
N_chars        = 512
N_ints         = 100
LineNumber     = 6Item[ 0]       = "ADPSFC"
Item[ 1]       = "CK005"
Item[ 2]       = "20110806_030000"
Item[ 3]       = "12.5500"
Item[ 4]       = "0075.0700"Item[ 5]       = "-9999.00"
Item[ 6]       = "61"
Item[ 7]       = "24"
Item[ 8]       = "-9999.00      103.8^M"Offset[ 0]     = 0
Offset[ 1]     = 7
Offset[ 2]     = 13
Offset[ 3]     = 32
Offset[ 4]     = 41Offset[ 5]     = 51
Offset[ 6]     = 61
Offset[ 7]     = 65
Offset[ 8]     = 68 eading ASCII Observation file: precip24_2011080700.ascii
N_items        = 9
N_chars        = 512
N_ints         = 100
LineNumber     = 25Item[ 0]       = "ADPSFC"
Item[ 1]       = "CK024"
Item[ 2]       = "20110807_030000"
Item[ 3]       = "14.1400"
Item[ 4]       = "0074.3900"Item[ 5]       = "-9999.00"
Item[ 6]       = "61"
Item[ 7]       = "24"
Item[ 8]       = "-9999.00      123.2^M"Offset[ 0]     = 0
Offset[ 1]     = 7
Offset[ 2]     = 13
Offset[ 3]     = 32
Offset[ 4]     = 41Offset[ 5]     = 51
Offset[ 6]     = 61
Offset[ 7]     = 65
Offset[ 8]     = 68 I removed the ^M from my ascii files, but somehow, the error persists. I also tried to streamline the no of gaps b/w column 9 and 10, but it still gives the Error.  Once I corrected the gap b/w column 9 and 10, so It run smoothly. Actually, I have created the ascii files using paste (2 files) as it is not possible for me to enter so much data on my own.  Pls suggest. I am still trying with the agg-stat that U sent. Geeta
 		 	   		  

----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: Re: [rt.rap.ucar.edu #58065] Error with ascii2nc
From: Paul Oldenburg
Time: Thu Aug 30 08:07:50 2012

Geeta,

The input file to ascii2nc must be delimited with spaces.  The files
that you sent me have a tab character after the
height value, which is -9999.00 in all cases.  If you replace the tab
character in your files with spaces, they should
work.  I used a perl substitution, as shown below.

Paul


$ $MET_BASE/bin/ascii2nc precip24_2011080700.ascii
precip24_2011080700.nc -v 4
Creating NetCDF Observation file: precip24_2011080700.nc
Reading ASCII Observation file: precip24_2011080700.ascii
open_met_ascii() -> line number 24 doesn't contain the expected number
of columns (10):
[... omitted ...]

$ perl -pi -e's/00\t/00  /' precip24_2011080700.ascii
$ $MET_BASE/bin/ascii2nc precip24_2011080700.ascii
precip24_2011080700.nc -v 4
Creating NetCDF Observation file: precip24_2011080700.nc
Reading ASCII Observation file: precip24_2011080700.ascii
Processing 315 observations.
Finished processing 315 observations.


On 08/30/2012 04:05 AM, Geeta Geeta via RT wrote:
>
> Thu Aug 30 04:05:28 2012: Request 58065 was acted upon.
> Transaction: Ticket created by geeta124 at hotmail.com
>         Queue: met_help
>       Subject: Error with ascii2nc
>         Owner: Nobody
>    Requestors: geeta124 at hotmail.com
>        Status: new
>   Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=58065 >
>
>
>
> Hi Paul, I am creating the nc file from the ascii observations. I
have attached files. When I run my ascii2nc , following error is
encountered.
> open_met_ascii() -> line number 88 doesn't contain the expected
number of columns (10):
> open_met_ascii() -> line number 118 doesn't contain the expected
number of columns (10):
>
> Creating NetCDF Observation file:
/oprn/model/wrf3/utils/met/METv3.0/myascii2nc/full/precip24_2011080600.nc
> Reading ASCII Observation file: precip24_2011080600.ascii
> N_items        = 9
> N_chars        = 512
> N_ints         = 100
> LineNumber     = 6Item[ 0]       = "ADPSFC"
> Item[ 1]       = "CK005"
> Item[ 2]       = "20110806_030000"
> Item[ 3]       = "12.5500"
> Item[ 4]       = "0075.0700"Item[ 5]       = "-9999.00"
> Item[ 6]       = "61"
> Item[ 7]       = "24"
> Item[ 8]       = "-9999.00      103.8^M"Offset[ 0]     = 0
> Offset[ 1]     = 7
> Offset[ 2]     = 13
> Offset[ 3]     = 32
> Offset[ 4]     = 41Offset[ 5]     = 51
> Offset[ 6]     = 61
> Offset[ 7]     = 65
> Offset[ 8]     = 68 eading ASCII Observation file:
precip24_2011080700.ascii
> N_items        = 9
> N_chars        = 512
> N_ints         = 100
> LineNumber     = 25Item[ 0]       = "ADPSFC"
> Item[ 1]       = "CK024"
> Item[ 2]       = "20110807_030000"
> Item[ 3]       = "14.1400"
> Item[ 4]       = "0074.3900"Item[ 5]       = "-9999.00"
> Item[ 6]       = "61"
> Item[ 7]       = "24"
> Item[ 8]       = "-9999.00      123.2^M"Offset[ 0]     = 0
> Offset[ 1]     = 7
> Offset[ 2]     = 13
> Offset[ 3]     = 32
> Offset[ 4]     = 41Offset[ 5]     = 51
> Offset[ 6]     = 61
> Offset[ 7]     = 65
> Offset[ 8]     = 68 I removed the ^M from my ascii files, but
somehow, the error persists. I also tried to streamline the no of gaps
b/w column 9 and 10, but it still gives the Error.  Once I corrected
the gap b/w column 9 and 10, so It run smoothly. Actually, I have
created the ascii files using paste (2 files) as it is not possible
for me to enter so much data on my own.  Pls suggest. I am still
trying with the agg-stat that U sent. Geeta
>
>


------------------------------------------------


More information about the Met_help mailing list