Re: blank plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 15 2010 - 13:04:14 MDT

Hi Lizzie,
You are setting both data@lat2d=lat and res@sfYArray=lat. You don't need
to set both of those. (Same for data@lon2d = lon, res@sfXArray = lon).
Setting both of those may cause an issue, so I'd change that first.

If the color filled contours still don't show up, and you are not
getting any error messages upon the plot creation, I would change your
projection from a polar plot to a cylindrical equidistant plot, and see
if you get any contours in the southern hemisphere...

I would also check the range of your lat and lon arrays, by doing a
printMinMax(lat,0) and printMinMax(lon,0), and see where the data is
supposed to be plotting.

If you go through all of that and you still can't figure it out respond
back to the group... Adam

On 09/15/2010 12:54 PM, ziying-li@hdfgroup.org wrote:
> Hi,
> Thanks for your reply and I tried. Only one more blank plot appears in phf
> file and no other things change.
>
> The lat/lon in this file is 4060*2780. I'm not sure if it matters.
>
> Thanks
>
> Lizzie
>
>> Hi,
>>
>> Add the following after plot=gsn_csm_contour_map_polar(xwks,data,res):
>>
>> draw(plot)
>> frame(xwks)
>>
>> -------------------------------------------------------------
>> Brandon Fisel
>>
>>
>> On Wed, Sep 15, 2010 at 13:36,<ziying-li@hdfgroup.org> wrote:
>>
>>> Hi,
>>> This is a follow up case for below example:
>>> http://www.ncl.ucar.edu/Support/talk_archives/2010/1904.html
>>>
>>> I successfully read out lat and lon from that ASCII file. The size
>>> matches
>>> and the value looks reasonable.
>>>
>>> But the final pdf plot I got is blank. You can see title, map and color
>>> bar well except data.
>>>
>>> NCL code:
>>> ------------------------------------------------------------
>>> load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>>
>>> begin
>>> eos_file=addfile("MYD02HKM.A2010031.0035.005.2010031183706.hdf.he2",
>>> "r")
>>>
>>> data_unscaled = eos_file->EV_500_RefSB_MODIS_SWATH_Type_L1B(0,:,:) ; get
>>> the clues from print(eos_file)
>>> data_unscaled@_FillValue = 65535h
>>> data = 3.4915833E-5 * ( data_unscaled - (-0.0) )
>>>
>>> nlon=4060
>>> nlat=2708
>>>
>>>
>>> lat=asciiread("lat_MYD02HKM.A2010031.0035.005.2010031183706.output",(/nlon,nlat/),"float")
>>>
>>> lon=asciiread("lon_MYD02HKM.A2010031.0035.005.2010031183706.output",(/nlon,nlat/),"float")
>>>
>>> data@lat2d=lat
>>> data@lon2d=lon
>>>
>>>
>>> xwks=gsn_open_wks("pdf","MYD02HKM.A2010031.0035.005.2010031183706_EV_500_RefSB.ncl")
>>>
>>> setvalues NhlGetWorkspaceObjectId() ; make maximum filesize larger
>>> "wsMaximumSize" : 200000000
>>> end setvalues
>>>
>>> res=True
>>> res@cnFillOn=True
>>> res@gsnMaximize=True
>>> res@gsnPaperOrientation = "portrait"
>>> res@cnLinesOn=False
>>> res@cnLineLabelsOn = False
>>> res@gsnSpreadColors=True
>>> res@cnFillMode="RasterFill"
>>> res@lbOrientation="vertical"
>>> res@cnMissingValFillPattern = 0
>>> res@cnMissingValFillColor=0
>>> res@lbLabelAutoStride = True
>>> res@sfXArray=lon
>>> res@sfYArray=lat
>>> res@gsnAddCyclic=False
>>>
>>> gsn_define_colormap(xwks,"BlAqGrYeOrReVi200")
>>> res@tiMainString = "MYD02HKM.A2010031.0035.005.2010031183706.hdf"
>>> res@gsnLeftString = "Field name: EV_500_RefSB"
>>> res@gsnRightString ="Units: none"
>>>
>>> ;res@mpLimitMode = "LatLon"
>>> ;res@mpMinLatF = min(data@lat2d) ;
>>> ;res@mpMaxLatF = max(data@lat2d) ;
>>> ;res@mpMinLonF = min(data@lon2d) ;
>>> ;res@mpMaxLonF = max(data@lon2d) ;
>>>
>>> res@gsnPolar = "NH" ; specify the hemisphere
>>> plot=gsn_csm_contour_map_polar(xwks,data,res)
>>>
>>>
>>> delete(plot)
>>> delete(xwks)
>>> delete(data)
>>> delete(res)
>>> delete(eos_file)
>>>
>>> end
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 15 12:04:21 2010

This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 11:05:24 MDT