;docformat='rst' ;+ ; This is the primary task called by the crontab that updates the ; AIM_CIPS_SCIENCE..Orbits and ..Sofie tables. ; ; :Author: ; Bill Barrett ; ;- ;+ ; :Params: ; NONE ; ; :Keywords: ; NONE ;- ;+ ; :Examples: ; run_cips_daily_orbit_update_cron ;- PRO run_cips_daily_orbit_update_cron ; The following line initializes the Query Database software used ; for all database access query_database, "", nrows, data, /GET_LOGIN ; Set all the necessary processing environment variables set_cips_production_vars start_time=systime(1) ; What is the most recent orbit in the database orbit_info = get_last_orbit_info() ; Update, if necessary, the AIM_CIPS_SCIENCE..Orbits and ..Sofie tables update_orbit_info, last_orbit_info=orbit_info, /verbose ; Let the user know how much time the update took elapsed=systime(1)-start_time print, get_routine_name() + ' finishing at ' + systime() + $ " TIME ELAPSED - " + strtrim(string(elapsed), 2) + " seconds" ; Write the daily orbit file close_query_database, /all get_database_login, 'AIM_CIPS_SCIENCE', user=user, password=password, url=url sql = 'select orbitNum, startTime from AIM_CIPS_SCIENCE.Orbits order by orbitNum' query_database, sql, data, nrows, user=user, password=password, dburl=url, /dbConnect filename = !DATA_PRODUCT_PATH + '/orbit_data/orbit_data.txt' openw, 2, filename for i = 0, n_elements(data) -1 do begin printf, 2, format='(I6, 2x, A20)', data[i].orbitnum, usec2vms(data[i].starttime) endfor close, 2 END