;+ ;NAME: ; thm_ui_only_trange ;PURPOSE: ; This program oprerates on the tplot data_quants to strip out data ; the is not in the input time range: start time, end time, and the ; subscripts of the appropriate data_quants structures are used, this ; is designed to be used in thm_ui_load_data_fn only... jmm, ; 13-nov-2006 ;INPUT: ; st_time, en_time = time in seconds from 1-jan-1970 0:00 ; data_ss = the subscripts of the data array to on which to operate ;OUTPUT: ; None explicit, the tplot variables are changed ;HISTORY: ; jmm, 13-nov-2006, jimm@ssl.berkeley.edu ; jmm, 13-dec-2006, made to work for non thg_mag data ; ;$LastChangedBy: kenb-mac $ ;$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ ;$LastChangedRevision: 241 $ ;$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_only_trange.pro $ ; ;- Pro thm_ui_only_trange, st_time, en_time, data_ss ;- ndss = n_elements(data_ss) For j = 0, ndss-1 Do Begin j1 = data_ss[j] If(j1 Gt 0) Then Begin tplotvars = tnames() get_data, tplotvars[j1-1], data = dd If(is_struct(dd)) Then Begin If(tag_exist(dd, 'v')) Then Begin yes_v = 1b dv = dd.v Endif Else yes_v = 0b ok_arr = where(dd.x Ge st_time And dd.x Lt en_time, nok_arr) If(nok_arr Gt 0) Then Begin xj = dd.x[ok_arr] yj = dd.y[ok_arr, *] If(yes_v) Then Begin dd = {x:temporary(xj), y:temporary(yj), v:temporary(dv)} Endif Else dd = {x:temporary(xj), y:temporary(yj)} store_data, tplotvars[j1-1], data = temporary(dd) Endif Endif Endif Endfor Return End