Re: extracting using coordinate subscript

From: Karin Meier-Fleischer <meier-fleischer_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 23 2014 - 04:02:05 MDT

Hi Ousmane,

no, you have to use the lat(i) and lon(i) wothout the dollar signs.

If you set the values

   lat=(/10.,12/)
   lon=(/-20.,-22/)

   pl(:,i,j)=rr( :, {lat(i)}, {lon(j)} )

Bye,
Karin

Am 23.04.14 10:13, schrieb ousmane ndiaye:
> thanks Karin,
> let me reframe my question :
> I want to retrieve let say two points with coordinates (-20,10) and
> (-22,12) I define two variables lat=(/10.,12/) and
> lon=(/-20.,-22/) and I want to use these variables as coordinate
> subscript in a loop to do the extraction :
> can I use this :
> ncl 42> pl(i,j)=rr(:,{$lat(i)$},{$lon(j)$})
> the points don't have to be contiguous.
> Ousmane
> sorry for the confusion
>
>
> On Sun, Apr 20, 2014 at 2:42 PM, Karin Meier-Fleischer
> <meier-fleischer@dkrz.de <mailto:meier-fleischer@dkrz.de>> wrote:
>
> Hi Ousmane,
>
> first there must be a double point ':' at pr=f->rr(:,{-20 : -22}).
> If you want to use variables
> do the following:
>
> xmin = -22.
> xmax = -20.
> pr = f->rr(:,{xmin:xmax})
>
> Bye,
> Karin
>
> Am 20.04.14 14:38, schrieb ousmane ndiaye:
>> Hi,
>> Is it possible using a variable in the dimension :
>> instead of doing
>> pr=f->rr(:,{-20,-22})
>> use something like :
>> xlat=(/-20.,-22/)
>> pr=f->rr(:,{$xlat$}) ; just guessing here or something similar
>> ousmane
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> Dipl. Geophys. Karin Meier-Fleischer
> Application Support, Visualization
>
> Deutsches Klimarechenzentrum GmbH E-Mail:meier-fleischer@dkrz.de <mailto:meier-fleischer@dkrz.de>
> Bundesstrasse 45a Internet:http://www.dkrz.de/
> 20146 Hamburg Phone:+49 (0)40 460094 126 <tel:%2B49%20%280%2940%20460094%20126>
> Germany Fax:+49 (0)40 460094 270 <tel:%2B49%20%280%2940%20460094%20270>
>
> Geschäftsführer: Prof. Dr. Thomas Ludwig
> Sitz der Gesellschaft: Hamburg
> Amtsgericht Hamburg HRB 39784
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Dipl. Geophys. Karin Meier-Fleischer
Application Support, Visualization
Deutsches Klimarechenzentrum GmbH      E-Mail:   meier-fleischer@dkrz.de
Bundesstrasse 45a                      Internet: http://www.dkrz.de/
20146 Hamburg                          Phone:    +49 (0)40 460094 126
Germany                                Fax:      +49 (0)40 460094 270
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 23 04:02:55 2014

This archive was generated by hypermail 2.1.8 : Tue Apr 29 2014 - 09:04:20 MDT