[ncl-talk] Trying to plot wrfout with Mercator projection, gives LCC anyway
Mary Haley
haley at ucar.edu
Wed Jan 18 11:39:34 MST 2017
Ryan,
Something is not making sense here. Can you provide the full script? If
you don't want to send it to the whole list, you can just email me. I will
also need to see the exact error messages and warnings.
The other warnings about MainTitle, TimeLabel, and ContourParameters are
because you are using special WRF resources with a gsn_csm call. These
resources are only recognized by wrf_xxxxx plotting routines.
--Mary
On Tue, Jan 17, 2017 at 3:03 PM, Ryan Connelly <rconne01 at gmail.com> wrote:
> Oh sorry, I forgot I switched dbz_plane in for contour. Either way, same
> error. Here are the printVarSummary's for those:
>
> Variable: dbz_plane
> Type: float
> Total Size: 973728 bytes
> 243432 values
> Number of Dimensions: 2
> Dimensions and sizes: [483] x [504]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 9.96921e+36
>
>
>
> Variable: contour
> Type: obj
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 1
>
> Before that, I also get a few warnings:
>
> warning:MainTitle is not a valid resource in /RAP_1.333km_wrf_dbz_MA_2014-01-29_01:15:00_contour
> at this time
> warning:TimeLabel is not a valid resource in /RAP_1.333km_wrf_dbz_MA_2014-01-29_01:15:00_contour
> at this time
> warning:ContourParameters is not a valid resource in
> /RAP_1.333km_wrf_dbz_MA_2014-01-29_01:15:00_contour at this time
> warning:ContourPlotDraw: data boundary is out of range
>
>
> On Tue, Jan 17, 2017 at 4:55 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> Ryan,
>>
>> I think the "argument mismatch" is referring to the "dbz_plane" argument,
>> because the argument count starts at 0, which would be "wks", and then 1
>> which would be "dbz_plane". But, it doesn't make sense that it is
>> complaining about dbz_plane, unless it is a not a numeric.
>>
>> What does:
>>
>> printVarSummary(dbz_plane)
>>
>> report?
>>
>> --Mary
>>
>>
>> On Tue, Jan 17, 2017 at 2:33 PM, Ryan Connelly <rconne01 at gmail.com>
>> wrote:
>>
>>> Hi Mary,
>>>
>>> Thanks for getting back to me. I suspected that was the problem, but in
>>> trying to use gsn_csm_contour_map, I encounter this error:
>>> fatal:Argument type mismatch on argument (1) of (gsn_csm_contour_map)
>>> can not coerce
>>>
>>> Argument (1) is contour, which is defined as
>>> contour = gsn_csm_contour(wks,dbz_plane(:,:),opts)
>>>
>>> Thanks,
>>> Ryan
>>>
>>> On Tue, Jan 17, 2017 at 4:20 PM, Mary Haley <haley at ucar.edu> wrote:
>>>
>>>> Hi Ryan,
>>>>
>>>> The WRF plotting routines want to plot data in the native projection on
>>>> the file, and won't let you set a different map projection. This is
>>>> actually why the file handle ("a" in your case) is the first argument to
>>>> wrf_map_overlays, because it queries the file for the map projection
>>>> information and sets it.
>>>>
>>>> It looks like your WRF data may be on an LCC projection, and so that's
>>>> what it's trying to use.
>>>>
>>>> If you really want to set your own map projection, then I suggest you
>>>> use gsn_csm_contour_map. To do this, you will need to read in XLAT and
>>>> XLONG off the file, and attach them as attributes called "lat2d" and
>>>> "lon2d".
>>>>
>>>> See example #10 at:
>>>>
>>>> http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml#ex10
>>>>
>>>> The first frame shows how to plot data using the native projection on
>>>> the WRF output file. The second frame, which is the one you want, shows how
>>>> to read XLAT/XLONG off the file. You want to follow this example, and then
>>>> set your map resources as you indicated.
>>>>
>>>> A more simple example is the first one at:
>>>>
>>>> http://www.ncl.ucar.edu/Applications/wrfgsn.shtml
>>>>
>>>> See the first frame of this example (not the second one, which uses
>>>> wrf_xxxx to plot).
>>>>
>>>> It plots the data on a Cylindrical Equidistant map, but you can change
>>>> this to mercator.
>>>>
>>>> --Mary
>>>>
>>>>
>>>> On Tue, Jan 17, 2017 at 12:29 PM, Ryan Connelly <rconne01 at gmail.com>
>>>> wrote:
>>>>
>>>>> I'm following this page as a guide: http://www.ncl.ucar.edu
>>>>> /Applications/wrfmerc.shtml
>>>>>
>>>>> I've added the following lines to my script:
>>>>>
>>>>> ; Plotting options for limited area Mercator projection plot
>>>>> consistent across domains
>>>>>
>>>>> mpres at tfDoNDCOverlay = True ; set True for native
>>>>> (direct) mapping
>>>>>
>>>>> mpres at mpProjection = "Mercator"
>>>>> mpres at mpLimitMode = "Corners"
>>>>> mpres at mpRightCornerLatF = 41.22405
>>>>> mpres at mpLeftCornerLonF = -72.25338
>>>>> mpres at mpLeftCornerLatF = 36.38864
>>>>> mpres at mpRightCornerLonF = -78.62663
>>>>>
>>>>> And I call the plot like this:
>>>>> plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
>>>>>
>>>>> I get the correct lat,lon corners, but on an LCC plot, not a
>>>>> Mercator. Please advise.
>>>>>
>>>>> Ryan
>>>>>
>>>>> --
>>>>> Ryan Connelly
>>>>> M.S. Student in Atmospheric Sciences, Stony Brook University
>>>>> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
>>>>> University
>>>>> rconne01 at gmail.com
>>>>> ryan.connelly at stonybrook.edu
>>>>>
>>>>> _______________________________________________
>>>>> ncl-talk mailing list
>>>>> ncl-talk at ucar.edu
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Ryan Connelly
>>> M.S. Student in Atmospheric Sciences, Stony Brook University
>>> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
>>> University
>>> rconne01 at gmail.com
>>> ryan.connelly at stonybrook.edu
>>>
>>
>>
>
>
> --
> Ryan Connelly
> M.S. Student in Atmospheric Sciences, Stony Brook University
> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
> University
> rconne01 at gmail.com
> ryan.connelly at stonybrook.edu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170118/a782f415/attachment.html
More information about the ncl-talk
mailing list