;+ ;NAME: ; mvn_swe_l2gen ;PURPOSE: ; Loads L0 data, creates L2 files for 1 day ;CALLING SEQUENCE: ; mvn_swe_l2gen, date = date ;INPUT: ; date keyword ;KEYWORDS: ; date = If set, the input date. The default is today ; directory = If set, output into this directory, for testing ; purposes, don't forget a slash '/' at the end. ;HISTORY: ; Hacked from Matt F's crib_l0_to_l2.txt, 2014-11-14, jmm, ; jimm@ssl.berkeley.edu ; $LastChangedBy: jimm $ ; $LastChangedDate: 2014-11-18 14:34:02 -0800 (Tue, 18 Nov 2014) $ ; $LastChangedRevision: 16227 $ ; $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/l2gen/mvn_swe_l2gen.pro $ ;- Pro mvn_swe_l2gen, date = date, directory = directory, _extra = _extra ; crib for loading l0 data, creating L2 CDF files, and populating structures ; only works for one day at a time -- that's how we make L2 CDFs @ mvn_swe_com ; pick a day If(keyword_set(date)) Then time = time_string(date[0], /date_only) $ Else time = time_string(systime(/sec), /date_only) ;time = '2014-03-26' ;time = '2014-10-22' t_start = time_double(time) t_end = time_double(time) + 86400.D ; a full day trange = [t_start, t_end] trange_str = time_string(trange) ;You need a timespan, so that the clock drift doesn't prompt for one timespan, t_start, 1 ; get SPICE kernels mvn_swe_spice_init, trange = trange ; load L0 data mvn_swe_load_l0, trange_str ; data variables that will populate CDF files ddd_svy = mvn_swe_get3d(trange_str, /all) ; trange_str changed by program trange_str = time_string(trange) ddd_arc = mvn_swe_get3d(trange_str, /all, /archive) trange_str = time_string(trange) pad_svy = mvn_swe_getpad(trange_str, /all) trange_str = time_string(trange) pad_arc = mvn_swe_getpad(trange_str, /all, /archive) trange_str = time_string(trange) spec_svy = mvn_swe_getspec(trange_str) trange_str = time_string(trange) spec_arc = mvn_swe_getspec(trange_str, /archive) ; create CDFs -- 6 of them ; someday include version number (comes direct from Dave Mitchell) ; if so, inlcude version keyword below ; i.e,. mvn_swe_makecdf_xxx, data, version = version mvn_swe_makecdf_3d, ddd_svy, directory=directory mvn_swe_makecdf_3d, ddd_arc, directory=directory mvn_swe_makecdf_pad, pad_svy, directory=directory mvn_swe_makecdf_pad, pad_arc, directory=directory mvn_swe_makecdf_spec, spec_svy, directory=directory mvn_swe_makecdf_spec, spec_arc, directory=directory ; stop here if you're only making L2 files Return End