[Thread Prev][Thread Next][Index]

Re: [ferret_users] RE: point selection & dimension removel



Hi,
Your solution seems fine. Another alternative is to use the compressi function after the xsequence, where still the latitude_map has missing values for ocean locations:

let las=xsequence(latitude_map)
let lasi=compressi(las)
let lats=lasi[i=1:npts]

Your result has the values sorted, this one does not, but they will be the same collection of values.

On 12/3/2013 4:46 AM, Kaduk, Jorg D. (Dr.) wrote:

Dear All,

 

I cam up with a solution. Turns out, it is not so difficult:

let las=xsequence(latitude_map) – latitude map needs to have a missing value for ocean

then sort it:

let lasi=sorti(las)  and you get the sorted indecies.

Pick out the land points (npts points):

let lats=sampli(las,lasi[1:npts])

 

Anything more direct would be brilliant, but that should work.

Thank you all,

Cheers,

Joerg

 

 

From: owner-ferret_users@xxxxxxxx [mailto:owner-ferret_users@xxxxxxxx] On Behalf Of Kaduk, Jorg D. (Dr.)
Sent: 03 December 2013 12:15
To: ferret_users@xxxxxxxx
Subject: [ferret_users] point selection & dimension removel

 

Hello,

 

I have the following problem:

I have a grid with land and ocean points. I want to pick out the land points and unravel them on a 1 dimensional vector. I have a land sea mask, and I can generate lats and lons as 2 dimensional fields, e.g. see the map of the latitudes below.

 

I know how many points overall on the grid and how many land points.

 

I can do an xsequence on the latitude field, but the results still contains the missing values from the ocean areas. Ideally, I would like just to forget about them.

I guess I could also do an reshape, but that would have the same problem, no?

 

Any suggestions most appreciated!

 

Thank you very much,

Cheers,

Joerg

 

 

 

 

 

 

Jörg Kaduk

Senior lecturer

http://www.geog.le.ac.uk/staff/jk61/

t: +44 (0)116 252 3848

Department of Geography, University of Leicester, University Road, Leicester LE1 7RH, UK

 

Elite Without Being Elitist

 

Times Higher Awards Winner 2007, 2008, 2009, 2010, 2011, 2012, 2013

 



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement