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

Home » Public Forums » archive » Re: array subtraction
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: array subtraction [message #63338] Wed, 05 November 2008 08:39 Go to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Nov 5, 4:29 pm, Wox <s...@nomail.com> wrote:
> On Wed, 5 Nov 2008 07:25:10 -0800 (PST), julia.waltersp...@gmail.com
> wrote:
>
>
>
>> hey guys
>> SOS call from the newbie:
>
>> I've got two data arrays, one of length 134 (=a), the other of length
>> 75 (=b) with monthly cloud cover data from modis terra and aqua.
>> Data from Terra starts feb 2000, data from Aqua starts july 2002.
>
>
> So you only need to get i in this:
> diff = a[i:*]-b
>

Hi,

Well if the time intervals are the same in both arrays (1 month), and
the last data point in both arrays is the same timepoint ('now'),
then I would do it this way:

na = n_elements(a)
nb = n_elements(b)

diff = abs(b-a[na-nb:*]) ; Given a>b as in your example

Or, if you really want a more general solution:
diff = abs(b[(nb-na>0):*] - a[(na-nb>0):*])

Regards,
Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: On-the-fly compilation of routines
Next Topic: Plot: idl_guide4 UK_NCAS-Meteo-Library

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

Current Time: Wed Oct 08 19:14:44 PDT 2025

Total time taken to generate the page: 0.00590 seconds