;docformat='rst' ;+ ; This is the primary task called by the crontab that handles the daily AIM CIPS ; level_3a processing. ; ; :Author: ; Bill Barrett ; ;- ;+ ; :Params: ; preliminary: in, required, type=int ; 0 if preliminary, 1 if definitive ; ; :Keywords: ; NONE ;- ;+ ; :Examples: ; For preliminary: ; run_cips_daily_level_3a_cron, 0 ; For definitive: ; run_cips_daily_level_3a_cron, 1 ;- pro run_cips_daily_level_3a_cron, preliminary ; Initialize the production environment set_cips_production_vars ; Is this preliminary or definitive processing? if preliminary eq 0 then begin output_string = 'preliminary' days_ago = 1 set_production_flag, flag=0 set_debug_level, 7 endif else begin output_string = 'definitive' days_ago = 5 set_debug_level, 5 set_production_flag, flag=1 endelse print, get_routine_name() + ' ' + output_string + ' level 3A processing starting at ' + systime() begin_time = systime(1) ; The following line initializes the Query Database software used ; for all database access query_database, "", nrows, data, /GET_LOGIN ; Get today's date, and convert it to the formats used by AIM processing curr_time=fix(systime(/seconds, /julian, /utc)-0.5, type=3) + 0.5 start_time=jd2gps(curr_time) * 1e6 aim_day=usec2ad(start_time) - days_ago print, get_routine_name() + ' beginning day: AIM date = ' + $ strtrim(string(aim_day - 1), 2) + ', year_day = ' + $ strtrim(string(ad2yd(aim_day - 1)), 2) ; Get the orbits for the given day start_time = ad2usec(aim_day - 1) stop_time = ad2usec(aim_day) orbit_info_array = get_orbit_info(start_time, stop_time) ; Do the level 3A processing ; l3a = obj_new('level_3a_daisy_server', obj_new()) ; result = l3a->get_data( orbit_info_array, /net_cdf ) ; str_free, result ; obj_destroy, l3a l3a_daisy_v52, orbit_info_array, /pca_preliminary heap_gc end