dd Software

dd Software

Go to HETG at XRCF

IDL S/W Introduction

(updated 6/9/98)

The S/W described here was created during the design, construction, testing, and flight activation of the HETG. The S/W is organized in directories with general themes or purposes and a general chronology. A large portion of the S/W is made available at the IDL command line through setup of path and commons via a startup procedure, e.g. ddidl_start.pro (most recent version is in ~dd/idl/marx/). Some changes are needed to run the s/w elsewhere, for example, the sao_start.pro below is used on the ASC/SAO system.

This page is rather large and spread out - the browser FIND can be used to search for items.

A snapshot of the full software directories is available at: DD IDL Software Directories.

IDL S/W by Purpose and Directory

Support Procedures

The routines here are generally useful...
The routines here are useful when used with the IRT package.

HETGS Design and Performance Evaluation

Ray-trace faceted grating instrument Compute error budget (copy of Mac budget equations that is correlated w/Raytrace)
Complete ray-trace of the Source-HRMA-HETG-ACIS. [Predecessor to "csim" and MARX.]
Efficiencies of Chandra elements. Simulated HETG results from source spectra.
Convert encircled energy plot into 1-D projected "line spread function".

Sub-assembly S/W

These routines read, analyze, and plot the data from Laser Reflection testing.
These routines are used to model lab source spectra, grating efficiencies, membrane transmission, etc. Many of the parameters are stored in common (labx_common.pro) and available and modifyable at the command line.
  • X-Ray Source Spectrum Modeling
    This directory is the repository for lookup tables used by the various software.
    At the ASC's urging long ago, a FITS format for the X-GEF data (PSPC, SSD, and SMD) was adopted. This directory has routines useful and related to the X-GEF FITS files.
    These routines call and interface with John Davis's efficiency model and fitting routines for X-GEF testing.
    • jfit common variables
      • jfit_common.pro
        Many routines in jfit put/take their parameters to/from jfit_common.
        IDL> @jfit_common
    • X-GEF Results Fitting
    • Other Interfaces
      • jfit_to_tilt.pro
        Convert jfit parameters in jfit_common into labx_common parameters and path shape function to allow tilt_effic to evaluate the jfit model efficiency.
        IDL> jfit_poly = 1.0
        IDL> (etc. to fill jfit paramters)
        IDL> jfit_to_tilt
        IDL> lx_gm = 1 ; select order
        IDL> effics = tilt_effic(energies)
    • X-GEF PSPC Basic S/W
      • pspc_read_events.pro
      • pspc_dither.pro
      • pspc_calib.pro
      • pspc_picture.pro
      • pspc_[x,y,e]hist.pro
        Routines to read, calibrate, select, and display X-GEF PSPC "images". It is useful to run xgef_analysis (below) with no keyword options in oder to set up the mapping from a useful PSPC file name (e.g., 'PSPC[]HEG7#31') to the date-time coded file name. Files can then be manipulated and displayed. Example:
        IDL> pspc_directory = 'caliber/d9/970721'
        IDL> xgef_analysis
        IDL> pspc_read_events, 'PSPC[]HEG7#38'
        IDL> pspc_dither
        IDL> pspc_calib
        IDL> pspc_picture
        IDL> pspc_selected = where( ABS(pspc_dx) LT 5.0 )
        IDL> pspc_picture
        IDL> pspc_xhist
        IDL> pspc_yhist
        IDL> pspc_ehist
    • X-GEF Simulation S/W
      • xrtf.pro
        This procedure simulates the X-GEF setup for a PSPC measurement. The various parameters are kept in commons and can be set from a FITS data file with the fits_fill_ps prodecure. Parameters of the form "xr_" control the coarse simulation properties (e.g., xr_nr is number of rays simulated.)
        IDL> pspc_directory = 'caliber/d9/970721'
        IDL> xgef_analysis
        IDL> fits_fill_ps, 'PSPC[]HEG7#38'
        IDL> xrtf
        IDL> xr_nr = 10000
        IDL> xrtf
    • X-GEF Optic S/W
      • dh_play.pro
        Procedure to simulate the 1D focussing optic in X-GEF and do a quasi ray-trace of it. (The "dh_" prefix refers to Don Humphries, Mechanical Engineer, who designed and had fabricated the piezo-bent-optic assembly.)
    Ancillary files used to record X-GEF calibration parameters and "analysis driver" files to support analysis of the various X-GEF test procedures.
    The highest-level directory for software that carries out X-GEF analysis.
    • X-GEF Documentation
    • X-GEF Routine Analysis s/w
      • xgef_analysis.pro
        Main X-GEF analysis s/w - top level routine. Summary of use:
        IDL> pspc_above_dir = '/nfs'
        IDL> pspc_directory = 'caliber/d9/980106'
        IDL> xgef_analysis, /SUMMARY, /PSPC_CAL
        IDL> xgef_analysis, /SMD, /SSD, /PSPC_ANAL, /PSPC_FITS,/AMP, /TILT
        IDL> xgef_analysis, /LOGIT
      • test_dirs.pro
      • xgef_read_dirs.pro
      • XGEF_valid_dirs.txt
        The file XGEF_valid_dirs.txt (located in the directory !DDGSDIR) lists the directories of all valid X-GEF tests. The function test_dirs() returns an array valid directories as read by xgef_read_dirs.pro.
        IDL> dir_array = test_dirs()
      • gs_xgef_fill.pro
      • gs_xgef_effic.pro
        These two routines are used to fill the "gs_xgef" variables in common, which can then be written to the GratingStatus.xgef.txt file.
        gs_xgef_fill.pro reads a FITS file in the directories given by the XGEF_valid_dirs.txt file to determine which facets were tested - and enters this directory into gs_xgef_dir.
        gs_xgef_effic.pro loads the averaged results of the grating region subtests into the gs_xgef_[thk, line, 1keV, 4keV, 8keV] arrays.
        IDL> gs_load_all ; load current data files
        IDL> old_dirs = gs_xgef_dir ; save current directories
        IDL> gs_xgef_fill ; update directories
        Now update all lines which have changed:
        IDL> changed = where(old_dirs NE gs_xgef_dir) IDL> for ic = 0, n_elements(changed)-1 do gs_xgef_effic, changed(il), changed(il)
        IDL> gs_xgef_write, /LAZY ; save the results
    • X-GEF Diagnostic s/w
      • ssd_ref_hist.pro
      • ssd_ref_plot.pro
        Routines to make plot of SSD-derived reference grating efficiency vs time.
        IDL> ssd_ref_hist, 'HX220' [or 'MX078']
        IDL> pre_print_landscape
        IDL> ssd_ref_plot
        IDL> post_print
    • X-GEF Verification Simulation
      • xgef_sim.pro
        Procedure to simulate a set of X-GEF measurements in order to test/verify the analysis software.
    Procedures in this directory generally make use of LR and X-GEF data together for grating counting, selection, etc. The "GratingStatus" spread sheet data, LR data, and X-GEF data are all available through the gs_common variables as described briefly in a memo (1/23/96).
    • Subassembly Grating Information
      • gs_load_all.pro
      • gs_list.pro
      • gs_lr_update.pro
        Go through all the gratings and find the most recent LR data file for each grating and update gs_lr data that has changed.
        IDL> gs_lr_update
    • Flight Grating Slection and Plots
    • Vacuum Storage Grating Analysis
      • vsg_info.pro
        Procedure capturing vacuum storage grating analysis - contains multiple internal sections for various purposes...

    XRCF and Cal Product Related

    • General CMBD Interface
      • cmdb_load.pro
      • cmdb_list.pro
      • cmdb_mini_list.pro
        Procedure to fill cmdb_common variables from a CMDB file.
        IDL> cmdb_file = 'tot_req_run.cmdb'
        IDL> cmdb_load
        IDL> cmdb_list
        IDL> cmdb_mini_list, where( STRPOS(cmdb_fields(*,c_X_ray_target_line),'Cr') GE 0 )
    • CMDB - XRCF support
      • cmdb_make_locs.pro
        Procedure to create locations (.loc) files for use with HXDS "3D" and "dF" scans.
        IDL> cmdb_make_locs, array_of_lines, /MAKE
    • XSS Source Spectra
      • xss_sim.pro
        Procedure to simulate the source spectrum based on a line of the CMDB. For EIPS sources it makes extensive use of the labxray routine labx_tubespec.pro.
        IDL> xss_sim, cmdb_line_number [, /NO_BND, /NO_PLOT, ITER=1 ]
    • General XRCF
      • xrcf_params.pro
        Procedure to return useful values of xrcf parameters. The values are returned through (optional, as desired) keywords.
        IDL> xrcf_params, HC=hc, FOCAL_LEN=focal_len
        IDL> xrcf_params, NAMES=names, PERIODS=periods, ANGLES=angles, ROWLANDS=rowlands
        IDL> xrcf_params, HSI_PIXEL=hsi_pixel, HSI_ANGLE=hsi_angle, TOGA_RC=toga_rc
      • xrcf_hsi_read.pro
        Procedure to read the MST HSI fits file (hsi[runid]iN.fits) and return a structure with Y, Z, and PHA. The /FAC converts the Y and Z to facility Y and Z in microns w.r.t. HSI aim point. /PBLURR blurrs the positions by +/- 0.5 pixel to remove aliassing in future binning steps.
        IDL> hsi = xrcf_hsi_read('/nfs/spectra/d6/970116/hsi109001i2.fits',/FAC,/PB)
        IDL> plot, hsi.y, hsi.z, PSYM=3
      • xrcf_loc_file_read.pro
        Procedure to return the X, Y, Z values in a locations file.
        IDL> xrcf_loc_file_read, 'E-HXS-3D-32.008', Xloc, Yloc, Zloc
    • HSI Analysis and Source Spectra
      • hsi_source_spectra.pro
        Extract a measured spectrum from an HSI measurement. Also compare the spectrum with source-model prediction.
      • hsi_do_source_spectra.pro
        Execute hsi_source_spectra for all relevant HSI TRW IDs, create web page of results, etc.
    • ACIS XRCF Analysis
      • psu_view.pro
        Procedure to read in the PSU-created FITS file for a given TRW ID and create useful plots and "Level 1" output product.
        View the data:
        IDL> psu_view, 'H-IAS-MC-3.013'
        Create IDL-save and FITS file outputs (no plots):
        IDL> psu_view, 'H-IAS-MC-3.013', /SAVE, /FITS_OUT, /NO_PLOT
        Process many files of similar kind:
        IDL> psu_view, 'H-HAS-EA-*', /SAVE, /FITS_OUT, /NO_PLOT, /PROC
      • asca_of_flight.pro
        Function to convert an array of flight grades into ASCA grades.
      • hrc_view.pro
        Procedure to read in the ASC-created FITS level 1 files for a given ASC TRW-ID code (or combined TRW ID) and create useful plots and "Level 1" output product in IDL save format.
        IDL> hrc_view, '*ghhi*'
        IDL> hrc_view, '*ghhi*',/PROCESS,/SAVE
    • Generally useful for MARX output
      • xye_image.pro
        Procedure to create an intensity-color coded image with intensity representing number of counts and color representing average energy in bin. See xye_image.pro header comments for calling options.
        Heavilly based on Dave H routine mk_color_image.pro!
        IDL> xye_image, X, Y, E, MARX_DIR = 'dir_specification'
      • mk_color_image.pro, make_image.pro
        DaveH's routines that are the heart of xye_image.pro.
    • MARX XRCF simulation
      • xrcf_sim.pro
        Simulate an XRCF measurement using MARX.
        IDL> xrcf_sim, 'E-HXS-3D-32.008'
      • sim_all_acis.pro
        Find and simulate all ACIS(HRC)-Grating measurements using xrcf_sim/MARX; also create web table and web pages for the measurements.
        IDL> sim_all_acis, /SIM, /FORM, /TABLE
        IDL> sim_all_hrc, /SIM, /FORM, /TABLE
    These routines are used for predicting flight effective areas for HETGS/LETGS configurations.
    • Effective Area Calculations (e.g., for PIMMS)
      • main_hetg_m.pro, main_letg_m.pro
    • ACIS-S Chip Gap Locations
      • hetgs_gaps.pro
        Creates .tex tables of HETG/HETG gap locations in energy:
        IDL> hetgs_gaps

    OAC and GTO Software

    • MARX Flight simulation
      • flight_sim.pro
        Simulate flight measurements using MARX.
        IDL> flight_sim, 'O-HAS-Capella-3.001'
  • MIT Accessibility