|
From: dileep k. <dil...@gm...> - 2012-05-22 06:49:51
|
Dear Dawson,
I will try your method as you suggested,
Thank you for your time and consideration.
On Mon, May 21, 2012 at 1:43 PM, Andrew Dawson <da...@at...> wrote:
> The reason it works for the region [latitude=(-5, 5), longitude=(210,
> 270)] is that there are no missing values here (the tropical Pacific), but
> there are in your other region selection.
>
> I wrote a new EOF package (called eof2) for CDAT designed to handle data
> with missing values. It should be distributed with CDAT 6, although it may
> be missing from some of the binaries. If you don't already have it you can
> obtain it using git (http://git-scm.com/):
>
> git clone git://uv-cdat.llnl.gov/eof2.git
>
> The documentation is fairly complete, and is currently the primary
> reference. A roughly equivalent usage of eof2 would be:
>
> >>> import cdms2
> >>> from eof2 import Eof
> >>> f = cdms2.open('HadISST_sst.nc')
> >>> data = f('sst', latitude=(-30, 30, 'cob'), longitude=(-60, 120, 'cob'))
> >>> solver = Eof(data, weights="coslat")
> >>> EOF_1 = solver.eofs(neofs=1)
> >>> percentvar = solver.varianceFraction(neigs=1) * 100.
> >>> print "Percent explained:", percentvar
>
> Note that this stores the leading *spatial* pattern in the variable EOF_1
> (in your example it looks like you are storing the leading principal
> component *time series* in EOF_1). If you have difficulties with this
> approach feel free to email offline.
>
> Andrew
>
> On 20 May 2012 20:30, dileep kunjaai <dil...@gm...> wrote:
>
>>
>> Dear all,
>>
>> I am trying to calculate the spatial EOF-1 of 'sst' data over the
>> region [latitude=(-30, 30), longitude=(-60, 120) ].
>>
>> I am using the following code for calculating the EOF 1.
>>
>> >>> import cdms2
>> >>> from eof import Eof
>> >>> f=cdms2.open('HadISST_sst.nc')
>> >>>data=f('sst', latitude=(-30, 30, 'cob'),
>> longitude=(-60, 120, 'cob'))
>> >>>result=Eof(data)
>> >>>pca=result.principal_components
>> >>>EOF_1=pca[0]
>> >>>print "Percent explained", result.percent_explained
>>
>> But it giving the following error.
>>
>> raise ValueError, 'eof cannot operate on masked data'
>> ValueError: eof cannot operate on masked data
>>
>> But it is working on the region [latitude=(-5, 5), longitude=(210,
>> 270)]
>>
>> Please someone help me to calculate the EOF over masked data.
>>
>>
>>
>> Thanking you all in advance
>>
>>
>>
>> DILEEPKUMAR. R
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Cdat-discussion mailing list
>> Cda...@li...
>> https://lists.sourceforge.net/lists/listinfo/cdat-discussion
>>
>>
>
>
> --
> Dr Andrew Dawson
> Atmospheric, Oceanic & Planetary Physics
> Clarendon Laboratory
> Parks Road
> Oxford OX1 3PU, UK
> Tel: +44 (0)1865 282438
> Email: da...@at...
> Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson
>
>
--
DILEEPKUMAR. R
|