[Met_help] [rt.rap.ucar.edu #75000] History for pntnc2ascii.R script failing to get varid

Julie Prestopnik via RT met_help at ucar.edu
Wed Feb 10 09:40:00 MST 2016


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

Hello,

I’m trying to check some MADIS RAOB files for the number of observations using the pntnc2ascii.R script copied from the yellowstone build (I tried from V5.0 and V5.1) and am receiving an error about the varid when opening the file.

I tried with and without the .nc extension, i’m just really not familiar with R language to troubleshoot. Any ideas? the copied R script and raob files are locate at /glade/scratch/brockb if you’d like to try yourself.

Thank you,
Brock


Rscript pntnc2ascii.R raob_2015050400_arc.nc > raob_2015050400_arc_out.txt

Error in vobjtovarid(nc, varid, verbose = verbose) :
  second argument (varid) must be a integer varid, character string variable name, or var.ncdf object
Calls: data.frame -> get.var.ncdf -> vobjtovarid
In addition: Warning message:
In is.na(varid) : is.na() applied to non-(list or vector) of type 'NULL'
Execution halted






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

Subject: pntnc2ascii.R script failing to get varid
From: Julie Prestopnik
Time: Fri Feb 05 10:53:37 2016

Hi Brock.

John is out of the office today.  Unfortunately, I am not familiar
with
either pntnc2ascii.R or the R language, however, I took a look at
/glade/scratch/brockb to see if there was anything I could do to help.
I
ran the code and received the same output that you did.

I took a look in pntnc2ascii.R, and it looks like the code expects a
specific netcdf file format.  For example in this section of code:

    typ    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_typ"]]),
    sid    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_sid"]]),
    vld    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_vld"]]),
    lat    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[1,],
    lon    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[2,],
    elv    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[3,]

and in this section of code:

    hdr_id = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[1,],
    gc     = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[2,],
    lvl    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[3,],
    hgt    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[4,],
    qty    = ObsQty,
    ob     = signif(get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[5,],
5)

it looks like the code expects to have the variable names "hdr_typ",
"hdr_sid", "hdr_vld", "hdr_arr", and "obs_arr".  I recognize these
variable
names from the output of files generated using pb2nc.  I see that your
netcdf file is not in this same format.

Perhaps pntnc2ascii.R only works on those files that have the same
format
as those generated from pb2nc?

I hope that helps somewhat.

Julie



On Fri, Feb 5, 2016 at 8:31 AM, Burghardt, Brock via RT
<met_help at ucar.edu>
wrote:

>
> Fri Feb 05 08:31:39 2016: Request 75000 was acted upon.
> Transaction: Ticket created by brock.burghardt at ttu.edu
>        Queue: met_help
>      Subject: pntnc2ascii.R script failing to get varid
>        Owner: Nobody
>   Requestors: brock.burghardt at ttu.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
>
>
> Hello,
>
> I’m trying to check some MADIS RAOB files for the number of
observations
> using the pntnc2ascii.R script copied from the yellowstone build (I
tried
> from V5.0 and V5.1) and am receiving an error about the varid when
opening
> the file.
>
> I tried with and without the .nc extension, i’m just really not
familiar
> with R language to troubleshoot. Any ideas? the copied R script and
raob
> files are locate at /glade/scratch/brockb if you’d like to try
yourself.
>
> Thank you,
> Brock
>
>
> Rscript pntnc2ascii.R raob_2015050400_arc.nc >
raob_2015050400_arc_out.txt
>
> Error in vobjtovarid(nc, varid, verbose = verbose) :
>   second argument (varid) must be a integer varid, character string
> variable name, or var.ncdf object
> Calls: data.frame -> get.var.ncdf -> vobjtovarid
> In addition: Warning message:
> In is.na(varid) : is.na() applied to non-(list or vector) of type
'NULL'
> Execution halted
>
>
>
>
>
>


--
Julie Prestopnik
National Center for Atmospheric Research
Research Applications Laboratory
Phone: 303.497.8399
Email: jpresto at ucar.edu

------------------------------------------------
Subject: pntnc2ascii.R script failing to get varid
From: John Halley Gotway
Time: Mon Feb 08 10:19:25 2016

Hi Brock,

I took a look at your data on yellowstone.  And I see that you have
some
NetCDF MADIS RAOB data files.  I see that you're trying to run the
pntnc2ascii.R Rscript on those MADIS files.  Unfortunately, that won't
work.  That Rscript is set up to read the NetCDF output files produced
by
MET (i.e. pb2nc, ascii2nc, or madis2nc).

I realize that your MADIS files are already in NetCDF, but the file
format
isn't the issue... it's how the data is structured.  That's not to say
that
you couldn't write an Rscript to process that MADIS data but the
Rscript
you're running isn't designed to do that.

Here are some commands you could try:

# Load R
module load R

# Run madis2nc
/glade/p/ral/jnt/MET/MET_releases/met-5.1/bin/madis2nc \
   /glade/scratch/brockb/raob_2015050400_arc.nc \
   ~/raob_2015050400_arc_madis2nc.nc -type raob

# Run Rscript
Rscript
/glade/p/ral/jnt/MET/MET_releases/met-
5.1/scripts/Rscripts/pntnc2ascii.R \
   ~/raob_2015050400_arc_madis2nc.nc >
~/raob_2015050400_arc_madis2nc.txt

My output file for these commands can be found in:
   /glade/u/home/johnhg/raob_2015050400_arc_madis2nc.txt

FYI, if get you a NetCDF when running that Rscript, try copying over
my
~/.Rprofile to your home directory:
   cp /glade/u/home/johnhg/.Rprofile ~/.Rprofile

That tells R where to look for external packages which may be required
for
this Rscript.

Please let me know how it all goes.

Thanks,
John


On Fri, Feb 5, 2016 at 10:53 AM, Julie Prestopnik via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
>
> Hi Brock.
>
> John is out of the office today.  Unfortunately, I am not familiar
with
> either pntnc2ascii.R or the R language, however, I took a look at
> /glade/scratch/brockb to see if there was anything I could do to
help.  I
> ran the code and received the same output that you did.
>
> I took a look in pntnc2ascii.R, and it looks like the code expects a
> specific netcdf file format.  For example in this section of code:
>
>     typ    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_typ"]]),
>     sid    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_sid"]]),
>     vld    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_vld"]]),
>     lat    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[1,],
>     lon    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[2,],
>     elv    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[3,]
>
> and in this section of code:
>
>     hdr_id = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[1,],
>     gc     = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[2,],
>     lvl    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[3,],
>     hgt    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[4,],
>     qty    = ObsQty,
>     ob     = signif(get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[5,],
5)
>
> it looks like the code expects to have the variable names "hdr_typ",
> "hdr_sid", "hdr_vld", "hdr_arr", and "obs_arr".  I recognize these
variable
> names from the output of files generated using pb2nc.  I see that
your
> netcdf file is not in this same format.
>
> Perhaps pntnc2ascii.R only works on those files that have the same
format
> as those generated from pb2nc?
>
> I hope that helps somewhat.
>
> Julie
>
>
>
> On Fri, Feb 5, 2016 at 8:31 AM, Burghardt, Brock via RT
<met_help at ucar.edu
> >
> wrote:
>
> >
> > Fri Feb 05 08:31:39 2016: Request 75000 was acted upon.
> > Transaction: Ticket created by brock.burghardt at ttu.edu
> >        Queue: met_help
> >      Subject: pntnc2ascii.R script failing to get varid
> >        Owner: Nobody
> >   Requestors: brock.burghardt at ttu.edu
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
> >
> >
> > Hello,
> >
> > I’m trying to check some MADIS RAOB files for the number of
observations
> > using the pntnc2ascii.R script copied from the yellowstone build
(I tried
> > from V5.0 and V5.1) and am receiving an error about the varid when
> opening
> > the file.
> >
> > I tried with and without the .nc extension, i’m just really not
familiar
> > with R language to troubleshoot. Any ideas? the copied R script
and raob
> > files are locate at /glade/scratch/brockb if you’d like to try
yourself.
> >
> > Thank you,
> > Brock
> >
> >
> > Rscript pntnc2ascii.R raob_2015050400_arc.nc > raob_2015050400
> _arc_out.txt
> >
> > Error in vobjtovarid(nc, varid, verbose = verbose) :
> >   second argument (varid) must be a integer varid, character
string
> > variable name, or var.ncdf object
> > Calls: data.frame -> get.var.ncdf -> vobjtovarid
> > In addition: Warning message:
> > In is.na(varid) : is.na() applied to non-(list or vector) of type
'NULL'
> > Execution halted
> >
> >
> >
> >
> >
> >
>
>
> --
> Julie Prestopnik
> National Center for Atmospheric Research
> Research Applications Laboratory
> Phone: 303.497.8399
> Email: jpresto at ucar.edu
>
>

------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #75000] pntnc2ascii.R script failing to get varid
From: Burghardt, Brock
Time: Mon Feb 08 12:12:52 2016

Hi John,

My bad, I forgot about the need to run the madis2nc executable.

Everything worked and I am able to compare the number of obs among
files.

Thanks again, you rock!
Brock

> On Feb 8, 2016, at 11:19 AM, John Halley Gotway via RT
<met_help at ucar.edu> wrote:
>
> Hi Brock,
>
> I took a look at your data on yellowstone.  And I see that you have
some
> NetCDF MADIS RAOB data files.  I see that you're trying to run the
> pntnc2ascii.R Rscript on those MADIS files.  Unfortunately, that
won't
> work.  That Rscript is set up to read the NetCDF output files
produced by
> MET (i.e. pb2nc, ascii2nc, or madis2nc).
>
> I realize that your MADIS files are already in NetCDF, but the file
format
> isn't the issue... it's how the data is structured.  That's not to
say that
> you couldn't write an Rscript to process that MADIS data but the
Rscript
> you're running isn't designed to do that.
>
> Here are some commands you could try:
>
> # Load R
> module load R
>
> # Run madis2nc
> /glade/p/ral/jnt/MET/MET_releases/met-5.1/bin/madis2nc \
>   /glade/scratch/brockb/raob_2015050400_arc.nc \
>   ~/raob_2015050400_arc_madis2nc.nc -type raob
>
> # Run Rscript
> Rscript
> /glade/p/ral/jnt/MET/MET_releases/met-
5.1/scripts/Rscripts/pntnc2ascii.R \
>   ~/raob_2015050400_arc_madis2nc.nc >
~/raob_2015050400_arc_madis2nc.txt
>
> My output file for these commands can be found in:
>   /glade/u/home/johnhg/raob_2015050400_arc_madis2nc.txt
>
> FYI, if get you a NetCDF when running that Rscript, try copying over
my
> ~/.Rprofile to your home directory:
>   cp /glade/u/home/johnhg/.Rprofile ~/.Rprofile
>
> That tells R where to look for external packages which may be
required for
> this Rscript.
>
> Please let me know how it all goes.
>
> Thanks,
> John
>
>
> On Fri, Feb 5, 2016 at 10:53 AM, Julie Prestopnik via RT
<met_help at ucar.edu>
> wrote:
>
>>
>> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
>>
>> Hi Brock.
>>
>> John is out of the office today.  Unfortunately, I am not familiar
with
>> either pntnc2ascii.R or the R language, however, I took a look at
>> /glade/scratch/brockb to see if there was anything I could do to
help.  I
>> ran the code and received the same output that you did.
>>
>> I took a look in pntnc2ascii.R, and it looks like the code expects
a
>> specific netcdf file format.  For example in this section of code:
>>
>>    typ    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_typ"]]),
>>    sid    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_sid"]]),
>>    vld    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_vld"]]),
>>    lat    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[1,],
>>    lon    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[2,],
>>    elv    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[3,]
>>
>> and in this section of code:
>>
>>    hdr_id = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[1,],
>>    gc     = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[2,],
>>    lvl    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[3,],
>>    hgt    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[4,],
>>    qty    = ObsQty,
>>    ob     = signif(get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[5,],
5)
>>
>> it looks like the code expects to have the variable names
"hdr_typ",
>> "hdr_sid", "hdr_vld", "hdr_arr", and "obs_arr".  I recognize these
variable
>> names from the output of files generated using pb2nc.  I see that
your
>> netcdf file is not in this same format.
>>
>> Perhaps pntnc2ascii.R only works on those files that have the same
format
>> as those generated from pb2nc?
>>
>> I hope that helps somewhat.
>>
>> Julie
>>
>>
>>
>> On Fri, Feb 5, 2016 at 8:31 AM, Burghardt, Brock via RT
<met_help at ucar.edu
>>>
>> wrote:
>>
>>>
>>> Fri Feb 05 08:31:39 2016: Request 75000 was acted upon.
>>> Transaction: Ticket created by brock.burghardt at ttu.edu
>>>       Queue: met_help
>>>     Subject: pntnc2ascii.R script failing to get varid
>>>       Owner: Nobody
>>>  Requestors: brock.burghardt at ttu.edu
>>>      Status: new
>>> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
>>>
>>>
>>> Hello,
>>>
>>> I’m trying to check some MADIS RAOB files for the number of
observations
>>> using the pntnc2ascii.R script copied from the yellowstone build
(I tried
>>> from V5.0 and V5.1) and am receiving an error about the varid when
>> opening
>>> the file.
>>>
>>> I tried with and without the .nc extension, i’m just really not
familiar
>>> with R language to troubleshoot. Any ideas? the copied R script
and raob
>>> files are locate at /glade/scratch/brockb if you’d like to try
yourself.
>>>
>>> Thank you,
>>> Brock
>>>
>>>
>>> Rscript pntnc2ascii.R raob_2015050400_arc.nc > raob_2015050400
>> _arc_out.txt
>>>
>>> Error in vobjtovarid(nc, varid, verbose = verbose) :
>>>  second argument (varid) must be a integer varid, character string
>>> variable name, or var.ncdf object
>>> Calls: data.frame -> get.var.ncdf -> vobjtovarid
>>> In addition: Warning message:
>>> In is.na(varid) : is.na() applied to non-(list or vector) of type
'NULL'
>>> Execution halted
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Julie Prestopnik
>> National Center for Atmospheric Research
>> Research Applications Laboratory
>> Phone: 303.497.8399
>> Email: jpresto at ucar.edu
>>
>>
>



------------------------------------------------
Subject: pntnc2ascii.R script failing to get varid
From: John Halley Gotway
Time: Mon Feb 08 12:41:02 2016

Great, glad that did the trick.

John

On Mon, Feb 8, 2016 at 12:12 PM, Burghardt, Brock via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
>
> Hi John,
>
> My bad, I forgot about the need to run the madis2nc executable.
>
> Everything worked and I am able to compare the number of obs among
files.
>
> Thanks again, you rock!
> Brock
>
> > On Feb 8, 2016, at 11:19 AM, John Halley Gotway via RT <
> met_help at ucar.edu> wrote:
> >
> > Hi Brock,
> >
> > I took a look at your data on yellowstone.  And I see that you
have some
> > NetCDF MADIS RAOB data files.  I see that you're trying to run the
> > pntnc2ascii.R Rscript on those MADIS files.  Unfortunately, that
won't
> > work.  That Rscript is set up to read the NetCDF output files
produced by
> > MET (i.e. pb2nc, ascii2nc, or madis2nc).
> >
> > I realize that your MADIS files are already in NetCDF, but the
file
> format
> > isn't the issue... it's how the data is structured.  That's not to
say
> that
> > you couldn't write an Rscript to process that MADIS data but the
Rscript
> > you're running isn't designed to do that.
> >
> > Here are some commands you could try:
> >
> > # Load R
> > module load R
> >
> > # Run madis2nc
> > /glade/p/ral/jnt/MET/MET_releases/met-5.1/bin/madis2nc \
> >   /glade/scratch/brockb/raob_2015050400_arc.nc \
> >   ~/raob_2015050400_arc_madis2nc.nc -type raob
> >
> > # Run Rscript
> > Rscript
> > /glade/p/ral/jnt/MET/MET_releases/met-
5.1/scripts/Rscripts/pntnc2ascii.R
> \
> >   ~/raob_2015050400_arc_madis2nc.nc >
~/raob_2015050400_arc_madis2nc.txt
> >
> > My output file for these commands can be found in:
> >   /glade/u/home/johnhg/raob_2015050400_arc_madis2nc.txt
> >
> > FYI, if get you a NetCDF when running that Rscript, try copying
over my
> > ~/.Rprofile to your home directory:
> >   cp /glade/u/home/johnhg/.Rprofile ~/.Rprofile
> >
> > That tells R where to look for external packages which may be
required
> for
> > this Rscript.
> >
> > Please let me know how it all goes.
> >
> > Thanks,
> > John
> >
> >
> > On Fri, Feb 5, 2016 at 10:53 AM, Julie Prestopnik via RT <
> met_help at ucar.edu>
> > wrote:
> >
> >>
> >> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
> >>
> >> Hi Brock.
> >>
> >> John is out of the office today.  Unfortunately, I am not
familiar with
> >> either pntnc2ascii.R or the R language, however, I took a look at
> >> /glade/scratch/brockb to see if there was anything I could do to
help.
> I
> >> ran the code and received the same output that you did.
> >>
> >> I took a look in pntnc2ascii.R, and it looks like the code
expects a
> >> specific netcdf file format.  For example in this section of
code:
> >>
> >>    typ    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_typ"]]),
> >>    sid    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_sid"]]),
> >>    vld    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_vld"]]),
> >>    lat    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[1,],
> >>    lon    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[2,],
> >>    elv    = get.var.ncdf(ncPnt, ncPnt$var[["hdr_arr"]])[3,]
> >>
> >> and in this section of code:
> >>
> >>    hdr_id = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[1,],
> >>    gc     = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[2,],
> >>    lvl    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[3,],
> >>    hgt    = get.var.ncdf(ncPnt, ncPnt$var[["obs_arr"]])[4,],
> >>    qty    = ObsQty,
> >>    ob     = signif(get.var.ncdf(ncPnt,
ncPnt$var[["obs_arr"]])[5,], 5)
> >>
> >> it looks like the code expects to have the variable names
"hdr_typ",
> >> "hdr_sid", "hdr_vld", "hdr_arr", and "obs_arr".  I recognize
these
> variable
> >> names from the output of files generated using pb2nc.  I see that
your
> >> netcdf file is not in this same format.
> >>
> >> Perhaps pntnc2ascii.R only works on those files that have the
same
> format
> >> as those generated from pb2nc?
> >>
> >> I hope that helps somewhat.
> >>
> >> Julie
> >>
> >>
> >>
> >> On Fri, Feb 5, 2016 at 8:31 AM, Burghardt, Brock via RT <
> met_help at ucar.edu
> >>>
> >> wrote:
> >>
> >>>
> >>> Fri Feb 05 08:31:39 2016: Request 75000 was acted upon.
> >>> Transaction: Ticket created by brock.burghardt at ttu.edu
> >>>       Queue: met_help
> >>>     Subject: pntnc2ascii.R script failing to get varid
> >>>       Owner: Nobody
> >>>  Requestors: brock.burghardt at ttu.edu
> >>>      Status: new
> >>> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=75000 >
> >>>
> >>>
> >>> Hello,
> >>>
> >>> I’m trying to check some MADIS RAOB files for the number of
> observations
> >>> using the pntnc2ascii.R script copied from the yellowstone build
(I
> tried
> >>> from V5.0 and V5.1) and am receiving an error about the varid
when
> >> opening
> >>> the file.
> >>>
> >>> I tried with and without the .nc extension, i’m just really not
> familiar
> >>> with R language to troubleshoot. Any ideas? the copied R script
and
> raob
> >>> files are locate at /glade/scratch/brockb if you’d like to try
> yourself.
> >>>
> >>> Thank you,
> >>> Brock
> >>>
> >>>
> >>> Rscript pntnc2ascii.R raob_2015050400_arc.nc > raob_2015050400
> >> _arc_out.txt
> >>>
> >>> Error in vobjtovarid(nc, varid, verbose = verbose) :
> >>>  second argument (varid) must be a integer varid, character
string
> >>> variable name, or var.ncdf object
> >>> Calls: data.frame -> get.var.ncdf -> vobjtovarid
> >>> In addition: Warning message:
> >>> In is.na(varid) : is.na() applied to non-(list or vector) of
type
> 'NULL'
> >>> Execution halted
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >> --
> >> Julie Prestopnik
> >> National Center for Atmospheric Research
> >> Research Applications Laboratory
> >> Phone: 303.497.8399
> >> Email: jpresto at ucar.edu
> >>
> >>
> >
>
>
>
>

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


More information about the Met_help mailing list