[gradsusr] Displaying a .nc file
Jennifer Adams
jma at cola.iges.org
Thu Jun 19 13:41:13 EDT 2014
David,
Can you post the output from ncdump -c on your netcdf file?
--Jennifer
On Jun 19, 2014, at 1:14 PM, David Stanfel wrote:
> I made the changes that were recommended with the following results. My X11 window does pop up when I run grads but it stays black. This is what happens when I try to display a variable:
>
> ga-> open cont.ctl
> Scanning description file: cont.ctl
> Data file atmos_month.nc.0000 is open as file 1
> LON set to 0 360
> LAT set to -88.29 88.29
> LEV set to 1000 1000
> Time values set: 0:1:1:0 0:1:1:0
> E set to 1 1
> ga-> q file
> File 1 : 6 Months Sample Model Output
> Descriptor: cont.ctl
> Binary: atmos_month.nc.0000
> Type = Gridded
> Xsize = 96 Ysize = 80 Zsize = 18 Tsize = 804 Esize = 1
> Number of Variables = 7
> u 18 t,z,y,x u
> v 18 t,z,y,x v
> w 18 t,z,y,x v
> t 18 t,z,y,x v
> sh 18 t,z,y,x v
> rh 18 t,z,y,x v
> z 18 t,z,y,x v
> ga-> d u
> Error: Variable u not in netcdf file
> Data Request Error: Error for variable 'u'
> Error ocurred at column 1
> DISPLAY error: Invalid expression
> Expression = u
> ga-> d z
> Error: Variable z not in netcdf file
> Data Request Error: Error for variable 'z'
> Error ocurred at column 1
> DISPLAY error: Invalid expression
> Expression = z
>
> It still does not recognize that that variable is in the netcdf file for some reason.
>
> Thanks,
>
> David
>
>
> On Thu, Jun 19, 2014 at 10:22 AM, Hosmay Lopez <hlopez at rsmas.miami.edu> wrote:
> Try this CTL file:
>
> The only difference is how you defined the variables' arguments.
>
>
> DSET ^atmos_month.nc.0000
> UNDEF 1.e-10
> DTYPE netcdf
> TITLE 6 Months Sample Model Output
> *
> XDEF 96 LINEAR 0.0 3.75
> *
> YDEF 80 GAUSR30 1
> *
> ZDEF 18 LEVELS 1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300
> 250 200 150
> *
> TDEF 804 LINEAR JAN0 1MO
> *
> VARS 7
> u 18 t,z,y,x u
> v 18 t,z,y,x v
> w 18 t,z,y,x v
> t 18 t,z,y,x v
> sh 18 t,z,y,x v
> rh 18 t,z,y,x v
> z 18 t,z,y,x v
> ENDVARS
>
> Good luck!
>
> Hosmay Lopez
> UM/CIMAS/RSMAS NOAA/AOML/PHOD
> 4301 Rickenbacker Causeway,
> Miami, FL 33149, USA
> Phone: (305) 361-4329
>
> From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on behalf of David Stanfel [dstanfel at ualberta.ca]
> Sent: Thursday, June 19, 2014 12:07 AM
> To: GrADS Users Forum
> Subject: Re: [gradsusr] Displaying a .nc file
>
> It did prompt a list of variables including u, v, w, and z. It still doesn't want to display them.
>
> ga-> q file
> File 1 : 6 Months Sample Model Output
> Descriptor: cont.ctl
> Binary: atmos_month.nc.0000
> Type = Gridded
> Xsize = 96 Ysize = 80 Zsize = 18 Tsize = 804 Esize = 1
> Number of Variables = 7
> u 18 0 u
> v 18 0 v
> w 18 0 v
> t 18 0 v
> sh 18 0 v
> rh 18 0 v
> z 18 0 v
> ga-> d v
> Data Request Error: Error for variable 'v'
> Error ocurred at column 1
> DISPLAY error: Invalid expression
> Expression = v
> ga-> d sh
> Error: Variable sh not in netcdf file
> Data Request Error: Error for variable 'sh'
> Error ocurred at column 1
> DISPLAY error: Invalid expression
> Expression = sh
>
> Thanks,
>
> David
>
>
> On Wed, Jun 18, 2014 at 11:58 PM, James T. Potemra <jimp at hawaii.edu> wrote:
> If you enter "q file" at the GrADS prompt it should list the variables.
>
>
> On 6/18/14 5:52 PM, David Stanfel wrote:
>> How do I know what variable name will work? I've tried u, v, w, and z and still only get:
>>
>> ga-> d v
>> Error: Variable v not in netcdf file
>> Data Request Error: Error for variable 'v'
>> Error ocurred at column 1
>> DISPLAY error: Invalid expression
>> Expression = v
>>
>> Thanks,
>>
>> David
>>
>>
>> On Wed, Jun 18, 2014 at 11:13 PM, Hosmay Lopez <hlopez at rsmas.miami.edu> wrote:
>> David,
>>
>> You should let GrADS know that the file is a netCDF. You do that by adding the following text line in your control file:
>>
>> DTYPE netcdf
>>
>> Insert such after the UNDEF line.
>>
>> Good luck!
>>
>> Hosmay Lopez
>> UM/CIMAS/RSMAS NOAA/AOML/PHOD
>> 4301 Rickenbacker Causeway,
>> Miami, FL 33149, USA
>> Phone: (305) 361-4329
>>
>> From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on behalf of David Stanfel [dstanfel at ualberta.ca]
>> Sent: Wednesday, June 18, 2014 10:58 PM
>> To: GrADS Users Forum
>> Subject: [gradsusr] Displaying a .nc file
>>
>> So I figured out how to use a descriptor file but I am still having troubles opening the file. My descriptor file is as follows:
>>
>> DSET ^atmos_month.nc.0000
>> UNDEF 1.e-10
>> TITLE 6 Months Sample Model Output
>> *
>> XDEF 96 LINEAR 0.0 3.75
>> *
>> YDEF 80 GAUSR30 1
>> *
>> ZDEF 18 LEVELS 1000 950 900 850 800 750 700 650 600 550 500 450 400 350 300
>> 250 200 150
>> *
>> TDEF 804 LINEAR JAN0 1MO
>> *
>> VARS 7
>> u 18 0 u
>> v 18 0 v
>> w 18 0 v
>> t 18 0 v
>> sh 18 0 v
>> rh 18 0 v
>> z 18 0 v
>> ENDVARS
>>
>> It was able to open it without issue:
>>
>> ga-> open cont.ctl
>> Scanning description file: cont.ctl
>> Data file atmos_month.nc.0000 is open as file 1
>> LON set to 0 360
>> LAT set to -88.29 88.29
>> LEV set to 1000 1000
>> Time values set: 0:1:1:0 0:1:1:0
>> E set to 1 1
>>
>> However, I am having trouble displaying the data. I tried to use the display command (d) with this result:
>>
>> ga-> d atmos_month.nc.0000
>> Syntax error: Bad file number for variable atmos_month
>> Error ocurred at column 1
>> DISPLAY error: Invalid expression
>> Expression = atmos_month.nc.0000
>>
>> Is my syntax off?
>>
>> Thanks,
>>
>> David
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140619/ce26a2dd/attachment-0001.html
More information about the gradsusr
mailing list