Re: Problem with White Space at Prime Meridian (Postscript File)

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri May 13 2011 - 11:25:52 MDT

Rather, then do these four lines,

     precc2_prect_ratio!0 = "lat" ; name the 1st dimension "lat"
     precc2_prect_ratio!1 = "lon" ; name the 2nd dimension "lon"
     precc2_prect_ratio&lat = prect&lat
     precc2_prect_ratio&lon = prect&lon

I think you can replace these with

     copy_VarCoords(precl, precc2_prect_ratio) ; copy spatial coordinate

It will make for cleaner code.

On 05/13/2011 10:27 AM, Adam Phillips wrote:
> Hi Zac,
> Thanks for sending your data and script. When I first tried to run your
> script I got the following errors repeated three times (1 time each for
> each of your three plots):
>
> (0) check_for_y_lat_coord: Warning: Data either does not contain a
> valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units'
> attribute equal to one of the following values:
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees
> north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg
> north'
> (0) check_for_lon_coord: Warning: Data either does not contain a
> valid longitude coordinate array or doesn't contain one at all.
> (0) A valid longitude coordinate array should have a 'units'
> attribute equal to one of the following values:
> (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
>
> Assuming you were getting these error messages on your end, these
> messages are a strong clue as to what is going wrong. NCL is telling you
> that the array that you are passing into a plotting function do not
> contain coordinate variables, or do not contain units attributes for the
> lat or lon coordinate variables.
>
> Looking at your code, you get half way to creating coordinate variables:
>
> precc2_prect_ratio = (prec_shal / prect) * 100.
> precc2_prect_ratio@long_name = "Shallow Convective:Total"
> precc2_prect_ratio@units = "%"
> precc2_prect_ratio!0 = "lat" ; name the 1st dimension "lat"
> precc2_prect_ratio!1 = "lon" ; name the 2nd dimension "lon"
>
> but you do not assign any kind of array to precc2_prect_ratio&lat or
> precc2_prect_ratio&lon.. By adding the following you attach coordinate
> variables to the 2 dimensions of precc2_prect_ratio:
> precc2_prect_ratio&lat = prect&lat
> precc2_prect_ratio&lon = prect&lon
>
> Alternatively, you can just use copy_VarCoords, which copies all
> metadata (including dimension names and coordinate variables) from one
> array to another:
> precc2_prect_ratio = (prec_shal / prect) * 100.
> precc2_prect_ratio@long_name = "Shallow Convective:Total"
> precc2_prect_ratio@units = "%"
> copy_VarCoords(prect,precc_prect_ratio)
>
> Repeating that coding for your other two arrays:
> precc_prect_ratio = (prec_conv / prect) * 100.
> precc_prect_ratio@long_name = "Deep Convective:Total"
> precc_prect_ratio@units = "%"
> copy_VarCoords(prect,precc_prect_ratio)
>
> precl_prect_ratio = (prec_strat / prect) * 100.
> precl_prect_ratio@long_name = "Stratiform:Total"
> precl_prect_ratio@units = "%"
> copy_VarCoords(prect,precl_prect_ratio)
>
> After making the above coding changes your plot looks good to me.. The
> white line disappears at the date line / 180th meridian, and the error
> messages are gone. Try to make the above changes and let the group know
> if that doesn't solve your issue.
> Adam
>
>
> On 05/13/2011 09:03 AM, Mary Haley wrote:
>> Zac,
>>
>> It would help if you could provide a sample image. Also, what does a "printVarSummary" of the variable you're plotting report?
>>
>> When you print the PS file, do you see the white line? If it's thin enough, it may just be something you see on a high-resolution monitor, but not when you print it out.
>>
>> Finally, how are you converting it to JPG?
>>
>> --Mary
>>
>> On May 12, 2011, at 4:10 PM, Zachary Mangin wrote:
>>
>>> Hello NCL Talk.
>>>
>>> I have a recurring problem when I output PS files. The Prime Meridian has a single vertical blank space. I thought gsnAddCyclic would solve my problem but the space is still there, whether I set the resource to True or False. I have 3 plots in a vertical panel zoomed in for data that span the Tropics. I tried converting to GIF format and this gets rid of the white space at the Meridian, but once I convert to TIFF format, the image's quality is greatly depreciated. Converting to JPG just kept the white space at the Meridian too. Any suggestions? Thanks in advance.
>>>
>>> -Zac _______________________________________________
>>> 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
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 13 11:26:02 2011

This archive was generated by hypermail 2.1.8 : Tue May 17 2011 - 15:11:28 MDT