Subset of a structure? [message #87246] |
Mon, 20 January 2014 14:36  |
troydporter13
Messages: 5 Registered: January 2014
|
Junior Member |
|
|
Hi,
I am trying to get a subset from a structure. I have the following;
help, pm25_total, /struc
** Structure <358d280>, 11 tags, length=7160, data length=6566, refs=1:
STATION STRING 'Station1'
OBSERVABLE STRING 'Value1
UNITS STRING ' microg m-3'
RATE INT 600
REPORTS_GOOD STRUCT -> <Anonymous> Array[144]
REPORTS_BAD STRUCT -> <Anonymous> Array[1]
REPORTS_GEN STRUCT -> <Anonymous> Array[1]
GAPS STRUCT -> <Anonymous> Array[1]
JS_GAPS STRUCT -> <Anonymous> Array[1]
P_FILL STRUCT -> <Anonymous> Array[1]
STATS STRUCT -> <Anonymous> Array[1]
help, pm25_total.reports_good, /struc
** Structure <3504e50>, 4 tags, length=48, data length=44, refs=2:
TIME_GOOD STRING '2012/06/01 00:00:00'
TIME_JS_GOOD DOUBLE 3.9182400e+008
VALUE_GOOD FLOAT 13.7600
COMMENT_GOOD STRING ''
help, pm25_total.reports_good.time_js_good, /struc
<Expression> DOUBLE = Array[144, 5]
Time_JS_good is in julian seconds so if there is a zero value in my data I want to eliminate it.
I have tried;
good_val_pm25 = where(PM25_TOTAL.reports_GOOD.time_JS_GOOD gt 1, good_val_pm25_count)
and then tried to use PM25_TOTAL.reports_GOOD.time_JS_GOOD(good_val_pm25) but it does not work. Any ideas why?
Troy
|
|
|
|
|
|
|
|
|
|
|
Re: Subset of a structure? [message #87255 is a reply to message #87252] |
Mon, 20 January 2014 17:50  |
Matthew Argall
Messages: 286 Registered: October 2011
|
Senior Member |
|
|
Sorry for all the mix-ups. To make up for it, tell me if I am doing something differently from you...
IDL> reports_good = {time_good: '2012/06/01 00:00:00', time_js_good: 0D, value_good: 0.0, comment_good: ''}
IDL> help, reports_good
** Structure <28533d8>, 4 tags, length=48, data length=44, refs=1:
TIME_GOOD STRING '2012/06/01 00:00:00'
TIME_JS_GOOD DOUBLE 0.0000000
VALUE_GOOD FLOAT 0.00000
COMMENT_GOOD STRING ''
IDL> reports_good = replicate(reports_good, 144)
IDL> pm25_total = {reports_good: reports_good}
IDL> help, pm25_total
** Structure <2937008>, 1 tags, length=6912, data length=6336, refs=1:
REPORTS_GOOD STRUCT -> <Anonymous> Array[144]
IDL> index = indgen(50)
IDL> help, (pm25_total.reports_good)[index].time_good
<Expression> STRING = Array[50]
IDL> help, pm25_total.reports_good[index].time_good
<Expression> STRING = Array[50]
|
|
|