;+ ;Procedure: process_orbit_dates ; ;Purpose: ; Process all orbit files fo a given set of days ; date_in: a base date, for which all dates before will be processed ; days: The number of days prior to the current date to process. If ; days is 1 (the default if undefined) then 1 day is processed. ; before_time=before_time: If set, then process the input number of ; days prior to the start date (not ; including the start date), will override ; /after_time if both are set ; after_time=after_time: If set, (or if no other time keywords are ; set) then process the input number of ; days after the start date ; days_in=days_in: If set, then process these input dates. Overrides ; the before, after time keywords and ignores the ; date_in, and days input ; lunar=lunar: If this keyword is set, this routine will generate lunar(zoomed out) orbit plots in GSE not standard(zoomed-in) orbit plots ; sse_lunar=sse_lunar: If this keyword is set, this routine will generate lunar orbit plots in SSE(zoomed in, but centered on the Moon) THB & THC only ; t96_north=t96_north: If this keyword is set northward t96 magnetopause mapping will be run for the specified dates ; t96_south=t96_south: If this keyword is set southward t96 magnetopause mapping will be run for the specified dates ; $LastChangedBy: jimm $ ; $LastChangedDate: 2013-06-28 10:13:38 -0700 (Fri, 28 Jun 2013) $ ; $LastChangedRevision: 12601 $ ; $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/thmsoc/asi/lunar_orbits/process_orbit_dates.pro $ ;- pro process_orbit_dates, time_in, days, before_time=before_time, after_time=after_time, days_in=days_in, $ lunar=lunar,sse_lunar=sse_lunar,t96_north=t96_north,t96_south=t96_south if(~keyword_set(time_in)) then time_in = time_string(systime(/sec), /date_only) if(~keyword_set(days)) then days = 1 one_day = 24.0*3600.0d0 if(keyword_set(days_in)) then begin tm_str = time_string(time_double(days_in), /date_only) endif else begin if(keyword_set(before_time)) then begin tim_arr = time_double(time_in)-one_day*(1+dindgen(days)) tm_str = time_string(tim_arr, /date_only) endif else begin ;after_time is the default if(days eq 1) then tm_str = time_string(time_in, /date_only) else begin tim_arr = time_double(time_in)+one_day*dindgen(days) tm_str = time_string(tim_arr, /date_only) endelse endelse endelse ;unique dates only to avoid unnessary reprocessing tm_str = tm_str[uniq(tm_str,bsort(tm_str))] for i = 0,n_elements(tm_str)-1 do begin if keyword_set(lunar) then begin moon_orbits_wrapper,tm_str[i] endif else if keyword_set(sse_lunar) then begin moon_orbits_wrapper_sse,tm_str[i] endif else if keyword_set(t96_north) then begin map_themis_state_t96_wrapper,tm_str[i] endif else if keyword_set(t96_south) then begin map_themis_state_t96_wrapper,tm_str[i],/south endif else begin orbits_wrapper,tm_str[i] endelse endfor end