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

Home » Public Forums » archive » Satellite Swath Overlap
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: Satellite Swath Overlap [message #87525 is a reply to message #87523] Wed, 12 February 2014 11:26 Go to previous messageGo to previous message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Well, you could try something like this (and assuming result1, result2 are supposed to be the same size and not different like in your code):

missingval=0 ; or whatever indicates no data

nx=n_elements(result1[*,0]) ; get size of x dimension
ny=n_elements(result1[0,*]) ; get size of y dimension

result_averaged=fltarr(36,400) ; array to contain average results

for i=0l,nx-1 do begin
for j=0l,ny-1 do begin ; Loop over cells
if result1[i,j] eq missingval and result2[i,j] eq missingval then result_averaged[i,j] = missingval
if result1[i,j] eq missingval and result2[i,j] ne missingval then result_averaged[i,j] = result2[i,j]
if result1[i,j] ne missingval and result2[i,j] eq missingval then result_averaged[i,j] = result1[i,j]
if result1[i,j] ne missingval and result2[i,j] ne missingval then result_averaged[i,j] = mean([result1[i,j],result2[i,j]])
endfor
endfor

Then do your plotting using result_averaged.

There are probably more efficient ways to code this but I think the above is an easy-to-understand method, if I have understood your problem correctly. Hope this helps!

Andy



On Wednesday, February 12, 2014 12:14:21 PM UTC-5, Chase Calkins wrote:
> Hello Everyone,
>
>
>
> I have a couple of files that I overlap on a mapset but when I plot it, the image is overwritten by the latter of each file. A simple set up is essentially like this.
>
>
>
> Lat1 = fltarr[36,400]
>
> Lon1 = fltarr[36,400]
>
>
>
> Lat2 = fltarr[36,400]
>
> Lon2 = fltarr[36,400]
>
>
>
> result1 = fltarr[36,400]
>
> result2 = fltarr[46,400]
>
>
>
> cgcontour, result1, Lon1, Lat1, level = findgen(18)/10-.2, /overplot, /cell_fill
>
>
>
> MAP_SET, /Continents, limit = [10,70,45,135], /grid, label = 2, latlab = 110, color =1, charsize = 1.9, /noerase
>
>
>
> cgcontour, result2, Lon2, Lat2, level = findgen(18)/10-.2, /overplot, /cell_fill
>
>
>
> MAP_SET, /Continents, limit = [10,70,45,135], /grid, label = 2, latlab = 110, color =1, charsize = 1.9, /noerase
>
>
>
> A picture of what I am experiencing is here.
>
>
>
> http://www.vos.noaa.gov/MWL/apr_10/Images/pacific/Fig21P.jpg
>
>
>
>
>
> I was wanting to know if there is a way IDL can say where the overlap is and average the result between the two files in the overlap section.
>
>
>
> Thanks,
>
>
>
> Chase
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: READU: Error encountered reading from file.
Next Topic: How to use cgplot insidecgwindow with mouse.button command

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

Current Time: Wed Oct 08 17:11:49 PDT 2025

Total time taken to generate the page: 0.00424 seconds