PRO cip_hetg_prune ;+ ; PRO cip_hetg_prune ; ; This procedure reads in the grating efficiency files and ; "prunes" them and writes them back out... with a type of ; "greffprNNN" where the NNN is the accuracy of the pruning. ; The pruned version is accurate to 0.NNN times the orignial; ; e.g., pr005 is 0.5% accuracy. ; ; 7/16/99 dd Pruning the N0003 efficiencies. Modified the code ; to be more general too. ;- ver_str = 'N0003' acurs = [0.001, 0.005, 0.020] acstrs = ['001', '005', '020'] ; Read in the shell effics and headers hmp1 = rdb_read(!DDHETGCAL+'/cip/hetgmp1D1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdr1) hmp3 = rdb_read(!DDHETGCAL+'/cip/hetgmp3D1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdr3) hmp4 = rdb_read(!DDHETGCAL+'/cip/hetgmp4D1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdr4) hmp6 = rdb_read(!DDHETGCAL+'/cip/hetgmp6D1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdr6) hMEG = rdb_read(!DDHETGCAL+'/cip/hetgmegD1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdrMEG) hHEG = rdb_read(!DDHETGCAL+'/cip/hetghegD1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdrHEG) HETG = rdb_read(!DDHETGCAL+'/cip/hetgD1996-11-01greff'+ver_str+'.rdb', $ HEADER=hdrHETG) ; Read in the shell ERRORs and headers hmp1e = rdb_read(!DDHETGCAL+'/cip/hetgmp1D1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdr1e) hmp3e = rdb_read(!DDHETGCAL+'/cip/hetgmp3D1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdr3e) hmp4e = rdb_read(!DDHETGCAL+'/cip/hetgmp4D1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdr4e) hmp6e = rdb_read(!DDHETGCAL+'/cip/hetgmp6D1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdr6e) hMEGe = rdb_read(!DDHETGCAL+'/cip/hetgmegD1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdrMEGe) hHEGe = rdb_read(!DDHETGCAL+'/cip/hetghegD1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdrHEGe) HETGe = rdb_read(!DDHETGCAL+'/cip/hetgD1996-11-01grerr'+ver_str+'.rdb', $ HEADER=hdrHETGe) ; Put all the products on one grid... Do zero and first-orders ; of the shell effics and the MEG and HEG combinations ys = [ [hmp1.op1], [hmp1.oz], $ [hmp3.op1], [hmp3.oz], $ [hmp4.op1], [hmp4.oz], $ [hmp6.op1], [hmp6.oz], $ [hMEG.op1], [hMEG.oz], $ [hHEG.op1], [hHEG.oz] ] ; Loop over the desired accuracies to output for iac = 0, n_elements(acurs)-1 do begin ; - - - - - - - - - - - - - - - - - - - - - - - ; Prune them... accuracy = acurs(iac) ; relative accuracy acstr = acstrs(iac) ; accuracy string ; Find the set of X values... ; use the same accuracy for them all ysize = SIZE(ys) as = accuracy * (1.0+FLTARR(ysize(2))) ; Find the needed xs... xs_needed = interp_pruned_x(hmp1.energy, ys, as ) ; Write out the pruned files hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr1] rdb_write, !DDHETGCAL+'/cip/hetgmp1D1996-11-01greffpr'+acstr+ver_str+'.rdb', $ hmp1(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr3] rdb_write, !DDHETGCAL+'/cip/hetgmp3D1996-11-01greffpr'+acstr+ver_str+'.rdb', $ hmp3(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr4] rdb_write, !DDHETGCAL+'/cip/hetgmp4D1996-11-01greffpr'+acstr+ver_str+'.rdb', $ hmp4(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr6] rdb_write, !DDHETGCAL+'/cip/hetgmp6D1996-11-01greffpr'+acstr+ver_str+'.rdb', $ hmp6(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdrMEG] rdb_write, !DDHETGCAL+'/cip/hetgmegD1996-11-01greffpr'+acstr+ver_str+'.rdb', $ hMEG(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdrHEG] rdb_write, !DDHETGCAL+'/cip/hetghegD1996-11-01greffpr'+acstr+ver_str+'.rdb', $ hHEG(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdrHETG] rdb_write, !DDHETGCAL+'/cip/hetgD1996-11-01greffpr'+acstr+ver_str+'.rdb', $ HETG(xs_needed), $ HEADER = hdr ; and the ERRORs hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr1e] rdb_write, !DDHETGCAL+'/cip/hetgmp1D1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ hmp1e(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr3e] rdb_write, !DDHETGCAL+'/cip/hetgmp3D1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ hmp3e(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr4e] rdb_write, !DDHETGCAL+'/cip/hetgmp4D1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ hmp4e(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdr6e] rdb_write, !DDHETGCAL+'/cip/hetgmp6D1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ hmp6e(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdrMEGe] rdb_write, !DDHETGCAL+'/cip/hetgmegD1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ hMEGe(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdrHEGe] rdb_write, !DDHETGCAL+'/cip/hetghegD1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ hHEGe(xs_needed), $ HEADER = hdr hdr = ['# written by cip_hetg_prune.pro, '+SYSTIME(), $ '# pruned to accuracy = '+STRCOMPRESS(accuracy), $ '#', $ hdrHETGe] rdb_write, !DDHETGCAL+'/cip/hetgD1996-11-01grerrpr'+acstr+ver_str+'.rdb', $ HETGe(xs_needed), $ HEADER = hdr ; - - - - - - - - - - - - - - - - - - - - - - - END ; of accuracy loop RETURN END