Re: coordinate use problem

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu, 18 May 2006 09:20:56 -0600

Hi Jerry,

You will have to flip your data manually. The following is untested.

; Starting out with an array named "array"
temp = array
delete(temp&lon)
temp = temp@_FillValue
temp&lon = fspan(-25.,335.,144)
print(temp&lon)
printVarSummary(array(:,:,{335.:}))
printVarSummary(temp(:,:,{:-1.}))
temp(:,:,{:-1.}) = (/ array(:,:,{335.:}) /)
printVarSummary(array(:,:,{:334.}))
printVarSummary(temp(:,:,{0.:}))
temp(:,:,{0.:}) = (/ array(:,:,{:334.})) /)
delete(array)
array = temp
delete(temp)
printVarSummary(array)

I would recommend doing a quick gsn_csm_contour_map_ce plot of a
timestep before the code above, and after the code, to double check that
everything is correct...
Good luck.
Adam

jerry wrote:
> Hi
> If i use function "lonFlip" it will change the coordinate variable to :
> Variable :VAR
> Dimension and sizes: [ lat | 73 ] x [ lon | 144 ]
> Coordinates:
> lat :[ -90...90 ]
> lon:[ -180....178.5 ]
> And the area of (longitude : 180~200 ) was been ignored .
> So it can't work !!
>
> Do you have any idea ?
> Thank you
>
> ----- Original Message ----- From: "Julie Arblaster" <jma_at_cgd.ucar.edu>
> To: "jerry" <jerry_at_cwb.gov.tw>
> Cc: <ncl-talk_at_ucar.edu>
> Sent: Thursday, May 18, 2006 4:04 PM
> Subject: Re: coordinate use problem
>
>
>> Hi Jerry,
>>
>> The contributed function 'lonFlip' can reorder the longitude
>> coordinate of your array so that you can subset your data
>> effectively.
>>
>> See
>> http://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml
>>
>> Cheers,
>> Julie
>>
>> On Thu, 18 May 2006, jerry wrote:
>>
>>> Hi
>>>
>>> I use function "wgt_areaave( VAR( {-10ĄG10},{-20ĄG200} ) , 1 ,1 ,0 )"
>>> to calculate the area average
>>> (The area range which i need was latitude ĄG -10~10 longitude ĄG
>>> -20~200 )ĄA
>>> But the coordinate variable of VAR is ĄG
>>> Variable ĄGVAR
>>> Dimension and sizesĄG [ lat | 73 ] x [ lon | 144 ]
>>> CoordinatesĄG
>>> lat ĄG[ -90...90 ]
>>> lonĄG[ 0....357.5 ]
>>>
>>> When i use "wgt_areaave( VAR( {-10ĄG10},{-20ĄG200} ) , 1 ,1 ,0 )"
>>> ĄAit seems only
>>> use the range (latitude ĄG -10~10 and longitude ĄG 0~200) to
>>> calculate the area average .
>>> The area of (longitude ĄG -20~0) was been ignored .
>>>
>>> How could i do ?
>>>
>>> Thanks
>>>
>>
>>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu May 18 2006 - 09:20:56 MDT

This archive was generated by hypermail 2.2.0 : Thu May 18 2006 - 09:30:43 MDT