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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
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 17:34:14 PDT 2025

Total time taken to generate the page: 0.00492 seconds