[ncl-talk] Program that reads Instantaneous Precipitation from NW&CT

Barry Lynn barry.h.lynn at gmail.com
Mon Oct 30 11:59:45 MDT 2017


Hi:

I have attached the program that Mary nudged along.

It was necessary to "grab" (->) the variables from within the file before
using the commands such as PrintVarSummary (this is pretty basic, but
somehow I had overlooked this), and to rid the "dipr" variable of NaNs
before accessing the file.

It now makes images of instantaneous precipitation with the radar location
as the origin (example attached).

Barry
P.S: It also sets cmap to output white as the first "color" in the color
bar.

On Sun, Oct 29, 2017 at 5:33 PM, Barry Lynn <barry.h.lynn at gmail.com> wrote:

> Yes, thanks for reminding me!
>
> I took a program that worked and tried to read a different file and
> variables, which I will panel later.
>
> The clocks changed here...
>
> Barry
>
> On Sun, Oct 29, 2017 at 5:25 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> Barry,
>>
>> You are trying to print the variables without reading them off the file
>> first.  You have:
>>
>>   printVarSummary(elevation)
>>   printVarSummary(rays_time)
>>   printMinMax(DigitalInstantaneousPrecipitationRate_RAW,False)
>>   printMinMax(DigitalInstantaneousPrecipitationRate,False)
>>
>> These are indeed all variables on the file, but you need to read them off
>> the file before you can do a printVarSummary on them:
>>
>>   printVarSummary(f->elevation)
>>   printVarSummary(f->rays_time)
>>   printMinMax(f->DigitalInstantaneousPrecipitationRate_RAW,False)
>>   printMinMax(f->DigitalInstantaneousPrecipitationRate,False)
>>
>> or:
>>
>>   elevation = f->elevation
>>   rays_time = f->rays_time
>>   dipr_raw  = f->DigitalInstantaneousPrecipitationRate_RAW
>>   dipr      = f->DigitalInstantaneousPrecipitationRate
>>
>>   printVarSummary(elevation)
>>   printVarSummary(rays_time)
>>   printMinMax(elevation,0)
>>   printMinMax(rays_time,0)
>>   printMinMax(dipr_raw,0)
>>   printMinMax(dipr,0)
>>
>> You will note that dipr is all NaNs. You need to replace the NaNs with
>> missing values:
>>
>> ;---Replace NaNs with missing values
>>
>>   dipr at _FillValue = default_fillvalue(typeof(dipr))
>>   replace_ieeenan (dipr,dipr at _FillValue,0)
>>
>> Finally,
>>
>> You need to fix the do loop to go from 0 to n_files-1:
>>
>>   do i_file = 0,n_files-1
>>
>> Also, none of the paneling works because none of the plots have been
>> created.  I assume this is a work in progress.
>>
>> Good luck,
>>
>>
>> --Mary
>>
>> On Sun, Oct 29, 2017 at 9:00 AM, Barry Lynn <barry.h.lynn at gmail.com>
>> wrote:
>>
>>> Hi:
>>>
>>> I am trying to access the variables in this file.  I have printed them
>>> out and copied them to the ncl printVarSummary/printMinMax commands, but I
>>> get an error.
>>>
>>> Since the variables (and others) are present, I don't see a way around
>>> this.  Thank you for your help,
>>>
>>> Barry
>>>
>>> (0) elevation
>>>
>>> (1) azimuth
>>>
>>> (2) gate
>>>
>>> (3) latitude
>>>
>>> (4) longitude
>>>
>>> (5) altitude
>>>
>>> (6) rays_time
>>>
>>> (7) DigitalInstantaneousPrecipitationRate_RAW
>>>
>>> (8) DigitalInstantaneousPrecipitationRate
>>>
>>> fatal:Variable (elevation) is undefined
>>>
>>> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 18 in
>>> file ./read_nc_file.ncl
>>>
>>> --
>>> Barry H. Lynn, Ph.D
>>> Senior Lecturer,
>>> The Institute of the Earth Science,
>>> The Hebrew University of Jerusalem,
>>> Givat Ram, Jerusalem 91904, Israel
>>> Tel: 972 547 231 170
>>> Fax: (972)-25662581
>>>
>>> C.E.O, Weather It Is, LTD
>>> Weather and Climate Focus
>>> http://weather-it-is.com
>>> Jerusalem, Israel
>>> Local: 02 930 9525
>>> Cell: 054 7 231 170
>>> Int-IS: x972 2 930 9525
>>> US 914 432 3108 <(914)%20432-3108>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108 <(914)%20432-3108>
>



-- 
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171030/66045d20/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: instant_prec_NWCT.ncl
Type: application/octet-stream
Size: 6589 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171030/66045d20/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: obs_prec.000004.png
Type: image/png
Size: 273665 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171030/66045d20/attachment-0001.png>


More information about the ncl-talk mailing list