
;pro sot_mech_data_ops

;@/archive/fppsw/idl/sag/sag_get_mnem.pro
;@/archive/ssw/hinode/sot/idl/monitoring/strtab2html_data_ops.pro
;@/archive/ssw/hinode/sot/idl/monitoring/ct_throughput_data_ops.pro*
;@/archive/ssw/hinode/sot/idl/monitoring/plot_the_madness_sp_data_ops.pro*
;@/archive/ssw/hinode/sot/idl/monitoring/sp_madness_data_ops.pro*
;@/archive/ssw/hinode/sot/idl/monitoring/update_pmu_cat_data_ops.pro
;@/archive/ssw/hinode/sot/idl/monitoring/mk_mech_data_ops.pro*
;@/archive/ssw/hinode/sot/idl/monitoring/go_mk_mech_data_ops.pro*

; @/Users/slater/soft/idl/idl_startup/setup_monsoft.pro
; @/Volumes/janus/io/slater/backups/DS_soft/idl/idl_startup/mech_tmp/strtab2html.pro

; Backup copy of current table:

; Backup copy of sot mechanisms directory
dir_mech = '/sanhome/slater/public_html/sot/instrument/mechanisms_data_ops'
dir_backup = '/sanhome/slater/public_html/sot/instrument/mechanisms_data_ops_backup_' + $
             time2file(!stime)
cmd = 'cp -Rpf ' + dir_mech + ' ' + dir_backup
;cmd = 'cp -Rpf /sanhome/slater/public_html/sot/instrument/mechanisms_data_ops ' + $
;      '/sanhome/slater/public_html/sot/instrument/mechanisms_data_ops_backup_' + $
;      time2file(!stime)
spawn,  cmd

; Run script which sets up monsoft environment:
; spawn, 'source /mars/ssw/hinode/sot/idl/monitoring/setup_monsoft_data_ops':
spawn, 'source /ssw/hinode/sot/idl/monitoring/setup_monsoft_data_ops'

setup_monsoft

entim_stats = anytim(!stime, /ccsds)

go_mk_mech_data_ops, /do_mk_mech, /do_restore, /do_plots, /do_html, $
                     entim_stats=entim_stats, /use_existing, /no_pmu

update_pmu_cat_data_ops, /use_existing

go_mk_mech_data_ops, /do_restore, /do_plots, /do_html, entim_stats=entim_stats

sp_madness_data_ops
;dirnam_gif = '/archive1/hinode/sot/sp_throughput'
dirnam_gif = '/sanhome/slater/public_html/sot/instrument/mechanisms_data_ops/sp_throughput'
plot_the_madness_sp_data_ops, /new_win, /do_write
; WHAT'S THIS?: $ls -altF /sanhome/slater/public_html/missions/hinode/sot/instrument_databases_backups | head
if ~keyword_set(no_zbuff) then set_plot, 'z'
cleanplot
ct_throughput_data_ops, /do_save
set_plot, 'x'

end

