Re: where

From: gibies george <gibiesgeorge_at_nyahnyahspammersnyahnyah>
Date: Sat Apr 30 2011 - 01:46:54 MDT

On 30 April 2011 11:06, gibies george <gibiesgeorge@gmail.com> wrote:

>
>
> On 29 April 2011 20:33, Rick Brownrigg <brownrig@ucar.edu> wrote:
>
>> Hi,
>>
>> You probably want to do a printVarSummary on all three of those parameters
>> to make sure they are what you think they are. In particular, aren't the 1st
>> and 3rd parameters of different dimensions?
>>
>
Thank you Rick.

What you have pointed out, is the exact problem.

Variable: mask1
Type: float
Total Size: 4620 bytes
            1155 values
Number of Dimensions: 2
Dimensions and sizes: [lat | 33] x [lon | 35]
Coordinates:
            lat: [ 6.5..38.5]
            lon: [66.5..100.5]

Variable: data1
Type: float
Total Size: 4147200 bytes
            1036800 values
Number of Dimensions: 2
Dimensions and sizes: [lat | 720] x [lon | 1440]
Coordinates:
            lat: [-90..90]
            lon: [ 0..360]

 (The second param is a scalar?). They are required to be the same.
>>
>
>
> But in one of the example given in
> http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml
>
> y = *where*(*ismissing* <http://www.ncl.ucar.edu/Document/Functions/Built-in/ismissing.shtml>(y),0,y)
>
> Here also the second parameter is a scalar.
> _______________________________
>
> I need a similar usage
>
>
> datamasked(lat|:,lon|:,season|i,component|j,ens|k,mdl|l) = \
> where(mask .eq. mask@_FillValue, data@_FillValue, \
> data(lat|:,lon|:,season|i,component|j,ens|k,mdl|l))
>
> *I want to put _FillValue in data, whereever there is _FillValue in mask.
> *
>
> Same thing I will be repeating using the do loop for each season, each
> component, each ensemble member and each model.
>
>
>> Its a misleading message if that's the case.
>>
>>

*parameter 0*
lat
*parameter 1*
lon

*Sorry for misleading *

I'm not sure that helps...please reply back to the group if not.
>> Rick
>>
>
Thank you Very much to give the correct direction.

Now I can solve it.

>> On Apr 29, 2011, at 7:15 AM, gibies george wrote:
>>
>> Dear NCL Users,
>>
>> Here is some part of my script in which, I used * "where() function"* for
>> masking a global data to some region using another data variable which is
>> already masked (regional).
>>
>> But I got some error as given below.
>> _______________________
>> ------------------
>> -------------
>> --------------
>> regrid = True
>> regrid@lat = data&lat
>> regrid@lon = data&lon
>> prepdata = read_data(source,predef,regrid)
>> mask =prepdata(time|0,lat|:,lon|:)
>> mask@_FillValue = data@_FillValue
>> do l = 0, dimsize(5)-1
>> do k = 0, dimsize(4)-1
>> do j = 0, dimsize(3)-1
>> do i = 0, dimsize(2)-1
>> datamasked(lat|:,lon|:,season|i,component|j,ens|k,mdl|l) = \
>> where(mask .eq. mask@_FillValue,data@
>> _FillValue,data(lat|:,lon|:,season|i,component|j,ens|k,mdl|l))
>> end do
>> end do
>> end do
>> end do
>> ave =
>> dim_avg_n_Wrap(datamasked(lat|:,lon|:,season|:,component|:),(/0,1/))
>> ------------------
>> ---------------------
>> --------------------
>> ________________________
>>
>> *fatal:wherefunc: dimension sizes of parameter 0 and parameter 1 do not
>> match
>> fatal:Execute: Error occurred at or near line 1893 in file
>> /home/gibies/ncl/mylib/lib_gibies.ncl
>>
>> **I could not find the mistake.
>>
>> **parameter 0*
>> mask .eq. mask@_FillValue
>> *parameter 1*
>> data@_FillValue
>>
>> Can anybody suggest a solution for this problem ?
>>
>>
>> --
>> *Gibies George, CSIR-RF,*
>> *Monsoon Seasonal Prediction Group,
>> Climate and Global Modelling Division,
>> Indian Institute of Tropical Meteorology,
>> Dr. Homi Bhabha Road,
>> NCL (P. O.), Pashan,
>> Pune 411008, India.*
>>
>> *http://sites.google.com/site/gibiesge/*
>>
>> Please Think about the environment. Save paper; Save Trees; and don't
>> print this e-mail unless it is necessary.
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>
>
> -- **
> *Gibies George, CSIR-RF,
> ****
> Climate and Global Modelling Division,
> Indian Institute of Tropical Meteorology,
> Dr. Homi Bhabha Road,
> NCL (P. O.), Pashan,
> Pune 411008, India.
> Office mail : gibies@tropmet.res.in
> Mobile: 9881707796 (at Pune)*
>
> *http://sites.google.com/site/gibiesge/*
>
> Please Think about the environment. Save paper; Save Trees; and don't print
> this e-mail unless it is necessary.
>
>
>

-- 
*Slomo Amogh ........*
[image: Picture]
*
Gibies George,
Vettikuzhiyil House,
Ezhakkaranadu south P. O.,
Puthencruz - 682308,
Kochi, Kerala, India.
Mobile: 9947575469 (at Kochi)
*
*Present Address*
*
Gibies George,   CSIR-RF,
****Climate and Global Modelling Division,
Indian Institute of Tropical Meteorology,
Dr. Homi Bhabha Road,
NCL (P. O.), Pashan,
Pune 411008, India.
Office mail : gibies@tropmet.res.in
Mobile: 9881707796 (at Pune)*
*http://sites.google.com/site/gibiesge/*
Please Think about the environment. Save paper; Save Trees; and don't print
this e-mail unless it is necessary.

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Apr 30 01:47:15 2011

This archive was generated by hypermail 2.1.8 : Tue May 03 2011 - 14:47:34 MDT