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

Home » Public Forums » archive » Re: comparing and concatenating arrays...please help!!
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: comparing and concatenating arrays...please help!! [message #37570] Fri, 09 January 2004 09:55 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Martin Doyle wrote:

Dear Martin,

we have some routines which could be used to synchronize your data.

With string2js you could convert your data columns of time into julian
seconds.

for example:
time1=string2js('1954 12 31 23',format=' Y M D H')

If you have done this you have a numerical time

print,js2string(-1.4200740d+09)
gives 1954-12-31 23:00:00 000

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/string2js_dbase.pro.html
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/js2string_dbase.pro.html


You may be interested in our time_series_sync routine too

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/time_series_sync_dbase.pro.html

Result = TIME_SERIES_SYNC(Master_time, Client_time, Client_value)


If you are able to store your data in an icg-data-structure you could do
this for all parameters at once by icg_ts_sync


if you are interested this may be interesing
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/gen_icgs_dbase.pro.html

s=gen_icgs(/small,short=['time','P1','P2'])
help,s,/str
*s.time.param=string2js(time,format=' Y M D H')
*s.time.units='seconds since 2000-01-01 00:00:00'
*s.time.long_name='time'
*s.p1.param=
*s.p1.units=
*s.p1.long_name=
*s.p2.param=
*s.p2.units=
*s.p2.long_name=
s=chk_struct(s)
master=ptr_struct2struct(s,/free)


result=icg_ts_sync(master,client)
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/icg_ts_sync_dbase.pro.html

This structure could be stored to several data formats already.
e.g. netCDF, HDF, nasa FFI 1001, END



For further routines and licensing please have a look at
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html


best regards

Reimar


> Hello all,
>
> I really hope someone out there can help me with this....I am tearing
> my hair out as my code is so slow!
>
> I have 2 files of data (hourly met data) with one file containing one
> set of parameters, and the other file containing another set of
> parameters. What I am trying to do, is to match the data based on the
> YY, MM, DD and HH values and then write BOTH sets of parameters to a
> seperate file. For example;
>
> file1:
> 1954 12 31 23 90 11 4 366 0.00
>
> file2:
> 1954 12 31 23 2.80 2.10 2.20 95.21
>
> intended result:
> 1954 12 31 23 90 11 4 366 0.00 2.80 2.10 2.20
> 95.21
>
> NOTE: Both files have no order to them, so a simple concatenation
> won't work
>
> I have written some code, but it is wrist slashing-ly slow!;
>
> I read in each variable as a seperate array...
>
> b=0L
> REPEAT BEGIN
> c=0L
> REPEAT BEGIN
> If (year(b) EQ year2(c)) AND (month(b) EQ month2(c)) AND (day(b) EQ
> day2(c)) AND (hour(b) EQ hour2(c)) THEN BEGIN
>
> printf, 3, year(b), month(b), day(b), hour(b), winddir(b), windsp(b),$
> present(b),visib(b), mslpres(b), airt(c), dewt(c), wett(c), relh(c),$
> format = finalformat
> endif
>
> c=c+1
>
> ENDREP UNTIL c EQ lines2-1
>
> b=b+1
>
> ENDREP UNTIL b EQ lines1-1
>
> I'm sure there must be a better way than this.
>
> Please help me!
>
> Many thanks in advance, Martin..


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Passing from from IDL to external lib (DLM)
Next Topic: Re: Problem masking multiple regions.

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

Current Time: Sat Oct 11 04:50:17 PDT 2025

Total time taken to generate the page: 0.72073 seconds