PRO xgef_analysis, SUMMARY=summary, SMD_ANALYSIS=smd_analysis, $ SSD_ANALYSIS=ssd_analysis, $ PSPC_CAL = pspc_cal, PSPC_ANAL=pspc_anal, $ PSPC_FITS=pspc_fits, AMP_FACTOR = amp_factor, ALL_SSD=all_ssd, $ TILT_ANALYSIS=tilt_analysis, LOGIT = logit ; Basic X-GEF analysis routine. ; 9/03/95 dd ; 9/15/95 dd Add jfit analysis ; 10/17/95 dd Modify to work for all tests... ; 3/7/96 dd Call jfit_analysis with grating parameters ; derrived from GratingStatus and LotIndicator data ; Create ssd_effic files in the subdirectories with ; relevant zero-order measurements. ; 4/2/96 Add AMP_FACTOR option for fitting: includes a "vignetting" term. ; 4/5/96 dd Add TILT_ANALYSIS to generate tilt plots and data files ; in all tilt directories ; 6/4/96 dd Add all_ssd keyword to override a now nominal limit of ; the ssd energies ; that are used in the fitting: too many zero-order ; points reduces quality of fit to 1st order... ; 7/20/96 dd Add LOGIT keyword to put the successfully analyzed ; new data into the system. @labx_common @xrtf_common @pcal_common @fits_common @gs_common ; Before running this procedure need to: ; - move (mv) all the FITS files from the test ; into one directory, e.g., 950615 ; - set " pspc_directory = '950615' " on IDL command line. ; - set " pspc_above_dir = ' ... ' as required on IDL coommand line ; After analysis is complete and looks OK ; - add the name of the new directory to test_dirs.pro ; so that all valid analysis directories are available ; (also move to bodicea and strip the data from the PSPC files ; to "compress" the data.") full_dir = pspc_above_dir+'/'+pspc_directory !p.multi = 0 ; Fill fits_common with the filename identifications ; and create human readable listing in list_fits.txt if (KEYWORD_SET(SUMMARY)) then begin list_fits, /SLIT_INFO end else begin list_fits, /NO_WRITE end ; SUMMARY INFORMATION etc. ;-------------------------- ; Skip summary? if (KEYWORD_SET(SUMMARY)) then begin ; Create and print a test summary sheet test_summary SPAWN, 'enscript '+full_dir+'/test_summary.txt' ; Create and print the test plots pre_print_landscape test_summary_plots post_print SPAWN, 'cp idl.ps '+full_dir+'/test_plots.ps' ; Output the test items list if( 1 EQ 1 ) then begin ; can skip this... ; Print the list_fits data for the PSPC SPAWN, 'cat '+full_dir+'/list_fits.txt | grep PSPC | '+ $ 'grep : | enscript -r -fCourier7'+$ ' -bPSPC_items_from_'+pspc_directory ; Print the list_fits data for the SSD SPAWN, 'cat '+full_dir+'/list_fits.txt | grep SSD | '+ $ 'grep : | enscript -r -fCourier7'+$ ' -bSSD_items_from_'+pspc_directory end end ; skip summary? ; SMD Analysis ;------------- ; Skip SMD analysis?----- if(KEYWORD_SET(SMD_ANALYSIS)) then begin ; SMD plots for one direct beam exposure for each anode ; Use SMD files for given test code test_code = ufn_testcode(3*n_elements(ufn_testcode)/4) test_code = STRUPCASE(test_code) pre_print_portrait !p.multi=[0,1,2] smd_anodes = ['Mo','Cu','Ti','MgO','Mg','Fe','Al','C'] for ia = 0, n_elements(smd_anodes)-1 do begin smd_direct = [ufn_search(['SMD[',']'+test_code, $ '.Direct','.'+smd_anodes(ia)+'.'])] if smd_direct(0) GE 0 then begin nsmd = n_elements(smd_direct) lx_lines_off = 0 ; be sure to include lines in the compare sxd_compare, ufn_useful_file(smd_direct(nsmd-1)) sxd_line_fit, ufn_useful_file(smd_direct(nsmd-1)) end end ; use next three lines instead of post_print to skip hardcopy device, /close set_plot, 'X' !p.multi = 0 ; copy the .ps file to the directory SPAWN, 'cp idl.ps '+full_dir+'/smd_fits.ps' ; SMD counts in lines smd_analyze ; output SMD count rate plot pre_print_portrait !p.multi=[0,1,2] smd_lnf = lnf_from_file('smd_results.txt') plot, smd_lnf.Cps, TITLE=pspc_directory+' SMD Line Count Rate', PSYM=4, $ XTITLE='SMD line (two lines for MgO files)', $ YRANGE=[0.,(MAX(smd_lnf.Cps) < 1.E5)] plot_oo, smd_lnf.Emeas, smd_lnf.Cps, TITLE=pspc_directory+ $ ' SMD Line Count Rate', PSYM=4, $ XTITLE='SMD-measured line Energy (keV)', $ YRANGE=[1.,(MAX(smd_lnf.Cps) < 1.E5 )], XRANGE=[0.1,10.] post_print !p.multi = 0 ; copy the .ps file to the directory SPAWN, 'cp idl.ps '+full_dir+'/smd_rate.ps' end ; smd skip ; SSD Analysis ;------------- ; Skip SSD analysis?----- if(KEYWORD_SET(SSD_ANALYSIS)) then begin ; SSD plots for one direct beam exposure for each anode pre_print_portrait !p.multi=[0,1,2] ssd_anodes = ['Mo','Cu','Ti','MgO','Mg','Fe','Al','C'] for ia = 0, n_elements(ssd_anodes)-1 do begin ssd_direct = [ufn_search(['SSD[','.Direct','.'+ssd_anodes(ia)+'.'])] if ssd_direct(0) GE 0 then begin nssd = n_elements(ssd_direct) lx_lines_off = 0 ; be sure to include lines in the compare sxd_compare, ufn_useful_file(ssd_direct(nssd-1)) sxd_line_fit, ufn_useful_file(ssd_direct(nssd-1)) end end ; use next three lines instead of post_print to skip hardcopy device, /close set_plot, 'X' !p.multi = 0 ; copy the .ps file to the directory SPAWN, 'cp idl.ps '+full_dir+'/ssd_fits.ps' ; SSD counts in lines ssd_analyze ; output SSD count rate plot pre_print_portrait !p.multi=[0,1,2] ssd_lnf = lnf_from_file('ssd_results.txt') plot_io, ssd_lnf.Cps, TITLE=pspc_directory+' SSD Line Count Rate', PSYM=4, $ XTITLE='SSD lines (multiple lines from most files)' plot_oo, ssd_lnf.Emeas, ssd_lnf.Cps, TITLE=pspc_directory+ $ ' SSD Line Count Rate', PSYM=4, $ XTITLE='SSD-measured line Energy (keV)', $ XRANGE=[0.1,10.] post_print !p.multi = 0 ; copy the .ps file to the directory SPAWN, 'cp idl.ps '+full_dir+'/ssd_rate.ps' ; make the SSD efficiencies ssd_mk_effics ; plot the measured ref grating efficiencies pre_print_portrait ssd_check_ref post_print !p.multi = 0 ; copy the .ps file to the directory SPAWN, 'cp idl.ps '+full_dir+'/ssd_check_ref.ps' end ; ssd skip ; PSPC CALIBRATION ;----------------- ; Skip calibration? if(KEYWORD_SET(PSPC_CAL)) then begin ; Remove any .idlb files to save disk space ; and avoid partial .idlb files! SPAWN, 'rm '+full_dir+'/*.idlb' ; Calibrate the four anodes of the PSPC pcal_anodes = [0,1,1,1,1,0] ; copy pspc_lin_cal.txt into the directory ; Use pspc_lin_cal selected by date of test ; get six digit date code from pspc_directory date_start = STRPOS(pspc_directory, '95') if date_start LE -1 then date_start = STRPOS(pspc_directory, '96') if date_start LE -1 then date_start = STRPOS(pspc_directory, '97') if date_start LE -1 then date_start = STRPOS(pspc_directory, '98') if date_start LE -1 then date_start = STRPOS(pspc_directory, '99') if date_start LE -1 then begin print, " xgef_analysis: Can't find date code in "+pspc_directory return end date_code = STRMID(pspc_directory,date_start,6) ; Convert the date to an integer date_int = LONG(0) READS, date_code, date_int ; Check for this date code's 'lin_cal calibration file ; Cal files are date coded with appended name: cal_file = 'pspc_lin_cal.txt' ; They are found in: whole_prefix = !DDXGEFANC n_found = 0 found_files = FINDFILE(whole_prefix+'/*'+cal_file,COUNT=n_found) if(n_found GT 0) then begin ; go through the files and use the one closeest and earlier than the ; date code, the files are date code sorted by the FINDFILE function. cal_date_code = date_code for icalf=0,n_found-1 do begin ; get six digit date code from filename date_start = STRPOS(found_files(icalf), '95') if date_start LE -1 then begin date_start = STRPOS(found_files(icalf), '96') end if date_start LE -1 then begin date_start = STRPOS(found_files(icalf), '97') end if date_start LE -1 then begin date_start = STRPOS(found_files(icalf), '98') end if date_start LE -1 then begin date_start = STRPOS(found_files(icalf), '99') end if date_start GE 0 then begin this_date_code = STRMID(found_files(icalf),date_start,6) this_date_int = LONG(0) READS, this_date_code, this_date_int if (this_date_int LE date_int) then cal_date_code = this_date_code end end ; OK, so copy that file... SPAWN, 'cp '+whole_prefix+'/'+cal_date_code+'_pspc_lin_cal.txt '+$ full_dir+'/pspc_lin_cal.txt' ; print the command too SPAWN, 'echo cp '+whole_prefix+'/'+cal_date_code+'_pspc_lin_cal.txt '+$ full_dir+'/pspc_lin_cal.txt' end else begin print, " xgef_analysis: found no pspc_lin_cal.txt files." return end ; Use cal driver based on test code test_code = ufn_testcode(3*n_elements(ufn_testcode)/4) test_cnt = ufn_test_cnt(3*n_elements(ufn_test_cnt)/4) test_code = STRUPCASE(test_code) SPAWN, 'cp '+!DDXGEFANC+'/'+test_code+'_pspc_cal_driver.txt '+$ full_dir+'/pspc_cal_driver.txt' ; special cal driver for 960110... if test_cnt EQ 913 then begin print, 'Using special cal driver for 960110...' SPAWN, 'cp '+!DDXGEFANC+'/960110_pspc_cal_driver.txt '+$ full_dir+'/pspc_cal_driver.txt' end ; Adjust the lin_cal for simple offset... if test_code EQ 'MEG5' OR test_code EQ 'MEG6' then begin ; Do a calibration x shift using MgO w/Ref grating pspc_xcal_shift, 'PSPC#48', 0.0, 'pspc_lin_cal.txt' end else begin ; Do a calibration x shift using Ti w/Ref grating first-orders pspc_ti_ref = [ufn_search([test_code,'PSPC[','.HX220','.Ti.'])] if pspc_ti_ref(0) GE 0 then begin ; read in the FITS data fits_fill_ps, ufn_useful_file(pspc_ti_ref(0)) ; first-order offset tifooff = lx_Dgd*(lx_akev/lx_tEka)/lx_gp pspc_xcal_shift, ufn_useful_file(pspc_ti_ref(0)), $ xr_detx+tifooff, 'pspc_lin_cal.txt' pspc_xcal_shift, ufn_useful_file(pspc_ti_ref(0)), $ xr_detx-tifooff, 'pspc_lin_cal.txt' end end ; The LETG test does not have Ti so do cal shift with ; the LEG grating and Al if STRPOS(test_code,'LETG') GE 0 then begin ; Do a calibration x shift using Al w/LEG grating first-orders pspc_al_leg = [ufn_search([test_code,'PSPC[','.LX','.Al.'])] if pspc_al_leg(0) GE 0 then begin ; read in the FITS data fits_fill_ps, ufn_useful_file(pspc_al_leg(0)) ; first-order offset alfooff = lx_Dgd*(lx_akev/lx_tEka)/lx_gp pspc_xcal_shift, ufn_useful_file(pspc_al_leg(0)), $ xr_detx+alfooff, 'pspc_lin_cal.txt' pspc_xcal_shift, ufn_useful_file(pspc_al_leg(0)), $ xr_detx-alfooff, 'pspc_lin_cal.txt' end end ; Calibrate the directory with output to printer pspc_calibrate, /PLOTS ; Copy the post script file into the directory SPAWN, 'cp idl.ps '+full_dir+'/calib_plots.ps' ; Output a linear calibration file to update pspc_lin_cal.txt ; (normally commented out) pspc_show_cal1, /PLOTS SPAWN, 'cp idl.ps '+full_dir+'/lin_calib_plots.ps' ; *** update this date's lin_cal.txt file? ; Plot and save pspc_plot_cal output pre_print_landscape pspc_read_cal,/SILENT pspc_plot_cal,/SILENT post_print SPAWN, 'cp idl.ps '+full_dir+'/plot_cal.ps' ; Remove any .idlb files to save disk space SPAWN, 'rm '+full_dir+'/*.idlb' ; Remove idl.ps (should already have been copied somewhere...) SPAWN, 'rm idl.ps' end ; skipping cal ;------------ ; ANALYZE the data ;------------------ ; Skip analysis? if(KEYWORD_SET(PSPC_ANAL)) then begin ; Remove any .idlb files to save disk space ; and avoid partial .idlb files! SPAWN, 'rm '+full_dir+'/*.idlb' ; Drivers are selected by test code... test_code = ufn_testcode(3*n_elements(ufn_testcode)/4) test_code = STRUPCASE(test_code) drivers = [ test_code+'_Ap0_pspc_anal_driver.txt', $ test_code+'_Bp0_pspc_anal_driver.txt', $ test_code+'_HRefp0_pspc_anal_driver.txt', $ test_code+'_MRefp0_pspc_anal_driver.txt', $ test_code+'_Ap4_pspc_anal_driver.txt', $ test_code+'_Bp4_pspc_anal_driver.txt', $ test_code+'_Ap8_pspc_anal_driver.txt', $ test_code+'_Bp8_pspc_anal_driver.txt', $ test_code+'_Am4_pspc_anal_driver.txt', $ test_code+'_Bm4_pspc_anal_driver.txt', $ test_code+'_Am8_pspc_anal_driver.txt', $ test_code+'_Bm8_pspc_anal_driver.txt', $ test_code+'_Ap0tilt_pspc_anal_driver.txt', $ test_code+'_Ap8tilt_pspc_anal_driver.txt', $ test_code+'_Bp0tilt_pspc_anal_driver.txt', $ test_code+'_Bp8tilt_pspc_anal_driver.txt' ] ; 950901 is missing PSPC#84 ?! if STRPOS(pspc_directory, '950901') GE 0 then begin drivers(15) = 'MEG7_Bp8tilt_pspc_anal_driver_no84.txt' end results = [ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'p0', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'p0', $ STRCOMPRESS(fxpar(XGEF_HDR, 'REF_HEG'),/REMOVE_ALL)+'Ref', $ STRCOMPRESS(fxpar(XGEF_HDR, 'REF_MEG'),/REMOVE_ALL)+'Ref', $ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'p4', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'p4', $ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'p8', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'p8', $ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'m4', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'m4', $ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'m8', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'m8', $ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'p0tilt', $ STRCOMPRESS(xgef_grat_name(0),/REMOVE_ALL)+'p8tilt', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'p0tilt', $ STRCOMPRESS(xgef_grat_name(1),/REMOVE_ALL)+'p8tilt' ] ; LETG test has limited drivers... if STRPOS(test_code,'LETG') GE 0 then begin drivers = [drivers(1), drivers(3), drivers(14)] results = [results(1), results(3), results(14)] end n_drivers = n_elements(drivers) ; Loop through the Gratings/regions ; FOR ianal=0, n_elements(results)-1 do begin ; Select an analysis driver file and coresponding results directory anal_driver_file = drivers(ianal) these_results_dir = results(ianal) ; Copy the anal driver to the directory ; The anal driver is from the xgef ancillary directory SPAWN, 'cp '+!DDXGEFANC+'/'+anal_driver_file+' '+ full_dir+'/pspc_anal_driver.txt' ; Analyze the directory with output to ps file pspc_analyze_fits, /SMART, /PLOTS ; Create a subdirectory for these analysis results SPAWN, 'mkdir '+full_dir+'/'+these_results_dir ; Copy the 'anal_driver and post script analysis file into the new directory SPAWN, 'mv '+full_dir+'/pspc_anal_driver.txt '+full_dir+'/'+these_results_dir SPAWN, 'mv '+full_dir+'/pspc_results.txt '+full_dir+'/'+these_results_dir SPAWN, 'cp idl.ps '+full_dir+'/'+these_results_dir+'/anal_plots.ps' ; Remove any .idlb files to save disk space SPAWN, 'rm '+full_dir+'/*.idlb' ; Remove idl.ps (should already have been copied somewhere...) SPAWN, 'rm idl.ps' end ; of driver loop end ; of skip analysis ; Reference grating analysis and fits ;------------------------------------ if KEYWORD_SET(PSPC_FITS) then begin ; Loop through Subdirectories read_a_fits_file test_code = ufn_testcode(3*n_elements(ufn_testcode)/4) test_code = STRUPCASE(test_code) ; LETG test has limited drivers... ig_start = 0 ig_end = 1 if STRPOS(test_code,'LETG') GE 0 then begin ig_start = 1 ig_end = 1 end for ig=ig_start,ig_end do begin grat_name = xgef_grat_name(ig) results = [ grat_name+'m8', $ grat_name+'m4', $ grat_name+'p0', $ grat_name+'p4', $ grat_name+'p8' ] gratxhere = [-8.0, -4.0, 0.0, 4.0, 8.0] if STRPOS(test_code,'LETG') GE 0 then begin results = [results(2)] gratxhere = [gratxhere(2)] end FOR ir=0, n_elements(results)-1 do begin print, '....................................' print, ' Processing: '+pspc_directory+'/'+results(ir) ; OK, now do what we want to do... ;--------------------------- ; Make the reference grating derrived efficiencies lnf_mk_effics, results(ir) ;--------------------------- ; Rest of action takes place in sub-directory ; so save pspc_directory save_dir = pspc_directory ; and set pspc_directory to pspc_directory = pspc_directory + '/' + results(ir) full_dir = pspc_above_dir+'/'+pspc_directory ;--------------------------- ; Make ratios from these effics pspc_mk_ratios, 'pspc_effics.lnf', 'pspc_effics.ratios' ;--------------------------- ;--------------------------- if (1 EQ 1) then begin ; Fit the RECTANGULAR model to the ratios pre_print_landscape ; use SMART option to use best guess at grating parameters ; as starting point... pspc_fit_model, 'pspc_effics.ratios', SMART=grat_name device, /close set_plot, 'X' SPAWN, 'cp idl.ps '+full_dir+'/effics_contour.ps' ; Set parameters to get portrait plotting for gfit_compare.pro SET_PLOT, 'PS' device, /portrait,/inch,font_size = 12, XSIZE=6.5, YSIZE=10.0, $ YOFFSET=0.5, XOFFSET=1.0 gfit_compare device, /close set_plot, 'X' SPAWN, 'cp idl.ps '+full_dir+'/effics_compare.ps' ; Display and write to file the bestfit comparison dummy = gfit_chi_2(lx_gthk, lx_gline, 1, full_dir+'/effics_best_fit.txt') end ; ;--------------------------- ; Restore pspc_directory pspc_directory = save_dir ; Do John's fitting things sub_dir = results(ir) ; If there are ssd data, write separate ssd_effics.lnf ; files to the subdirectories with the appropriate ; zero-order measurements based on grating and grating region. ssd_file_name = 'ssd_effics_noref.lnf' file_array = FINDFILE(pspc_above_dir+'/'+pspc_directory+ $ '/'+ssd_file_name, COUNT=nfound) if nfound EQ 1 then begin ssd_lnf_data = lnf_from_file(ssd_file_name) ssd_relevant = 0*intarr(n_elements(ssd_lnf_data)) ; go through these and check that they are zero-order and ; at the right grating x offset for issd = 0, n_elements(ssd_lnf_data)-1 do begin ; find out where grat x is for this ssd measurement ufnindex = where(ufn_useful_file EQ ssd_lnf_data(issd).File, nfound) if nfound GT 0 then begin thisgratx = ufn_grat_x(ufnindex(0)) if approx_equal(thisgratx, gratxhere(ir), 0.2) AND $ ssd_lnf_data(issd).Order EQ 0 AND $ STRPOS(ssd_lnf_data(issd).File,grat_name) GE 0 $ then ssd_relevant(issd) = 1 ; optional not-limit of SSD zero-order to 0.93 and 1.25 values if NOT(KEYWORD_SET(ALL_SSD)) AND $ NOT(approx_equal(ssd_lnf_data(issd).Eexact,1.1,0.25)) then $ ssd_relevant(issd) = 0 end end ; Now save the relevant lnf's into the subdirectory ssd_lnf_data = ssd_lnf_data(where(ssd_relevant GT 0)) lnf_write_file, ssd_lnf_data, pspc_above_dir+'/'+pspc_directory + $ '/'+sub_dir+'/'+ssd_file_name end ; Now call john's fitting stuff... ; Use best guess at grating parameters for fitting ; constants (poly, PB_Cr, PB_Au) and initial guess. if STRPOS(sub_dir,'LX') GE 0 OR KEYWORD_SET(AMP_FACTOR) then begin jfit_analysis, sub_dir, gsli_grat_params(grat_name),/AMP_FACTOR end else begin jfit_analysis, sub_dir, gsli_grat_params(grat_name) end ; Save all the pretty plots pre_print_landscape jfit_plot_shape device, /close set_plot, 'X' SPAWN, 'cp idl.ps '+full_dir+'/jfit_shape.ps' pre_print_portrait jfit_compare, sub_dir device, /close set_plot, 'X' SPAWN, 'cp idl.ps '+full_dir+'/jfit_compare.ps' end ; loop through sub directories end ; loop through gratings ; Remove idl.ps (should already have been copied somewhere...) SPAWN, 'rm idl.ps' end ; pspc_fits ; Tilt analysis ;------------------------------------ if KEYWORD_SET(TILT_ANALYSIS) then begin ; Find all the subdirectories that have ; tilt in their names and have a pspc_results.txt file tilt_files = FINDFILE(pspc_above_dir+'/'+pspc_directory+'/*tilt*/'+ $ 'pspc_results.txt', COUNT=n_found) if n_found GT 0 then begin for it=0,n_elements(tilt_files)-1 do begin ; extract the subdirectory pieces = str_sep(tilt_files(it),'/') sub_dir = pieces(n_elements(pieces)-2) print, '' print, ' xgef_analysis: Doing TILT analysis for '+sub_dir ; do the analysis, plot to a file pre_print_portrait tilt_analysis, sub_dir device,/close set_plot,'X' SPAWN,'cp idl.ps '+pspc_above_dir+'/'+pspc_directory+'/'+sub_dir+'/'+ $ 'tilt_plots.ps' end ; loop over files print, '' end ; n_found > 0 end ; tilt analysis ; Put the results into the spreadsheet files, etc. ;------------------------------------ if KEYWORD_SET(LOGIT) then begin print, ' ' print, 'Logging X-GEF results...' print, ' ' ; get latest spreadsheet files gs_load_all ; put pspc_directory in the spreadsheet at the grating's lines new_line_A = where(gs_data.Frame EQ xgef_grat_name(0),nA) new_line_B = where(gs_data.Frame EQ xgef_grat_name(1),nB) if nA EQ 1 then begin gs_xgef_dir(new_line_A(0)) = pspc_directory print, 'Logged '+xgef_grat_name(0)+' in GratingStatus.' end else begin print, '*** Did not find grating '+xgef_grat_name(0)+' in GratingStatus.' end if nB EQ 1 then begin gs_xgef_dir(new_line_B(0)) = pspc_directory print, 'Logged '+xgef_grat_name(1)+' in GratingStatus.' end else begin print, '*** Did not find grating '+xgef_grat_name(1)+' in GratingStatus.' end ; fill the spreadsheet with X-GEF results if nA EQ 1 then begin gs_xgef_effics, new_line_A(0), new_line_A(0) end if nB EQ 1 then begin gs_xgef_effics, new_line_B(0), new_line_B(0) end ; show the new data if nA EQ 1 then begin gs_list, [new_line_A(0)] end if nB EQ 1 then begin gs_list, [new_line_B(0)] end ; save the spreadsheet print, ' ' print, ' Saving these X-GEF results...' gs_xgef_write, /LAZY ; output plots of results for fab, test, and dd. if nA EQ 1 then begin xgef_fab_plots, /HARDCOPY, new_line_A(0) end if nB EQ 1 then begin xgef_fab_plots, /HARDCOPY, new_line_B(0) end ; add pspc_directory to XGEF_valid_dirs.txt ; if it's not there already ;; not implemented print, ' ' print, ' Logging complete.' print, ' Add ""'+ pspc_directory $ +'"" to the file '+!DDGSDIR+'/XGEF_valid_dirs.txt' end ; LOGIT set_plot,'X' RETURN END