(See SDSS/LLS/sdss_llsfn.pro)
NAME: sdss_llsgoz PURPOSE: Determines the g(z) path for a LLS search CALLING SEQUENCE: sdss_llsgoz INPUTS: qalfil -- Filename of QSO structure for g(z) calculation RETURNS: OUTPUTS: OUTFIL= -- Filename for g(z) FITS file OPTIONAL KEYWORDS: ORIG_ZEM= -- Use the original redshifs from SDSS (in this file) SNRLMT= -- SNR limit for DLA search [default: 2] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: sdss_llsgoz, '../dr5_qso.fits', 'dr5_lls_goz_sn2.fits' PROCEDURES CALLED: REVISION HISTORY: 27-Feb-2004 Written by SHF 14-Oct-2004 Modified by JXP
(See SDSS/LLS/sdss_llsgoz.pro)
NAME: sdss_llsinit Version 1.0 PURPOSE: Produces a LLS structure of SDSS LLS CALLING SEQUENCE: sdss_llsstrct, lls INPUTS: RETURNS: lls -- LLS structure OUTPUTS: OPTIONAL KEYWORDS: QSOS= -- Structure of statistical QSOs in the sample OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 16-Feb-2010 Written by JXP
(See SDSS/LLS/sdss_llsinit.pro)
NAME: sdss_llslozx PURPOSE: Calculate dn/dz or dn/dX for a set of redshift bins CALLING SEQUENCE: sdss_llslozx INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: Jul-2009 Written by JXP
(See SDSS/LLS/sdss_llslozx.pro)
NAME: sdss_llsnchk PURPOSE: Launches x_specplot to fiddle (and set) the redshift of a LLS in SDSS given the LLS structure. CALLING SEQUENCE: sdss_llszchk INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 30-May-2007 Modified by JXP
(See SDSS/LLS/sdss_llsnchk.pro)
NAME: sdss_llsstrct Version 1.0 PURPOSE: Produces a LLS structure of SDSS LLS CALLING SEQUENCE: sdss_llsstrct, lls INPUTS: RETURNS: lls -- LLS structure OUTPUTS: OPTIONAL KEYWORDS: QSOS= -- Structure of statistical QSOs in the sample OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 16-Feb-2010 Written by JXP
(See SDSS/LLS/sdss_llsstrct.pro)
NAME: sdss_llsview Version 1.1 PURPOSE: GUI used to check for (and designate) BAL quasars from SDSS CALLING SEQUENCE: sdss_llsview, qalfil, IQSO=, XSIZE=, YSIZE=, /RECHK INPUTS: qalfil -- Name of FITS file containing the QAL structure RETURNS: OUTPUTS: qalfil -- With the BAL info modified accordingly OPTIONAL KEYWORDS: IQSO -- Number of the first QSO to start with [default: 0L] /RECHK -- Only plot thos QSOs identified as BAL previously MATCHFIL -- to skip QSOs that have already been checked (see sdss_balupdate.pro) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: sdss_llsview, 'DR2_QSO/sdss_DR2_QAL.fits', MATCHFIL='DR2_QSO/matched.fits' PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 05-Feb-2004 Written by JXP 07-Jun-2004 Revised by SHF
(See SDSS/LLS/sdss_llsview.pro)
NAME: sdss_llszchk PURPOSE: Launches x_specplot to fiddle (and set) the redshift of a LLS in SDSS given the LLS structure. CALLING SEQUENCE: sdss_llszchk INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 30-May-2007 Modified by JXP
(See SDSS/LLS/sdss_llszchk.pro)
NAME: sdss_m912 PURPOSE: Compute the apparent magnitude one would measure at the Lyman limit in the observed frame at lambda = (1 + z)912 CALLING SEQUENCE: m_912 = m912(z,m,filter,[ logLv = , ALPHA_EUV = , OMEGA0 = , LAMBDA0 = $ , W = , LIT_H = ]) INPUTS: z - Redshift of the quasar m - Apparent magnitude filter - filter name SDSS [u,g,r,i,z,B,B_J] OPTIONAL KEYWORDS: logLv - Log_10 of the specific luminosity at the Lyman edge (ergs/s/Hz) ALPHA_EUV - Spectral slope in the extreme UV. Default is 1.57 (Tefler et al 2002). A power law v^{-ALPHA_EUV} is pasted onto the quasar spectrum at 1285 A. OMEGA0 - Matter density. Default is 0.27 LAMBDA0 - Dark energy density. Default is 0.73 W - Equation of state parameter. Default is w = -1.0 LIT_H - Hubble h parameter. Required if logLv is specified OUTPUTS: m_912 - Apparent magnitude one would measure at the Lyman limit in the observed frame at lambda = (1 + z)912 COMMENTS: The code will return an error if one tries to use a filter with lambda_min < (1 + z)*1216. The lyman alpha forest will reduce the observed apparent magnitude, and the mean flux blueward of 1216 is not reproduced correctly in the quasar template used here. EXAMPLE: Compute m_912 for a quasar at z=2.43 which has g=20.5 m_912=m912(2.43,20.5,1,logLv=logLv) print,m_912 22.199551 print,loglv 29.812608 PROCEDURES CALLED: dofa() sdss_filter_nu() qso_template_nu() obs_int_nu() REVISION HISTORY: 17-Sep-2005 Written by Joe Hennawi UCB
(See SDSS/m912/sdss_m912.pro)
NAME: sdss_metals Version 1.1 PURPOSE: Identify metal-line systems given a set of absorption lines CALLING SEQUENCE: sdss_metals, abswave, zem, WAVE=, FLUX=, QSTRCT= INPUTS: abswave -- Absorption line array zem -- Emission redshift of the QSO RETURNS: OUTPUTS: QSTRCT= -- Structure containing the key output of this routine OPTIONAL KEYWORDS: WAVE= -- Wavelength array for plotting (not required) FLUX= -- Flux array for plutting (not required) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Apr-2004 Written by SHF
(See SDSS/General/sdss_metals.pro)
NAME: sdss_mgii Version 1.0 PURPOSE: Brute force algorithm which examines the absorption lines detectedin a SDSS spectrum and searches for matches with MgII CALLING SEQUENCE: sdss_fndciv, abswav INPUTS: abswav - Array of observed wavelengths of detected absorption lines RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-May-2002 Written by JXP
(See SDSS/MgII/sdss_mgii.pro)
NAME: sdss_mgiisearch Version 1.0 PURPOSE: Given a list of SDSS quasars, search these spectra for MgII absorbers and output a structure of detections and EWs CALLING SEQUENCE: INPUTS: filename - File containing a (long) list of SDSS quasar data files (1d spectra, .fit) SDSSSUM= - Summary file of QSO properties [required] INIFIL= - File containing the MgII structure which was created previously. These will not be redone. RETURNS: OUTPUTS: outfil - Name for outputted structure of MgII absorbers OPTIONAL KEYWORDS: /LZ -- Restrict to low redshift (z = 0.45) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: sdss_mgiisearch, 'Lists/dr6_qso.list', 'DR6_QSO/', 'dr6_qso.fits', 'mgii_search.fits' PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-May-2002 Written by JXP
(See SDSS/MgII/sdss_mgiisearch.pro)
NAME: sdss_mkllstmpl PURPOSE: Routine to make a series of LLS absorption templates by only varying NHI CALLING SEQUENCE: INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 27-Feb-2004 Written by JXP
(See SDSS/LLS/sdss_mkllstmpl.pro)
NAME: sdss_na1search Version 1.0 PURPOSE: Given an array of strings, return an array of unique values + number CALLING SEQUENCE: uniq = x_chkfil(strings, COUNT=count) INPUTS: strings - Array of strings RETURNS: uniq - Array of unique members OUTPUTS: OPTIONAL KEYWORDS: sort - Sort the output OPTIONAL OUTPUTS: COUNT - number of unique strings COMMENTS: EXAMPLES: flg = x_chkfil( lbls, count=count) sdss_na1search, 'Lists/dr3_abs.lst', 'sdss_DR3_NaI.fits', SDSSSUM='dr3_qso.fits', DATR='DR3_QSO/' PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-May-2002 Written by JXP
(See SDSS/NaI/sdss_na1search.pro)
NAME: sdss_newzem Version 1.1 PURPOSE: Returns the new QSO redshift if a new one has been calculated. The redshifts generally come from the Shin et al. 2007 prescription. CALLING SEQUENCE: zem = sdss_newzem(zmin, zmax, GZFIL=, XZFIL=) INPUTS: plate -- Plate fiber -- Fiber RETURNS: zem -- New QSO emission redshift OUTPUTS: OPTIONAL KEYWORDS: /FMATCH -- Demand that there is a match OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 10-Nov-2005 Written by JXP
(See SDSS/General/sdss_newzem.pro)
NAME: sdss_objinf Version 1.1 PURPOSE: Routine to quickly parse the SDSS QSO database. CALLING SEQUENCE: sdss_objinf, names, SUMMF=, /PLOT, DATDIR=, $ FILNM=, CHKDF=, PATH=, ZEM=,$ RMAG=, RA=, DEC=, /SILENT, /NMRAD INPUTS: names -- List of filenames or 2-element array giving plate and fiber RETURNS: OUTPUTS: OPTIONAL KEYWORDS: SUMMF= -- Summary file [default: 'sdss2_qsoi205.fits'] PATH= -- Path to SDSS data [default: 'SDSSPATH'+'/DR2_QSO'] DATDIR= -- Data directory [default: 'spectro/1d_23'] /NMRAD -- Input is ['RA:::', 'DED:::'] /DECI -- Input is [rad, decd] /DR1 -- Check the DR1 list (r <= 19.5) ZIN= -- Input redshift for plotting SDSS= -- Structure contaning the QSO info /LLS -- Use the LLS line list /QSO -- Use the quasar line list /PHOTOM -- Print all photometry OPTIONAL OUTPUTS: FILNM= -- File name of the data RA= -- RA of the QSO DEC= -- DEC of the QSO FLGSDSS= -- Flag signifying success (1) or failure (0) COMMENTS: EXAMPLES: sdss_objinf, '0571-52286-276', /plot sdss_objinf, [463, 95], filnm=filnm sdss_objinf, ['12:00:21.3', '+32:22:12'], /nmrad PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 20-Nov-2003 Written by JXP
(See SDSS/General/sdss_objinf.pro)
NAME: sdss_omgdla PURPOSE: Calculates the first moment of f(N,X) [i.e. Omega_DLA] Includes He as the default CALLING SEQUENCE: sdss_omgdla, GZFIL=, PEROUX=, MODELS=, STRCT=, BINS=, VPROX=, DR3=, ALL= INPUTS: GZFIL= -- Filename of the g(z) file for the quasars RETURNS: OUTPUTS: STRCT= -- Structure summarizing the calculation OPTIONAL KEYWORDS: BINS= -- Redshift intervals, e.g. [ [1,2], [2,3]] /PEROUX -- Include DLAs in Peroux03 in the stats /DR3 -- Restrict the DLAs to DR3 OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 14-Nov-2006 Written by JXP (based on fig_omega)
(See SDSS/DLA/sdss_omgdla.pro)
NAME: sdss_proxgoz PURPOSE: Determines the g(z) path for each QSO in the inputted list. Restrict to the proximate DLAs CALLING SEQUENCE: sdss_proxgoz INPUTS: qalfil -- Filename of QSO structure for g(z) calculation XZFIL= -- Filename of the dX calculation as a function of z. RETURNS: OUTPUTS: OUTFIL= -- Filename for g(z) FITS file OPTIONAL KEYWORDS: ORIG_ZEM= -- Use the original redshifs from SDSS (in this file) SNRLMT= -- SNR limit for DLA search [default: 4] OPTIONAL OUTPUTS: /CHK -- Plot g(z) to the screen COMMENTS: EXAMPLES: sdss_proxgoz, 'sdss_dr3_QAL.fits', 'dr3_proxdlagz_s2n4.fits' PROCEDURES CALLED: REVISION HISTORY: 27-Feb-2004 Written by SHF 14-Oct-2004 Modified by JXP
(See SDSS/DLA/sdss_proxgoz.pro)
NAME: sdss_qsoflux PURPOSE: Measure the QSO fluxes for the QAL structure and fill up the appropriate tag. Uses SDSS photometry CALLING SEQUENCE: sdss_qsoflux, qalfil INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 04-Jan-2005 Written by JXP
(See SDSS/General/sdss_qsoflux.pro)
NAME: sdss_qsolin Version 1.0 PURPOSE: Fits a continuum to SDSS QSO spectroscopic data interactively using a PCA as a guess for the Lya and CIV emission lines. The code then automoatically searches for absorption line features redward of Lya. CALLING SEQUENCE: sdss_qsolin, sdss_list INPUTS: sdss_list -- List of QSOs to analyze RETURNS: OUTPUTS: One FITS file per QSO which contains the continuum and a list of absorption lines detected OPTIONAL KEYWORDS: LSNR= -- Statistical significance for an absorption line feature [default: 3.5] /NOPLOT -- Do not plot to screen /REDO -- Redo the search even if the file exists /NOCOMPRESS -- Do not gzip suprress the output OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: parse_sdss, fil sdss_qsolin, 'dr1_fit.lst', OUTDIR='ABSLIN/', /noplt sdss_qsolin, 'dr3_fit.list', OUTDIR='ABSLIN/', /noplt PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 09-Sep-2003 Written by JXP
(See SDSS/General/sdss_qsolin.pro)
NAME: sdss_qsostrct Version 1.1 PURPOSE: Routine to quickly grab the SDSS QSO structure CALLING SEQUENCE: sdss_objinf, names, SUMMF=, /PLOT, DATDIR=, $ FILNM=, CHKDF=, PATH=, ZEM=,$ RMAG=, RA=, DEC=, /SILENT, /NMRAD INPUTS: names -- List of filenames or 2-element array giving plate and fiber RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: qso = sdss_qsostrct() PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 15-Mar-2010 Written by JXP
(See SDSS/General/sdss_qsostrct.pro)
NAME: sdss_qsotempl PURPOSE: Extrapoles a continuum for a SDSS QSO in the Lya forest based on a template, a fit to the QSO slope and the known average absorption by the Lya forest. CALLING SEQUENCE: sdss_qsotempl INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: ORIG_ZEM = Use the original redshifs from SDSS (in this file) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 27-Feb-2005 Written by JO 14-Oct-2006 Modified by JXP
(See SDSS/General/sdss_qsotempl.pro)
NAME: sdss_queryimage PURPOSE to query SDSS image SYNTAX sdss_queryimage, ra, dec [, scale , xs=xs, ys=ys, /gridoff, /labeloff] INPUTS ra: right ascension (J2000 decimal degrees) dec: declination (J2000 decimal degrees) scale: plate scale (arcsec/pixel) [default to .3961] KEYWORDS filename: name of filt to be written to [default to temp.jpeg] xs: xsize (in pixels) [default to 512] ys: y size (in pixels) [default to 512] labeloff: if set leaves off label gridoff: if set leaves off Gid RETURNS: jpeg of the image OPTIONAL OUTPUTS FILENAME= writes a file to the filename given by the keyword NOTES by default gives you pretty picture of blue spiral galaxy (default SDSS image) with ra=18.87667, dec=-0.86083 Written by R. da Silva, UCSC, 3-11-09
(See SDSS/General/sdss_queryimage.pro)
NAME: sdss_repeats Version 1.1 PURPOSE: Identify repeats in DLA/MSDLA candidates in the the checked file (default: DR2) CALLING SEQUENCE: sdss_repeats, fil INPUTS: fil -- Name of checked file RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by SHF
(See SDSS/General/sdss_repeats.pro)
NAME: sdss_search Version 1.1 PURPOSE: Main program which drives the search for LLS, DLA and metal-line systems CALLING SEQUENCE: sdss_search, filename, outfil, ESIF=, SDSSSUM=, ZMIN=, $ RMAX=, SDSSPATH= INPUTS: filename -- ASCII file listing all SDSS quasars RETURNS: OUTPUTS: outfil -- Name of QAL file OPTIONAL KEYWORDS: ZMIN= -- Minimum redshift to search RMAX= -- Maximum magnitude to include [default: 21.] INIFIL= -- Name of QAL file (good to restart after a 'bomb') OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: flg = x_chkfil( lbls, count=count) sdss_search, 'Lists/dr3_abs.lst', 'sdss_DR3_QAL.fits', SDSSSUM='dr3_qso.fits' PROCEDURES/FUNCTIONS CALLED: sdss_dla sdss_metals REVISION HISTORY: 07-May-2002 Written by JXP
(See SDSS/DLA/sdss_search.pro)
NAME: sdss_searchlls PURPOSE: Search for LLS in the SDSS QSO distribution CALLING SEQUENCE: INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 2005 Written by JO + JXP
(See SDSS/LLS/sdss_searchlls.pro)
NAME: sdss_sllsstat PURPOSE: Given a LLS struct and gz list, determine the indices of those LLS satisfying the statistical sample. CALLING SEQUENCE: sdss_llsstat INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: Nov-2004 Written by JXP
(See SDSS/LLS/sdss_sllsstat.pro)
NAME: sdss_uniqdla Version 1.1 PURPOSE: Finds those entires unique in data set 2 CALLING SEQUENCE: sdss_uniqdla, data1, data2, uni INPUTS: data1 -- DLA structure data2 -- DLA structure RETURNS: uni -- Unique index in data2 OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: sdss_uniqdla, dr1, dr2, uni PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 11-Nov-2004 Written by JXP
(See SDSS/DLA/sdss_uniqdla.pro)
NAME: sdss_wave Version 1.1 PURPOSE: Create a wavelength array for SDSS data CALLING SEQUENCE: sdss_wave, wave, pxiels=, iwave= INPUTS: RETURNS: wave -- Wavelength array OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by SHF
(See SDSS/General/sdss_wave.pro)
NAME: skyspec_paranal PURPOSE: Return the sky spectrum at Paranal CALLING SEQUENCE: skyflux = skyspec_paranal(loglam, [ disp= ] ) INPUTS: loglam - Log10 of wavelengths [vacuum Ang]; need not be uniformly spaced OPTIONAL INPUTS: disp - Sigma of the intrumental response (dispersion) in units of the LOGLAM pixels, either as a scalar, or as a vector with the same number of elements as LOGLAM. If not set, then the returned sky spectrum is at the resolution of the Paranal data files, and will be undersampled for any resolution worse than about 100,000. OUTPUTS: skyflux - Sky spectrum in units of e-17 erg/s/cm^2/Ang/asec^2 OPTIONAL OUTPUTS: COMMENTS: The lowest sky level is on plate 1292/52736 taken at airmass=1.04. A representative low sky level is plate 406/51817. A high sky level is plate 298/51955. EXAMPLES: BUGS: The Paranal sky spectra are missing data from 8550-8610 Ang. There are a few regions where their spectra are not in agreement with the lower-resolution SDSS sky spectra such as at 7600-7650 Ang, probably because the SDSS spectra "correct up" the sky level for the telluric absorption. Also, the Paranal sky is higher than SDSS by about a factor of 2 blueward of 4800 Ang. DATA FILES: $IDLSPEC2D_DIR/templates/fluxed_sky_346.fits $IDLSPEC2D_DIR/templates/fluxed_sky_580L.fits $IDLSPEC2D_DIR/templates/fluxed_sky_860L.fits $IDLSPEC2D_DIR/templates/fluxed_sky_437.fits $IDLSPEC2D_DIR/templates/fluxed_sky_580U.fits $IDLSPEC2D_DIR/templates/fluxed_sky_860U.fits $IDLSPEC2D_DIR/templates/fluxed_sky_564U.fits $IDLSPEC2D_DIR/templates/fluxed_sky_800U.fits PROCEDURES CALLED: djs_maskinterp() mrdfits() populate_image sxpar() REVISION HISTORY: 20-Mar-2006 Written by D. Schlegel, LBL 17-Mar-2008 Bastardized by JXP for Lick
(See Lick/Kast/Calibs/skyspec_lick.pro)
NAME: specobjstrct__define Version 1.1 PURPOSE: This routine creates a structure to describe the spectrum for an object in a given slit CALLING SEQUENCE: tmp = {specobjstrct} INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by JXP
(See Spec/Slits//specobjstrct__define.pro)
NAME: stdstruct__define Version 1.1 PURPOSE: Structure to handle observations of Standard stars CALLING SEQUENCE: tmp = {stdstruct} INPUTS: RETURNS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Aug-2001 Written by JXP
(See IMG/Photometry//stdstruct__define.pro)
NAME: strctcldy__define V1.1 PURPOSE: Named IDL Structure for Cloudy output CALLING SEQUENCE: tmp = {strctcldy} REVISION HISTORY: 31-May-2001 Written by JXP
(See Cloudy//strctcldy__define.pro)
NAME: STRINGIFY PURPOSE: This function converts a real value into a string based on the specified format. CATEGORY: Formatting. CALLING SEQUENCE: Result = STRINGIFY( Value, Format) INPUTS: Value Value which is to be converted. OPTIONAL INPUTS: Format Optional format statement OUTPUTS: This function returns a string version of the input array with leading and trailing spaces removed. RESTRICTIONS: None EXAMPLE: 1) format a number into a string: label = "X=" + stringify(x) 1) format a number into a string, with formatting: label = "X=" + stringify(x,'(f15.3)') AUTHOR: Gregory D. Wirth, W. M. Keck Observatory MODIFICATION HISTORY: 1999-Dec-14 GDW Original version
(See Keck/LRIS/General/x_readmhdufits.pro)
NAME: synthspec PURPOSE: Construct synthetic spectrum from eigen-templates. Stolen from the SDSS codes. CALLING SEQUENCE: synflux = synthspec(zans, [ loglam=, hdr=, eigendir= ]) INPUTS: zans - Structure(s) with redshift-fit information (from SPREDUCE1D). OPTIONAL KEYWORDS: loglam - Log-10 wavelengths at which to synthesize the spectrum; this can either be a single vector if all spectra have the same wavelength mapping, or an array of [NPIX,NOBJ]. hdr - If specified, then use this header to construct LOGLAM. Either LOGLAM or HDR must be specified. eigendir - Directory for EIGENFILE; default to $IDLSPEC2D/templates. OUTPUTS: synflux - Synthetic spectra COMMENTS: The sub-pixel shifts are applied with the COMBINE1FIBER procedure. EXAMPLES: BUGS: DATA FILES: $IDLSPEC2D_DIR/etc/TEMPLATEFILES PROCEDURES CALLED: combine1fiber concat_dir() poly_array() readfits() sxpar() REVISION HISTORY: 20-Aug-2000 Written by D. Schlegel, Princeton
(See Spec/Analysis//x_synthspec.pro)
NAME: tracestrct__define Version 1.1 PURPOSE: This routine defines the trace structure Not in use CALLING SEQUENCE: tmp = {tracestrct} INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by JXP
(See Spec/Rectify//tracestrct__define.pro)
NAME: velpltstrct__define Version 1.1 PURPOSE: Structure that is useful for velocity plots CALLING SEQUENCE: tmp = {velpltstrct} INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by JXP
(See Spec/Lines//velpltstrct__define.pro)
NAME: voigtq Version 1.0 PURPOSE: Creates a quick Voigt profile using code written by SB. Not recommended for usage CALLING SEQUENCE: INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Feb-2002 Written by JXP
(See Spec/Voigt//voigtq.pro)
NAME: voigtwal PURPOSE: Calculate a single voigt profile, given wavelength, absorber, and an array of lines. I recommend x_voigt CALLING SEQUENCE: tau = voigtwal(wave,abs,lines) INPUTS: wave - Array of wavelengths to realize voigt profile abs - single absorber lines - line(s) structure to compute voigt profile, if mutliple, the entire list will be looped through. OUTPUTS: tau - Optical depth at each wavelength OPTIONAL OUTPUTS: COMMENTS: Line is a structure with: ** Structure <81a5f94>, 4 tags, length=24, refs=3: ION STRING 'H I' WAVE DOUBLE 1215.6701 F FLOAT 0.416400 GAMMA FLOAT 6.26500e+08 Abs must have at least : ** Structure ABS, 10 tags, length=44: N FLOAT 15.0000 log 10 Column density B FLOAT 5.00000 velocity dispersion (km/s) Z FLOAT 2.00000 redshift EXAMPLES: BUGS: PROCEDURES CALLED: REVISION HISTORY: 25-May-2000 Created by S. Burles, FNAL/IAP
(See Spec/Voigt//voigtwal.pro)
NAME: vpparse Version 1.1 PURPOSE: given a vpstrct, creates a fort.13 input file for vpfit CALLING SEQUENCE: mkvpin, vpstr, FIL= INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by GEP
(See Spec/Voigt//g_mkvpin.pro)
NAME: vpparse Version 1.1 PURPOSE: parses a vpfit fort.26 output file and puts data into a structure of type 'vpstrct' which holds the relavent data. CALLING SEQUENCE: vpparse, vpfil, VPSTR=vpstr INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by GEP
(See Spec/Voigt//g_vpparse.pro)
NAME: vpstrct__define Version 1.1 PURPOSE: creates structure to contain data from a vpfit fort.26 output file, including flux file names, region start/stop, abs. lines, N, Nerr, etc. For the lines, has both string and double representations of the data, so information on 'tied' or 'locked' lines is not lost. CALLING SEQUENCE: tmp = {vpstrct} INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: Limits total number of regions to 500, total number of lines to 1000 EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written by GEP
(See Spec/Voigt//vpstrct__define.pro)
NAME: writecol Version 1.1 PURPOSE: Prints a series of arrays to a file in ASCII format CALLING SEQUENCE: writecol, filename, v1, v2, FMT='' INPUTS: file - Name of the ASCII file v1 - Vector 1 v2 - Vector 2 [v3-v19] - Vectors 3-14 RETURNS: OUTPUTS: Prints v1, v2 to screen OPTIONAL KEYWORDS: FMT - FORTRAN formatting FILNUM - File number (as opposed to file) OPTIONAL OUTPUTS: COMMENTS: The program keys off the number of elements in v1 EXAMPLES: writecol, 'arrays.dat', array1, array2 PROCEDURES CALLED: REVISION HISTORY: 17-June-2001 Written by JXP
(See General//writecol.pro)
NAME: write_dimgstr Version 1.1 PURPOSE: Write a dimg_struct (direct image) to an ASCII file and/or FITS file CALLING SEQUENCE: write_dimgstr, struct, ANONLY=anonly, OUTFIL=outfil, FITS=fits INPUTS: struct - A dimg_struct RETURNS: OUTPUTS: OUTFIL - Output file for ASCII [default is image.list] OPTIONAL KEYWORDS: /ANONLY - Only print files with flg_anly NE 0 FITS= - Fits file output for the structure OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: write_dimgstr, nght1_strct PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 18-July-2001 Written by JXP 29-Dec-2001 Added fits option
(See IMG/General//write_dimgstr.pro)
NAME: x1dfit Version 1.3 PURPOSE: GUI for fitting a function to a set of x,y data. This program does far too much! Warning: This was one of my first GUIs. It works pretty well, but is a bit old. CALLING SEQUENCE: fit = x1dfit([xdat],ydat,func=,nord=, /inter, xsize=, ysize=) INPUTS: xdat - Values along one dimension [optional] ydat - Values along the other RETURNS: fit - Values at each xdat OUTPUTS: OPTIONAL KEYWORDS: func - String for Fitting function (POLY, LEGEND, BSPLINE, GAUSS, CHEBY) nord - Order of the fit /inter - Interactive fitting xsize - Draw window xsize (pixels) ysize - Draw window ysize (pixels) sig - Errors in the points reg - Regions of data to fit LSIG - Lower SIGMA HSIG - High SIGMA /REJ - Turn rejection on DELPTS - Array of user-deleted points MSK - Array of 0,1 values [0=do not include] OPTIONAL OUTPUTS: bset - Bspline info rms - RMS of the fit (only valid for fits with rejection) COMMENTS: EXAMPLES: fit = x1dfit(x, y, 'POLY', nord=5, /inter) PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG BSPLINE GAUSS XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT GETCOLOR (coyote package) REVISION HISTORY: 22-June-2001 Written by JXP 28-June-2001 Added LEGENDRE fits (JXP) 23-Nov-2001 Added BSPLIN (SB), GAUSS, REJECTION (JXP) 31-Jan-2002 Added CHEBYSHEV
(See FIT//x1dfit.pro)
NAME: xcombine Version 1.2 PURPOSE: Combines a set of images with a variety of options. CALLING SEQUENCE: xcombine, img, comb, [header], FCOMB=, GAIN=, RN=, MASKS=, SCALE=, STATSEC=, MMEM=, SIGHI=, SIGLO=, MXITER=, OUTNM=, /SILENT, WEIGHT=, IMGINDX= INPUTS: img -- Array of image names RETURNS: OUTPUTS: comb -- Combined image OPTIONAL KEYWORDS: fcomb -- Binary keyword describing combine method 0,1 = Median, Avg 2 = SIG Rej 4 = Masks 8 = Weight mmem -- Maximum memory to use at any one time [default: Approx 200Mb] outnm -- File to write combined fits image gain -- Gain (required for SIGMEDCLIP) rn -- ReadNoise (required for SIGMEDCLIP) scale -- scale: Could be array of floats, 'MED', 'AVG', or Keyword statsec -- Section to perform stats on (for scale) imgindx -- Index number of image [default: 0L] siglo -- Lower sigma for rejection [default: 3.] sighi -- Upper sigma for rejection [default: 3.] OPTIONAL OUTPUTS: header -- Header of one of the files COMMENTS: EXAMPLES: xcombine, all_img, comb_img PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 18-Jul-2001 Written by JXP 28-Jul-2001 Added masks, sigma clipping 29-Jul-2001 Added scaling, median routines 07-Jan-2002 Fixed memory leak
(See IMG/Reduction//xcombine.pro)
NAME: xdimg_ar Version 1.1 PURPOSE: Reads in the first file in the directory with 'xdimg*fits' CALLING SEQUENCE: xdimg = xdimg_ar() INPUTS: RETURNS: xdimg - WFCCD structure OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg = xdimg_ar() PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 13-Nov-2001 Written by JXP
(See IMG/General//xdimg_ar.pro)
NAME: xdimg_badpix Version 1.1 PURPOSE: Creates a bad pixel mask given a structure which contains either a flat or dark image. CALLING SEQUENCE: xdimg_badpix, struct INPUTS: struct -- dimg_strct defining the images of interest RETURNS: OUTPUTS: OUTFIL - Name of bad pixel mask file [default is e.g. 'PixMask/BadPixMask_w.fits'] NOTE: the "w" indicates NIRC2 wide camera and the "n" indicates narrow camera. OPTIONAL KEYWORDS: OUTFIL - Name of bad pixel mask to be created, including directory. CCD - Name of the ccd for which a bad pixel mask should be made. ('NIRC2W' or 'NIRC2N') DEADPERCENT - percentage of saturation to be identified as a dead pixel in a well-exposed flat frame. (default is 10%) HOTPERCENT - percentage of saturation to be identified as a hot pixel in a dark frame. (default is 50%) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_badpix, nght1_strct PROCEDURES/FUNCTIONS CALLED: XDIMG_DELCODIV REVISION HISTORY: 11-June-2007 Written by LKP
(See IMG/Reduction//xdimg_badpix.pro)
NAME: xdimg_bias Version 1.1 PURPOSE: Creates Bias frame given direct image structure (which must contain a number of bias files!) CALLING SEQUENCE: xdimg_bias, struct, /SVOV, OUTFIL= INPUTS: struct -- dimg_strct defining the images of interest RETURNS: OUTPUTS: OUTFIL - Name of Bias file [default is 'Bias/Bias.fits'] OPTIONAL KEYWORDS: SVOV - Save ov files (default is to delete them) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_bias, nght1_strct PROCEDURES/FUNCTIONS CALLED: XDIMG_OVER XCOMBINE MWRFITS XDIMG_DELOV REVISION HISTORY: 26-July-2001 Written by JXP
(See IMG/Reduction//xdimg_bias.pro)
NAME: xdimg_dark Version 1.1 PURPOSE: Creates super dark frame given direct image structure. CALLING SEQUENCE: xdimg_dark, struct INPUTS: struct -- dimg_strct defining the images of interest RETURNS: OUTPUTS: OUTFIL - Name of Dark file [default is e.g. 'Darks/Dark_n10.000_1_3_8.fits'] The 10.000 is the exposure time, the "n" indicates the narrow camera, the "1_3_8" means coadds=1, sampmode=3, multisam=8. OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_dark, nght1_strct PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 11-June-2007 Written by LKP
(See IMG/Reduction//xdimg_dark.pro)
NAME: xdimg_darksub Version 1.1 PURPOSE: Dark subtracts an image. CALLING SEQUENCE: xdimg_darksub, struct, imgarr, /SVSTRCT INPUTS: struct -- dimg_strct defining the images of interest imgarr -- integer array defining the images to be process RETURNS: OUTPUTS: imgarr - fits files in the dir Coadd_divided OPTIONAL KEYWORDS: /svstrct -- Save the updated structure. OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_dividecoadds, nght1_strct, imgarr PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 11-June-2007 Written by LKP
(See IMG/Reduction//xdimg_darksub.pro)
NAME: xdimg_deldrksub Version 1.1 PURPOSE: Delete a set of dark subtracted images. CALLING SEQUENCE: xdimg_deldrksub, strct, delimg INPUTS: strct -- Direct image structure delimg -- Indices of direct images RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 14-June-2007 Written by LKP
(See IMG/General//xdimg_deldrksub.pro)
NAME: xdimg_delov Version 1.1 PURPOSE: Delete a set of OV images CALLING SEQUENCE: xdimg_delov, strct, delimg INPUTS: strct -- Direct image structure delimg -- Indices of direct images RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 13-Nov-2001 Written by JXP
(See IMG/General//xdimg_delov.pro)
NAME: xdimg_dflat Version 1.1 PURPOSE: Creates dome flats given the direct image structure (assuming there are dome flats in the structure) CALLING SEQUENCE: xdimg_dflat, struct, /IR, /SVOV, /SVDRKSUB, BPM=, OUTROOT=, /ALLOUT INPUTS: struct -- dimg_strct defining the images of interest RETURNS: OUTPUTS: flats - fits files in the dir Flats; 1 per filter OPTIONAL KEYWORDS: /SVOV - save ov files OUTROOT - Root name of Dome flats (default is 'Flats/DFlat') /ALLOUT - Output unnormalized frame too BPM - Name of the bad pixel mask to apply, including directory name. OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_dflat, nght1_strct PROCEDURES/FUNCTIONS CALLED: XDIMG_OVER XCOMBINE MWRFITS XDIMG_DELOV XDIMG_DELCODIV XDIMG_DELDRKSUB X_FILTERS REVISION HISTORY: 18-July-2001 Written by JXP 24-Apr-2002 Allow for non-linearity 14-June-2007 Updated by LKP to allow for making flats for IR data
(See IMG/Reduction//xdimg_dflat.pro)
NAME: xdimg_finddark Version 1.1 PURPOSE: Finds the superdark file associated with the requested images. Updates the structure with the flg_drk and img_drk keywords. CALLING SEQUENCE: xdimg_finddark, struct, imgarr INPUTS: struct -- dimg_strct defining the images of interest RETURNS: OUTPUTS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_finddark, struct, imgarr PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 21-June-2007 Written by LKP
(See IMG/Reduction//xdimg_finddark.pro)
NAME: xdimg_nonlinear Version 1.0 PURPOSE: Performs non-linear correction on a ccd image. Only setup for SITe3 at this point. CALLING SEQUENCE: newimg = xdimg_nonlinear(img, ccd) INPUTS: img - image ccd - (SITe3) RETURNS: newimg - Corrected image OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: newimg = xdimg_nonlinear(img, 'SITe3') PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 24-Apr-2002 Written by JXP
(See IMG/Reduction//xdimg_nonlinear.pro)
NAME: xdimg_objmsk Version 1.0 PURPOSE: Builds a sky mask for each input image using xmkmask, an IDL gui built for this procedure.  Calls routine xoverscan extensively. CALLING SEQUENCE: xdimg_over, struct, imgs, ORDR=, /ERASE, /INTER, /NOSV INPUTS: struct -- dimg_strct defining the images of interest imgs -- integer array defining the images to process RETURNS: OUTPUTS: ovimg - fits files in the dir OV OPTIONAL KEYWORDS: /erase - Erase pre-existing ov files /inter - Interactive OV fitting (uses x1dfit) /nosv -- Dont save the OV image! ORDR= -- Order to fit the overscan OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_over, nght1_strct, ovimg PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 22-July-2001 Written by JXP
(See IMG/Reduction//xdimg_over.pro)
NAME: xdimg_photcal Version 1.1 PURPOSE: Drives the program x_intphotcal which allows the user to interactively create photometric solutions. CALLING SEQUENCE: xdimg_photcal, struct, LNDTFIL=, SETAM=, XSIZE=, YSIZE=, MIN_NOBS= MIN_MOBS=, SETAM=, OUTROOT=, MAGROOT=, /NCLR INPUTS: struct -- dimg_strct defining the images of interest. This program focuses on the STD frames only. RETURNS: OUTPUTS: OPTIONAL KEYWORDS: LNDTFIL = Filename of landolt fits file [default: $XIDL_DIR/IMG/Photometry/Lists/nlandolt.fits ] SETAM = AM terms (one per filter: UBVRI) MIN_MOBS = Minimum number of nights observed by Landolt (default=2) MIN_NOBS = Minimum number of observations by Landolt (default=4) XSIZE= - Size of gui in screen x-pixels (default = 1000) YSIZE= - Size of gui in screen y-pixels (default = 600) OUTROOT - Root name of Twilight flats (default is 'Photo/soln_') OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_photcal, dimg PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Aug-2001 Written by JXP
(See IMG/Photometry//xdimg_photcal.pro)
NAME: xdimg_proc Version 1.1 PURPOSE: Processes a set of images (OV, TRIM, FLAT) CALLING SEQUENCE: xdimg_proc, struct, img, flat, OUTPTH=, /IR, /INTER, /SVOV, /SVCODIV, /SVDRKSUB, /GAIN, /SILENT, MSK=, BPM=, FILEOUT= INPUTS: struct -- dimg_strct defining the images of interest img -- intarr of images to process flatnm -- Flat root to use (e.g. 'Flats/SkyFltN') RETURNS: OUTPUTS: Processed image (e.g. Final/f_ccd001.fits) OPTIONAL KEYWORDS: OUTPTH = Output directory (default = 'Final/') /INTER = Interactive OV fitting /SVOV = Delete ov files when through /SVCODIV = Delete coadd divided files when through /SVDRKSUB = Delete dark subtracted files when through MSK = Default name for mask file /GAIN = Multiply by the gain BPM = Name of bad pixel mask file to apply to image. (including directory) OPTIONAL OUTPUTS: FILEOUT = Name of output file which has the names of the reduced images. Useful for call to stacking procedure.
(See IMG/Reduction//xdimg_proc.pro)
NAME: xdimg_skyflt Version 1.1 PURPOSE: Creates Super-sky flat given the image list structure. The routine first OV subtracts (or dark subtracts, for IR images) each image as necessary. It then calls xdimg_skymask to create masks for each of the images (unless the /NOMSK keyword is set). It then calls xcombine which: (1) scales each image by the median calculated for the OV (or dark subtracted) image (2) does a median combine with 3sigma/2.5sigma (low/high) clipping. CALLING SEQUENCE: xdimg_skyflt, struct, MMEM=, /NOMSK, /INTER, /IR, CCD='NIRC2W' INPUTS: struct -- dimg_strct defining the images of interest RETURNS: OUTPUTS: skyflt - fits files; 1 per filter (and per CCD, if CCD option is given) OPTIONAL KEYWORDS: MMEM - Max memory to use with this routine (default = 200M) NOMSK - Don't create new masks OUTROOT - Root name of Sky flats (default is 'Flats/SkyFlt') INTER - Interactive OV subtraction OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_skyflt, nght1_strct PROCEDURES/FUNCTIONS CALLED: XDIMG_OVER XCOMBINE MWRFITS XDIMG_DELOV XDIMG_DELDRKSUB X_FILTERS XDIMG_SKYMASK REVISION HISTORY: 26-July-2001 Written by JXP 24-Apr-2002 Added nonlinearity correction 25-Jun-2007 LKP added ability to use with IR, NIRC2 images
(See IMG/Reduction//xdimg_skyflt.pro)
NAME: xdimg_skymsk Version 1.1 PURPOSE: Builds a sky mask for each input image using xmkmask, an IDL gui built for this procedure. CALLING SEQUENCE: xdimg_skymask, struct, objimg, /ERASE, /DOOV, XSIZE=, YSIZE= INPUTS: struct -- dimg_strct defining the images of interest objimg -- integer array defining the images to mask RETURNS: OUTPUTS: skymasks -- Builds sky masks and puts them into 'Masks/Sky/' OPTIONAL KEYWORDS: erase - Erase pre-existing sky masks first doov - Make OV files as necessary OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_skymsk, nght1_strct, objimg PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 26-July-2001 Written by JXP
(See IMG/Reduction//xdimg_skymsk.pro)
NAME: xdimg_starid Version 1.1 PURPOSE: Helps identify standard stars in a field by driving the program x_starid which is an interactive, GUI program. CALLING SEQUENCE: xdimg_starid, struct, LST_PATH=, INDX= INPUTS: struct -- dimg_strct defining the images of interest. This program focuses on the STD frames only. RETURNS: OUTPUTS: OPTIONAL KEYWORDS: LST_PATH - Path name for Lists (default: Take x_starid default) OUT_PATH - Output name for id files (default: 'Photo/') OPTIONAL OUTPUTS: INDX -- Subset of indices for standards to fit INORIENT -- Choose a number in the range [-4,4] to change the orientation of standards plotted on the image. COMMENTS: EXAMPLES: xdimg_starid, strct PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Aug-2001 Written by JXP 08-Jan-2002 Added paths (JXP) 14-Oct-2002 Added indx (JXP)
(See IMG/Photometry//xdimg_starid.pro)
NAME: xdimg_stdmag Version 1.1 PURPOSE: Does aperture photometry on the objects in the std_* lists. Drives the program x_aper CALLING SEQUENCE: xdimg_stdmag, struct, SKYR=, STRROOT=, OUTROOT= INPUTS: struct -- dimg_strct defining the images of interest. This program focuses on the STD frames only. RETURNS: OUTPUTS: OPTIONAL KEYWORDS: SKYR = 2 float array describing sky annulus in arcsec (default=15,30) STRROOT= Path for standard stars [default: 'Photo/std_'] OUTROOT= Path for output of magnitudes [default: 'Photo/mag_'] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_stdmag, dimg PROCEDURES/FUNCTIONS CALLED: X_APER X_CCDINF REVISION HISTORY: 07-Aug-2001 Written by JXP
(See IMG/Photometry//xdimg_stdmag.pro)
NAME: xdimg_strct Version 1.2 PURPOSE: Creates and outputs a structure for a series of direct images. This is a key routine in organizing a night of imaging data. CALLING SEQUENCE: xdimg_strct, struct, ccd, tel, LIST=, /MKDIR, /NOFILE INPUTS: CCD - CCD/INSTRUMENT; Options: Tek5, LRISR, SITe1, SITe3, NIRC2 tel - Telescope; Options: (Keck, LCO-40, LCO-100) RETURNS: OUTPUTS: struct - Creates an IDL structure for direct images + an ASCII file summarizing the structure + a FITS file saving the IDL structure OPTIONAL KEYWORDS: LIST - Image list [default is Raw/*.fits] /NOFILE - Do not create the ASCII file /MKDIR - Create a set of directories which facilitate the rest of the reduction process (e.g. Flats/ Bias/ Photo/) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_strct, nght1_strct, 'Tek5', /MKDIR PROCEDURES/FUNCTIONS CALLED: MRDFITS SXPAR X_SETJDATE MWRFITS WRITE_DIMGSTR REVISION HISTORY: 18-July-2001 Written by JXP 22-Aug-2001 Allows for LRISR 24-Dec-2001 LRISR modifications 14-June-2007 LKP updated to allow for NIRC2 data
(See IMG/General//xdimg_strct.pro)
NAME: xdimg_twiflt Version 1.1 PURPOSE: Creates twilight flats given the image list structure (assuming twilight flats were taken!) CALLING SEQUENCE: xdimg_twiflt, struct, /SVOV, OUTROOT= INPUTS: struct -- 'distruct' defining the images of interest RETURNS: OUTPUTS: twiflats - fits files; 1 per filter OPTIONAL KEYWORDS: SVOV - Save ov files OUTROOT - Root name of Twilight flats (default is 'Flats/TwiFlat') OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_twiflt, nght1_strct PROCEDURES/FUNCTIONS CALLED: XDIMG_OVER XCOMBINE MWRFITS XDIMG_DELOV X_FILTERS REVISION HISTORY: 26-July-2001 Written by JXP 24-Apr-2002 Added nonlinearity correction
(See IMG/Reduction//xdimg_twiflt.pro)
NAME: xdimg_updstr Version 1.1 PURPOSE: Looks around for OV and other images and resets the appropriate flags. CALLING SEQUENCE: xdimg_updstr, strct, /REDOMED INPUTS: strct -- Direct Image strcure DISTRUCT RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xdimg_updstr, struct PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Aug-2001 Written by JXP
(See IMG/General//xdimg_updstr.pro)
NAME: xgetx_plt Version 1.1 PURPOSE: Returns the x-value corresponding to the x-pixel on a GUI. Requires pos, xymnx or the appropriate Structure. CALLING SEQUENCE: xval = xgetx_plt(xtmp, pos, xymnx, size, /STRCT) INPUTS: xtmp -- x-pixel value pos -- Fraction of plot window covered by plot (2 element array) xymnx -- x-y limits of plot window (4 element array: x0,y0,x1,y1) RETURNS: xval -- OUTPUTS: OPTIONAL KEYWORDS: /STRCT -- xtmp contains a structure with the relevant tags OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: uniq = x_uniqstr( lbls, count=count) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Nov-2001 Written by JXP
(See General//xgetx_plt.pro)
NAME: xgetx_plt Version 1.1 PURPOSE: Returns the x-pixel value corresponding to the x-value. Requires pos, xymnx or the appropriate Structure. CALLING SEQUENCE: xpix = xgetx_plt(xtmp, pos, xymnx, size, /STRCT) INPUTS: xtmp -- x-pixel value pos -- Fraction of plot window covered by plot (2 element array) xymnx -- x-y limits of plot window (4 element array: x0,y0,x1,y1) RETURNS: xpix -- OUTPUTS: OPTIONAL KEYWORDS: /STRCT -- xtmp contains a structure with the relevant tags OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Nov-2001 Written by JXP
(See General//xgetxpix_plt.pro)
NAME: xgetx_plt Version 1.1 PURPOSE: Returns the y-value corresponding to the y-pixel on a GUI. Requires pos, xymnx or the appropriate Structure. CALLING SEQUENCE: yval = xgety_plt(ytmp, pos, xymnx, size, /STRCT) INPUTS: ytmp -- y-pixel value pos -- Fraction of plot window covered by plot (2 element array) xymnx -- x-y limits of plot window (4 element array: x0,y0,x1,y1) RETURNS: yval -- OUTPUTS: OPTIONAL KEYWORDS: /STRCT -- ytmp contains a structure with the relevant tags OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: uniq = x_uniqstr( lbls, count=count) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Nov-2001 Written by JXP
(See General//xgety_plt.pro)
NAME: xgety_plt Version 1.1 PURPOSE: Returns the y-pixel corresponding to the y-value on a GUI. Requires pos, xymnx or the appropriate Structure. CALLING SEQUENCE: yval = xgety_plt(ytmp, pos, xymnx, size, /STRCT) INPUTS: ytmp -- y-pixel value pos -- Fraction of plot window covered by plot (2 element array) xymnx -- x-y limits of plot window (4 element array: x0,y0,x1,y1) RETURNS: yval -- OUTPUTS: OPTIONAL KEYWORDS: /STRCT -- ytmp contains a structure with the relevant tags OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: uniq = x_uniqstr( lbls, count=count) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Nov-2001 Written by JXP
(See General//xgetypix_plt.pro)
NAME: xheadfits Version 1.1 PURPOSE: Uses headfits to read the header of a fits file. The only advantage of xheadfits is that the file can be compressed and yet the filename may be named without the gz extension. CALLING SEQUENCE: head = xheadfits(fil, _EXTRA) INPUTS: fil -- FITS Filename RETURNS: head -- Header OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: head = xheadfits('spec.fits') PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Sep-2002 Written by JXP
(See General//xheadfits.pro)
NAME: xmkmask Version 1.1 PURPOSE: Allows the user to interactively choose pixels to mask in an image. The resulting images are saved as gzipped fits images. CALLING SEQUENCE: xmkmask, img, IMSK=, OUTDIR=, XSIZE=, YSIZE=, /SKYMSK INPUTS: img - Image(s) for Masking RETURNS: OUTPUTS: mask - Creates a fits table of pixel values to mask OPTIONAL KEYWORDS: outdir - Output directory: Default = './Masks/' IMSK - Initial mask to include; Convenient for dealing with bad columns and the like in the CCD XSIZE - Size of gui in screen x-pixels (default = 700) YSIZE - Size of gui in screen y-pixels (default = 700) SKYMSK - Create sky mask (default into Masks/Sky/) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xmkmask,'OV/ccd001.fits' PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 11-July-2001 Written by JXP
(See IMG/Reduction//xmkmask.pro)
NAME: xmrdfits Version 1.1 PURPOSE: Uses mrdfits to read the header of a fits file. The only advantage of xheadfits is that the file can be compressed and yet the filename may be named without the gz extension. CALLING SEQUENCE: dat = xmrdfits(fil, [extension, header], _EXTRA) INPUTS: fil -- FITS Filename [extension] -- Extension of the data array RETURNS: dat - Data array OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: header -- Header of the FITS extension COMMENTS: EXAMPLES: dat = xmrdfits('spec.fits') PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Sep-2002 Written by JXP
(See General//xmrdfits.pro)
NAME: xoffset Version 1.1 PURPOSE: Calculates integer offsets between a series of images. The program uses Sextractor to find objects in the image and then uses a brute force algorithm to find the integer offset. CALLING SEQUENCE: xoffset, imglist, INSTR= INPUTS: imglist - List of images RETURNS: OUTPUTS: offsets - ASCII file with offsets OPTIONAL KEYWORDS: INSTR - Instrument keyword OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xoffset, 'offR.list', INSTR='SITe3' PROCEDURES CALLED: REVISION HISTORY: 26-Apr-2001 Written by JXP
(See IMG/Reduction//xoffset.pro)
NAME: xoverscan Version 1.2 PURPOSE: Subtracts an overscan region from an image CALLING SEQUENCE: xoverscan, img, ccd, [medov], OVSEC=, OVROOT=, /INTER, /ERASE OVIMG=, /NOFITS, /SILENT, /MEDONLY, /COMPRESS, TRIMSEC= INPUTS: img - Raw fits file ccd - CCD name (Tek5, SITe1, LRISR, LRISb, GEN, WFTek5, SITe3) RETURNS: OUTPUTS: nwimg - Writes overscan subtracted image to OV directory with an ov_ prefix (default) OPTIONAL KEYWORDS: func - String defining function to fit with (POLY is default) ordr - Order of the function ovsec - String defining overscan section ovroot - String for OV root ('OV/' is the default) erase - Erase pre-existing ov files NOFITS - Suppress output to fits file MEDONLY - Useful in updating distruct /COMPRESS - Spawn gzip on the output image TRIMSEC - Image region to trim to OPTIONAL OUTPUTS: medov - Median of each OV image OVIMG - Float array of OV image COMMENTS: EXAMPLES: xoverscan, 'ccd001.fits', 'Tek5' PROCEDURES CALLED: xregtovec djs_median x1dfit REVISION HISTORY: 20-June-2001 Written by JXP 05-Dec-2001 Added OVIMG option
(See IMG/Reduction//xoverscan.pro)
NAME: xpix_circ Version 1.1 PURPOSE: Finds all pixels within a circle on an image. CALLING SEQUENCE: pval = xpix_circ(x0, y0, radius, /NOZERO, MAXX=, MAXY=, COUNT=) INPUTS: x0 -- Circle x position y0 -- Circle y position radius -- Radius of the circle RETURNS: pval -- pixels in the circle: array[2,npt] OUTPUTS: OPTIONAL KEYWORDS: /NOZERO -- Disallow value of 0 (minimum is 1 instead) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Sep-2002 Written by JXP
(See General//xpix_circ.pro)
NAME: xpix_line Version 1.1 PURPOSE: Finds all pixels within a ray (or line) of specified width. CALLING SEQUENCE: pval = xpix_line(x0, y0, x1, y1, wid, xmax, ymax, /NOZERO, COUNT=) INPUTS: x0 -- x position of one point on the ray y0 -- y position of one point on the ray x1 -- x position of one point on the ray y1 -- y position of one point on the ray wid -- Width of the line RETURNS: pval -- pixels in the circle: array[2,npt] OUTPUTS: OPTIONAL KEYWORDS: /NOZERO -- Disallow value of 0 (minimum is 1 instead) COUNT= -- Number of the pixels in the ray OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Sep-2002 Written by JXP
(See General//xpix_line.pro)
NAME: xregtovec Version 1.1 PURPOSE: Converts a string region into a vector for an image CALLING SEQUENCE: vect = xregtovec(sreg, size) INPUTS: string - String defining the region (e.g. '[1:10,*]') size - Size of the image RETURNS: vect - Integer vector defining the region in sreg OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: area = xregtovec('[1:10,*]',size(img)) PROCEDURES CALLED: REVISION HISTORY: 21-June-2001 Written by JXP
(See IMG/Reduction//xregtovec.pro)
NAME: xsp1dstrct__define Version 1.0 PURPOSE: This routine defines the structure for individual object spectra CALLING SEQUENCE: tmp = {xsp1dstrct} INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 02-Aug-2002 Written by JXP
(See Spec/Analysis//contistrct__define.pro)
NAME: xsp1dstrct__define Version 1.0 PURPOSE: This routine defines the structure for individual object spectra CALLING SEQUENCE: tmp = {xsp1dstrct} INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 02-Aug-2002 Written by JXP
(See Spec/Analysis//xsp1dstrct__define.pro)
NAME: XSPLINE -- Copied version of the RSI program PURPOSE: This function performs cubic spline interpolation. CATEGORY: Interpolation - E1. CALLING SEQUENCE: Result = SPLINE(X, Y, T [, Sigma]) INPUTS: X: The abcissa vector. Values MUST be monotonically increasing. Y: The vector of ordinate values corresponding to X. T: The vector of abcissae values for which the ordinate is desired. The values of T MUST be monotonically increasing. OPTIONAL INPUT PARAMETERS: Sigma: The amount of "tension" that is applied to the curve. The default value is 1.0. If sigma is close to 0, (e.g., .01), then effectively there is a cubic spline fit. If sigma is large, (e.g., greater than 10), then the fit will be like a polynomial interpolation. OUTPUTS: SPLINE returns a vector of interpolated ordinates. Result(i) = value of the function at T(i). RESTRICTIONS: Abcissa values must be monotonically increasing. EXAMPLE: The commands below show a typical use of SPLINE: X = [2.,3.,4.] ;X values of original function Y = (X-3)^2 ;Make a quadratic T = FINDGEN(20)/10.+2 ;Values for interpolated points. ;twenty values from 2 to 3.9. Z = SPLINE(X,Y,T) ;Do the interpolation. MODIFICATION HISTORY: Author: Walter W. Jones, Naval Research Laboratory, Sept 26, 1976. Reviewer: Sidney Prahl, Texas Instruments. Adapted for IDL: DMS, Research Systems, March, 1983.
(See General//xspline.pro)
NAME: x_abtoflam PURPOSE: Converts AB mag to flambda (given a wavelength) CALLING SEQUENCE: INPUTS: AB -- AB magnitude WAVE -- Wavelength (Angstroms) RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 24-Jan-2008 Written by JXP
(See General//x_abtoflam.pro)
NAME: x_addimg Version 1.1 PURPOSE: Combines a set of images. I think this routine is entirely superseded by xcombine. CALLING SEQUENCE: x_addimg, img, comb, var, SCALE=, WEIGHT=, IMGINDX=, VARINDX= INPUTS: RETURNS: OUTPUTS: comb -- Combined image OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_addimg, all_img, comb_img PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 10-Dec-2002 Written by JXP
(See IMG/Reduction//x_addimg.pro)
NAME: x_addnoise Version 1.1 PURPOSE: Simple routine to add noise to a normalized spectrum. CALLING SEQUENCE: newf = x_addnoise(fx, snr, SEED=) INPUTS: fx - Flux array snr - Signal-to-noise per pixel of the data RETURNS: newfx - Flux array with noise OUTPUTS: OPTIONAL KEYWORDS: SEED= -- Seed for random number generator [Default: -1322] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: newfx = x_addnoise(fx, 15.) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 04-Nov-2002 Written by JXP
(See Spec/Analysis//x_addnoise.pro)
NAME: x_addtwoflats Version 1.1 PURPOSE: Combines two flats, rejecting Cosmic Rays. This routine is used extensively in the WFCCD routines. CALLING SEQUENCE: flat = x_addtwoflats, img1, img2, VAR=, GAIN=, RN= INPUTS: img1 - OV subtracted img1 (data or fits) img2 - OV subtracted img2 (data or fits) RETURNS: OUTPUTS: flat - Combined flat with CR rejected OPTIONAL KEYWORDS: GAIN - gain RN - Read noise (for the VAR output only) OPTIONAL OUTPUTS: VAR - Variance image COMMENTS: EXAMPLES: flat = x_addtwoflats(img1, img2) PROCEDURES CALLED: REVISION HISTORY: 17-Jan-2002 Written by JXP
(See IMG/Reduction//x_addtwoflats.pro)
NAME: x_alav Version 1.0 PURPOSE: Report A_lambda/A(V) given lambda for a user specific extinction law. Default is the Cardelli 1989 paramaterization of the MW. The 'laws' are contained in .dat files in XIDL_DIR/Dust CALLING SEQUENCE: dat = x_alav(lambda, RV=, /SMC, /CALZ) INPUTS: lambda -- Wavelengths to evaluate A at (angstroms) RETURNS: OUTPUTS: OPTIONAL KEYWORDS: RV= -- Value of R_V /SMC -- Use the SMC law /CALZ -- Use the Calzetti law OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 2006 Written by JXP
(See Dust//x_alav.pro)
NAME: x_allvelo PURPOSE: Create an array of velocity arrays for a string of transitions CALLING SEQUENCE: all_velo = x_allvelo(wave, zabs, wrest, vmnx, ALL_PMNX=, NPIX=) INPUTS: wave -- Wavelength array zabs -- Redshift of absorption system wrest -- Array of rest wavelengths vmnx -- 2-element array of velocities RETURNS: all_velo -- Velocity array (one per rest wavelength) OUTPUTS: OPTIONAL KEYWORDS: NPIX -- Number of pixels in the array OPTIONAL OUTPUTS: ALL_PMNX= -- pixmin and pixmax array COMMENTS: EXAMPLES: all_velo = x_allvelo(wave, zabs, wrest, vmnx, ALL_PMNX=) PROCEDURES CALLED: REVISION HISTORY: 24-Oct-2002 Written by JXP
(See Spec/General//x_allvelo.pro)
NAME: x_allvoigt Version 1.1 PURPOSE: Calculate a single voigt profile, given wavelength, absorber, and an array of lines. Warning: This program is not exact! CALLING SEQUENCE: tau = x_allvoigt(wave,lines, SIGMA=, MNDV=) INPUTS: wave - Array of wavelengths to realize voigt profile lines - Line(s) structure to compute voigt profile, if mutliple, the entire list will be looped through. RETURNS: tau - Optical depth at each wavelength OPTIONAL INPUTS: SIGMA= - Resolution of instrument in pixels MNDV= - Range in velocity to calculate Voigt over [defalut: 1000 km/s] OUTPUTS: OPTIONAL OUTPUTS: COMMENTS: Line is a structure with: ** Structure <81a5f94>, 4 tags, length=24, refs=3: ION STRING 'H I' WAVE DOUBLE 1215.6701 F FLOAT 0.416400 GAMMA FLOAT 6.26500e+08 Abs must have at least : ** Structure ABS, 10 tags, length=44: N FLOAT 15.0000 log 10 Column density B FLOAT 5.00000 velocity dispersion (km/s) Z FLOAT 2.00000 redshift EXAMPLES: BUGS: ; PROCEDURES CALLED: REVISION HISTORY: 25-May-2000 Created by S. Burles, FNAL/IAP Modified by JXP
(See Spec/Voigt//x_allvoigt.pro)
NAME: x_apall Version 1.1 PURPOSE: Performs an aperture extraction on a 2D image. Much like IRAFs apall routine. CALLING SEQUENCE: spec = x_apall( img, OVR=, CLINE=, APER=, $ SKYFUNC=, SKYNORD=, SKYREG=, $ /DISPLAY, /NOREJ, TRACE=, /NOOV, $ /NOSKY=, STRCT=, RN=, GAIN=, VAR=, $ /CRUDE, TINTER=, ERROR=, /SILENT ) INPUTS: img -- 2D spectrum RETURNS: OUTPUTS: OPTIONAL KEYWORDS: /DISPLAY - Display the sky subtracted image with xatv OVR= - String array for ov region: '[2050:2100, *]' VAR= - Variance image RN= - Read noise [default: 5.] GAIN= - Gain [default: 1.] /CRUDE - Use trace_crude to trace the object /TINTER - Fit the trace interactively /NOSKY - Do not sky subtract SKYFUNC= - Function to use to fit the sky [default: POLY] SKYNORD= - Order for sky fit [default: 1] SKYREG= - Region to fit the sky /NOREJ - Do not do rejection when fitting the sky CLINE= - Line to identify object in [default: sz[0]/2] APER= - Aperture to extract [default: determine interactively] /NOOV - Do not perform OV subtraction /ROT - Transpose the data (code expects data parallel to rows) OPTIONAL OUTPUTS: ERROR= - Sigma array (or is it variance?) STRCT= - Structure defining the various extraction parameters. Useful for performing wavelength subtraction TRACE= - Output trace COMMENTS: EXAMPLES: spec = x_apall('spec.fits', STRCT=strct) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 19-Nov-2001 Written by JXP 05-Dec-2001 Modularized most of the routine
(See Spec/Extraction//x_apall.pro)
NAME: X_APER PURPOSE: Compute concentric aperture photometry (adapted from DAOPHOT) EXPLANATION: APER can compute photometry in several user-specified aperture radii. A separate sky value is computed for each source using specified inner and outer sky radii. CALLING SEQUENCE: APER, image, xc, yc, [ mags, errap, sky, skyerr, phpadu, apr, skyrad, badpix, /NAN, /EXACT, /FLUX, /MED_SKY, PRINT = , /SILENT, SETSKYVAL = ] INPUTS: IMAGE - input image array XC - vector of x coordinates. YC - vector of y coordinates OPTIONAL INPUTS: PHPADU - Photons per Analog Digital Units, numeric scalar. Converts the data numbers in IMAGE to photon units. (APER assumes Poisson statistics.) APR - Vector of up to 12 REAL photometry aperture radii. SKYRAD - Two element vector giving the inner and outer radii to be used for the sky annulus. Ignored if the SETSKYVAL keyword is set. BADPIX - Two element vector giving the minimum and maximum value of a good pixel. If badpix is not supplied or if BADPIX[0] is equal to BADPIX[1] then it is assumed that there are no bad pixels. Note that fluxes will not be computed for any star with a bad pixel within the aperture area, but that bad pixels will be simply ignored for the sky computation. The BADPIX parameter is ignored if the /NAN keyword is set. OPTIONAL KEYWORD INPUTS: /EXACT - By default, APER counts subpixels, but uses a polygon approximation for the intersection of a circular aperture with a square pixel (and normalize the total area of the sum of the pixels to exactly match the circular area). If the /EXACT keyword, then the intersection of the circular aperture with a square pixel is computed exactly. The /EXACT keyword is much slower and is only needed when small (~2 pixels) apertures are used with very undersampled data. /FLUX - By default, APER uses a magnitude system where a magnitude of 25 corresponds to 1 flux unit. If set, then APER will keep results in flux units instead of magnitudes. /NAN - If set then APER will check for NAN values in the image. /NAN takes precedence over the BADPIX parameter. Note that fluxes will not be computed for any star with a NAN pixel within the aperture area, but that NAN pixels will be simply ignored for the sky computation. PRINT - if set and non-zero then APER will also write its results to a file aper.prt. One can specify the output file name by setting PRINT = 'filename'. READNOISE - Scalar giving the read noise (or minimum noise for any pixel. This value is passed to the procedure mmm.pro when computing the sky, and is only need for images where the noise is low, and pixel values are quantized. /SILENT - If supplied and non-zero then no output is displayed to the terminal. SETSKYVAL - Use this keyword to force the sky to a specified value rather than have APER compute a sky value. SETSKYVAL can either be a scalar specifying the sky value to use for all sources, or a 3 element vector specifying the sky value, the sigma of the sky value, and the number of elements used to compute a sky value. The 3 element form of SETSKYVAL is needed for accurate error budgeting. /MED_SKY - Instead of using MMM to calculate sky value, just take a simple median. Does nothing if SETSKYVAL is set. OUTPUTS: MAGS - NAPER by NSTAR array giving the magnitude for each star in each aperture. (NAPER is the number of apertures, and NSTAR is the number of stars). If the /FLUX keyword is not set, then a flux of 1 digital unit is assigned a zero point magnitude of 25. ERRAP - NAPER by NSTAR array giving error for each star. If a magnitude could not be determined then ERRAP = 9.99 (if in magnitudes) or ERRAP = !VALUES.F_NAN (if /FLUX is set). SKY - NSTAR element vector giving sky value for each star in flux units SKYERR - NSTAR element vector giving error in sky values EXAMPLE: Determine the flux and error for photometry radii of 3 and 5 pixels surrounding the position 234.2,344.3 on an image array, im. Compute the partial pixel area exactly. Assume that the flux units are in Poisson counts, so that PHPADU = 1, and the sky value is already known to be 1.3, and that the range [-32767,80000] for bad low and bad high pixels IDL> aper, im, 234.2, 344.3, flux, eflux, sky,skyerr, 1, [3,5], -1, $ [-32767,80000],/exact, /flux, setsky = 1.3 PROCEDURES USED: GETOPT, MMM, PIXWT(), STRN(), STRNUMBER() NOTES: Reasons that a valid magnitude cannot be computed include the following: (1) Star position is too close (within 0.5 pixels) to edge of the frame (2) Less than 20 valid pixels available for computing sky (3) Modal value of sky could not be computed by the procedure MMM (4) *Any* pixel within the aperture radius is a "bad" pixel (5) The total computed flux is negative APER was modified in June 2000 in two ways: (1) the /EXACT keyword was added (2) the approximation of the intersection of a circular aperture with square pixels was improved (i.e. when /EXACT is not used) REVISON HISTORY: Adapted to IDL from DAOPHOT June, 1989 B. Pfarr, STX Adapted for IDL Version 2, J. Isensee, July, 1990 Code, documentation spiffed up W. Landsman August 1991 TEXTOUT may be a string W. Landsman September 1995 FLUX keyword added J. E. Hollis, February, 1996 SETSKYVAL keyword, increase maxsky W. Landsman, May 1997 Work for more than 32767 stars W. Landsman, August 1997 Don't abort for insufficient sky pixels W. Landsman May 2000 Added /EXACT keyword W. Landsman June 2000 Allow SETSKYVAL = 0 W. Landsman December 2000 Set BADPIX[0] = BADPIX[1] to ignore bad pixels W. L. January 2001 Fix chk_badpixel problem introduced Jan 01 C. Ishida/W.L. February 2001 Set bad fluxes and error to NAN if /FLUX is set W. Landsman Oct. 2001 Remove restrictions on maximum sky radius W. Landsman July 2003 Added /NAN keyword W. Landsman November 2004 Set badflux=0 if neither /NAN nor badpix is set M. Perrin December 2004 Added READNOISE keyword W. Landsman January 2005 LKP added MED_SKY keyword Oct 2007
(See IMG/Photometry//x_aper.pro)
NAME: x_arcimage Version 1.0 PURPOSE: Creates an arcimage given a tracestructure. This code has been superseded by x_mkaimg. CALLING SEQUENCE: arcimg = x_arcimage( trcstrct, arcfit, sz_img ) INPUTS: trcstrct - Trace structure (contains all of the info on the position and value of various arc lines) arcfit - Template fit structure ; Includes fit instructions sz_img - Size of output image [lines] - Line list strurcture (Usually defined) RETURNS: arcimg OUTPUTS: OPTIONAL KEYWORDS: YSTRT - Row defining the arcfit [default = middle] LINELIST - Arc line list (in lieu of lines) NSIG - Sig of RMS from the fit that line must match OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: arcimg = x_arcimage( trcstrct, arcfit, imgsz) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 18-Feb-2002 Written by JXP
(See Spec/Arcs//x_arcimage.pro)
NAME: x_arclist Version 1.1 PURPOSE: Reads a line list into an arclin strutcture CALLING SEQUENCE: x_arclist, linelist, lines, /GDONLY INPUTS: linelist - Name of line list (formatted: D, I, A) RETURNS: arclinstr - Arc line structure OUTPUTS: OPTIONAL KEYWORDS: /GDONLY -- Restrict the line list to those where flg_qual NE 0 OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_arclist, linelist, lines PROCEDURES/FUNCTIONS CALLED: arclinstrct__define readcol REVISION HISTORY: 14-Feb-2002 Written by JXP
(See Spec/Arcs//x_arclist.pro)
NAME: x_arcpeakup Version 1.1 PURPOSE: Finds the fit iteratively to a set of lines given the Arc spectrum and a line list. This code has been superseded by x_arctempl. CALLING SEQUENCE: x_arcpeakup, spec, lines, FFIT=, WV=, NFRST=, NFIN=, /INTER, SIG= INPUTS: spec - Input arc spectrum lines - Arc line list structure RETURNS: OUTPUTS: OPTIONAL KEYWORDS: NFRST= -- Order of fit for the first try [default: 3L] NFIN= -- Order of fit for the final fit MXOFF= -- Maximum pixel offset between a line and its expected position SIG= -- Lower and upper sigma values for fitting OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_arcpeakup, spec, lines, guessfit PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 26-Aug-2002 Written by JXP
(See Spec/Arcs//x_arcpeakup.pro)
NAME: x_autoid Version 1.0 PURPOSE: Given a 1D arc-line spectrum from the WFCCD or ESI-LowD, this code will automatically determine the wavelength solution. CALLING SEQUENCE: x_autoid, img, [extrct], instr=, IDLIST=, GUESS=, LINELIST=, TOLER= INPUTS: img - Input arc image or spectrum [extrct] - Slit edges (default to image edges) RETURNS: OUTPUTS: FITSTR - Fit structure; Set values prior to passing for OPTIONAL KEYWORDS: CPROG - Run the monte-carlo in the c program (advised) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_autoid, img, instr='WFCCDB' PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 12-Feb-2002 Written by JXP
(See Spec/Arcs//x_autoid.pro)
NAME: x_autophot PURPOSE: Compute concentric aperture photometry (adapted from DAOPHOT) I have adopted this from the Goddard routines EXPLANATION: APER can compute photometry in several user-specified aperture radii. A separate sky value is computed for each source using specified inner and outer sky radii. CALLING SEQUENCE: APER, image, xc, yc, [ mags, errap, sky, skyerr, phpadu, apr, skyrad, badpix, /EXACT, /FLUX, PRINT = , /SILENT, SETSKYVAL = ] INPUTS: IMAGE - input image array XC - vector of x coordinates. YC - vector of y coordinates OPTIONAL INPUTS: PHPADU - Photons per Analog Digital Units, numeric scalar. Converts the data numbers in IMAGE to photon units. (APER assumes Poisson statistics.) APR - Vector of up to 12 REAL photometry aperture radii. SKYRAD - Two element vector giving the inner and outer radii to be used for the sky annulus BADPIX - Two element vector giving the minimum and maximum value of a good pix (Default [-32765,32767]). If BADPIX[0] is equal to BADPIX[1] then it is assumed that there are no bad pixels. OPTIONAL KEYWORD INPUTS: /EXACT - By default, APER counts subpixels, but uses a polygon approximation for the intersection of a circular aperture with a square pixel (and normalize the total area of the sum of the pixels to exactly match the circular area). If the /EXACT keyword, then the intersection of the circular aperture with a square pixel is computed exactly. The /EXACT keyword is much slower and is only needed when small (~2 pixels) apertures are used with very undersampled data. /FLUX - By default, APER uses a magnitude system where a magnitude of 25 corresponds to 1 flux unit. If set, then APER will keep results in flux units instead of magnitudes. PRINT - if set and non-zero then APER will also write its results to a file aper.prt. One can specify the output file name by setting PRINT = 'filename'. /SILENT - If supplied and non-zero then no output is displayed to the terminal. SETSKYVAL - Use this keyword to force the sky to a specified value rather than have APER compute a sky value. SETSKYVAL can either be a scalar specifying the sky value to use for all sources, or a 3 element vector specifying the sky value, the sigma of the sky value, and the number of elements used to compute a sky value. The 3 element form of SETSKYVAL is needed for accurate error budgeting. OUTPUTS: MAGS - NAPER by NSTAR array giving the magnitude for each star in each aperture. (NAPER is the number of apertures, and NSTAR is the number of stars). A flux of 1 digital unit is assigned a zero point magnitude of 25. ERRAP - NAPER by NSTAR array giving error in magnitude for each star. If a magnitude could not be deter- mined then ERRAP = 9.99. SKY - NSTAR element vector giving sky value for each star SKYERR - NSTAR element vector giving error in sky values PROCEDURES USED: DATATYPE(), GETOPT, MMM, PIXWT(), STRN(), STRNUMBER() NOTES: Reasons that a valid magnitude cannot be computed include the following: (1) Star position is too close (within 0.5 pixels) to edge of the frame (2) Less than 20 valid pixels available for computing sky (3) Modal value of sky could not be computed by the procedure MMM (4) *Any* pixel within the aperture radius is a "bad" pixel APER was modified in June 2000 in two ways: (1) the /EXACT keyword was added (2) the approximation of the intersection of a circular aperture with square pixels was improved (i.e. when /EXACT is not used) REVISON HISTORY: Adapted to IDL from DAOPHOT June, 1989 B. Pfarr, STX Adapted for IDL Version 2, J. Isensee, July, 1990 Code, documentation spiffed up W. Landsman August 1991 TEXTOUT may be a string W. Landsman September 1995 FLUX keyword added J. E. Hollis, February, 1996 SETSKYVAL keyword, increase maxsky W. Landsman, May 1997 Work for more than 32767 stars W. Landsman, August 1997 Converted to IDL V5.0 W. Landsman September 1997 Don't abort for insufficient sky pixels W. Landsman May 2000 Added /EXACT keyword W. Landsman June 2000 Allow SETSKYVAL = 0 W. Landsman December 2000 Set BADPIX[0] = BADPIX[1] to ignore bad pixels W. L. January 2001 Fix chk_badpixel problem introduced Jan 01 C. Ishida/W.L. February 2001
(See IMG/Photometry//x_autophot.pro)
NAME: x_avsigclip PURPOSE: Average multiple images with sigma-rejection. This routine makes extensive use of Schlegels avsigclip routine. CALLING SEQUENCE: result = x_avsigclip( array, [ dimension, siglo=, sighi=, maxiter=, $ inmask=, outmask= ] ) INPUTS: array - N-dimensional array OPTIONAL INPUTS: dimension - The dimension over which to collapse the data. If ommitted, assume that the last dimension is the one to collapse. siglo - Low Sigma for rejection; default to 3.0. sighi - High Sigma for rejection; default to 3.0. maxiter - Maximum number of sigma rejection iterations. One iteration does no sigma rejection; default to 10 iterations. inmask - Input mask, setting =0 for good elements OUTPUTS: result - The output array. outmask - Output mask, setting =0 for good elements, =1 for bad. Any pixels masked in INMASK are also masked in OUTMASK. OPTIONAL OUTPUTS: COMMENTS: The DIMENSION input is analogous to that used by the IDL built-in function TOTAL. EXAMPLES: Create a data cube of 10 random-valued 100x200 images. At each pixel in the image, compute the average of the 10 values, but rejecting 3-sigma outliers: > array = randomu(123,100,200,10) > ave = x_avsigclip(array, siglo=3., sighi=4.) If all points are masked in any given vector or array, a mean and dispersion are computed for all the points. Is this the behaviour we want? If you want to replace those values with zeros instead, look at OUTMASK: > array = randomu(123,100,200) > inmask = bytarr(100,200) > inmask[*,8] = 1 ; mask all of row #8 > ave = x_avsigclip(array, 1, inmask=inmask, outmask=outmask) > ibad = where( total(1-outmask, 1) EQ 0) > if (ibad[0] NE -1) then ave[ibad] = 0 ; zero-out bad rows BUGS: PROCEDURES CALLED: Dynamic link to arravsigclip.c REVISION HISTORY: 07-Jul-1999 Written by David Schlegel, Princeton. 28-Jul-2001 Revised by JXP (Added lo/hi sigrej)
(See IMG/Reduction//x_avsigclip.pro)
NAME: x_calc2dfit Version 1.1 PURPOSE: Calculates a 2d fit-function at a set of xy pairs. Restricted to a 2D polynomial for now. CALLING SEQUENCE: fit = x_calc2dfit(xyval, func, ffit, nx, ny, NRM=, FITSTR=) INPUTS: xyval - 2D array [npix, 2] of the x,y values [func] - String for Fitting function (POLY) [ffit] - Output from the fitting stuff [nx] - order of the 2d surface in x [ny] - order of the 2d surface in y RETURNS: fit - Values at each xyval [1D array] OUTPUTS: OPTIONAL KEYWORDS: FITSTR= -- IDL structure for 2D fitting (recommended) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: fit = x_calc2dfit(xy, 'POLY', ffit, 3, 3) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 31-Jan-2002 Written by JXP
(See FIT//x_calc2dfit.pro)
NAME: x_calccog Version 1.1 PURPOSE: Perform a COG solution given a list of flambda values, EW measurements and the errors in those measurements. The user inputs an array of column densities to search over and the code finds the minimum in chi^2 and returns the value. This code is currently only used to calculate the best b value for the lines for the given N values. See fuse_cog for a better COG routine. [JXP: 5/25/04] CALLING SEQUENCE: x_calccog, ew_red, sig_ew, flambda, Nval, blmt, FNDB= BANS=, /EXACT INPUTS: ew_red -- Reduced ew array sigew -- Error in ew flambda -- f lambda (assumes A not cm) Nval -- List of Nval to consider blmt -- Limits for b value search (assumes km/s) RETURNS: OUTPUTS: OPTIONAL KEYWORDS: /EXACT -- Calculate the COG exactly (otherwise use lookup table) /FNDB -- Find the b-value (only option now) OPTIONAL OUTPUTS: BANS= -- The b value which minimizes chi^2 COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: x_calccog_initcomm x_calccog_cog x_calccog_ftau REVISION HISTORY: 05-Mar-2002 Written by JXP
(See Spec/Analysis//x_calccog.pro)
NAME: x_calcew Version 1.1 PURPOSE: Calculates the EW given a wavelength and flux array and limits to integrate over. Can also calculate the error in the EW as well as the reduced values. CALLING SEQUENCE: ew = x_calcew(wav, fx, lmts, [sig, sigew], /REDUCED, FPIX=) INPUTS: wav - Rest wavelength [Angstromgs] fx - Flux (presumed normalized) lmts - Limits of integration (wavelength unless /FPIX is set) [sig] - Error in fx RETURNS: ew - Equivalent width OUTPUTS: OPTIONAL KEYWORDS: /REDUCED -- Divide EW value by lambda /FPIX -- If flagged, this indicates the lmts array contains the pixel endpoints for the EW calculation. OPTIONAL OUTPUTS: sigew - Error in ew COMMENTS: The flux array should be normalized to unity EXAMPLES: ew = x_calcew( fx, sig, [50, 100], ERR=sigew, /FPIX) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 05-Mar-2002 Written by JXP
(See Spec/Analysis//x_calcew.pro)
NAME: x_calcfit Version 1.2 PURPOSE: Calculates a fit-function at a set of x points CALLING SEQUENCE: fit = x_calcfit(xval,func,ffit, NORD=) INPUTS: xval - Value(s) along one dimension [func] - String for Fitting function (POLY, LEGEND, BSPLIN, GAUSS) [ffit] - Output from the fitting stuff RETURNS: fit - Values at each xval OUTPUTS: OPTIONAL KEYWORDS: nord= - Required for LEGEND FITSTR= - Fit structure (OVERRIDES input values of func, ffit) OPTIONAL OUTPUTS: NRM= - Normalization parameters (-1 to 1) COMMENTS: EXAMPLES: fit = x_calcfit(x, 'POLY', 5) PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG BSPLIN GAUSS REVISION HISTORY: 20-Nov-2001 Written by JXP 31-Jan-2002 Added NRM, CHEBY func, FITSTR
(See FIT//x_calcfit.pro)
NAME: x_calcgain Version 1.1 PURPOSE: Calculate the inverse gain, e-/DN with two very similiar input images For MIKE, milky flats or well illuminated flats are best. CALLING SEQUENCE: estimated_gain = x_gain(image1, image2) INPUTS: image1 - Any array of pixels with reasonable gaussian errors image2 - A very similar image to image1, but not identical! RETURNS: gain - A floating point number: the inverse gain OUTPUTS: OPTIONAL KEYWORDS: MINPIX -- Minimum number of pixels with DN>MINVAL in both images to perform statistics (Default: 1000) MINVAL -- Minimum flux to perform stats (default: 100) OPTIONAL OUTPUTS: COMMENTS: The gain is calculated from the variance of the natural logarithm of the ratio of two images which have units of ADU (Poisson counts / gain) <gain> = 1.0 / { variance [ sqrt(reduced_flux) * ln(i1/i2) ] } EXAMPLES: image1 = readfits('ov_mr0405.fits') image2 = readfits('ov_mr0406.fits') gain = x_calcgain(image1, image2) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 16-Jul-2003 Written by SMB 04-Apr-2005 Ported to XIDL by JXP
(See IMG/Reduction//x_calcgain.pro)
NAME: x_calclstar Version 1.1 PURPOSE: Calculate apparent magnitude for Lstar at a given redshift for a given cosmology and Hubbles constant. CALLING SEQUENCE: lstar = x_calclstar( z, H0=, AMIN=, /SILENT, OM=, OV=) INPUTS: z -- Redshift RETURNS: lstar -- Apparent magnitude for Lstar OUTPUTS: OPTIONAL KEYWORDS: lstr0 -- Assumed value of Lstar at z=0 [default: -21.06] H0 -- Hubbles constant (km/s/Mpc) OM -- Omega Dark Matter OV -- Lambda /SILENT -- No printing to the screen OPTIONAL OUTPUTS: AMIN -- Mpc per arcmin at z COMMENTS: EXAMPLES: lstar = x_calclstar(2., H0=75., AMIN=amin) PROCEDURES CALLED: REVISION HISTORY: 22-Nov-2003 Written by JXP
(See Cosm//x_calclstar.pro)
NAME: x_calctb Version 1.1 PURPOSE: Calculate the temperature of a gas given its Doppler parameter CALLING SEQUENCE: x_calctb, b, T, /LOGT, MA= INPUTS: b -- Doppler parameter (km/s) RETURNS: OUTPUTS: T -- Temperature (K) OPTIONAL KEYWORDS: /LOGT -- Return logarithmic temperature MA -- Mass of nucleus [1 for Hydrogen] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_calctb, 25., T, /LOGT PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 20-Dec-2001 Written by JXP
(See General//x_calctb.pro)
NAME: x_calctwilight Version 1.0 PURPOSE: Calculate twilight in LST given a lat+long+date CALLING SEQUENCE: INPUTS: date - String name of the date of the night of observing at the observatory (not UT) Allowed formats: DDmmmYY (e.g. 22Oct99) DD-MM-YY (e.g. 20-12-99) YYYY-MM-DD (e.g. 1999-12-20) DDMMMYYYY (e.g. 20JAN2004) obs_str - Observatory structure (long, latitute, time zone) RETURNS: twlight in LST (decimal hours) OUTPUTS: OPTIONAL KEYWORDS: stmid -- LST at midnight (end of the input date) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: x_calclst REVISION HISTORY: Based on code in skycalendar v5 written by John Thorstensen Dartmouth College 10-Dec-2009 Written by JXP
(See Obs//x_calctwilight.pro)
NAME: x_calibstd Version 1.1 PURPOSE: Given a standard star spectrum and a calibration file, calculate a sensitivity function parameterized by a BSLINE or some other function. CALLING SEQUENCE: x_calibstd, wave, flux, outfil, HSTFIL=, /CHKFIT, EXP=, BSPLIN=, SWV=, SFX=, GDWV=, BSET=, YFIT=, SENS=, EVERYN= INPUTS: wave -- Wavelength array of standard star flux -- Flux array of standard star RETURNS: OUTPUTS: outfil -- FITS file to write sensitivity function OPTIONAL KEYWORDS: EXP= -- Exposure time [default: 1.] HSTFIL= -- HST calibration file /CHKFIT -- Plot the fit to the sensitivity function EVERYN= -- Spacing of b-spline breakpoints in pixel space [default: 5] OPTIONAL OUTPUTS: SWV= -- Wavelength array of calibration data SFX= -- Flux array of calibration data SENS= -- Sensitivity function COMMENTS: EXAMPLES: x_calibstd, kast, 0, 1, 0 PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 29-Aug-2003 Written by JXP
(See Spec/Flux//x_calibstd.pro)
NAME: x_ccdinf Version 1.0 PURPOSE: Returns arcpix and orientation of ccd+tel combination. This routine saves all of that key info in one spot, although it is primarily used only for direct imaging. CALLING SEQUENCE: x_ccdinf, ccd, tel, arcpix, [orient], SAT= INPUTS: ccd - Name of CCD ('SITe1', 'LRISR', 'WFTek5') tel - Name of Telescope ('LCO-40', 'Keck', 'LCO-100') RETURNS: arcpix -- Arcsec per pixel OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: orient - Orientation of the CCD: ; -2 = SITe1 on LCO-40 (E up, N left) SAT= -- Saturation limit of the CCD COMMENTS: EXAMPLES: x_ccdinf, 'SITe1', 'LCO-40', arcpix, SAT=sat PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Aug-2001 Written by JXP
(See IMG/General//x_ccdinf.pro)
NAME: x_centerpk Version 1.1 PURPOSE: Finds the center of a peak CALLING SEQUENCE: center = x_centerpk(xdat, ydat, [fracpk], VAR=, FUNC=, NORD=, HSIG=, LSIG=, IPX=, MINVAL=, FFIT=, /INTER) INPUTS: xdat - x Values ydat - y Values [fracpk] - Fraction of peak relative to the minimum (default=1/3 max + min) RETURNS: center - center of the peak OUTPUTS: ffit - Fit parameters OPTIONAL KEYWORDS: func - Function VAR - variance in ydat nord - order number HSIG - upper sigma LSIG - lower sigma IPX - Allows user to give best guess INTER - Interative fit OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: center = x_centerpk(xdat, ydat, /inter) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 23-Nov-2001 Written by JXP
(See Spec/General//x_centerpk.pro)
NAME: x_centfwgt Version 1.1 PURPOSE: Given a 'peak', this routine will find the center of that peak in a using flux weighting. CALLING SEQUENCE: xcen = x_centfwgt(xval, yval, [radius]) INPUTS: xval - x values of the peak yval - y values of the peak [RADIUS] - radius of data around the peak for centroiding RETURNS: xcen - Center OUTPUTS: OPTIONAL KEYWORDS: /SILENT -- Turn off warnings OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: trace_fweight REVISION HISTORY: 22-Jun-2005 Written by JXP
(See FIT//x_centfwgt.pro)
NAME: x_centfwgt Version 1.1 PURPOSE: Given a 'peak', this routine will find the center of that peak in a using flux weighting. CALLING SEQUENCE: xcen = x_centfwgt(xval, yval, [radius]) INPUTS: xval - x values of the peak yval - y values of the peak [RADIUS] - radius of data around the peak for centroiding RETURNS: xcen - Center OUTPUTS: OPTIONAL KEYWORDS: /SILENT -- Turn off warnings OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: trace_fweight REVISION HISTORY: 22-Jun-2005 Written by JXP
(See FIT//x_centgauss.pro)
NAME: x_centspln Version 1.1 PURPOSE: Given a 'peak', this routine will find the center of that peak in a non-parameteric manner. The routine first spliens the peak. It then steps in from both sides until it hits FRACPK of the peak value of the line. Finally, the centroid is the midpoint of these two spots. CALLING SEQUENCE: xcen = x_centspln(xval, yval, [fracpk]) INPUTS: xval - x values of the peak yval - y values of the peak [FRACPK] - Fraction of the peak for centroiding [default=0.3333] RETURNS: xcen - Center OUTPUTS: OPTIONAL KEYWORDS: /SILENT -- Turn off warnings /FORCE -- Calculate a centroid even if the edges are non-sensical OPTIONAL OUTPUTS: EDGES= -- Values of the spots on the peak corresponding to FRACPK COMMENTS: EXAMPLES: xcen = x_centspln(data) PROCEDURES/FUNCTIONS CALLED: x_fndspln x_golden REVISION HISTORY: 07-Feb-2002 Written by JXP
(See FIT//x_centspln.pro)
NAME: x_chgbw Version 1.1 PURPOSE: Sets colors to black and white CALLING SEQUENCE: x_chgbw INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_chgbw PROCEDURES CALLED: getcolor REVISION HISTORY: 19-Dec-2001 Written by JXP
(See General//x_chgbw.pro)
NAME: x_chkfil Version 1.1 PURPOSE: Check for a file and return the number of entries matching CALLING SEQUENCE: flag = x_chkfil(fil, COUNT=, /SILENT) INPUTS: fil - Filename RETURNS: flag - 0: No file; 1: One file; 2: More than one OUTPUTS: OPTIONAL KEYWORDS: /SILENT -- Suppress messages to screen OPTIONAL OUTPUTS: COUNT - number of unique strings COMMENTS: EXAMPLES: flg = x_chkfil('junk.dat', count=cnt, /SILENT) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-May-2002 Written by JXP
(See General//x_chkfil.pro)
NAME: x_chkwindow Version 1.1 PURPOSE: Check to see if a window is open CALLING SEQUENCE: x_chkwindow, win_id, get_all_active= INPUTS: win_id RETURNS: dat - Byt array describing open windows OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: HEAD - Header COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 03-Jan-2005 Written by JXP
(See General//x_chkwindow.pro)
NAME: x_combspec Version 1.2 PURPOSE: Combines multiple exposures of the same slit CALLING SEQUENCE: x_combspec, flux, var, fflux, fvar, NRMFLUX=, WAVE=, NSIG=, SCALE=, SNR= INPUTS: flux -- 2D flux array var -- 2D variance array RETURNS: fflux -- Combined flux array fvar -- Combined variance array OUTPUTS: OPTIONAL KEYWORDS: NRMFLUX - Array of 2 elements (wave min,max) to normalize flux WAVE= -- Wavelength array for normalizing WVMNX= -- Wavelength region for normalizing NSIG= -- Number of sigma to reject on SCALE= -- Scale the flux arrays by this array SNR= -- Signal-to-noise ratios to weight by SKY= -- Array containing the sky level OPTIONAL OUTPUTS: FSKY= -- Combined sky spectrum FNOVAR= -- Variance without object noise COMMENTS: EXAMPLES: x_combspec, flux, var, fflux, fvar PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 28-May-2002 Written by JXP 03-Sep-2002 Added SCALE keyword + weighted means for 2 exposures 25-Aug-2004 Modified x_combspec_two to scale both spectra and to combine if one spectra has zero flux (Kathy Cooksey) 27-Dec-2006 Added novar functionality to combine variances which do not include object noise (Joe Hennawi).
(See Spec/Extraction//x_combspec.pro)
NAME: x_constants Version 1.1 PURPOSE: Return a structure of the usual physical constants. Default is cgs units. CALLING SEQUENCE: cstr = x_constants(/KSG) INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: /KSG -- Return mks units OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: cstr = x_constants() PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-May-2002 Written by JXP
(See General//x_constants.pro)
NAME: x_continuum Version 1.1 PURPOSE: GUI used to fit the continuum of a spectrum (usually quasars). The user can dictate a SPLINE or perform a minimum chi^2 fit to regions with rejection. CALLING SEQUENCE: x_continuum, flux_fil, error_fil, FITSTR=, CONTI=, LSIG=, XSIZE=, YSIZE=, INFLG=, OUTFIL=, /SPLINE, INISPL= INPUTS: flux_fil - Values along one dimension [optional] error_fil - Values along the other RETURNS: OUTPUTS: OUTFIL= -- Name of FITS file to save continuum OPTIONAL KEYWORDS: CONTI= -- Name of FITS file containing previously saved continuum INFLG -- 0 = yin, ysin as data arrays (fits allowed and expected) 1 = One fits file (flux, sig) 2 = One fits file (flux, sig, wave) 3 = FUSE format 5 = SDSS file XSIZE= -- Window size in pixels YSIZE= -- Window size in pixels LSIG= -- Value for sigma rejection on low side [default: 2.5] INISPL= -- IDL file containing a saved SPLINE for the continuum FITSTR -- Fit structure OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_continuum, 'Q0000.fits', OUTFIL='Q0000_c.fits', /SPLINE PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG BSPLINE GAUSS XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT GETCOLOR (coyote package) ; REVISION HISTORY: 26-Feb-2002 Written by JXP
(See Spec/Analysis//x_continuum.pro)
NAME: x_convdeimosarc Version 1.0 PURPOSE: Simple program to convert the DEIMOS line list to my own format CALLING SEQUENCE: INPUTS: OPTIONAL KEYWORDS: OUTPUTS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY:
(See Spec/Arcs//x_convdeimosarc.pro)
NAME: x_crossarc Version 1.1 PURPOSE: Finds shift between saved template and current arc spectra. CALLING SEQUENCE: x_crossarc, guessarc, cur_aspec, guess_spec, guess_fit, ordrs, $ ordr_shift, row_shift, chk=chk, sigrej=sigrej, /DEBUG INPUTS: guessarc - Filename of IDL save file with known wavelength solution cur_aspec - Current extracted Arc spectra to be fit obj_id - Object identifier [side] - Blue (1), Red (2), or both [1,2L] (Default: [1,2L]) RETURNS: OUTPUTS: guess_spec - saved arc spectrum rebinned to match cur_aspec guess_fit - polynomial wavelength fits in rebinned space ordrs - Orders matching saved spectrum ordr_shift - Order offset between template and current row_shift - Pixel offset between template and current OPTIONAL KEYWORDS: /CHK - Manually check steps along the way /DEBUG - Debugging SIGREJ= - Rejection sigma for outliers in arc line fitting (default: 2.) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: restore fft() REVISION HISTORY: 2004 Written by SB
(See Spec/Arcs//x_crossarc.pro)
NAME: x_cumulative Version 1.1 PURPOSE: Calculates a histogram of sorts [defunct] CALLING SEQUENCE: INPUTS: Array, binsize or nbin RETURNS: cumulative array OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: XARR -- Value of xarray COMMENTS: EXAMPLES: cumul = x_cumulative(array, 0.05) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 12-Dec-2004 Written by JXP
(See General//x_cumulative.pro)
NAME: x_curvefill PURPOSE: Shade the region between two curves CALLING SEQUENCE: x_curvefill, x, y1, y2, COLOR=, OUTLINECOLOR=, OUTHICK= INPUTS: x -- x-values of the curve y1 -- lower set of y-values y2 -- upper set of y-values RETURNS: OUTPUTS: OPTIONAL KEYWORDS: color= -- Color for shading /LINE_FILL -- Hashes instead of fills ORIENTATION -- Sets the angle of the lines /xyreverse -- Lets you fill based on x rather than y ie: x->y, y1->x1, y2->x2 x2= -- Lets you input a second array specifying both x1 and x2. OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES CALLED: REVISION HISTORY: 18-May-2006 Written by Joe H. 7-Dec-2009 Modified by Marc R. (xyreverse and x2)
(See Color//x_curvefill.pro)
NAME: x_echcombspec Version 1.1 PURPOSE: Combines multiple exposures of the same obj Must be run even on an object with a single exposure CALLING SEQUENCE: x_echcombspec, allobj, finspec, ordrs, keyindx INPUTS: allobj -- Array of echspec structures ordrs -- Orders to coadd keyindx -- Exposure to serve as the fiducial for stats RETURNS: OUTPUTS: finspec -- echfspec structure containing the combined spectrum OPTIONAL KEYWORDS: /SILENT - No text output /NOFLUX - Use the fluxed array MINPIX1= - Minimum 'good' pixels to calculate fitting profile ORDNM= - Fitting profile order [default: 1] SNRMIN= - Minimum S/N per pixel for stats [Default: 2] REJSIG= - Parameter passsed to x_combine [default = 4.] MEDINDX= - Value for median smoothing [default: 100] /NOREJ - Do not search for and reject bad pixels (e.g. cosmic /ACHK - Force check of all orders OPTIONAL OUTPUTS: COMMENTS: ; EXAMPLES: hires_combspec, hires, setup, obj_id, side PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 04-Jan-2004 Written by JXP 10-Jun-2004 Revisited by GEP Sep-2005 Revisited by JXP
(See Spec/Analysis//x_echcombspec.pro)
NAME: x_echfitstd Version 1.3 PURPOSE: GUI for tweaking a sensitivity function for an Echelle spectrum CALLING SEQUENCE: fit = x_echfitstd([xdat],ydat,func=,nord=, /inter, xsize=, ysize=) INPUTS: xdat - Values along one dimension [optional] ydat - Values along the other RETURNS: fit - Values at each xdat OUTPUTS: OPTIONAL KEYWORDS: func - String for Fitting function (POLY, LEGEND, BSPLINE, GAUSS, CHEBY) nord - Order of the fit /inter - Interactive fitting xsize - Draw window xsize (pixels) ysize - Draw window ysize (pixels) sig - Errors in the points reg - Regions of data to fit LSIG - Lower SIGMA HSIG - High SIGMA /REJ - Turn rejection on DELPTS - Array of user-deleted points MSK - Array of 0,1 values [0=do not include] OPTIONAL OUTPUTS: bset - Bspline info rms - RMS of the fit (only valid for fits with rejection) COMMENTS: EXAMPLES: fit = x_echfitstd(x, y, 'POLY', nord=5, /inter) PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG BSPLINE GAUSS XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT GETCOLOR (coyote package) REVISION HISTORY: 22-June-2001 Written by JXP 28-June-2001 Added LEGENDRE fits (JXP) 23-Nov-2001 Added BSPLIN (SB), GAUSS, REJECTION (JXP) 31-Jan-2002 Added CHEBYSHEV
(See Spec/Flux//x_echfitstd.pro)
NAME: x_echtrcarc Version 1.1 PURPOSE: To trace the arc lines in each order (individually) and fit a straight line to each one. The following steps are taken: 1. Scattered light is removed from the image 2. All significant arc lines are identified (5 sigma) 3. trace_crude is used to trace the lines 4. trace_crude is reapplied to only those lines which are entirely in the order 5. xy2traceset is used to fit a straight line to each arc line 6. Only the good lines are saved for 2D fitting in a structure which is written to disk CALLING SEQUENCE: x_echtrcarc, arc_fil, ordr_str, out_fil, SZCCD=, $ INIO=, ALL_XSET=, /CLOBBER, $ QAFIL= INPUTS: arc_fil -- Name of arc file for tracing ordr_str -- Order strucure describing the echelle footprint out_fil -- Name of FITS file describing the traces RETURNS: OUTPUTS: OPTIONAL KEYWORDS: INIO - Initial order to trace (for debugging) /CLOBBER - Overwrite previous fits SZCCD -- Dimensions of the ccd OPTIONAL OUTPUTS: ALL_XSET -- A structure containing the info QAFIL -- Filename for QA output COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 28-Apr-2003 Written by SB
(See Spec/Arcs//x_echtrcarc.pro)
NAME: x_editspec Version 1.1 PURPOSE: Allows user to reset values of a spectrum to reject bad regions using a simple GUI CALLING SEQUENCE: x_editspec, wv, fx, var, [title], XSIZE=, YSIZE=, ISPEC=, /BLOCK, NEWVAR=, FLG=, NEWFLG= INPUTS wv -- Wavelength array (expected to be a 2D array [npix, nspec]) fx -- Flux array (expected to be a 2D array [npix, nspec]) var -- Variance array (expected to be a 2D array [npix, nspec]) [title] -- List of object ID numbers RETURNS: OUTPUTS: NEWVAR= -- Updated variance array which has bad pixels (regions) masked NEWFLG= -- Flag used to specify whether to analyse the spectrum OPTIONAL KEYWORDS: xsize - Draw window xsize (pixels) ysize - Draw window ysize (pixels) /BLOCK - Block the window OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_editspec PROCEDURES/FUNCTIONS CALLED: XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT REVISION HISTORY: 03-May-2002 Written by JXP
(See Spec/Analysis//x_editspec.pro)
NAME: x_extapprof Version 1.0 PURPOSE: Given the flux and wave images and the starting position of the object to extract (x,y), do a trace (if necessary) and then calcualte the aperture and a Gaussian fit to the aperture. CALLING SEQUENCE: x_extapprof, fx, wv, xyguess INPUTS: fx -- Flux image wv -- Wavelength image xyguess -- Guess at the trace RETURNS: OUTPUTS: apstrct -- Structure containing the key info for the aperture and profile OPTIONAL KEYWORDS: WVMNX - Endpoints for extraction (default: [3200., 11000.]) COLLMNX - Endpoints for collapsing the spectrum prior to extraction (default: [3400., 8000.]) VAR= -- Variance array FRAC= -- Fraction of flux NOT to include in aperture [default: 0.025, which corresponds to 5% total] TRC_ORD= -- Polynomial order for fitting the trace [default: 5] /SKYSUB -- Perform simple sky subtraction before calculating the profile PARAMETERS to TRACE_CRUDE: NMED, NAVE, TRADIUS, MXSHIFT OPTIONAL OUTPUTS: TOT_TRC -- Final trace (can be an input too) FLG_APER= -- Flag describing the success (1= good) COMMENTS: EXAMPLES: x_extapprof, slitstr, map PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 17-Sep-2004 Written by JXP
(See Spec/Extraction//x_extapprof.pro)
NAME: x_extechopt Version 1.1 PURPOSE: Extract 1D spectra from the 2D images. For each order, a boxcar and an optimal extraction is performed. For the latter, an object profile is derived and both the object flux and sky are fit throughout the order (i.e. not row by row). The main driver is x_extechopt. For the optimal extraction, the data is extracted to a specific set of vacuum wavelengths, chosen to be the same for every spectrum to facilitate coadding without rebinning. Here are the steps in detail: 1. Perform a boxcar extraction using extract_box 2. Estimate the SNR per order from the boxcar extraction -- LOOP ON ORDERS IN DECREASING SNR -- 3. Fit the boxcar extraction with a bspline 4. Calculate the object profile a. bspline_iterfit the flux vs position on slit b. Force the profile to be positive everywhere and have a sensible FWHM 5. Fit the order using the profile and sky (bspline_extract) CALLING SEQUENCE: x_extechopt, img, skysub, ivar, ordr_str, obj_str, velpix, radius= INPUTS: img -- Data image skysub -- Sky subtraction image from x_echskysub ivar -- Inverse variance image ordr_str -- Order structure describing the echelle footprint velpix -- Size of pixel in velocity units (km/s) RETURNS: OUTPUTS: obj_str -- Structure containing the trace and extracted data OPTIONAL KEYWORDS: /BOXONLY -- Only do boxcar extraction SKYFIL= -- Filename containing the sky spectrum IMG_ARC= -- Wavelength image BASE_APER= -- Aperture for boxcar [default: 0.75, 0.75] /OCHK - Plot the extracted flux (optimal) for each order /RESCHK - Check the residuals of the 2D, fully extracted image /DEBUG - Stop within extraction routine to check stuff HIGHSNR - Value of SNR^2 of the data for a given order which when exceeded mike_box uses an additional parameter for the profile shape. (Default: 500 corresponding to SNR=22) Lowering this parameter may improve extraction. ORDRS - Input array of physical order numbers to extract /EXTENBOX - Allows the boxcar aperture to be larger than the slit length defined by the trace flats (only recommended for very bright stars) MIN_CUT - Minimum length for cutoff aper in fractional slit length [default: 0.]. For longer slits and good seeing, it may be useful to set this to a number like 0.5 or larger FIN_MASK -- Image of masked pixels (mainly cosmic rays) MSKTRIM= -- Value to trim edge of slit by [default: 0.5] /SKIPSKYSUB -- Skip sky subtraction Optional OUTPUTS: FIN_TRC= -- Final trace of spectrum MODEL_OBJ= -- Model of the object flux MODEL_SKY= -- Model of the sky MODEL_PROF= -- Model of the object profile COMMENTS: The program extracts the orders in order of decreasing SNR. If the SNR is lower than lowsnr (default: 2.49) then the optimal extraction is performed using the profile parameters from the previous order(s). EXAMPLES: x_extechopt PROCEDURES/FUNCTIONS CALLED: extract_boxcar x_smoothmask bspline_extract REVISION HISTORY: 26-Aug-2003 Written by SMB Feb-2005 Ported to XIDL by JXP
(See Spec/Extraction//x_extechopt.pro)
NAME: x_extobjbox Version 1.0 PURPOSE: Given the flux and wave images and the starting position of the object to extract (x,y), do a boxcar extraction CALLING SEQUENCE: x_extobjbox, fx, wv, xyguess, fin_spec, MSK=, VAR=, WVMNX= INPUTS: fx -- Image array wv -- Wavelength array xyguess -- Guess at the trace RETURNS: OUTPUTS: fin_spec -- Final spectrum OPTIONAL KEYWORDS: WVMNX - Endpoints for extraction (default: [3200., 11000.]) COLLMNX - Endpoints for collapsing the spectrum prior to extraction (default: [3400., 8000.]) REDBLUE - Spectrum runs from red to blue NEWWV - Finaly 1D wavelength array desired CRVAL1 - Starting wavelength of final 1D array CDELT - Delta lambda (lor or linear) OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_extobjbox, slitstr, map PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 01-Apr-2002 Written by JXP
(See Spec/Extraction//x_extobjbox.pro)
NAME: x_extobjopt Version 1.0 PURPOSE: Given the flux and wave images, extract a 1D spectrum using the Horne optimal algorithm. Assumes a Gaussian or input profile image for now. CALLING SEQUENCE: x_extobjopt, fx, wv, xyguess, fin_spec INPUTS: fx -- 2D Image wv -- 2D wavlenegth array xyguess -- One spot on the image that the object is RETURNS: OUTPUTS: fin_spec -- Final 1D spectrum OPTIONAL KEYWORDS: WVMNX - Endpoints for extraction (default: [3200., 11000.]) COLLMNX - Endpoints for collapsing the spectrum prior to extraction (default: [3400., 8000.]) REDBLUE - Spectrum runs from red to blue NEWWV - Finaly 1D wavelength array desired CRVAL1 - Starting wavelength of final 1D array CDELT - Delta lambda (lor or linear) DEFGAU = Value for Gaussian profile if data is insufficient USEGAU = Use this Gaussian sigma for the profile NCRITER = Number of iterations of CR rejection (default: 1) OPTIONAL OUTPUTS: QAPROF -- The object profile for QA purposes COMMENTS: EXAMPLES: x_extobjopt, slitstr, map PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 20-Sep-2004 Written by JXP
(See Spec/Extraction//x_extobjopt.pro)
NAME: x_extract Version 1.1 PURPOSE: Extracts a 1D spectrum from a 2D image given an aperture. This routine is superseded by x_extobjbox CALLING SEQUENCE: spec = x_extract(img, aper, trace, [error, sky], CAPER=, GAIN=, RN=, /OPTIMAL) INPUTS: img - 2D Image aper - Aperture to extract trace - Trace of the spectrum [sky] - Optional input required for error output RETURNS: spec - 1D Spectrum OUTPUTS: OPTIONAL KEYWORDS: CAPER - Line chosen for aperture: Require with TRACE GAIN - CCD gain RN - Read noise OPTIONAL OUTPUTS: var - Error array COMMENTS: EXAMPLES: spec = x_extract(img, aper) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 05-Dec-2001 Written by JXP
(See Spec/Extraction//x_extract.pro)
NAME: x_extractarc Version 1.1 PURPOSE: Straighten each order indivdiually (x_ordrectify) and then extract a boxcar down the center of each order by taking the average flux in two regions (each side of the center) of width 1/3 the order width. CALLING SEQUENCE: flux = extract_arc( arc_img, ordr_str ) INPUTS: arc_img - 2D Arc image ordr_str - Order structure RETURNS: flux - 1D spectrum down the center of each order OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: flux = x_extractarc( arc_img, ordr_str ) PROCEDURES/FUNCTIONS CALLED: x_ordrectify REVISION HISTORY: ??--2004 Written by SB
(See Spec/Arcs//x_extractarc.pro)
NAME: x_ffttrace Version 1.1 PURPOSE: Traces the y-distortion of a flat using FFTs. It is unlikely this program works well. I highly recommend tracing the 'sawtooth' image of a flat instead. CALLING SEQUENCE: x_ffttrace, img INPUTS: img - Input image (flat) RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_ffttrace, img, map PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 29-Jan-2002 Written by JXP
(See Spec/Rectify//x_ffttrace.pro)
NAME: x_filters Version 1.1 PURPOSE: Grabs out a list of unique filters from a full string array list of filters. CALLING SEQUENCE: x_filters, allfilt, filter, [nfilt], NOSORT=nosort INPUTS: allfilt - List of all images RETURNS: filter - Filter list OUTPUTS: OPTIONAL KEYWORDS: /NOSORT -- Dont bother sorting the unique filter list OPTIONAL OUTPUTS: nfilt - Number of unique filters COMMENTS: EXAMPLES: x_filters, img, filter, nfilt PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 27-July-2001 Written by JXP 08-Aug-2001 Revised to sort
(See IMG/General//x_filters.pro)
NAME: x_findgauss Version 1.0 PURPOSE: Finds Gaussian absorption features in a spectrum (should be normalized). The routine uses find_npeaks to find the features and then tunes up on then with zfitmax. CALLING SEQUENCE: x_findgauss, y, [invvar], xarr=, sigma=, xpeak=, ypeak=, xsn=, sn=, width=, nfind=, minsep= INPUTS: y -- Flux [invvar] -- Inverse variance RETURNS: OUTPUTS: xpeak -- x values of the peaks ypeak -- y height of the peak OPTIONAL KEYWORDS: SIGMA= -- Width of Gaussian (pixels) [default: 1.] WIDTH= -- FWHM of the feature [default: 2.5*sigam] MINSEP= -- Minimum separation between lines [default: 4.1*sigma] NFIND= -- Number of peaks to find with find_nepaks [default: 50] XARR= -- x array (e.g. wavelength) OPTIONAL OUTPUTS: xsn -- x values of peaks from find_npeaks sn -- y values of the peaks from find_npeaks COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: find_npeaks gauss_kernel zfitmax REVISION HISTORY: 24-Sep-2003 Written by SB 2003 Grabbed by JXP and slightly modified
(See Spec/Analysis//x_findgauss.pro)
NAME: x_findnpeaks Version 1.1 PURPOSE: Stolen from SDSS CALLING SEQUENCE: INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 28-Apr-2003 Written by SB
(See Spec/Arcs//x_findnpeaks.pro)
NAME: x_fit Version 1.2 PURPOSE: Fits a function to a set of x,y data CALLING SEQUENCE: fit = x_fit(xdat,ydat,func,nord,sig=,reg=) INPUTS: xdat - Values along one dimension ydat - Values along the other RETURNS: fit - Values of the fit at each xdat value OUTPUTS: OPTIONAL KEYWORDS: sig= - Errors in the yval points IVAR= - Inverse variance of the ydat values func= - String for Fitting function (POLY, LEGEND, BSPLIN, GAUSS) nord= - Order of the fit reg= - Regions of data to fit msk= - Mask (0 = Do NOT include) guess= - First guess for GAUSS routine FITSTR= - 1D Fit structure used to set many of the above parameters (recommended) FLG_BSP= - Flag controlling BSPLINE options (1: nord = everyn) /NONRM - Do not normalize the xdat from -1 to 1 OPTIONAL OUTPUTS: ffit - Functional form NRM - Normalization numbers for xdat :: dblarr(2) RMS - RMS of the fit COMMENTS: EXAMPLES: fit = x_fit(x, y, 'POLY', nord=5) PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG FUNC_FIT ; REVISION HISTORY: 20-Nov-2001 Written by JXP 31-Jan-2002 Revised significantly. Added fit structure, CHEBY 27-Feb-2002 Added ivar option, am using func_fit for legendre
(See FIT//x_fit.pro)
NAME: x_fit2darc Version 1.1 PURPOSE: To fit the arc lines identified in x_fitarc as a fucntion of their y-centroid and order number. The main routine is in x_fit2darc. The fit is a simple least-squares with one round of rejection. CALLING SEQUENCE: x_fit2darc, arcfil, ordr_str, arc_info, nycoeff=nycoeff, $ nocoeff=nocoeff, CLOBBER=clobber, SZ=sz, $ DEBUG=debug, CHKRES=chkres, out_str=out_str, $ QAFIL=qafil, YVAL=yval, ORIG=orig, SIGREJ=sigrej $ , pixrms = pixrms INPUTS: arc_fil -- Name of arc file ordr_str -- Order strucure describing the echelle footprint arc_info -- Name of file created by x_fitarc RETURNS: OUTPUTS: A fits file containing the 2D solution. Named something like 'Arcs/Fits/Arc_B0010_fit2D.fits' OPTIONAL KEYWORDS: NOCOEFF - Number of coefficients to use in the x-direction (default: 5) NYCOEFF - Number of coefficients to use in the y-direction (default: 4) /CLOBBER - Overwrite any previous solution /DEBUG - debug /CHKRES - Plot the residuals /YVAL - Use the x position on the CCD [not recommended] /ORIG - Use wavelengths for the basis not wavelength*order# [not recommended] SIGREJ= - Value for sigma rejection in the fit [default: 10] OPTIONAL OUTPUTS: PIXRMS= -- RMS of the fit in pixels (for each echelle order) COMMENTS: EXAMPLES: print, x_fit2darc(arcfil, ordr_str, arc_info) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 28-Feb-2003 Written by SB 18-Apr-2003 Revised by JXP Feb-2005 Ported to XIDL by JXP
(See Spec/Arcs//x_fit2darc.pro)
NAME: x_fit2dsurf Version 1.1 PURPOSE: Fits a 2d surface to a set of x,y data with errors (optional). It is recommended to set the FIT parameters with the structure FITSTR. CALLING SEQUENCE: fit = x_fit2dsurf(xy, z,[sig], nx=, ny=, MSK=, FITSTR=, REJPT=, NRM=, /NONRM, /SVDFT, LSIG=, HSIG=, NITER=, MAXREJ=, FUNC= ) INPUTS: xy - 2d array of xy pairs: [N,2] z - Values at each xy pair [sig] - Variance in each data point RETURNS: fit - Values at each xdat OUTPUTS: OPTIONAL KEYWORDS: msk - Mask (0 = Do NOT include) func - 2d function ('POLY') nx - Order in x ny - Order in y NONRM - Don't normalize data before fitting MINPT - Minimum number of points to keep in fit LSIG,HSIG - Lower and upper sigma rejection /SVDFT - Use the IDL routine SVDFT for the fitting. Otherwise use CHOLDC (recommended for speed) OPTIONAL OUTPUTS: ffit - Functional form NRM - [2,2] array of Normalization coefficients REJPT - Points rejected in the fit COMMENTS: EXAMPLES: fit = x_fit2dsurf(xy,z, sig) PROCEDURES/FUNCTIONS CALLED: f2dpoly CHOLDC SVDFT x_calc2dfit ; REVISION HISTORY: 31-Jan-2002 Written by JXP 02-Feb-2002 Added rejection
(See FIT//x_fit2dsurf.pro)
NAME: x_fit2dtrace Version 1.1 PURPOSE: Fits the traced y-distortion of a flat in 2D given a set of traces for at various spots in the image. CALLING SEQUENCE: map = x_fit2dtrace( trcstr, FITSTR=, RES=, NX=, NY=, /SILENT ) INPUTS: trcstr - Trace structure RETURNS: map - Map of the y-distortion OUTPUTS: OPTIONAL KEYWORDS: nx - Number of orders along x axis [default: 4L] ny - Number of orders along y axis [default: 4L] OPTIONAL OUTPUTS: FITSTR - 2D fitting function structure of the trace RES - Residual image of the fit COMMENTS: Need to watch for memory issues with 2d surfaces EXAMPLES: map = x_fit2dtrace( trcstr ) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 07-Feb-2002 Written by JXP
(See Spec/Rectify//x_fit2dtrace.pro)
NAME: x_fitarc Version 1.1 PURPOSE: To identify and centroid arc lines in each order. There is actually no fitting done at this stage other than to reject bad lines. The main program does the following: 1) Input the arc image 2) Input an archived arc solution 3) Extract 1D (boxcar) spectra down each order :: extract_arc 4) Cross correlate (FFT) against the archived 1D arc spectrum, this gives the order number and the pixel offset 5) Automatically identify a set of lines (x_templarc) 6) Perform a low order fit to these lines 7) Reidentify all lines with this fit and refit 8) Write arc solutions (one per order) to a fits file 9) If the orders extend beyond the archived solution, attempt to extrapolate to the remaining orders. The idea is to use the known wavelengths from the good orders to extrapolate a guess at the solution. Then use this guess to peak up on the arc lines in these additional orders. CALLING SEQUENCE: x_fitarc, arc_fil, ordr_str, out_fil INPUTS: arc_fil -- Name of arc file ordr_str -- Order strucure describing the echelle footprint out_fil -- Name of IDL file containing the 1D fits RETURNS: OUTPUTS: IDL fit file (one per order) (e.g. Arcs/ArcECH_##fit.idl) OPTIONAL KEYWORDS: /PINTER - Perform fit for pre-identified lines using x_identify /INTER - Identify lines interactively and then fit LINLIST - Arc line list (default: $XIDL_DIR/Spec/Arcs/Lists/hires_thar.lst /CHK - Manually check steps along the way /DEBUG - Debugging /BCKWD - Data runs from red to blue [only necessary for interactive fitting] SIGREJ= - Rejection sigma for outliers in arc line fitting (default: 2.) IORDR - Initial order for analysis FORDR - Final order for analysis /CLOBBER - Overwrite previous fits /FWEIGHT - Centroid arc lines using a flux-weighting scheme /FGAUSS - Centroid arc lines using a gaussian fitting scheme IPSIG - Array which sets the sigma significance for arc lines as a function of order#. This is for the initial solution and it is recommended to use a higher value than IFSIG. An example: [ [0,40,10], [40,80,20]] -- This sets the significance to 10 for orders 0 to 40 and 20 for orders 40 to 80. IFSIG - Similar to IPSIG except this is for the final line list. One may tend to use weaker lines (lower significance) for this step. /NOLOG - Indicates the template file does not have Log wavelengths SATUR - Saturation level for the Arc [default: 30000.] MXSHFT= - Maximum shift allowed between initial guess and FFT cross-correlation /CLIP - Remove especially bad lines [obsolete?] GUESSARC= - Name of archived solution to use as a guess to the inputted arc frame /ARCPAIR - Use the routine arcpairs to guess at the solution (not well tested) /NOEXTRAP - Do not try to extrapolate the solution CCDSZ= - Dimensions of the arc file [native] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_fitarc, aimg PROCEDURES/FUNCTIONS CALLED: x_crossarc x_fitarc_ps extract_arc x_templarc x_identify x_fndpeaks z_arcpairs REVISION HISTORY: 12-Aug-2002 Written by JXP 21-Aug-2002 Streamlined + Added ps output 01-Feb-2003 Polished (JXP) 01-Jan-2004 Added a guess at unmatched orders (SB) 28-Jun-2005 Added arcpairs functionality (SB+JXP)
(See Spec/Arcs//x_fitarc.pro)
NAME: x_fitdla Version 1.11 PURPOSE: GUI used to fit DLA profiles interactively. The user determines the continuum at the same time. CALLING SEQUENCE: x_fitdla, flux_fil, [err_fil], XSIZE=, YSIZE=, TITLE=, WAVE=, /BLOCK, FWHM=, INIFIT=, INFLG= INPUTS: flux_fil - FITS file (or array) containing flux [err_fil] - FITS error array RETURNS: OUTPUTS: OPTIONAL KEYWORDS: xsize - Draw window xsize (pixels) ysize - Draw window ysize (pixels) wave - wavelength array FWHM= - Resoltuion (FWHM in pixels) [default: 2] INFLG= - Usual flag for reading the FITS file (see x_readspec) INIFIT= - IDL file containing a saved version of the fit OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_fitdla, 'spec.fits' PROCEDURES/FUNCTIONS CALLED: XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT REVISION HISTORY: 17-Oct-2002 Written by JXP
(See Spec/Voigt//x_fitdla.pro)
NAME: x_fitline Version 1.1 PURPOSE: Routine used with absorption line fit GUIs CALLING SEQUENCE: x_fitline, state, eventch, /FLG_PLT INPUTS: state - Structure describing the GUI and program eventch -- Character input by the user RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT REVISION HISTORY: 17-Oct-2002 Written by JXP
(See Spec/Voigt//x_fitline.pro)
NAME: x_fitlls Version 1.11 PURPOSE: GUI used to fit DLA profiles interactively. The user determines the continuum at the same time. CALLING SEQUENCE: x_fitlls, flux_fil, [err_fil], XSIZE=, YSIZE=, TITLE=, WAVE=, /BLOCK, FWHM=, INIFIT=, INFLG= INPUTS: flux_fil - FITS file (or array) containing flux [err_fil] - FITS error array RETURNS: OUTPUTS: OPTIONAL KEYWORDS: xsize - Draw window xsize (pixels) ysize - Draw window ysize (pixels) wave - wavelength array FWHM= - Resoltuion (FWHM in pixels) [default: 2] INFLG= - Usual flag for reading the FITS file (see x_readspec) INIFIT= - IDL file containing a saved version of the fit OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_fitlls, 'spec.fits' PROCEDURES/FUNCTIONS CALLED: XGETX_PLT XGETY_PLT XGETXPIX_PLT XGETYPIX_PLT REVISION HISTORY: 17-Oct-2002 Written by JXP
(See Spec/Voigt//x_fitlls.pro)
NAME: x_fitrej Version 1.2 PURPOSE: Fits a function to a set of x,y data with rejection! CALLING SEQUENCE: fit = x_fitrej(xdat,ydat,func=,nord=,sig=,reg=, lsigma=,hsigma=,maxrej=,niter=,minpt=) INPUTS: xdat - Values along one dimension ydat - Values along the other [func] - String for Fitting function (POLY, LEGEND, BSPLIN) [nord] - Order of the fit RETURNS: fit - Values at each xdat OUTPUTS: OPTIONAL KEYWORDS: sig - Errors in the points IVAR= - Inverse variance in the points reg - Regions of data to fit lsigma - Lower sigma threshold hsigma - Upper sigma threshold maxrej - Maximum points to reject per iteration niter - Number of iterations for rejection minpt - Minimum # of points FITSTR - Fit structure :: OVERIDES ALL OTHER INPUT VALUES! MSK - Mask for input data (1 = good) FLG_BSP= - Flag controlling BSPLINE options (1: nord = everyn) /NONRM - Do not normalize the xdat from -1 to 1 OPTIONAL OUTPUTS: rms - RMS of the fit REJPT - Rejected points GDPT - Good (unrejected) points NRM - Normalization numbers for xdat :: dblarr(2) COMMENTS: EXAMPLES: fit = x_fitrej(x, y, FITSTR=fitstr) PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG DJS_REJECT REVISION HISTORY: 20-Nov-2001 Written by JXP 31-Jan-2002 Revised significantly. Added fit structure, CHEBY
(See FIT//x_fitrej.pro)
NAME: x_fitstrtofits Version 1.1 PURPOSE: Writes a fitstr as a binary fits file (or read in a fit struct from a binary FITS file) CALLING SEQUENCE: x_fitstrtofits, fit_str, fits_fil, /REVERSE INPUTS: fit_str - Fit structure fits_fil - Fitsfile RETURNS: OUTPUTS: OPTIONAL KEYWORDS: /REVERSE -- Default is to write the file. If /REVERSE is set then the FITS file is read into a FIT structure OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_fitstrtofits, fit_str, fits_fil PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 15-Apr-2002 Written by JXP
(See FIT//x_fitstrtofits.pro)
NAME: x_fittrcarc Version 1.1 PURPOSE: To fit the slope of the arc lines as a function of order number and y position on the CCD. This information is then used to construct a 2D wavelength image. The fitting routine is the usual least-squares algorithm with two rounds of rejection. CALLING SEQUENCE: x_fittrcarc, arc_fil, trc_fil, ordr_str, out_fil, [qafil] INPUTS: arc_fil -- Name of arc file trc_fil -- Name of file containing the output from x_echtrcarc ordr_str -- Order strucure describing the echelle footprint out_fil -- Name of FITS file containing the 2D fit [qafil] -- Filename for QA output RETURNS: OUTPUTS: Fits file with the coefficients of the 2D fit. Filename like 'Arcs/TRC/Arc_mb0539_F.fits' OPTIONAL KEYWORDS: /CHK -- Plots residuals /CLOBBER -- Overwrite previous solution /ORDRCLOB -- Overwrite arc_m in the order structure ORDR_FIL= -- Filename containing the order sturcture. Necessary for overwriting (e.g. MIKE spectrometer). NOCOEFF - Number of coefficients to use in the x-direction [default: 3] NYCOEFF - Number of coefficients to use in the y-direction [default: 2] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 28-Apr-2003 Written by SB Feb-2005 Ported to XIDL by JXP
(See Spec/Arcs//x_fittrcarc.pro)
NAME: x_fitzpalav Version 1.0 PURPOSE: Report A_lambda/A(V) given lambda for a Fitzpatrick & Massa parameterized extinction law. CALLING SEQUENCE: AlAV = x_alav(lambda, RV=, c3=, c4=) INPUTS: lambda -- Wavelengths to evaluate A at (angstroms) RETURNS: OUTPUTS: OPTIONAL KEYWORDS: RV= -- Value of R_V /SMC -- Use the SMC law /CALZ -- Use the Calzetti law OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: Written W. Landsman Raytheon STX October, 1998 2008 Revised by JXP
(See Dust//x_fitzpalav.pro)
NAME: x_fluxcalib Version 1.1 PURPOSE: Given a spectrum and a flux calib solution, calibrate CALLING SEQUENCE: fx_fnu = x_fluxcalib(wv, fx, fitstr, [var, newvar], /FLAMBDA, DLMB=, TRUCONV=) INPUTS: wv - Wavelength array fx - Stellar flux (e- per pixel) fitstr - Calibration fitting function (assumes alog10 for flux) [var] - Variance array RETURNS: fx_fnu - Flux in fnu (or flambda) OUTPUTS: OPTIONAL KEYWORDS: /FLAMBDA - Return flambda instead of fnu DLMB -- Delta lambda (or km/s if negative) of wavelength array OPTIONAL OUTPUTS: newsig -- Fluxed variance array COMMENTS: EXAMPLES: fx_fnu = x_fluxcalib(wv, fx, fitstr) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 15-Apr-2002 Written by JXP
(See Spec/Flux//x_fluxcalib.pro)
NAME: x_fluxjohnson Version 1.1 PURPOSE: Calculates conversion factor for Johnson magnitudes to physical flux by interpolation CALLING SEQUENCE: flux_conv = x_fluxjohnson(wave) INPUTS: wave= -- Wavelength array RETURNS: flux_conv -- Conversion factor from mag to flux OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 30-Aug-2005 Written by JXP based on HIRES S2N code
(See Obs//x_fluxjohnson.pro)
NAME: x_fmidx Version 1.1 PURPOSE: Converts frame number to index -- Useful for ccd### CALLING SEQUENCE: indx = x_fmidx(struct, frameno) INPUTS: frameno - Frameno [array] of the CCD image RETURNS: indx -- Index of the frame OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: idx = x_fmidx(n1, 203) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 14-Nov-2001 Written by JXP
(See IMG/General//x_fmidx.pro)
NAME: x_fndchrt Version 1.1 PURPOSE: Given an array of Obj name, RA, and DEC create a set of postscript finding charts. CALLING SEQUENCE: x_fndchrt, targlist, OUTDIR=, IMSIZE=, SURVEY=, /ESO INPUTS: targlist -- ASCII file containing (QSO, RA, DEC) RETURNS: OUTPUTS: OPTIONAL KEYWORDS: imsize - Arcmin of image [default is 5'] circ -- Radius of green to draw about the target [default: 5"] /ESO -- Use the DSS at ESO /radec -- Input is ['Name', 'RA:RA', 'DEC:DEC'] EPOCH= -- Epoch of RA/DEC [default: 2000] SKIP= -- Skip lines at the start of the file TWOCIRC = (x,y) offset in arcmin from field center OPTIONAL OUTPUTS: OUTDIR= -- Name of output directory COMMENTS: EXAMPLES: x_fndchrt, 'targets.list' PROCEDURES/FUNCTIONS CALLED: showfits querydss sdss_queryimage REVISION HISTORY: 21-Nov-2003 Written by JXP
(See Obs//x_fndchrt.pro)
NAME: x_fndchrt Version 1.1 PURPOSE: Precess RA and DEC CALLING SEQUENCE: INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: imsize - Arcmin of image (default is 5') OPTIONAL OUTPUTS: OUTDIR= -- Name of output directory COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: precess REVISION HISTORY: 21-Nov-2003 Written by JXP
(See Obs//x_precess.pro)
NAME: x_fndfitval Version 1.1 PURPOSE: Solves for x in y = f(x) given a fitted function f(x) and y CALLING SEQUENCE: xsolv = x_fndfitval(val, fitstr, xval,[fit], NITER=, IPX=, TOLER=, NEG=, FITSTR=) INPUTS: val - Value to match fitstr - FIT structure xval - Values where fit was pre-evaluated [fit] - Values of the fit at xval (calculated if not input) RETURNS: xsolv - x position where the fit = val OUTPUTS: OPTIONAL KEYWORDS: NORD - Required for LEGEND TOLER - Tolerance for match [default: 10^-4] IPIX - Starting pixel in xval NEG - Proceed in the negative direction NITER - Max number of iterations [default: 50] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xsolv = x_fndfitval(0.2, fitstr, xval) PROCEDURES/FUNCTIONS CALLED: POLY_FIT POLY SVDFIT SVLEG BSPLIN GAUSS ; REVISION HISTORY: 23-Nov-2001 Written by JXP 13-Feb-2002 Requires fit structure
(See FIT//x_fndfitval.pro)
NAME: x_fndflux Version 1.1 PURPOSE: OBSOLETE: Use x_calibstd CALLING SEQUENCE: x_fndflux, wv, fx, star, fitstr INPUTS: wv - Wavelength array fx - Stellar flux star - Specphot standard ('LTT7379') fitstr - Fit of the star RETURNS: OUTPUTS: fitstr - Fit structure OPTIONAL KEYWORDS: INTER - Interactive OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_fndflux, wv, fx, star, fitstr PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 15-Apr-2002 Written by JXP
(See Spec/Flux//x_fndflux.pro)
NAME: x_fndpeaks Version 1.1 PURPOSE: Finds a set of peaks in a spectrum. Generally used with arc line spectra, but valueable in many other areas. CALLING SEQUENCE: x_fndpeaks, spec, center, NSIG=, PEAK=, /ALL, /SILENT, $ PKWDTH=, /THIN, /NORECENT, /FORCE, $ FRACPK=, EDGES=, NORDB=, NEDG=, AFUNC=,$ MSK=, AUTOFIT=, ICLSE= INPUTS: spec - Input spectrum (1D) RETURNS: center - Array of peak centers OUTPUTS: OPTIONAL KEYWORDS: PKWDTH - Width of peak to center on (pixels) [default: 3L] NORDB - Order for b-spline fit to the continuum of the spectrum [default: 31L] NSIG= - Number of sigma signifcance for the peak [default: 5.] NEDG= - Number of pixels peak must be from the edge of the spectrum [default: 5L] AFUNC= - Name of function to fit to continuum [default: 'BSPLIN'] MSK= - Mask of good peaks ICLSE= - Minimum separation between peaks [default: 4L] /ALL - Pass back all peaks, not just the good ones /THIN - Allow peaks to be 3 pixel thin [default: 5 pixel] /FORCE - Force centering in x_centspln /NORECNT - Do not bother to try to recenter the peaks FRACPK= - Fraction of peak to calculate centroid [default: 0.33] /FWEIGHT - Centroid using flux weighting /FGAUSS - Centroid arc lines using a gaussian fitting scheme OPTIONAL OUTPUTS: PEAK= - Integer values of centeroids of the peaks EDGES= - Positions of the edges of each peak (usually 0.33 of COMMENTS: EXAMPLES: x_fndpeaks, spec, center PROCEDURES/FUNCTIONS CALLED: x_centspln REVISION HISTORY: 14-Feb-2002 Written by JXP
(See Spec/Arcs//x_fndpeaks.pro)
NAME: x_fndreg Version 1.1 PURPOSE: Finds data points within a number of regions. [This is a rather difficult routine to use] CALLING SEQUENCE: pts = x_fndreg(xdat, reg) INPUTS: xdat - Data reg - Regions: fltarr(N,2) RETURNS: pts - Points in the regions OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: NPNT - Number of points within the regions COMMENTS: EXAMPLES: pts = x_fndreg( findgen(1000), [15., 25.]) PROCEDURES CALLED: REVISION HISTORY: 21-Nov-2001 Written by JXP
(See General//x_fndreg.pro)
NAME: x_fndslitobj Version 1.0 PURPOSE: Given the slitstr and the map, find slit positions in the original image and create object structure. Used for the WFCCD CALLING SEQUENCE: x_fndslitobj, img, wvimg, slitstr INPUTS: img - Flux image slitstr - Slit structure RETURNS: OUTPUTS: Updates slitstr for original positions OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: x_fndslitobj, slitstr, map PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 14-Feb-2002 Written by JXP
(See Spec/Slits//x_fndslitobj.pro)
NAME: x_fndspln Version 1.0 PURPOSE: Solves for x in y = f(x) given a splined function f(x) and y CALLING SEQUENCE: xsolv = x_fndsplin(sx,sy,val,[splin] IPX=, TOLER=, /NEG=) INPUTS: sx - Values where spline was pre-evaluated sy - Values of the spline at sx val - Value to match [splin] - Spline (calculated if necessary) RETURNS: xsolv - x position where the fit = val OUTPUTS: OPTIONAL KEYWORDS: TOLER - Tolerance for match (default: 10^-4) IPIX - Starting pixel in sx /NEG - Proceed in the negative direction from IPIX /SILENT - Turn off warning messages NITER - Max number of iterations [default: 50L] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: xsolv = x_fndspln(sx, sy, val) PROCEDURES/FUNCTIONS CALLED: SPLIN REVISION HISTORY: 02-Feb-2002 Written by JXP
(See FIT//x_fndspln.pro)
NAME: x_fweight Version 1.1 PURPOSE: Recenter a x using flux-weighted algorithm. CALLING SEQUENCE: xnew = x_fweight( img, xcen, ycen, [radius=radius, xerr=xerr, invvar=invvar] ) INPUTS: img - Image xcen - Initial guesses for X centers ycen - Y positions corresponding to "xcen" (expected as integers) OPTIONAL KEYWORDS: radius - Radius for centroiding; default to 3.0 invvar - Inverse variance of image used only in computing errors XERR. If not set, then INVVAR=1 is used. ninter - Number of iterations to perform OUTPUTS: xnew - New X centers OPTIONAL OUTPUTS: xerr - Formal errors for XNEW; set equal to 999.0 if there are any masked pixels in a centroiding region (e.g., if INVVAR=0) COMMENTS: EXAMPLES: PROCEDURES CALLED: trace_fweight REVISION HISTORY: 2004 Written by SB
(See Spec/Arcs//x_fweight.pro)
NAME: x_gaussslit Version 1.1 PURPOSE: Calcualte the slit lost assuming a Gaussian object and a box slit CALLING SEQUENCE: INPUTS: RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 27-Oct-2005 Written by JXP based on HIRES S2N code
(See Obs//x_gaussslit.pro)
NAME: x_getlst Version 1.0 PURPOSE: Calculate twilight in LST given a lat+long+date CALLING SEQUENCE: INPUTS: jdin - Julian Date Allowed formats: DDmmmYY (e.g. 22Oct99) DD-MM-YY (e.g. 20-12-99) YYYY-MM-DD (e.g. 1999-12-20) DDMMMYYYY (e.g. 20JAN2004) longit - Longitude on Earth [decimal hours] RETURNS: twlight in LST strarr(2) OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: PROCEDURES/FUNCTIONS CALLED: x_getlst REVISION HISTORY: Based on code in skycalendar v5 written by John Thorstensen Dartmouth College 10-Dec-2009 Written by JXP
(See Obs//x_getlst.pro)
NAME: x_getmonth PURPOSE: Converts a number into a month CALLING SEQUENCE: month = x_setmonth(ival) INPUTS: ival - Long value of the month RETURNS: month - String OUTPUTS: OPTIONAL KEYWORDS: /REVERSE -- Turn a month into a number /SSMALL -- Use lowercase OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: month = x_getmonth(10) PROCEDURES CALLED: REVISION HISTORY: 04-Jan-2002 Written by JXP
(See General//x_getmonth.pro)
NAME: x_getobjnm Version 1.1 PURPOSE: Get the index of the object name OR return the list of obj_nm. This is a pretty specific routine. If obj_nm is not specified the routine launches a GUI to have the user choose. CALLING SEQUENCE: indx = x_getobjnm(objstr, [obj_nm], LST=) INPUTS: objstr -- Object structure [obj_nm] -- Name of object for which the index is desired RETURNS: indx - Index of the object name OR list of obj_nm OUTPUTS: OPTIONAL KEYWORDS: /LST - Return the list instead of the index OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: indx = x_getobjnm(objstr) list = x_getobjnm(objstr, /LST) PROCEDURES/FUNCTIONS CALLED: x_guilist REVISION HISTORY: 30-Jul-2002 Written by JXP
(See Spec/Analysis//x_getobjnm.pro)
NAME: x_getrainbow Version 1.1 PURPOSE: Passes back a structure defining a rainbow CALLING SEQUENCE: colm = ew_to_colm([lambda], [EW], /RVRS) INPUTS: lambda - Rest Wavelength (Ang) EW - EW (mA) [or column density (linear)] RETURNS: colm - Column density (linear) OUTPUTS: OPTIONAL KEYWORDS: /SILENT -- Suppress written output /RVRS -- Take a column density input and output the EW assuming the linear COG TOLER= -- Tolerance on wavelength [default: 0.1] OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: colm = ew_to_colm([1215.6701],[50.]) PROCEDURES/FUNCTIONS CALLED: REVISION HISTORY: 08-May-2008 Written by JXP
(See Color//x_getrainbow.pro)
NAME: x_getxpmnx PURPOSE: Find the pixels corresponding to xymnx in state CALLING SEQUENCE: pxmnx = x_getxpmnx(state) INPUTS: state -- Structure with TAGS wave, xymnx RETURNS: OUTPUTS: OPTIONAL KEYWORDS: OPTIONAL OUTPUTS: COMMENTS: EXAMPLES: pxmnx = x_getxpmnx(state) PROCEDURES CALLED: REVISION HISTORY: 24-Oct-2002 Written by JXP
(See Spec/General//x_getxpmnx.pro)