[ncl-talk] The whole matrix replaced by fill values
Ipshita Majhi
ipmajhi at alaska.edu
Fri Nov 14 16:15:58 MST 2014
On Friday, November 14, 2014, Ipshita Majhi <ipmajhi at alaska.edu> wrote:
> Hi
> I want to extract years with 52 weeks and yeara with 53 weeks
> I have a matrix going from 1968 to 2013 and that is year_52
> Then i have few years which I have stored in week_53
>
I want to remove the years with 53 weeks from year_ 52 and then use those
indices to extract snow cover extent
Thank you dor help
>
>
> On Friday, November 14, 2014, Walter Kolczynski <
> walter.kolczynski at noaa.gov
> <javascript:_e(%7B%7D,'cvml','walter.kolczynski at noaa.gov');>> wrote:
>
>> There are a several problems:
>>
>> 1) Every time through the loop, you are overwriting your existing
>> Year_52, so only the last iteration will control the end result.
>> 2) Week_same(i) contains the index where the two weeks are the same, but
>> then the equality in the where statement is checking for equality of that
>> *index* with the *values* of year_52. Unless the values of year_52 are
>> equal to the index, this is probably not what you want.
>> 3) This code will fail if more than one value in week_52 and week_53
>> match.
>>
>> I'm not sure exactly what you are trying to do, but I believe this
>> structure is either wrong or just more complicated than you need. Can you
>> tell us what you are trying to accomplish (i.e., what you expect Week_52
>> and Week_53 to be at the end)?
>>
>> - Walter Kolczynski
>>
>> On 14-Nov-14 17:35, Ipshita Majhi wrote:
>>
>> Hi
>> I am replacing indices that match with indices but the whole array gets
>> replaced by fill values
>>
>> do i = 0,9-1
>> Week_53=year_53(i)
>> Week_same(i)=ind(year_52.eq.week_53)
>> Year_52=where(year_52.eq.week_same(i),year_52,year_52 at fillvalue)
>> end do
>>
>> It will be great if someone can help
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141114/14b7ee42/attachment.html
More information about the ncl-talk
mailing list