comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Separating land and ocean data in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Separating land and ocean data in IDL [message #91413] Fri, 10 July 2015 12:33 Go to next message
siumtesfai is currently offline  siumtesfai
Messages: 62
Registered: April 2013
Member
Hello all,

I have climate model output data in IDL sav file format and NCDF file.

Dimension of the data

Sz=size (DATA)

longitude= sz(1) : 0-360 degree
latitude = Sz(2) : -90S to 90N
pressure = Sz(3) : 1000hPa to 10hPa
time = Sz(4) : 1979 to 2005


The data is global. I can extract regions . For example , North america domain by restricting my longitude and latitude. That is easy. I would use "Where" command


E.g lat=where( latitude GE lat1 and latitude LT lat2)
lon =where( longitude GE lon1 and longitude LT lon2)

DATA1=data(lon,lat,*,*)


My question is how can you extract only data at the continental north america over land. I am not interested in analyzing data over the oceans ( i.e North Pacific and Atlantic )

Waiting for your suggestion.

Thank you for you help

Best regards
Re: Separating land and ocean data in IDL [message #91416 is a reply to message #91413] Fri, 10 July 2015 22:47 Go to previous messageGo to next message
siumtesfai is currently offline  siumtesfai
Messages: 62
Registered: April 2013
Member
Hello all,

Any suggestion on my question . Please I need your help . If the question is not clear, please also let me know

Best regards

On Friday, July 10, 2015 at 3:33:25 PM UTC-4, siumt...@gmail.com wrote:
> Hello all,
>
> I have climate model output data in IDL sav file format and NCDF file.
>
> Dimension of the data
>
> Sz=size (DATA)
>
> longitude= sz(1) : 0-360 degree
> latitude = Sz(2) : -90S to 90N
> pressure = Sz(3) : 1000hPa to 10hPa
> time = Sz(4) : 1979 to 2005
>
>
> The data is global. I can extract regions . For example , North america domain by restricting my longitude and latitude. That is easy. I would use "Where" command
>
>
> E.g lat=where( latitude GE lat1 and latitude LT lat2)
> lon =where( longitude GE lon1 and longitude LT lon2)
>
> DATA1=data(lon,lat,*,*)
>
>
> My question is how can you extract only data at the continental north america over land. I am not interested in analyzing data over the oceans ( i.e North Pacific and Atlantic )
>
> Waiting for your suggestion.
>
> Thank you for you help
>
> Best regards
Re: Separating land and ocean data in IDL [message #91417 is a reply to message #91416] Sun, 12 July 2015 00:42 Go to previous messageGo to next message
shilosh is currently offline  shilosh
Messages: 2
Registered: July 2015
Junior Member
Take a look at David Fanning's example here: http://www.idlcoyote.com/map_tips/seamask.html#NEWTECHNIQUES

Shilo
--------
Shilo Shiff
Department of Geography and Environment
Bar-Ilan University
Re: Separating land and ocean data in IDL [message #91421 is a reply to message #91416] Mon, 13 July 2015 09:13 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
On Saturday, July 11, 2015 at 12:47:21 AM UTC-5, siumt...@gmail.com wrote:
> Hello all,
>
> Any suggestion on my question . Please I need your help . If the question is not clear, please also let me know
>
> Best regards
>

Have you tried Google-ing to see if someone has some sort of example that might help you?

(It's out there! David's is a good place to start, but there are others.)
Re: Separating land and ocean data in IDL [message #91460 is a reply to message #91413] Thu, 16 July 2015 14:28 Go to previous message
siumtesfai is currently offline  siumtesfai
Messages: 62
Registered: April 2013
Member
On Friday, July 10, 2015 at 3:33:25 PM UTC-4, siumt...@gmail.com wrote:
> Hello all,
>
> I have climate model output data in IDL sav file format and NCDF file.
>
> Dimension of the data
>
> Sz=size (DATA)
>
> longitude= sz(1) : 0-360 degree
> latitude = Sz(2) : -90S to 90N
> pressure = Sz(3) : 1000hPa to 10hPa
> time = Sz(4) : 1979 to 2005
>
>
> The data is global. I can extract regions . For example , North america domain by restricting my longitude and latitude. That is easy. I would use "Where" command
>
>
> E.g lat=where( latitude GE lat1 and latitude LT lat2)
> lon =where( longitude GE lon1 and longitude LT lon2)
>
> DATA1=data(lon,lat,*,*)
>
>
> My question is how can you extract only data at the continental north america over land. I am not interested in analyzing data over the oceans ( i.e North Pacific and Atlantic )
>
> Waiting for your suggestion.
>
> Thank you for you help
>
> Best regards

Thank you for your direction on my solution


I know now that there are functions to extract landmass only data

I have the following question though. Suppose you have surface data from ncep. Data= (144,73, 795)

restore,'ncep.sav'

sz=size(data)
lon=sz(1)
lat=sz(2)
time=sz(3)

Domain = extract_region( data,region='NAMERICA', lon=lon, lat=lat )
land = LAND_MASK( /NAMERICA,lat=lat,lon=lon,Limit=[-170,30,-50,75],resolution= [2.5,2.5])

end


I checked the dimension of the result

Domain= Array[49, 17, 795]

land = Array[48, 18]

So, I have mismatch in the array size from my domain and land .

Any suggestion on how to fix the problem

I should have both Domain and land to have the same array size in order to extract landmass data from original data as follow

landmass=fltarr(49,17,795)
FOR i=0,48 do begin
FOR j=0,16 do begin
x=reform(land(i,j))

y=where(x GT 0 )
if y(0) GE 0 then begin
landmass(i,j,*)=Domain(i,j,*)
endif else begin
landmass(i,j,*)=1E20
endelse
ENDFOR


Best regards
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Easy question on for loops and if statements
Next Topic: land_mask function

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:36:32 PDT 2025

Total time taken to generate the page: 0.00648 seconds