[ncl-talk] gsn_contour_map, zoom in plot problem

Ying Song ying.song at sjsu.edu
Mon Oct 16 17:04:46 MDT 2017


​
 MERRA2_400.inst3_3d_asm_Np.20160601.nc
<https://drive.google.com/a/sjsu.edu/file/d/0B67osBUwSAudOC15MWZsRzAwZWc/view?usp=drive_web>
​Hello, Mary,

I tried to the "trGridType" setting and got this error:
fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size
100000000
fatal:ContourPlotDraw: draw error
fatal:ContourPlotDraw: draw error
fatal:PlotManagerDraw: error in plot draw
fatal:_NhlPlotManagerDraw: Draw error
-----------------

the script is attached. The MERRA-2 file I used is quite large (2.9G). I
tried to upload it to ftp following the link you sent. Got some error msg
below. So I attached it using google drive. Hope you are able to download
it.

200 PORT command sucessful. Consider using PASV
553 Could not create file.
---------------------

Thanks!

Ying


On Thu, Sep 21, 2017 at 10:12 AM, Mary Haley <haley at ucar.edu> wrote:

> Ying,
>
> Sorry about the delay, I've been out-of-town.
>
> Were you able to figure out the problem? Did you try the "trGridType"
> setting that the message recommended? This is needed if your lat/lon
> coordinates contain missing values.
>
>  If you are still having a problem, it would help if I could have access
> to your data file and the latest version of your script.
>
> You can upload these to our ftp site:
>
> http://www.ncl.ucar.edu/ftp_files.shtml
>
> --Mary
>
>
>
> On Fri, Sep 8, 2017 at 2:58 AM, Ying Song <ying.song at sjsu.edu> wrote:
>
>> Hello, Mary,
>>
>> I modified my script following your first suggestion. The problem is
>> still there. The warning msg shows:
>> -------------------------------------------------
>> Variable: o3_p
>> Type: float
>> Total Size: 831744 bytes
>>             207936 values
>> Number of Dimensions: 2
>> Dimensions and sizes:   [lat | 361] x [lon | 576]
>> Coordinates:
>>             lat: [ -90..  90]
>>             lon: [-180..179.375]
>> Number Of Attributes: 13
>>   lev :  900
>>   time :        540
>>   long_name :   ozone mixing ratio
>>   units :       ppbv
>>   _FillValue :  1e+15
>>   missing_value :       1e+15
>>   fmissing_value :      1e+15
>>   scale_factor :         1
>>   add_offset :   0
>>   standard_name :       ozone_mass_mixing_ratio
>>   vmax :        1e+15
>>   vmin :        -1e+15
>>   valid_range : ( -1e+15, 1e+15 )
>> warning:ContourPlotDraw: out of range coordinates encountered; standard
>> AreaFill rendering method may be unreliable;
>>  consider setting the resource trGridType to "TriangularMesh" if
>> coordinates contain missing values
>> -------------------------------------
>> And I attached the updated script. I wounder if I need to add triangular
>> meshes resource in my script?
>>
>> Thanks!
>>
>> On Thu, Sep 7, 2017 at 8:46 AM, Mary Haley <haley at ucar.edu> wrote:
>>
>>> I think the issue is that "o3_p", which is the variable you are trying
>>> to plot, doesn't have any metadata attached to it.
>>>
>>> When you do calculations like this in NCL:
>>>
>>>    o3= a->O3(3,4,:,:) ; 18GTM = 11AM PST
>>>
>>>   printVarSummary(o3)
>>>    o3_p =(o3*1e9)*(28.97/48)
>>>
>>> The "o3" will have metadata because no computations were done when you
>>> read the variable off the file.
>>>
>>> However, since o3_p involves calculations, NCL will strip all the
>>> metadata and the only thing that o3_p will retain from o3 is the _FillValue
>>> attribute, if any.
>>>
>>> As a "trick", you can force o3_p to have the same metadata by doing the
>>> following:
>>>
>>>    o3_p = a->O3(3,4,:,:) ; 18GTM = 11AM PST
>>>
>>>    o3_p =(o3_p*1e9)*(28.97/48)
>>>
>>> The first line will read the data into o3_p, and the metadata will all
>>> be there. Then, when you do the calculation, since o3_p already exists, no
>>> metadata will be removed.
>>>
>>> Note that I removed the use of o3, just to save memory. If you need to
>>> keep o3 and o3_p around, then you can do:
>>>
>>>    o3 = a->O3(3,4,:,:) ; 18GTM = 11AM PST
>>>    o3_p = o3           ; trick to copy metadata
>>>    o3_p =(o3*1e9)*(28.97/48)
>>>
>>> You should however, update the long_name and units attributes of o3_p,
>>> to reflect what the new values represent.
>>>
>>> --Mary
>>>
>>>
>>> On Wed, Sep 6, 2017 at 5:05 PM, Ying Song <ying.song at sjsu.edu> wrote:
>>>
>>>> Hello, ncl helper,
>>>>
>>>> I trying to plot MERRA-2 reanalysis data in NCL using gsn_contour_map.
>>>> I am only interested in west coast of US.  But I can not get the zoom in
>>>> plot correctly by using resources:
>>>>
>>>>   res at mpMinLatF               = 30
>>>>   res at mpMaxLatF               = 45
>>>>   res at mpMinLonF               = -130
>>>>   res at mpMaxLonF               = -110
>>>>
>>>> The warning shows:
>>>> warning:ContourPlotDraw: out of range coordinates encountered; standard
>>>> AreaFill rendering method may be unreliable;
>>>>  consider setting the resource trGridType to "TriangularMesh" if
>>>> coordinates contain missing values
>>>>
>>>> Attachment is my script. The info of MERRA-2 O3 data from
>>>> printVarSummary is:
>>>>  ------------------------------
>>>> Variable: o3
>>>> Type: float
>>>> Total Size: 279465984 bytes
>>>>             69866496 values
>>>> Number of Dimensions: 4
>>>> Dimensions and sizes:   [time | 8] x [lev | 42] x [lat | 361] x [lon |
>>>> 576]
>>>> Coordinates:
>>>>             time: [0..1260]
>>>>             lev: [1000..0.1000000014901161]
>>>>             lat: [ -90..  90]
>>>>             lon: [-180..179.375]
>>>> Number Of Attributes: 11
>>>>   long_name :   ozone_mass_mixing_ratio
>>>>   units :       kg kg-1
>>>>   _FillValue :  1e+15
>>>>   missing_value :       1e+15
>>>>   fmissing_value :      1e+15
>>>>   scale_factor :         1
>>>>   add_offset :   0
>>>>   standard_name :       ozone_mass_mixing_ratio
>>>>   vmax :        1e+15
>>>>   vmin :        -1e+15
>>>>   valid_range : ( -1e+15, 1e+15 )
>>>> ---------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171016/ac0edc21/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: o3_xy_plt_zoom.ncl
Type: application/octet-stream
Size: 1270 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171016/ac0edc21/attachment.obj>


More information about the ncl-talk mailing list