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

Home » Public Forums » archive » Where vs Histogram vs ??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Where vs Histogram vs ?? [message #32526] Wed, 16 October 2002 16:05 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Hello All,

I have a structure defined as :-

data_st = {YEAR : 0 ,$
DAY : 0 ,$ ; 136 days over 12 years
HALF_HR : 0 ,$ ; 0..47
RANGE_IDX : 0 ,$ ; 0..267
WRF : 0B ,$ ; 3 possible values
FREQ : 0B ,$ ; 4 possible values
BEAM : 0B ,$ ; 4 possible values
PAD : 0B ,$ ; Padding to align byte
boundaries
Parameter : FLTARR(5)}


Replicate that a few times :-

database = Replicate(data_st,15425228)

Data is plugged into this variable by reading from a file, and then
converting
database to a system variable, !database, so that it survives intact
just about
anything bar a .reset_session. Saves a lot of time recreating &
reloading the database.

Roughly speaking, a third of the data is for any given WRF (waveform
repetition frequency),
a quarter is at any given frequency, and a quarter is in each of the 4
possible beams.
Or, for any given day, the data is split over 4 beams, and cycled over
4 frequencies and
3 WRF's.

I need to be able to search this entire database and pull out a
nominated parameter
value based on year,day, half_hr, range_idx, WRF, freq and beam and
parameter.

At the moment I'm doing something like this :-

start_year = 2000
end_year = 2002
start_day = 120
end_day = 133
start_half_hr = 0
end_half_hr = 47
WRF = 1
FREQ = 2
start_beam = 0
end_beam = 3
nominated_parameter = 2

index = Where(!database.year GE start_year AND $
!database.year LE end_year AND $
!database.day GE start_day AND $
!database.day LE end_day AND $
!database.beam GE start_beam AND $
!database.beam LE end_beam AND $
!database.half_hr GE start_half_hr AND $
!database.half_hr LE end_half_hr AND $
!database.WRF EQ WRF AND $
!database.FREQ EQ FREQ AND $
!database.parameter(nominated_parameter) NE
bad_data_value)


This takes about 10-12 minutes on sizeable Alpha box running OpenVMS
(IDL v5.4)
if working through the entire database for all 4 beams.

To then plot each beam, there's a further loop of Where's to
subindex each
particular beam out of index. The beam plots are either by UT or
range.


Is there a quicker way than the above monsterous Where statement?

I've browsed the Histogram tut on David Fanning's site, and rapidly
found
my eyes glazing over. Can Histogram help here? Perhaps multiple
nested
Histograms? David's SetUnion or SetIntersection, maybe?


Any ideas appreciated,

Andrew

------------------------------------------------------------ -----------------
Andrew D. Cool
Electromagnetics & Propagation Group
Intelligence, Surveillance & Reconnaissance Division
Defence Science & Technology Organisation
PO Box 1500, Edinburgh
South Australia 5111
Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ -----------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Finding the mean of a set of images
Next Topic: slice of 2D surface

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

Current Time: Thu Oct 09 22:23:55 PDT 2025

Total time taken to generate the page: 1.68080 seconds