This page is a listing of the entire contents of this library for IDL. This listing is the long version. Viewing the much more compact listing may be handier.
NAME:
ABSCAL
PURPOSE:
Provide an absolute calibration using the BZERO and BSCALE keywords
in an FITS header
CALLING SEQUENCE:
RESULT = ABSCAL(VALUE,HEADER)
INPUTS:
VALUE - Any scalar, vector, or array (usually an integer type giving a
relative intensity).
HEADER - A FITS header array containing the absolute calibration
keyword BSCALE, and optionally BZERO and BUNIT.
OUTPUT:
RESULT = BSCALE*VALUE + BZERO, where the BSCALE and BZERO scalars
are taken from the FITS header.
If the absolute calibration keywords do not exist, then
RESULT = VALUE, and !ERR = -1.
SYSTEM VARIALBES:
If the system variable !DEBUG is set, then ABSCAL will print the
calibration units given by the BUNIT keyword.
REVISION HISTORY:
Written W. Landsman, STX Corporation January 1987
(See /host/bluemoon/usr2/idllib/uit/pro/abscal.pro)
NAME: AD2XY PURPOSE: Compute an X and Y position given the RA and DEC and the astrometry parameters CD, CRPIX, and CRVAL. A tangent (gnomonic) projection is computed directly; other projections are computed using WCSXY2SPH. AD2XY is meant to be used internal to other procedures. For interactive purposes, use ADXY. CALLING SEQUENCE: AD2XY, a ,d, cd, astr, x, y INPUTS: A - R.A. in DEGREES, scalar or vector D - Dec. in DEGREES, scalar or vector ASTR - astrometry structure, output from EXTAST procedure containing: .CD - 2 x 2 array containing the astrometry parameters CD1_1 CD1_2 in DEGREES/PIXEL CD2_1 CD2_2 .CDELT - 2 element vector giving increment at reference point in DEGREES/PIXEL .CRPIX - 2 element vector giving X and Y coordinates of reference pixel (def = NAXIS/2) .CRVAL - 2 element vector giving R.A. and DEC of reference pixel in DEGREES .CTYPE - 2 element vector giving projection types OUTPUTS: X - row position in pixels, scalar or vector Y - column position in pixels, scalar or vector REVISION HISTORY: Converted to IDL by B. Boothman, SASC Tech, 4/21/86 Use astrometry structure, W. Landsman Jan. 1994
(See /host/bluemoon/usr2/idllib/uit/pro/ad2xy.pro)
NAME:
ADSTRING
PURPOSE:
Return RA and Dec as character string in sexigesimal format.
RA and Dec may be entered as either a 2 element vector or as
2 scalars. You may also specify the precision of the declination
in digits after the decimal point.
CALLING SEQUENCE
result = ADSTRING( ra_dec )
or
result = ADSTRING( ra,dec,[ precision ] )
INPUTS:
RA_DEC - 2 element vector giving the right ascension and declination
in decimal degrees.
or
RA - Right ascension in decimal degrees, numeric scalar
DEC - Declination in decimal degrees, numeric scalar
OPTIONAL INPUT:
PRECISION - The number of digits after the decimal of DEClination.
The RA is automatically 1 digit more. This parameter may
either be the third parameter after RA,DEC or the second
parameter after [RA,DEC]. It is not available for just DEC.
If no PRECISION parameter is passed, a precision of 1 for
both RA and DEC is returned to maintain compatibility with
past ADSTRING functions. A precision of 0 will result in
the below format, always claimed, but but never delivered by
ADSTRING.
OUTPUT:
RESULT - Character string containing HR,MIN,SEC,DEC,MIN,SEC formatted
as ( 2I3,F5.(p+1),2I3,F4.p ) where p is the PRECISION
parameter. If only a single scalar is supplied it is
converted to a sexigesimal string (2I3,F5.1).
EXAMPLE:
(1) Display CRVAL coordinates in a FITS header, H
IDL> crval = sxpar(h,'CRVAL*') ;Extract 2 element CRVAL vector (degs)
IDL> print, adstring(crval) ;Print CRVAL vector sexigesimal format
(2) print,adstring(30.42,-1.23,1) ==> ' 02 01 40.80 -01 13 48.0'
print,adstring(30.42,+0.23) ==> ' 02 01 40.8 +00 13 48.0'
print,adstring(+0.23) ==> '+00 13 48.0'
PROCEDURES CALLED:
RADEC, SIXTY, NINT
REVISION HISTORY:
Written W. Landsman June 1988
Addition of variable precision and DEC seconds precision fix.
ver. Aug. 1990 [E. Deutsch]
Output formatting spiffed up October 1991 [W. Landsman]
Remove ZPARCHECK call, accept 1 element vector April 1992 [W. Landsman]
(See /host/bluemoon/usr2/idllib/uit/pro/adstring.pro)
NAME: ADXY PURPOSE: Use an image header to compute X and Y positions, given the RA and Dec in decimal degrees. CALLING SEQUENCE: ADXY, HDR ;Prompt for Ra and DEC ADXY, hdr, a, d, x, y, [ /PRINT ] INPUTS: HDR - FITS Image header containing astrometry parameters OPTIONAL INPUTS: A - Right ascension in decimal DEGREES, scalar or vector D - Declination in decimal DEGREES, scalar or vector If A and D are not supplied, user will be prompted to supply them in either decimal degrees or HR,MIN,SEC,DEG,MN,SC format. OPTIONAL OUTPUT: X - row position in pixels, same number of elements as A and D Y - column position in pixels OPTIONAL KEYWORD INPUT: PRINT - If this keyword is set and non-zero, then results are displayed at the terminal. OPERATIONAL NOTES: If less than 5 parameters are supplied, or if the /PRINT keyword is set, then then the X and Y positions are displayed at the terminal. If the procedure is to be used repeatedly with the same header, then it would be faster to use AD2XY. REVISION HISTORY: W. Landsman HSTX January, 1988 Use astrometry structure W. Landsman January, 1994
(See /host/bluemoon/usr2/idllib/uit/pro/adxy.pro)
NAME:
ANNSTATS
PURPOSE:
Integrate flux in annular apertures and get std. dev. in each
annulus. User responsible for subtracting sky first. See
notes (1) and (2) below.
CALLING SEQUENCE:
annstats, image, x0, y0, radius, tot, npix, sigma, stderr, $
mask=mask, /verbose
INPUT PARAMETERS:
image 2-D image array
x0, y0 center of circular annuli (need not be integral)
radius vector of annulus radii
OUTPUT PARAMETERS:
For each annulus,
tot = total of pixel values
npix = number of pixels
mean = mean value per pixel
sigma = standard deviation (scatter) among pixels
stderr = standard error of the mean
OPTIONAL INPUT KEYWORDS:
mask Must be same size as image. If a pixel in
the mask is 1, the corresponding pixel in the image is
counted. If 0, the corresponding pixel in the image is
ignored (in all results). See note (3).
verbose Use of /verbose will make the routine tell you what stage
it's at. See note (1).
COMMON BLOCKS:
none
NOTES:
(1) If you aren't sure you've set up right, use the /verbose keyword,
because the routine is fairly slow.
(2) Mask is intended to mask out stars or garbage. Depending on your
application, you might be better off modifying the input image.
SIDE EFFECTS: none
PROCEDURE: Similar to IDL/UIT/DAOPHOT aperture routine.
MODIFICATION HISTORY:
Modified from CIRCINT. R.S.Hill, Hughes STX Corp., 5 August 1993.
Message fixed. One aperture possible. RSH, HSTX, 12-Oct-1993.
(See /host/bluemoon/usr2/idllib/uit/pro/annstats.pro)
NAME: APER PURPOSE: Procedure (adapted from DAOPHOT) to compute concentric aperture photometry. A separate sky value is determined for each source using specified inner and outer sky radii. CALLING SEQUENCE: aper, image, xc, yc, [ mags, errap, sky, skyerr, phpadu, apr, skyrad, badpix, TEXTOUT = , SILENT = ] INPUTS: IMAGE - input image array XC - vector of x coordinates. COORDINATE VALUES MUST BE IN IDL CONVENTION! (First pixel is 0 not 1!) 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]) OPTIONAL KEYWORD INPUTS: TEXTOUT - Determines output device (see TEXTOPEN) textout=1 TERMINAL using /more option textout=2 TERMINAL without /more option textout=3.prt textout=4 laser.tmp textout=5 user must open file textout = filename (default extension of .prt) SILENT - If supplied and non-zero then no output is displayed to the terminal. 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 SYSTEM VARIABLES: If keyword textout is not used, the non-standard system variable !TEXTOUT will be used to determine the output device. PROCEDURES USED: MMM, TEXTOPEN, STRN 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
(See /host/bluemoon/usr2/idllib/uit/pro/aper.pro)
NAME:
APEROI
PURPOSE:
Procedure to compute aperture photometry for arbitrarily
shaped aperture defined by DEFROI (DEFine Region Of Interest)
The sky value is input.
CALLING SEQUENCE:
APEROI, Image, Roi, Mag, Errm, Skyin, [ Bscale, Badpix,
TEXTOUT = ]
INPUTS:
Image - input image array
Roi - array of pixel locations defining aperture
Skyin - constant sky value used for all sources.
OPTIONAL INPUTS:
Bscale - Scale factor to give absolute calibration. BSCALE may
be obtained from an image header HDR by the command
BSCALE = SXPAR(HDR,'BSCALE')
Set BSCALE = 1 to keep data units rather than convert to
magnitudes.
Badpix - Two element vector giving the minimum and maximum value
of a good pixel (Default [-32765,32767])
APEROI prompts for Bscale and Badpix if not supplied
OPTIONAL INPUT KEYWORDS:
TEXTOUT - Optional, textout = 3 prints to a file APER.PRT,
textout = 1 (default) prints to the screen.
OUTPUTS:
Mag - magnitude for region of interest.
After computing an aperture flux,
FLUX, in data units, a magnitude flux is computed from the
relation
MAGS = -2.5 * alog10(BSCALE*FLUX) - 21.1
If BSCALE =1 then MAGS will return the output flux in data
units, and not convert to magnitudes.
Errm - NAPER by NSTAR array giving error in magnitude (or flux if
BSCALE =1) for each star. If a magnitude could not be deter-
mined then ERRAP = 9.99 (magnitude) or -9.99 (flux units)
SYSTEM VARIABLES:
Set !QUIET = 1 to suppress print output
REVISON HISTORY:
1991 April 26 J. K. Hill, STX
(See /host/bluemoon/usr2/idllib/uit/pro/aperoi.pro)
NAME: ARCBAR PURPOSE: Create and display a bar of a specified input size in arcminutes CALLING SEQUENCE: arcbar, hdr, arcmins,[ LABEL= , SIZE =, THICK =, POSITION = ] INPUTS: hdr - image FITS header, string array arcmins - length in arcminutes of bar, scalar OPTIONAL KEYWORD INPUTS: LABEL - string giving user defined label for bar. Default label is size of bar in arcminutes SIZE - size of label, default = 1.0 THICK - Character thickness of the annotation, default = !P.THICK POS - 2 element vector giving the (X,Y) position in device units at which to begin the scale bar. If not supplied, then the user will be prompted to place the cursor at the desired position EXAMPLE: Place a 3' arc minute scale bar, at position 300,200 of the current image display, (which is associated with a FITS header, HDR) IDL> arcbar, HDR, 3, pos = [300,200] REVISON HISTORY: written by L. Taylor (STX) from ARCBOX (Boothman) modified for Version 2 IDL, B. Pfarr, STX, 4/91 Updated to use ASTROMETRY structures J.Offenberg, HSTX, 31 Dec 92 New ASTROMETRY structures W.Landsman, HSTX, Jan 94
(See /host/bluemoon/usr2/idllib/uit/pro/arcbar.pro)
NAME:
ARROWS
PURPOSE:
To display "weathervane" directional arrows on an astronomical image
showing orientation of North and East.
CALLING SEQUENCE:
arrows,h, [ xcen,ycen, THICK = , CHARSIZE = , ARROWLEN = , COLOR = ,
/NOTVERTEX ]
INPUTS:
h - FITS or STSDAS header array, must include astrometry
OPTIONAL INPUTS:
xcen,ycen - numeric scalars, specifying the center position of
arrows. Position in device units unless the /NORMALIZED
keyword is specified. If not supplied, then ARROWS
will prompt for xcen and ycen
OPTINAL KEYWORD INPUTS:
thick - line thickness, default = 1.0, floating point scalar
charsize - character size, default = 2.0, floating point scalar
arrowlen - length of arrows in terms of normal Y size of vector-drawn
character, default = 3.5, floating point scalar
color - color that the arrows and NE letters should be. Default
value is !P.COLOR
NotVertex - Normally (historically) the specified xcen,ycen indicated
the position of the vertex of the figure. If this
keyword is set, the xcen,ycen coordinates refer to a sort
of 'center of mass' of the figure. This allows the
figure to always appear with the area irregardless of
the rotation angle.
Normal - if this keyword is set and nonzero, the input center
(xcen,ycen) is taken to be in normalized coordinates. The
default is device coordinates.
OUTPUTS:
none
EXAMPLE:
Draw a weathervane at (400,100) on the currently active window,
showing the orientation of the image associated with a FITS header, hdr
IDL> arrows, hdr, 400, 100
METHOD:
Uses EXTAST to EXTract ASTrometry from the FITS header. The
directions of North and East are computed and the procedure
ONE_ARROW called to create the "weathervane".
REVISON HISTORY:
written by B. Boothman 2/5/86
Recoded with new procedures ONE_ARROW, ONE_RAY. R.S.Hill,HSTX,5/20/92
Added separate determination for N and E arrow to properly display
arrows irregardless of handedness or other peculiarities and added
/NotVertex keyword to improve positioning of figure. E.Deutsch 1/10/93
Added /DATA and /NORMAL keywords W. Landsman July 1993
(See /host/bluemoon/usr2/idllib/uit/pro/arrows.pro)
NAME:
ASCENDING_NODE
PURPOSE:
To compute the right ascension of the ascending node of an orbit
at a given time during a shuttle mission.
CALLING SEQUENCE:
node_ra = ascending_node(met, lnch_inf, orbt_inf)
INPUTS:
met - The mission elapsed time to compute the RA for, in hours.
lnch_inf - A structure containing information pertaining to launch:
{LNCHINF_ST, day:0.d, mon:0.d, year:0.d, time:0.d,
daysav:0, site_lat:28.5d, site_lon:80.6d}
day - The day of the launch.
mon - The month of the launch.
year - The year of the launch.
time - The time of day of the launch, in decimal hours.
daysav - The daylight savings time flag. Set to 1 if the
time is daylight savings time; set to 0 if standard
time.
site_lat - The north latitude of the launch site, in degrees.
site_lon - The west longitude of the launch site, in degrees.
orbt_inf - A structure containing information pertaining to the orbit:
{ORBITINF_ST, met_ins:0.d, met_an2:0.d, alt:0.d, incl:0.d,
eccen:0.d, del_u:155.d}
met_ins - The mission elapsed time of the insertion into the
orbit.
met_an2 - The mission elapsed time of the second ascending
node passage.
alt - The altitude (measured from ground level) of the
orbit, in meters.
incl - The orbital inclination, in degrees.
eccen - The orbital eccentricity.
del_u - This is a parameter which aids in determining the
longitude of the insertion into orbit. It depends
upon orbital altitude, inclination, and launch
profile. Note that errors of 10 degrees in this
parameter result in an error in the RA of 0.6
degrees; therefore, an approximation of this
parameter is "good enough." This parameter should
be provided in degrees.
RETURNED:
node_ra - The right ascension of the ascending node, in degrees.
KEYWORDS:
REG_RATE - The rate of change, in degrees per hour, of the ascending
node right ascension.
PROCEDURE:
The computation procedure is described in Appendix B of
"Celestial Target Observability for Astro Spacelab Missions"
by Larry D. Mullins. This is NASA Technical Memorandum
NASA TM-86591, and was written at Marshall Space Flight Center.
MODIFICATION HISTORY:
Written by Michael R. Greason, Hughes STX, 23 November 1992.
(See /host/bluemoon/usr2/idllib/uit/pro/ascending_node.pro)
NAME: ASTDISP DESCRIPTION: This procedure prints of the X,Y,RA,DEC,DN in a standard format. X,Y must be supplied. RA,DEC may also be supplied, and a DN may also be supplied. INPUT: X The X pixel coordinate Y The Y pixel coordinate OPTIONAL INPUT: RA Right Ascention DEC DEClination (if RA is supplied, DEC must also be supplied) DN Data Number OUTPUT: Printed positions in both degrees and sexigesimal format All passed variables remain unchanged HISTORY: 10-AUG-90 Version 1 written by Eric W. Deutsch 20-AUG-91 Converted to standard header. Vectorized Code. E. Deutsch
(See /host/bluemoon/usr2/idllib/uit/pro/astdisp.pro)
NAME:
ASTRO
PURPOSE:
Interactive astronomical utitlity for precession and coordinate
conversion.
CALLING SEQUENCE:
ASTRO, [ selection, EQUINOX = ]
OPTIONAL INPUT:
SELECTION - Scalar Integer (0-6) giving the the particular astronomical
utility to be used. (0) Precession, (1) RA, Dec to Galactic
coordinates, (2) Galactic to RA,Dec (3) RA,Dec to Ecliptic,
(4) Ecliptic to RA, Dec, (5) Ecliptic to Galactic, (6) Galactic
to Ecliptic. Program will prompt for SELECTION if this parameter
is omitted.
OPTIONAL KEYWORD INPUT:
EQUINOX - numeric scalar specifying the equinox to use when converting
between celestial and other coordinates. If not supplied,
then the RA and Dec will be assumed to be in EQUINOX 1950.
This keyword is ignored by the precession utility. For
example, to convert from RA and DEC (2000) to galactic
coordinates:
IDL> astro, 1, E=2000
METHOD:
ASTRO uses PRECESS to compute precession, and EULER to compute
coordinate conversions. The procedure GET_COORDS is used to
read the coordinates, and ADSTRING to format the RA,Dec output.
NOTES:
ASTRO temporarily sets !QUIET to suppress compilation messages and
keep a pretty screen display.
REVISION HISTORY
Written, W. Landsman November 1987
Code cleaned up W. Landsman October 1991
Added Equinox keyword, call to GET_COORDS, W. Landsman April, 1992
(See /host/bluemoon/usr2/idllib/uit/pro/astro.pro)
NAME: ASTROM PURPOSE: Computes parameters describing a linear fit to a plate solution using the algorithm supplied by R. S. HARRINGTON, USNO Use the procedure ASTROMIT for interactive use of this program CALLING SEQUENCE: astrom, raref, decref, idgs, ximg, yimg, astr, err, [ fl , /NOQUESTIONS, DUMPTYPE= ] INPUTS: raref - Array of RA'S of astrometric reference stars (DEGREES) decref- Array of DEC'S of astrometric reference stars (DEGREES) idgs - Array of indices of selected reference stars. IDGS must contain the same or fewer elements than RAREF and DECREF. If the total # of reference stars is N, then to select all the reference stars, set IDGS = INDGEN(N) ximg - Array of image source X COORDS. yimg - Array of image source Y COORDS. astr - A structure, of type ASTROMETRY, containing the initial guess at the plate solution. OPTIONAL INPUTS: fl - Camera Focal Length (in pixel units). If omitted, a focal length of 1.7E5 (UIT camera) will be assumed KEYWORDS: NOQUESTIONS - If set, user will not be asked 'Ren/Del/Cont' DUMPTYPE - If 0, printed information will NOT be dumped. If 1, printed information will be dumped to ASTROM.DMP in the same format as the screen. If 2, a higher precision and sexigesimal format will be dumped to file ASTROM.DMP. DumpType=2 is noticeably slower... OUTPUTS: astr - The input ASTROMETRY structure is filled with the just-computed plate solution. err - (output) error in star location (measured - calc) in arcsec Same number of elements as IDGS REVISION HISTORY: Written by J. K. HILL, STX CORP. 7/11/86 Converted to IDL, made interactive by R. H. CORNETT, STX 5/29/87 03-SEP-90 Fixed Error calculation and made it dump in to file. (Deutsch) Added option to delete or rename output file, J. Isensee, ST Systems Corp. Added Calling sequence message, N. Collins, STX, 11/20/90 20-AUG-91 Fixed Error calculation by removing extra SQRT inserted in line 161 probably when the ERR variable was changed to ERROUT by someone. Therefore, all error values were wrong, probably since 11/20/90. Also changed variable ERROUT back to ERR because only SOME of the ERRs had been changed, which gave more errors. (E. Deutsch) 20-AUG-91 Added /NoQues parameter to avoid Del/Ren Prompt. (E. Deutsch) 24-AUG-91 Added DumpType= keyword and corresponding code. (E. Deutsch) 24-AUG-91 Changed Dumpfile Unit=8 to /get_lun (E. Deutsch) Fixed the returned ERR array. The square of the errors was being returned; a square root is now taken prior to returning. The displayed error analysis is not affected. M. R. Greason, Hughes STX, 10 December 1992. Converted to the new, image-distortion-related, astrometry scheme. Reformatted the procedure and beefed up the internal documentation. M. R. Greason, Hughes STX, 6 January 1993. Fixed variable-name error. RSH, HSTX, 25-Mar-93 New astrometry software WBL HSTX Feb 94
(See /host/bluemoon/usr2/idllib/uit/pro/astrom.pro)
NAME: ASTROMIT PURPOSE: Uses the procedure ASTROM to derive an astrometry solution from a set of reference star positions and coordinates. The reference stars may be culled interactively to obtain the best astrometric solution. The procedure writes to a file ASTROM.DMP during each iteration. CALLING SEQUENCE: ASTROMIT, X, Y, A, D [, HDR, FL, /UNDISTORT] INPUTS: X - Vector (at least 3 elements) containing the X positions of a set of astrometric reference stars Y - Vector containing Y positions of reference stars A - Vector (same # of elements as X) containing the Right Ascension (decimal degrees) of the astrometric reference stars D - Vector containing declinations (decimal degrees) of reference stars OPTIONAL INPUTS: HDR - Image header which may be updated with the astrometric solution. FL - Camera focal length. If not supplied, a focal length appropriate to UIT is assumed KEYWORDS: UNDISTORT - If present and non-zero, the reference star (x,y) positions are assumed to have been corrected for image distortion (transformed into the undistorted frame of reference). THIS KEYWORD SHOULD ONLY BE USED FOR UIT IMAGES. METHOD: The procedure ASTROM is called (twice) to compute an initial astrometry solution. The errors in the initial solution are then displayed for each reference star. The user then has the option of culling the the reference star list, either by setting a maximum tolerable error or by removing individual stars. NOTES: ASTROMIT will write the results of each iteration to a file ASTROM.DMP. However, under Unix only the final iteration is saved. PROCEDURES USED: ZPARCHECK,ASTROM,PUTAST,STRN,STRNUMBER,SXADDHIST REVISION HISTORY: Written R. Cornett, W. Landsman January 1988 Fixed to allow header updates if npar GE 5, B Pfarr, June 1989 20-AUG-91 Fixed so that it correctly puts residual in header. (E. Deutsch) 24-AUG-91 Modified to work with latest mods to ASTROM. (E. Deutsch) Corrected ASTROM bug, requiring a change in how the residual is put into the header. M. R. Greason, Hughes STX, 10 December 1992. Converted to the new, image-distortion-related, astrometry scheme. Reformatted the procedure and beefed up the internal documentation. M. R. Greason, Hughes STX, 6 January 1993. Fixed misnomers in calling sequence, bug in ctype handling, a couple of instances of not including the structure name astr. RSH, HSTX, 25-Mar-93 Fixed a loop init. and processing. MRG, HSTX, 8-Apr-1993. Individual star deletion fixed (`where' added). RSH, HSTX, 18 June 1993.
(See /host/bluemoon/usr2/idllib/uit/pro/astromit.pro)
NAME:
ASTSCALE
PURPOSE:
Transfer astrometry from condensed image to full-resolution image,
or between any two images differing _only_ in plate scale.
Astrometry is transferred from header in an array to header on disk.
CALLING SEQUENCE:
astscale,name,hd,scalefac=scalefac
INPUT PARAMETERS:
name = filename of destination image header on disk (without .hhh)
hd = header array with astrometry (e.g., produced by VIDEO)
OPTIONAL INPUT PARAMETERS:
scalefac (keyword) = size of disk image/size of image on which
astrometry was done (default = 4.0)
OUTPUT PARAMETERS: none
COMMON BLOCKS: none
SIDE EFFECTS: New version of name.HHH generated.
PROCEDURE: straightforward
MODIFICATION HISTORY:
Written by R. S. Hill, Hughes STX Corp., 28-May-1992.
(See /host/bluemoon/usr2/idllib/uit/pro/astscale.pro)
NAME:
AVG
PURPOSE:
Calculate the average value of an array, or calculate the average
value over one dimension of an array as a function of all the other
dimensions.
CALLING SEQUENCE:
RESULT = AVG( ARRAY, [ DIMENSION ] )
INPUTS:
ARRAY = Input array. May be any type except string.
OPTIONAL INPUT PARAMETERS:
DIMENSION = Optional dimension to do average over, scalar
OUTPUTS:
The average value of the array when called with one parameter.
If DIMENSION is passed, then the result is an array with all the
dimensions of the input array except for the dimension specified,
each element of which is the average of the corresponding vector
in the input array.
For example, if A is an array with dimensions of (3,4,5), then the
command B = AVG(A,1) is equivalent to
B = FLTARR(3,5)
FOR J = 0,4 DO BEGIN
FOR I = 0,2 DO BEGIN
B(I,J) = TOTAL( A(I,*,J) ) / 4.
ENDFOR
ENDFOR
RESTRICTIONS:
Dimension specified must be valid for the array passed; otherwise the
input array is returned as the output array.
PROCEDURE:
AVG(ARRAY) = TOTAL(ARRAY)/N_ELEMENTS(ARRAY) when called with one
parameter.
MODIFICATION HISTORY:
William Thompson Applied Research Corporation
July, 1986 8201 Corporate Drive
Landover, MD 20785
Converted to Version 2 July, 1990
Replace SUM call with TOTAL W. Landsman May, 1992
(See /host/bluemoon/usr2/idllib/uit/pro/avg.pro)
NAME: A_b PURPOSE: Compute interstellar extinction in the B bandpass as a function of galactic position using the 21 parameter function given by deVaucoulers in the 2nd Reference Catalog of Galaxies (RC2). Note that this formula is no longer used in the RC3 and that reddenings are instead obtained from the Burstein-Heiles maps. CALLING SEQUENCE: result = A_b( l2, b2) INPUT PARAMETERS l2 = galactic longitude (degrees), scalar or vector b2 = galactic latitude (degrees), scalar or vector OUTPUT PARAMETERS RESULT - Interstellar extinction Ab in magnitudes, scalar NOTES: The controversial aspect of the deVaucoulers reddening curve is that it predicts an extinction of about 0.2 at the poles The parameters used here differ from the ones printed in the RC2 but are the ones actually used for entries in the catalog (see Rowan-Robinson 1985) REVISION HISTORY Written by R. Cornett and W. Landsman, STX October 1987 Vectorized code W. Landsman STX December 1992
(See /host/bluemoon/usr2/idllib/uit/pro/a_b.pro)
NAME:
BAKFILE
PURPOSE:
To perform a fog-level correction on an image, using a bilinear
interpolation technique.
CALLING SEQUENCE:
bakfile [, infile, outfile, PATCH=patfil, /DOC, BASEFOG=basefog]
INPUTS:
infile The file containing the image to be processed.
outfile The output file.
KEYWORDS:
PATCH If present, get the patch information from the specified
file. Otherwise, get it from:
/usr4/uitbdr/patches/patchs.dat
DOC If present and non-zero, status information concerning the
processing of the image is displayed as the image is processed.
BASEFOG If present, this value is used as the base fog level.
Defaults to 200.
RESTRICTIONS:
The image MUST be a UIT image, either of the normal or of the
substep variety.
PROCEDURE:
Fog levels are computed for the four corners of the image. If
processing a "normal" image, a series of patches are used to determine
these fog levels. If a substepped image, a pixel strip along each
side is used. These four fogs are then used to perform a bilinear
interpolation of the fog throughout the image; these interpolated
fogs are used to adjust the fog level to the base fog level throughout
the image.
MODIFICATION HISTORY:
Written by Michael R. Greason and Susan Gessner, HUGHES STX,
21 November 1991.
(See /host/bluemoon/usr2/idllib/uit/pro/bakfile.pro)
NAME:
BAKSUB
PURPOSE:
To perform a fog-level correction on an image, using a bilinear
interpolation technique.
CALLING SEQUENCE:
baksub [, im, hd, PATCH=patfil, /DOC, BASEFOG=basefog]
INPUTS:
im The image array.
hd The header array.
KEYWORDS:
PATCH If present, get the patch information from the specified
file. Otherwise, get it from:
/usr4/uitbdr/patches/patchs.dat
DOC If present and non-zero, status information concerning the
processing of the image is displayed as the image is processed.
BASEFOG If present, this value is used as the base fog level.
Defaults to 200.
RESTRICTIONS:
The image MUST be a UIT image, either of the normal or of the
substep variety.
PROCEDURE:
Fog levels are computed for the four corners of the image. If
processing a "normal" image, a series of patches are used to determine
these fog levels. If a substepped image, a pixel strip along each
side is used. These four fogs are then used to perform a bilinear
interpolation of the fog throughout the image; these interpolated
fogs are used to adjust the fog level to the base fog level throughout
the image.
MODIFICATION HISTORY:
Written by Michael R. Greason, STX, 26 September 1991.
BASEFOG added. MRG, STX, 8 October 1991.
File i/o converted to image and header supplied. Susan Gessner,
MRG, HUGHES STX, 21 November 1991.
Selects patch file based on input image size. Nicholas Collins,
Hughes STX, 24 Feb. 1993.
(See /host/bluemoon/usr2/idllib/uit/pro/baksub.pro)
NAME BDRDASTROM PURPOSE: Add astrometry from the HDRS database into a UIT FITS header. CALLING SEQUENCE: bdrastrom ,h [,/Nocompress,/OLD] INPUT - OUTPUT: h - UIT FITS header, string array. It can be for either a compressed or full-resolution UIT image, but must be in the original UIT orientation. BDRASTROM will not work on subimages or rotated images. KEYWORD INPUT: NOCOMPRESS - If present and non-zero, the restored astrometry will NOT be compressed. OLD - If present and non-zero, HDRSOLD rather than HDRS will be used for FLIGHT12 or QUICK13 images. REVISION HISTORY: Written, W.Landsman October 1991 Added NOCOMPRESS option J. Offenberg 22 January 92 Added OLD option for pre-Flght13 J. Offenberg Jan 29 1992 Updated for compatiblity with ASTROMETRY structures and image distortion. J. Offenberg Jan 1993
(See /host/bluemoon/usr2/idllib/uit/pro/bdrastrom.pro)
NAME
BIGDIV
PURPOSE:
Divide a image in one file by another (flatfield) image and write to
a third file. Do in 8 steps to save virtual memory. The numerator
image and the denominator image must be the same size, INTEGER*2
datatype and the dimensions must be an even multiple of 512 x 512
(usually 2048 x 2048).
CALLING SEQUENCE:
bigdiv, image1, image2, scale, image3
INPUTS:
image1 - filename of the INTEGER*2 STSDAS numerator image.
image2 - filename of the INTEGER*2 SDAS denominator image.
scale - scale factor, scalar: ratio = num*scale/denom
The scale factor will always be converted to floating point.
image3 - name of output file to write quotient image. The division is
done using REAL*4 arithmetic which is then converted to
INTEGER*2.
NOTES:
BIGDIV make the following adjustments to the division:
(1) BIGDIV will change any 0 pixels in the denominator image to 1,
to avoid divide by zero.
(2) Any input values of 32766 in the numerator image will be set to
32767 in the quotient image
(3) Any input values of 32767 in the denominator image will be set to
0 in the quotient image
EXAMPLE:
Divide the image 'FUV0342_LIN' by the flatfield image 'B1M', scale
by 270 and put the quotient image in 'FUV0342F'
IDL> bigdiv,'FUV0342_LIN','B1M',270,'FUV0324F'
MODIFICATION HISTORY
written by Wayne Landsman, STX
modified to handle saturated pixels, Bob C., STX 1/30/91
Problem indexing bad pixels corrected Wayne L. STX 27-Sep-91
Do image sizes any multiple of 512 x 512 rather than just 2048 x 2048
Wayne L. Nov-91
(See /host/bluemoon/usr2/idllib/uit/pro/bigdiv.pro)
NAME:
BLINK
PURPOSE:
To allow the user to alternatively examine two or more windows within
a single window.
CALLING SEQUENCE:
BLINK, Wndw [, T]
INPUTS:
Wndw A vector containing the indices of the windows to blink.
T The time to wait, in seconds, between blinks. This is optional
and set to 1 if not present.
OUTPUTS:
None.
PROCEDURE:
The images contained in the windows given are written to a pixmap.
The contents of the the windows are copied to a display window, in
order, until a key is struck.
EXAMPLE:
Blink windows 0 and 2 with a wait time of 3 seconds
IDL> blink, [0,2], 3
MODIFICATION HISTORY:
Written by Michael R. Greason, STX, 2 May 1990.
Allow different size windows Wayne Landsman August, 1991
(See /host/bluemoon/usr2/idllib/uit/pro/blink.pro)
NAME:
BORDER
PURPOSE:
To blacken out a border around an image. (50 pixels wide)
CALLING SEQUENCE:
border, imagein, imageout
INPUTS:
imagein - input image array
OUTPUTS:
imageout - output image array
REVISON HISTORY:
written by B. Pfarr, STX,12/14/90
(See /host/bluemoon/usr2/idllib/uit/pro/border.pro)
NAME: BOXAVE PURPOSE: Box-average a 1 or 2 dimensional array. This procedure differs from the intrinsic REBIN function in the follow 2 ways: (1) the box size parameter is specified rather that the output array size (2) for INTEGER arrays, BOXAVE computes intermediate steps using REAL*4 arithmetic. This is considerably slower than REBIN but avoids integer truncation CALLING SEQUENCE: result = BOXAVE( Array, Xsize,[ Ysize ] ) INPUTS: ARRAY - Two dimensional input Array to be box-averaged. Array may be one or 2 dimensions and of any type except character. OPTIONAL INPUTS: XSIZE - Size of box in the X direction, over which the array is to be averaged. If omitted, program will prompt for this parameter. YSIZE - For 2 dimensional arrays, the box size in the Y direction. If omitted, then the box size in the X and Y directions are assumed to be equal OUTPUT: RESULT - Output array after box averaging. If the input array has dimensions XDIM by YDIM, then RESULT has dimensions XDIM/NBOX by YDIM/NBOX. The type of RESULT is the same as the input array. However, the averaging is always computed using REAL arithmetic, so that the calculation should be exact. If the box size did not exactly divide the input array, then then not all of the input array will be boxaveraged. PROCEDURE: BOXAVE boxaverages all points simultaneously using vector subscripting REVISION HISTORY: Written, W. Landsman, October 1986 Call REBIN for REAL*4 and REAL*8 input arrays, W. Landsman Jan, 1992
(See /host/bluemoon/usr2/idllib/uit/pro/boxave.pro)
NAME BPRECESS PURPOSE: Calculate the mean place of a star at B1950.0 on the FK4 system from the mean place at J2000.0 on the FK5 system. CALLING SEQUENCE: bprecess, ra, dec, ra_1950, dec_1950, [ MU_RADEC = , PARALLAX = RAD_VEL = ] INPUTS: RA,DEC - Input J2000 right ascension and declination in *degrees*. Scalar or N element vector OUTPUTS: RA_1950, DEC_1950 - The corresponding B1950 right ascension and declination in *degrees*. Same number of elements as RA,DEC but always double precision. OPTIONAL INPUT-OUTPUT KEYWORDS MU_RADEC - 2xN element double precision vector containing the proper motion in seconds of arc per tropical *century* in right ascension and declination. PARALLAX - N_element vector giving stellar parallax (seconds of arc) RAD_VEL - N_element vector giving radial velocity in km/s The values of MU_RADEC, PARALLAX, and RADVEL will all be modified upon output to contain the values of these quantities in the B1950 system. The parallax and radial velocity will have a very minor influence on the B1950 position. NOTES: The algorithm is taken from the Astronomical Almanac 1990, page B42. Also see Aoki et al (1983), A&A, 128,263 The error in using the IDL procedure PRECESS for converting between B1950 and J1950 can be up to 1.5", mainly in right ascension. If better accuracy than this is needed then BPRECESS should be used. EXAMPLE: The SAO2000 catalogue gives the J2000 position and proper motion for the star HD 119288. Find the B1950 position. RA(2000) = 13h 42m 12.740s Dec(2000) = 8d 23' 17.69'' Mu(RA) = -.0257 s/yr Mu(Dec) = -.090 ''/yr IDL> mu_radec = 100D* [ -15D*.0257, -0.090 ] IDL> ra = ten(13, 42, 12.740)*15.D IDL> dec = ten(8, 23, 17.69) IDL> bprecess, ra, dec, ra1950, dec1950, mu_radec = mu_radec IDL> print, adstring(ra1950, dec1950,2) ===> 13h 39m 44.526s +08d 38' 28.63" REVISION HISTORY: Written, W. Landsman October, 1992 Vectorized, W. Landsman February, 1994
(See /host/bluemoon/usr2/idllib/uit/pro/bprecess.pro)
NAME: BRUZUAL PURPOSE: Extract a spectrum from the BRUZUAL database (Bruzual & Chalrot, 1993, ApJ, 405, 538) for a specified model at specified ages. Meant to be analogous to the procedure CLUST_FLUX CALLING SEQUENCE: BRUZUAL, wave, time, model, flux INPUT-OUTPUT PARAMETERS WAVE - Wavelength(s) (A) at which to determine flux, scalar or vector If this parameter is undefined on input, then on output it will contain the Bruzual wavelengths actually tabulated. Otherwise the Bruzual spectra are quadratically interpolated onto the input wavelength grid. TIME - Time(s) (in Myr) following beginning of star formation at which to evaluate flux, scalar or vector. Spectra are not interpolated over time, rather the closest point in the Bruzual time grid is used. Upon output, TIME will contain the time values actually used. If TIME is undefined on input the Bruzual time grid is used. OUTPUT: FLUX - Flux vector dimensioned NWAVE by NTIME where NWAVE is the number of elements in WAVE and NTIME is then number of elements in TIME. Units are ergs s(-1) A(-1) per solar mass formed. INPUT PARAMETER MODEL - An integer scalar (1-19) specifying the Bruzual model to use (1) Salpeter IMF, Inst. Burst, 0.1 - 125 Msun (2) Salpeter IMF, Inst. Burst, 0.1 - 65 Msun (3) Salpeter IMF, Inst. Burst, 0.1 - 30 Msun (4) Salpeter IMF, Inst. Burst, 0.1 - 2.5 Msun (5) Salpeter IMF, Inst. Burst, 2.5 - 125 Msun (6) Scalo (1986) IMF, Inst. Burst, 0.1 - 125 Msun (7) Scalo (1986) IMF, Inst. Burst, 0.1 - 65 Msun (8) Scalo (1986) IMF, Inst. Burst, 0.1 - 30 Msun (9) Scalo (1986) IMF, Inst. Burst, 0.1 - 2.5 Msun (10) Scalo (1986) IMF, Inst. Burst, 2.5 - 125 Msun (11) Miller-Scalo IMF, Inst. Burst, 0.1 - 125 Msun (12) Miller-Scalo IMF, Inst. Burst, 0.1 - 65 Msun (13) Miller-Scalo IMF, Inst. Burst, 0.1 - 40 Msun (14) Miller-Scalo IMF, Inst. Burst, 0.1 - 2.5 Msun (15) Miller-Scalo IMF, Inst. Burst, 2.5 - 125 Msun (16) Salpeter IMF, 1 Gyr Burst, 0.1 - 125 Msun (17) Salpeter IMF, Exponential Decayng SFR with tau = 1 Gyr, 0.1 - 125 Msun (18) Salpeter IMF, Exponential Decaying SFR with Mu = 0.50, 0.1 - 125 Msun (19) Salpeter IMF, Constant SFR 1e-10 Msun/yr. 0.1 - 125 Msun EXAMPLE: Return the Bruzual flux at 1600 A every million years for the first 10 million years. Assume a Salpeter IMF with mass range 0.1-65 Msun (model 2) IDL> age = indgen(11) IDL> bruzual, 1600, age, 2, flux Upon output the AGE vector is modified to contain the ages actually used REVISION HISTORY Written, W.Landsman HSTX April, 1993
(See /host/bluemoon/usr2/idllib/uit/pro/bruzual.pro)
NAME:
BSORT
PURPOSE:
Function to sort data into ascending order, like a simple bubble sort.
original subscript order is maintained when values are equal (FIFO).
(This differs from the IDL SORT routine alone, which may rearrange
order for equal values)
CALLING SEQUENCE:
result = bsort( array, [ asort, /INFO, /REVERSE ] )
INPUT:
Array - array to be sorted
OUTPUT:
result - sort subscripts are returned as function value
OPTIONAL OUTPUT:
Asort - sorted array
OPTIONAL KEYWORD INPUTS:
/REVERSE - if this keyword is set, and non-zero, then data is sorted
in descending order instead of ascending order.
/INFO = optional keyword to cause brief message about # equal values.
HISTORY
written by F. Varosi Oct.90:
uses WHERE to find equal clumps, instead of looping with IF ( EQ ).
compatible with string arrays, test for degenerate array
20-MAY-1991 JKF/ACC via T AKE- return indexes if the array to
be sorted has all equal values.
Aug - 91 Added REVERSE keyword W. Landsman
(See /host/bluemoon/usr2/idllib/uit/pro/bsort.pro)
NAME:
BUILDAST
PURPOSE:
Build an ASTROMETRY structure from given data. If data are not
supplied, prompt for all necessary. A CD matrix must be supplied and
will not be prompted.
CALLING SEQUENCE:
ASTR = BUILDAST( CD, [CRPIX, CRVAL, CType, Flag, Cam, Equinox, $
/RADIANS,SCALE=scl,OFFSET=offst])
INPUTS:
CD - 2 x 2 array containing the astrometry parameters CD1_1 CD1_2
in DEGREES/PIXEL CD2_1 CD2_2
CRPIX - 2 element vector giving X and Y coord of reference pixel
CRVAL - 2 element vector giving R.A. and DEC of reference pixel
in DEGREES
CTYPE - 2 element vector giving dimension types (Nominally "RA--TAN",
"RA--UIT", "DEC--TAN","DEC--UIT") (Defaults to "*--TAN")
FLAG - String containing "T" if plate solution requires a distortion
to match the plate, "F" if not. (Defaults to "F")
CAM - String containing the UIT camera of the image ("A", "B" or "").
(Defaults to "")
EQUINOX- Scalar containing the equinox of astrometry coordinates
(Defaults to 2000).
KEYWORD INPUT:
RADIANS - If present and non-zero, assumes that the input CD and CRVAL
are in RADIANS, not DEGREES.
SCALE - Scalar containing the multiplicative scale factor of the image
(e.g. 4.0 for a 512x512 compressed UIT image). If not
supplied, default value of 1 assumed (SCALE=0 ignored).
OFFSET - 2 element vector containing the X and Y offsets needed to put
the CRPIXes at (1024.5,1024.5) AFTER scaling. If not supplied,
default value of [0,0] assumeed.
OUTPUT:
Function value = ASTROMETRY structure, containing:
.CD - 2 x 2 array containing the astrometry parameters CD1_1 CD1_2
in DEGREES/PIXEL CD2_1 CD2_2
.CRPIX - 2 element vector giving X and Y coordinates of reference pixel
.CRVAL - 2 element vector giving R.A. and DEC of reference pixel
in DEGREES
.CTYPE - 2 element vector giving dimension types (Nominally "RA---TAN"
or "RA---UIT", "DEC--TAN","DEC--UIT")
.FLAG - String containing "T" if plate solution requires a distortion
to match the plate, "F" if not.
.CAM - String containing the UIT camera of the image ("A" or "B","N"
or blank if not a UIT image).
.EQUINOX- Scalar containing equinox of CRVAL coordinates (def=2000)
.SCALE - Scalar containing the multiplicative scale factor of the image
(e.g. 4.0 for a 512x512 compressed UIT image). Will be 1.0
if not a UIT image.
.OFFSET - 2 element vector containing the X and Y offsets needed to put
the CRPIXes at (1024.5,1024.5) AFTER scaling. Will be [0,0]
if not a UIT image.
PROCEDURE:
Routine prompts for any missing parameters (CD matrix must be
supplied).
Once values for all fields are complete, the routine will build an
ASTROMETRY structure and return it.
COMMON BLOCKS:
None
EXAMPLES:
IDL> astr = buildast(cd, crpix, crval) ;Prompts for other values
IDL> putast,hdr, buildast(cd, cp, cv, ct, f, cam, equ) ;Puts astrometry
into header hdr
MODIFICATION HISTORY:
Written. Joel D. Offenberg, Hughes STX, January, 1993.
All numerics floated. RSH, HSTX, 22-Apr-1993.
Degrees converted to radians for entered CRVALs. RSH, HSTX,
23-Apr-1993.
Now able to handle IRAS headers (3 CTYPES, 3 CRPIX---just ignore the
third.) JDO, HSTX, May 26, 1993
(See /host/bluemoon/usr2/idllib/uit/pro/buildast.pro)
NAME: BYTESWAP CALLING SEQUENCE: byteswap, im PURPOSE: To swap the bytes in an image array. INPUT/OUTPUT: im The image array (both input and output). COMMON BLOCKS: None PROCEDURE: The byteorder procedure is used to perform the conversion. The form of this conversion depends upon the datatype of the array. If it is of I*2 format, a short integer swap is performed. If it is of I*4 format, a long integer swap is performed. Otherwise, nothing is done. MODIFICATION HISTORY: Written by Michael R. Greason, STX, 30 August 1990.
(See /host/bluemoon/usr2/idllib/uit/pro/byteswap.pro)
NAME:
CALFIX
PURPOSE:
Updates calibration keywords in a UIT FITS header to use the latest
values. Exposure time is read from the NEWFRAMES data base.
Absolute calibration is set to the Landsman 10-Dec In-Flight calibration.
These are the values used in REV 2.
CALLING SEQUENCE:
CALFIX,'image_name' ,[cmpr= ]
or
CALFIX,header, [cmpr= ]
INPUT-OUTPUT PARAMETERS:
image_name = name of .HHH header file. The file will be updated
with the proper calibration.
or
header - FITS header, string array
KEYWORD PARAMETERS:
cmpr = compression factor, e. g. 4 for images boxaveraged by
a factor 4. If not supplied, then CALFIX checks the PIXELSIZ
keyword to determine the compression. Warning - HREBIN did not
reset the PIXELSIZ keyword prior to 10-Dec-91.
OUTPUT PARAMETERS:
none
SIDE EFFECTS:
Writes changed copy of header to disk.
PROCEDURE:
Header read, parameters retrieved, manipulated, stored.
MODIFICATION HISTORY:
Written by R. S. Hill, ST Sys. Corp., 4 Feb 1991
Correction for PIXELSIZ parameter ne 20, added by J. K. Hill, STX, 2/5/91
Also fixes character-string formatting problem. RSH, STX, 9 April 1991.
Updated to emulate REV 2 calibration WBL 10 Dec 1991
Exp time is read from NEWFRAMES database. N. Collins, HSTX, 24 Feb. 1994
(See /host/bluemoon/usr2/idllib/uit/pro/calfix.pro)
NAME: CCM_UNRED PURPOSE: Deredden a flux vector according to the parameterization of Cardelli, Clayton, and Mathis (1989 ApJ. 345, 245), including the update for the near-UV given by O'Donnell (1994, ApJ, 422, 158). Parameterization is valid from the IR to the far-UV (3.5 microns to 0.1 microns). CALLING SEQUENCE: CCM_UNRED, wave, flux, ebv, funred, [ R_V = ] INPUT: WAVE - wavelength vector (Angstroms) FLUX - calibrated flux vector, same number of elements as WAVE EBV - color excess E(B-V), scalar. If a negative EBV is supplied, then fluxes will be reddened rather than deredenned. OUTPUT: FUNRED - unreddened flux vector, same units and number of elements as FLUX OPTIONAL INPUT KEYWORD R_V - scalar specifying the ratio of total selective extinction R(V) = A(V) / E(B - V). If not specified, then R_V = 3.1 Extreme values of R(V) range from 2.75 to 5.3 EXAMPLE: Determine how a flat spectrum (in wavelength) between 1200 A and 3200 A is altered by a reddening of E(B-V) = 0.1. Assume an "average" reddening for the diffuse interstellar medium (R(V) = 3.1) IDL> w = 1200 + findgen(40)*50 ;Create a wavelength vector IDL> f = w*0 + 1 ;Create a "flat" flux vector IDL> ccm_unred, w, f, -0.1, fnew ;Redden (negative E(B-V)) flux vector IDL> plot,w,fnew NOTES: (1) The CCM curve shows good agreement with the Savage & Mathis (1979) ultraviolet curve shortward of 1400 A, but is probably preferable between 1200 and 1400 A. (2) Many sightlines with peculiar ultraviolet interstellar extinction can be represented with a CCM curve, if the proper value of R(V) is supplied. (3) Curve is extrapolated between 912 and 1000 A as suggested by Longo et al. (1989, ApJ, 339,474) REVISION HISTORY: Written W. Landsman Hughes/STX January, 1992 Extrapolate curve for wavelengths between 900 and 1000 A Dec. 1993 Use updated coefficients for near-UV from O'Donnell Feb 1994
(See /host/bluemoon/usr2/idllib/uit/pro/ccm_unred.pro)
NAME:
CCRTWARP
PURPOSE:
Warps an image to match a reference image. Prompts the user to pick
out corresponding sources on two display channels using cursor.
Neighborhood of cursor is searched for centroid in the image array.
POLY_2D used to do real work a couple of layers down.
CALLING SEQUENCE:
ccrtwarp,ch,chref,oldim,refim,newim[,x,y,xref,yref],$
fwhm=fwhm,missing=missing,degree=degree,fast=fast
INPUT PARAMETERS:
ch = channel number with display of image to be warped
chref = channel number with display of reference image
oldim = image to be warped
refim = image to which the warped image will conform
fwhm [keyword] passed ultimately to CNTRD (centroid) routine.
Default is set by CWARPLIST routine.
missing [keyword] = missing keyword of poly_2d
degree [keyword] = degree of polynomical to be fit; default is 1
fast [keyword] = flag for nearest-neighbor transformation;
default is bilinear interpolation
OUTPUT PARAMETERS:
newim = output image
x, y, xref, yref [optional] = coordinates of corresponding sources
COMMON BLOCKS:
none
SIDE EFFECTS:
none
PROCEDURE:
Calls cwarplist and imwarp. Latter calls POLY_2D.
MODIFICATION HISTORY:
Written by R. S. Hill, ST Systems Corp., 10 April 1991
Degree keyword added. RSH, STX, 15 April 1991
Fast keyword added. RSH, STX, 16 April 1991
CRTWARP changed to CCRTWARP for centroiding from actual image.
RSH, STX, 17 April 1991
fwhm keyword substituted for boxrad. RSH, STX, 2 May 1991.
(See /host/bluemoon/usr2/idllib/uit/pro/ccrtwarp.pro)
NAME: CDEL PURPOSE: To delete a window and update the common blocks. CALLING SEQUENCE: CDEL, IPLANE INPUTS: IPLANE - Image window index. OUTPUTS: None. COMMON BLOCKS: The variable CHAN in the common block TV is set to 0 if it is equal to IPLANE. PROCEDURE: The given window is deleted. REVISION HISTORY: Written by Michael R. Greason, May 1990. OPND variable in common block TV replaced with WINDOW_STATE statement, K.Rhode, STX, 7/90. WINDOW_STATE procedure and the IMAGES common block added. MRG, STX, August 1990.
(See /host/bluemoon/usr2/idllib/uit/pro/cdel.pro)
NAME:
CDROT
PURPOSE:
Rotates matrix by an angle.
CALLING SEQUENCE:
cdrot, cd, newcd, angle
INPUT PARAMETERS:
cd = input matrix (usually astrometric CD's)
angle - angle by which to rotate CD matrix, scalar
OUTPUT PARAMETERS:
newcd = output matrix (usually astrometric CD's)
COMMON BLOCKS:
none
PROCEDURE:
Computes rotation matrix from trig functions, multiplies.
MODIFICATION HISTORY:
Written by J. K. Hill, STX
Double precision. RSH, HSTX, 18 Feb 93.
(See /host/bluemoon/usr2/idllib/uit/pro/cdrot.pro)
NAME: CHAN PURPOSE: To display a different image window and update the common blocks. CALLING SEQUENCE: CHAN, IPLANE, [ /PLOT, /FREE ] INPUTS: IPLANE - Image window index. OUTPUTS: None. OPTIONAL INPUT KEYWORDS: PLOT - If this keyword is set, then a window of the default size is is opened. However, images displayed with CTV will not be displayed to this plane. FREE - If present and non-zero, a free window is created. COMMON BLOCKS: The variable CHAN in the common block TV is updated to the new image plane PROCEDURE: The given window is made active and shown. If it has yet to be opened, it is opened with the WINDOW command REVISION HISTORY: Written, Wayne Landsman, July, 1986 Adapted for IVAS July 1989 Adapted for workstations. Michael R. Greason, May 1990. Removed hard-coding of number of windows W. Landsman January, 1991 Added /FREE keyword J. D. Offenberg Nov, 1991 Removed the RETAIN = 2 default Switch to X windows if not already there W. Landsman Mar 1994
(See /host/bluemoon/usr2/idllib/uit/pro/chan.pro)
NAME:
CHARCURVE
PURPOSE:
To fetch the UIT characteristic curve from its file and return it to the
calling level.
CALLING SEQUENCE:
CHARCURVE, Intensity [, Ind, HDFILE=, HDENTRY= ]
INPUTS:
Ind The optional index in the curve file of the desired curve.
This defaults to 0.
OUTPUTS:
Intensity This is a 4096 element integer array containing the
characteristic curve.
KEYWORDS:
HDFILE If specified, the H&D curve is extracted from this file.
Otherwise, it is retreived from UIT_DATA:newhd.dat
HDENTRY If specified, the H&D curve is assumed to be this entry
in the file. Otherwise, it is assumed to be Ind. This
keyword overrides the Ind parameter.
RESTRICTIONS:
The intensity must be specified.
PROCEDURE:
The file is opened and associated to a 4096 element integer array. The
desired element is stored in the argument, the file is closed, and
execution returns to the calling level.
MODIFICATION HISTORY:
Written by Robert H. Cornett, STX, 24 April 1988.
Modified to the current H&D curve. Documentation added. IND added.
Michael R. Greason, STX, 9 December 1988.
Again modified to a new H&D curve. MRG, STX, 27 March 1990.
Adapted to the new H&D curve. The keywords added. MRG, STX,
MRG, STX, 3 October 1991.
(See /host/bluemoon/usr2/idllib/uit/pro/charcurve.pro)
NAME:
CHECKERBOARD
PURPOSE:
To create a checkerboard array (alternating bytes 0 and 255)
One use of CHECKERBOARD is to study resolution and distortion
on the TV display
CALLING SEQUENCE:
checkerboard,x,[width]
OPTIONAL INPUTS:
width - size of (square) output array. If not supplied, then
a 512 x 512 array will be output
OUTPUTS:
x - byte array containing alternating values
REVISON HISTORY:
written by B. Pfarr and W. Landsman 4/87
(See /host/bluemoon/usr2/idllib/uit/pro/checkerboard.pro)
NAME:
CHECK_FITS
PURPOSE:
Given a FITS array IM, and a associated FITS or STSDAS header HDR, this
procedure will check that
(1) HDR is a string array, and IM is defined and numeric
(2) The NAXISi values in HDR are appropiate to the dimensions
of IM
(3) The BITPIX value in HDR is appropiate to the datatype of IM
If HDR contains a DATATYPE keyword (as in STSDAS files), then this is
also checked against the datatype of of IM
If the UPDATE keyword is present, then FITS header will be modified, if
necessary, to force agreement with the image array
CALLING SEQUENCE:
check_FITS, im, hdr, [ dimen, idltype, /UPDATE, /NOTYPE, /SDAS ]
INPUTS:
IM - FITS or STSDAS array, (e.g. as read by SXREAD or READFITS )
HDR - FITS or STSDAS header (string array) associated with IM
OPTIONAL OUTPUTS:
dimen - vector containing actual array dimensions
idltype- data type of the FITS array as specified in the IDL SIZE
function (1 for BYTE, 2 for INTEGER*2, 3 for INTEGER*4, etc.)
OPTIONAL KEYWORD INPUTS:
/NOTYPE - If this keyword is set, then only agreement of the array
dimensions with the FITS header are checked, and not the
data type.
/UPDATE - If this keyword is set then the BITPIX, NAXIS and DATATYPE
FITS keywords will be updated to agree with the array
/SDAS - If this keyword is set then the header is assumed to be from
an SDAS (.hhh) file. CHECK_FITS will then ensure that (1)
a DATATYPE keyword is included in the header and (2) BITPIX
is always written with positive values.
/FITS - If this keyword is present then CHECK_FITS assumes that it is
dealing with a FITS header and not an SDAS header, see notes
below.
SYSTEM VARIBLE:
If there is a fatal problem with the FITS array or header then !ERR is
set to -1. ( If the UPDATE keyword was supplied, and the header could
be fixed then !ERR = 0.)
PROCEDURE:
Program checks the NAXIS1 and NAXIS2 parameters in the header to
see if they match the image array dimensions.
NOTES:
An important distinction between an STSDAS header and a FITS header
is that the BITPIX value in an STSDAS is always positive, e.g. BITPIX=32
for REAL*4 data. Users should use either the /SDAS or the /FITS
keyword if it is important whether the STSDAS or FITS convention for
REAL*4 data is used. Otherwise, CHECK_FITS assumes that if a
DATATYPE keyword is present then it is dealing with an STSDAS header.
MODIFICATION HISTORY:
Written, December 1991 W. Landsman Hughes/STX to replace CHKIMHD
No error returned if NAXIS=0 and IM is a scalar W. Landsman Feb 93
Fixed bug for REAL*8 STSDAS data W. Landsman July 93
Make sure NAXIS agrees with NAXISi W. Landsman October 93
(See /host/bluemoon/usr2/idllib/uit/pro/check_fits.pro)
NAME: CHKDTYPE PUROPOSE: Compares Datatype of an Image to that stored in its header, and corrects the header if any discrepancy is found (at user's discretion) CALLING SEQUENCE: CHKDTYPE, IM, HD [, /INFO, /SILENT, /AUTO] INPUTS: IM - 2-dimensional image HD - FITS header for IM OUTPUTS: If necessary, BITPIX and DATATYPE fields of HD will be changed. OPTIONAL KEYWORD INPUTS: INFO - Informational status only-- will not change FITS header AUTO - Automatically updates header with new parameters SILENT - Supresses informational messages unless IM and HD disagree. PROCEDURE: Compares BITPIX and DATATYPE in HD to the datatype of IM. If they agree, return. If not, allow the user the option to change the header, unless INFO or AUTO are selected. If the routine returns with the header and image still disagreeing, !ERR is set to -1, otherwise !ERR is set to zero. SIDE EFFECTS: None COMMON BLOCKS: None HISTORY: Written by J. D. Offenberg, Hughes-STX, 05 DEC 1991
(See /host/bluemoon/usr2/idllib/uit/pro/chkdtype.pro)
NAME:
CHNGCAM
PURPOSE:
For UIT images. Transforms astrometry for an NUV image to that for
an FUV image in the same acquisition.
CALLING SEQUENCE:
chngcam, hdn, hdf, [ ANGLE =, COMPRESS = , OFFSET = , DISTORT = ]
INPUT PARAMETERS:
hdn = NUV image header
OPTIONAL INPUT KEYWORDS:
angle = angle of rotation in degrees (DEFAULT = 174.6, 174.87 if image
distortion is present)
compress = compression factor as compared to 20 micron pixel spacing on
film (DEFAULT = 1)
distort = If present and non-zero, forces angle to be 174.87, regardless
of what HDN says. ANGLE keyword over-rides DISTORT.
offset = offset of centers in pixels
(DEFAULT = -[28.62/COMPRESS, 15.11/COMPRESS])
OUTPUT PARAMETERS:
hdf = FUV image header (modified, not created)
PROCEDURE:
Matrix multiplication.
MODIFICATION HISTORY:
Written by J. K. Hill, STX
CRPIX change added. R. S. Hill, STX, 7 March 1991
Image distortion angles added, Updated to use ASTROMETRY structure.
M.R. Greason & J.D. Offenberg Hughes STX, Jan 1993
Brought into conformity with BDR routine ULCCAM. Conversion
based on MRG's angle, together with an FUV-->NUV scale change and a
revised offset. Based on two pairs of images, NUV0402-FUV0496
(M33) and NUV0442-FUV0556 (M81). R. S.Hill, HSTX, 18 Feb 93.
Astrometry recentered on middle of image, in conformity with BDR
version of algorithm. RSH, HSTX, 2 July 1993.
(See /host/bluemoon/usr2/idllib/uit/pro/chngcam.pro)
NAME:
CHNGXY
PURPOSE:
To convert x and y values based on the reference frame of one header
into x and y values based on the reference frame of a new header.
CALLING SEQUENCE:
chngxy,hdr1,x1,y1,hdr2,x2,y2
INPUTS:
hdr1 - first FITS header
x,y - x and y values based on hdr1, scalars or vectors
hdr2 - second FITS header
OUTPUTS:
x2,y2 - x and y values based on hdr2
SIDE EFFECTS:
if hdr2 is at a different equinox, it will be precessed to match
hdr1.
REVISON HISTORY:
written by J. Hill, STX
documented for public use, B. PFarr, STX, 2/91
(See /host/bluemoon/usr2/idllib/uit/pro/chngxy.pro)
NAME CINIT PURPOSE: To initialize the common block TV, TEK, IMAGES, and TAPEINFO (on the SUNs) CALLING SEQUENCE: CINIT INPUTS: None. OUTPUTS: None. COMMON BLOCKS: The common blocks are initialized. SIDE EFFECTS: The TV is reset to zero roam and zoom factors. REVISION HISTORY: Written, Wayne Landsman, July 1986. Converted to workstation use. Michael R. Greason, May 1990. OPND variable removed from common block TV. K.Rhode, July 1990. TAPEINFO added. MRG, STX, October 1990. TEK added, N. Collins, STX, Nov. 28, 1990.
(See /host/bluemoon/usr2/idllib/uit/pro/cinit.pro)
NAME:
CIRCINT
PURPOSE:
Integrate flux in circular apertures. User responsible for
subtracting sky first. See notes (1) and (2) below.
CALLING SEQUENCE:
circint, image, x0, y0, radius, tot, npix, totdif, npixdif, t8, $
mask=mask, /verbose
INPUT PARAMETERS:
image 2-D image array
x0, y0 center of circular apertures (need not be integral)
radius vector of aperture radii
OUTPUT PARAMETERS (see note 2):
tot total raw flux in each aperture
npix number of pixels in each aperture
totdif total raw flux for each annulus (difference of successive
apertures)
npixdif number of pixels in each annulus
t8 like totdif, but each annulus is divided into eight sections
(X dimension = 8, Y dimension = number of annuli). Allows
assessment of error due to lumpiness of distribution, by
method of Djorgovski & King
OPTIONAL INPUT KEYWORDS:
mask Must be same size as image. If a pixel in
the mask is 1, the corresponding pixel in the image is
counted. If 0, the corresponding pixel in the image is
ignored (in all results). See note (3).
verbose Use of /verbose will make the routine tell you what stage
it's at. See note (1).
COMMON BLOCKS:
none
NOTES:
(1) If you aren't sure you've set up right, use the /verbose keyword,
because the routine is fairly slow.
(2) For a surface brightness profile, plot totdif/npixdif vs. radius.
For an aperture growth curve, plot tot vs. radius.
(3) Mask is intended to mask out stars or garbage. Depending on your
application, you might be better off modifying the input image.
SIDE EFFECTS: none
PROCEDURE: Similar to IDL/UIT/DAOPHOT aperture routine.
MODIFICATION HISTORY:
Integrate in circular aperture.
RSH - STX - 20 Aug 1990
Modified to ignore some pixels according to mask image.
RSH - STX - 19 Sept 90
Totals done for annuli rather than discs.
RSH - STX - 20 Sept 90
Use of mask corrected. RSH - STX - 27 Sept 90
Small change to conserve array space. RSH - STX - 5 Nov 90
Fractional-pixel approximation adopted from Wayne Landsman's version
of DAOPHOT APER. Annuli computed from discs. RSH - STX - 17 July 91
Annuli divided into octants for subsequent error estimate due to random
distribution of sources. RSH - STX - 22 July 91
Several bugs fixed. RSH - STX - 3 Oct 91
Spiffed up for UIT IDL library. RSH - Hughes STX - 11 June 92
Speeded up initializaion. RSH - HSTX - 5 August 1993
(See /host/bluemoon/usr2/idllib/uit/pro/circint.pro)
NAME: CIRRANGE PURPOSE: To force an angle into the range 0 <= ang < 360. CALLING SEQUENCE: cirrange, ang INPUTS/OUTPUTS: ang - The angle to modify, in degrees. This parameter is changed by this procedure. Can be a scalar or vector. KEYWORDS: RADIANS - If present and non-zero, the angle is specified in radians rather than degrees. It is forced into the range 0 <= ang < 2 PI. PROCEDURE: The upper limit is added to negative values until there are no more. Then the MOD operator is applied to all the angles to deal with values that are too large. MODIFICATION HISTORY: Written by Michael R. Greason, Hughes STX, 10 February 1994.
(See /host/bluemoon/usr2/idllib/uit/pro/cirrange.pro)
NAME: CLEANPLOT PURPOSE: Reset all system variables (!P,!X,!Y,!Z) set by the user which affect plotting to their default values. CALLING SEQUENCE: Cleanplot INPUTS: None OUTPUTS: None SIDE EFFECTS: The system variables that concern plotting are reset to their default values. A message is output for each variable changed. The CRANGE, S, WINDOW, and REGION fields of the !X, !Y, and !Z system variables are not checked since these are set by the graphics device and not by the user. PROCEDURE: This does NOT reset the plotting device. This does not change any system variables that don't control plotting. RESTRICTIONS: If user default values for !P, !X, !Y and !Z are different from the defaults adopted below, user should change P_old etc accordingly MODIFICATION HISTORY: Written IDL Version 2.3.0 W. Landsman & K. Venkatakrishna May '92 Handle new system variables in V3.0.0 W. Landsman Dec 92
(See /host/bluemoon/usr2/idllib/uit/pro/cleanplot.pro)
NAME:
CLUSTMOD
PURPOSE:
Return the flux of a model star cluster as a function of mass at a
specified age and at specified wavelengths
CALLING SEQUENCE:
CLUSTMOD, w, f, age, expon, [ log_Z, init_M, Mass_Range = ,/Silent
Mdot =, /NoInterp, /OldMaeder , /OldKurucz , Z_evol = ]
INPUTS:
W - wavelength(s) (A) at which to evaluate fluxes. Set W = -1 to
evaluate Lyman continuum fluxes. Wavelengths may be
modified upon output if the /NoInterp keyword is set.
AGE - age (in Myr) of the the star cluster, scalar
OPTIONAL INPUT:
EXPON - power law exponent, uusally negative, scalar or vector
The number of values in expon equals the number of different
power-law components in the IMF
A Saltpeter IMF has a scalar value of expon = -1.35
LOG_Z - Log of the metallicity relative to solar. Values of
LOG_Z = 0.3, 0, -0.4,-0.7, or -1.5 are preferred since these
correspond exactly to available evolutionary tracks. User
prompted if LOG_Z not supplied
OPTIONAL INPUT-OUTPUT
INIT_M - Masses at which to evaluate cluster flux. If not suppled
or set to 0, then INIT_MASS is set equal to the masses used
in the evolution grid of Schaller et al. plus a 20 element
grid for the post main-sequence. Masses are truncated to
those with lifetimes less than AGE.
KEYWORD INPUT:
MASS_RANGE - vector containing upper and lower limits of the IMF and
masses where the IMF exponent changes. The number of values
in mass_range should be one more than in expon. The values
in mass_range should be monotonically increasing.
OPTIONAL KEYWORD INPUTS:
Z_Evol - scalar giving metal abundance to use with evolutionary tracks.
Allowed values are 0.04, 0.02, 0.004, 0.008 or 0.001 for the
new Schaller et al. tracks or 0.002, 0.005, 0.02, or 0.04 if
the OldMaeder keyword is used. If not supplied, then the
value of log_Z is used to select the track with the closest
metallicity.
Mdot - scalar either 1 (default) or 2. If Mdot = 2 then
CLUSTMOD uses evolutionary tracks with the double the mass loss
rate of the deJager parameterization whenever the winds are
driven by radiation pressure (main-sequence + Wolf-Rayet phases)
NoInterp - If this keyword set, then the input wavelengths are rounded
off to the nearest Kurucz model wavelengths. This avoids
interpolation in wavelength and saves considerable time.
OldKurucz - If set and non-zero, then the old (1979) Kurucz models are
used.
OldMaeder - If set and non-zero, then the old (1989) Maeder tracks are
are used.
Silent - If set and non-zero, the informational messages are suppressed
OUTPUT:
F - Flux of star cluster at specified wavelengths and masses
dimension NWAVE by NMASS. Flux units are erg s-1 A-1 cm-2
per solar mass in the cluster. If W = -1 then F is the
number of Lyman continuum photons (x 10(45)) emitted per
solar mass in the cluster.
EXAMPLE:
Compute the flux at 1600 A for a solar metallicity 10Myr old model at
the masses used in the Schaller et al. tracks. Use the IMF of
Lequex (1981) which has an exponent of -0.6 between 0.007 and 1.8
Msun, and an exponent of -1.7 between 1.8 and 120 Msun.
IDL> clustmod, 1600, f, 10, [-.6,-1.7], 0, init_m, mass=[0.007,1.8,120]
REVISION HISTORY:
Written Wayne Landsman September, 1989
Update for new Kurucz models July, 1992
Added /NoInterp keyword September, 1992
(See /host/bluemoon/usr2/idllib/uit/pro/clustmod.pro)
NAME:
CLUST_FLUX
PURPOSE:
Returns the flux of a model star cluster at a specified wavelength
as a function of time.
CALLING SEQUENCE:
CLUST_FLUX, wave, time, expon, flux,[ log_z, init_m, Mass_range = ,
NoInterp = , Z_evol = , OldKurucz =, Oldmaeder = ,
Mdot = mdot, /SILENT ]
INPUTS:
WAVE - Wavelength(s) (A) at which to determine flux, scalar or vector
Set WAVE = -1 to determine the Lyman continuum flux. WAVE
may be modified upon output, if the /NoInterp keyword is set
TIME - Time(s) (in Myr) following starburst at which to evaluate flux,
scalar or vector
EXPON - power law exponent, usually negative, scalar or vector
The number of values in expon equals the number of different
power-law components in the IMF
A Saltpeter IMF has a scalar value of expon = -1.35
KEYWORD INPUT:
MASS_RANGE - vector containing upper and lower limits of the IMF and
masses where the IMF exponent changes. The number of values
in mass_range should be one more than in expon. The values
in mass_range should be monotonically increasing. For
a scalar value of EXPON the default value of MASS_RANGE is
[0.1, 110].
OPTIONAL INPUT:
LOG_Z - Log of the metal abundance relative to solar. Suggested values
are 0.3, 0, -0.4, -0.7, or -1.5. CLUST_FLUX will prompt for
LOG_Z if not supplied.
INIT_M - This parameter determines the discrete masses at which to
evaluate the cluster flux. If INIT_M is not supplied,
or set to 0, then the discrete initial masses of the Schaller
et al (1992) models are used (with a factor of 10 finer grid for
the post-main-sequence). The user can alter this default mass
grid in two ways:
(1) If INIT_M is a vector it is assumed to explicitly contain
each mass at which the cluster flux is to be evaluated
(2) If INIT_M is a scalar positive integer, it specifies how
how many times finer the mass grid should be than the
default; i.e setting INIT_M=2 will double the number of
mass_grid points.
OPTIONAL KEYWORD INPUT:
Z_Evol - scalar giving metal abundance to compute Schaller (1992)
evolution models with. Must be 0.04, 0.02, 0.004, 0.008, or
0.001. If not supplied, then metallicity closest to log_Z is
selected.
NoInterp - If this keyword set, then the input wavelengths are rounded
off to the nearest Kurucz model wavelengths. This avoids
interpolation in wavelength and saves considerable time.
OldKurucz - If this keyword is set and non-zero, then the old (1979)
Kurucz models are used. Cannot be used with /NoInterp
OldMaeder - If set and non-zero, then the old (1989) Maeder tracks are
are used.
Silent - If set and non-zero, informational messages are suppressed
OUTPUT:
FLUX - Flux vector dimensioned NWAVE by NTIME where NWAVE is the number
of elements in WAVE and NTIME is then number of elements in
TIME. Units are ergs s(-1) A(-1) per solar mass formed.
If WAVE = -1, then FLUX is given in 10(45) Lyman continuum
photons per second.
EXAMPLES:
Find the 1600 A flux every Myr during the first 10 Myr, for a star
cluster with an IMF exponent gamma = -2, and upper and lower mass
limits of 0.1 and 110 Msun
IDL> CLUST_FLUX, 1600, indgen(11), -2, f, mass_range = [0.1,110]
REVISION HISTORY:
Written W. Landsman September, 1989
Updated for new Maeder models August, 1992
Added /NoInterp keyword September, 1992
Support multicomponent IMF April, 1993
(See /host/bluemoon/usr2/idllib/uit/pro/clust_flux.pro)
NAME: CNTRD PURPOSE: Compute centroid coordinates of a stellar object using the algorithm in the DAOPHOT FIND subroutine. CALLING SEQUENCE: CNTRD, img, x, y, xcen, ycen, [ fwhm , /SILENT, /DEBUG] INPUTS: IMG - Two dimensional image array X,Y - Scalar or vector integers giving approximate stellar center OPTIONAL INPUT: FWHM - floating scalar; Centroid is computed using a box of half width equal to 1.5 sigma = 0.637* FWHM. CNTRD will prompt for FWHM if not supplied OUTPUTS: XCEN - the computed X centroid position, same number of points as X YCEN - computed Y centroid position, same number of points as Y Values for XCEN and YCEN will not be computed if the computed centroid falls outside of the box, or if the computed derivatives are non-decreasing. If the centroid cannot be computed, then a message is displayed and XCEN and YCEN are set to -1. OPTIONAL OUTPUT KEYWORDS: SILENT - Normally CNTRD prints an error message if it is unable to compute the centroid. Set /SILENT to suppress this. DEBUG - If this keyword is set, then CNTRD will display the subarray it is using to compute the centroid. PROCEDURE: Maximum pixel within distance from input pixel X, Y determined from FHWM is found and used as the center of a square, within which the centroid is computed as the value (XCEN,YCEN) at which the derivatives of the partial sums of the input image over (y,x) with respect to (x,y) = 0. MODIFICATION HISTORY: Written 2/25/86, by J. K. Hill, S.A.S.C., following algorithm used by P. Stetson in DAOPHOT. Improved error checking W. Landsman August, 1991 Allowed input vectors G. Hennessy April, 1992 Fixed to prevent wrong answer if floating pt. X & Y supplied W. Landsman March, 1993
(See /host/bluemoon/usr2/idllib/uit/pro/cntrd.pro)
NAME: COLOR2PHOT PURPOSE: Extracts objects from a UITPHOT table, selecting those with colors and magnitudes between an interactively specified ranges. This is a SHOWPHOT procedure. CALLING SEQUENCE: flg = color2phot([sel, WIDTH=wdth, SILENT=slnt, TXTWDGT=outtext, BASWDGT=baswdgt,] INSWDGT=instext) sel - A structure array containing position/magnitude information for the selected stars. Each element contains: XI - The x coordinate of the star in the image. YI - The y coordinate of the star in the image. XT - The x coordinate of the star in the table. YT - The y coordinate of the star in the table. RA - The right ascension of the star, in degrees. DEC - The declination of the star, in degrees. EQNX - The equinix of the celestial coordinates. MAG1 - The first aperture magnitude of the star. ERR1 - The first aperture magnitude error. MAG2 - The second aperture magnitude of the star. ERR2 - The second aperture magnitude error. MAG3 - The third aperture magnitude of the star. ERR3 - The third aperture magnitude error. MAGPSF - The PSF magnitude of the star. ERRPSF - The PSF magnitude error. SKY - The sky flux. ERRSKY - The sky error. IND - The index in the table of the star. FILTER - The table's filter. COLOR - A structure containing the UV color of the star. This structure contains the color, and two strings indicating the filters used. returned - The number of positions that have been selected and extracted. KEYWORDS: BASWDGT - The widget id for the most basic widget. This is the widget maintaining the SHOWPHOT command menu and is used here to desensitize that menu while objects are being extracted from the table. INSWDGT - The instruction widget. This is where the instructions for the use of this function are written. This keyword is mandatory. SILENT - If present and non-zero AND if sel has been specified on the command line, information concerning each selected star is not written to the screen. TXTWDGT - If present and non-negative, and if FILE has not been specified, the output is written to this widget instead of the standard output. WIDTH - Defines the size of the full-width half-max used in the centroid, the size of the boxes displayed about the stars, and the maximum separation between the table and image star positions defining a match. 1/3 of this number is used to determine the maximum separation. COMMON BLOCKS: Image_Blk The image common block. See IMG_INIT for details. Table_Bk1 The first FITS table block. See TAB_INIT for details. Table_Bk2 The second FITS table block. See TAB_INIT for details. Color_Share Provides the event handler with the variables it needs from COLOR2PHOT. PROCEDURE: A set of widgets are created to allow the user to interactively specify the ranges (through a set of sliding bars). The user finalizes the range by pressing either the Abort button (which cancels further processing), or one of the Done buttons (one will cause the objects' info to be written to the Output widget while the other suppresses this output). All objects with colors and magnitudes between the range are then extracted from the table. MODIFICATION HISTORY: Written by Michael R. Greason, Hughes STX, 1 May 1992. Position indexing problem corrected. MRG, HSTX, 16 July 1992.
(See /host/bluemoon/usr2/idllib/uit/pro/color2phot.pro)
NAME:
COLORMAG
PURPOSE:
Create a color-magnitude plot from 2 uitphot tables.
CALLING SEQUENCE:
Colormag,filename1,head1,filename2,head2,cdst
INPUTS:
filename1 - name of nuv fits table 1 (example: nuv0388t1_1 )
head1 - header with GOOD astrometry for file1
filename2 - name of fuv fits table 2 (example:fuv0485t1_1 )
head2 - header with GOOD astrometry fof file2
cdst - critical distance, in real pixels for determining matches
KEYWORD INPUTS:
title - string for title of plot
xmin - min x value (from first image)
xsize - length of x (from first image)
ymin - min y value (from first image)
ysize - length of y (from first image)
OUTPUT:
none
SIDE EFFECTS:
REVISION HISTORY:
Written, B. PFarr, STX, 2/91
(See /host/bluemoon/usr2/idllib/uit/pro/colormag.pro)
NAME:
COMPRESS
PURPOSE:
Create a compressed image on disk. Combines the function of
STRD, HREBIN, and STWRT.
CALLING SEQUENCE:
compress, name, OUTSIZE = outsize, [ OUTNAME = , BOXAVE = ]
INPUTS:
name - scalar string giving the name of the SDAS file containing the
big image.
OPTIONAL KEYWORD INPUT:
OUTSIZE - two element vector giving the size of the output image to be
created. The default output size is 512 by 512.
OUTNAME - scalar string giving the name of the output image file
If not supplied, the default is created by
(1) Using the first 7 letters of the input file name
(2) Appending a 'G' for geomed images, and a 'Q13'
for QUICK13 images
(3) Appending a 'C' (for compressed image)
BOXAVE - if this keyword is set and non-zero then the compress image is
created using the BOXAVE function rather than the REBIN function.
BOXAVE always computes intermediate steps using REAL*4
arithmetic and so is much slower, but should be used when
photometric accuracy is needed.
EXAMPLE:
A 2048 x 2048 UIT image 'FUV0537Q13E' exists on the default directory.
Create a 512 x 512 compressed image named FUV0537Q13C
IDL> COMPRESS, 'FUV0537Q13E'
SIDE EFFECTS:
A new SDAS image file is created on disk
REVISION HISTORY
Written W. Landsman October 1991
Fixed up for non-UIT images W. Landsman February, 1991
(See /host/bluemoon/usr2/idllib/uit/pro/compress.pro)
NAME:
COMP_NITE
PURPOSE:
To determine the sunset and sunrise times for a shuttle in orbit
during a given range of time.
CALLING SEQUENCE:
comp_nite, times, start_time, stop_time [, time_res]
INPUTS:
start_time - The start of the time range, in hours MET.
stop_time - The end of the time range, in hours MET.
time_res - The time resolution (the max. error in the reported
times), in hours. Defaults to 15 sec. (note: going
much finer will result in arithmetic errors).
OUTPUTS:
times - An array of structures containing sunrise and sunset
times, in hours MET. The structure declaration is:
{TIME_STRCT, rise_time:0.0d, set_time:0.0d}
COMMON BLOCKS:
mission_comm - Contains a structure which, in turn, contains the
orbit parameters.
RESTRICTIONS:
The SETORB procedure must be called before using this procedure.
PROCEDURE:
CALL_EXTERNAL is used to call the "compnite" C function. This
function steps through the time range, in time_res increments,
looking for changes between day and night. These times are
recorded in the output arrays.
MODIFICATION HISTORY:
Written by Michael R. Greason, Hughes STX, 20 November 1992.
(See /host/bluemoon/usr2/idllib/uit/pro/comp_nite.pro)
NAME: CONS_DEC PURPOSE: Returns a set of Y pixels values, given an image with astrometry, and either (1) A set of X pixel values, and a scalar declination value, or (2) A set of declination values, and a scalar X value Form (1) can be used to find the (X,Y) values of a line of constant declination. Form (2) can be used to find the Y positions of a set declinations, along a line of constant X. CALLING SEQUENCE: Y = CONS_DEC( DEC, X, CD, ASTR, ALPHA) INPUTS: DEC - Declination value(s) in DEGREES (-!PI/2 < DEC < !PI/2). If X is a vector, then DEC must be a scalar. X - Specified X pixel value(s) for line of constant declination If DEC is a vector, then X must be a scalar. ASTR - Astrometry structure, as extracted from a FITS header by the procedure EXTAST OUTPUT: Y - Computed set of Y pixel values. The number of Y values is the same as either DEC or X, whichever is greater. OPTIONAL OUTPUT: ALPHA - the right ascensions (DEGREES) associated with the (X,Y) points RESTRICTIONS: Program will have difficulty converging for declination values near 90. For tangent (gnomonic) projections only. REVISION HISTORY: Written, Wayne Landsman STX Co. April 1988 Algorithm adapted from AIPS memo 27. by Eric Griessen Use new astrometry structure, W. Landsman HSTX Jan. 1994
(See /host/bluemoon/usr2/idllib/uit/pro/cons_dec.pro)
NAME: CONS_RA PURPOSE: Return a set of X pixel values given an image with astrometry, and either (1) a set of Y pixel values, and a scalar right ascension, or (2) a set of right ascension values, and a scalar Y value. In usage (1), CONS_RA can be used to determine the (X,Y) values of a line of constant right ascension. In usage (2), CONS_RA can used to determine the X positions of specified RA values, along a line of constant Y. CALLING SEQUENCE: X = CONS_RA( RA, Y, ASTR) INPUTS: RA - Right Ascension value in DEGREES (0 < RA < 2*PI). If Y is a vector, then RA must be a scalar Y - Specified Y pixel value(s) for line of constant right ascension If RA is a vector, then Y must be a scalar ASTR - Astrometry structure as extracted from a FITS header by the procedure EXTAST OUTPUTS X - Computed set of X pixel values. The number of elements of X is the maximum of the number of elements of RA and Y. RESTRICTIONS: Program will have difficulty converging for declination values near 90. For tangent projection only. REVISION HISTORY: Written, Wayne Landsman STX Co. April, 1988 Algorithm adapted from AIPS memo No. 27 by Eric Griessen New astrometry structure
(See /host/bluemoon/usr2/idllib/uit/pro/cons_ra.pro)
NAME: CONTRAST PURPOSE: Use the mouse to change the slope and Y intercept of the color lookup table on an X windows display. CALLING SEQUENCE: CONTRAST, [ cont ] OPTIONAL INPUT: CONT - If this optional parameter is supplied and non-zero, then CONTRAST is initialized by placing the cursor at the position of the previous call to CONTRAST. Otherwise, CONTRAST initializes with the cursor in the center of the image. OUTPUT: None SIDE EFFECTS: Mouse button enabled: LEFT - Reverses black and white RIGHT - Exit PROCEDURE: The y position (0-!D.Y_SIZE) is converted into a slope of range -10 to 10 by using a tangent function. The x position (0-!D.X_SIZE) is converted into a Y-intercept range of -128 to 128. COMMON BLOCKS: The COLORS common block (see LOADCT) store the modified color table The CONTRAST common block stores the final position of the cursor. REVISION HISTORY: Adapted from IVAS version on contrast, B. Pfarr, STX, 1/91 Added CONT parameter W. Landsman STX August, 1991
(See /host/bluemoon/usr2/idllib/uit/pro/contrast.pro)
- NAME: CONV_STSDAS PURPOSE: Convert the internal format of an STSDAS image (.hhh and .hhd file) to the host machine architecture. Useful for copying STSDAS files between different machines. If the host is not a Vax, then by default CONV_STSDAS assumes the image originated on a Vax. If the host is a Vax, then CONV_STSDAS assumes that the image originated on an IEEE machine (e.g. SparcStation). CALLING SEQUENCE: CONV_STSDAS, sdas_name, [ /FROM_IEEE] INPUTS: sdas_name - scalar string giving name of the STSDAS (.hhh and .hhd) image. Do not supply the filename extension. The internal format of this file will be modified by CONV_STSDAS. OPTIONAL KEYWORD INPUT: /FROM_IEEE - On little endian machines (mipsel, ms-dos) this keyword indicates that the STSDAS file originated on an IEEE machine (e.g SparcStation) rather than a Vax. EXAMPLE: Suppose files test.hhd and test.hhh have been copied with FTP from a Vax to a Sparcstation. Convert these files to the SparcStation internal format. IDL> conv_stsdas, 'test' METHOD: CONV_STSDAS reads each group image and parameter block and uses IEEE_TO_HOST or CONV_VAX_UNIX to convert the internal format. The converted images and parameter blocks are written back to the orginal file. PROCEDURE CALLS sxopen, fdecomp, datatype, sxgpar, ieee_to_host, conv_vax_unix NOTES: (1) When copying STSDAS files to a Vax, be sure the .hhh file is formatted as fixed block 80 byte. (2) CONV_STSDAS has no way of knowing if a file really came from a different machine architecture. If it is applied to a file that already has the correct internal format, then CONV_STSDAS will "convert" this file and corrupt the internal format. REVISION HISTORY: Written W. Landsman January, 1993 Don't require .hhh extension April, 1993 Increase speed by calling SXGINFO May, 1993 - On_error,2
(See /host/bluemoon/usr2/idllib/uit/pro/conv_stsdas.pro)
NAME:
CONV_VAX_UNIX
PURPOSE:
To convert VAX IDL data types to UNIX (Sun,MIPS,etc.) IDL data types.
The architecture is obtained from IDL sys.var. !VERSION.ARCH.
CALLING SEQUENCE:
var_unix = conv_vax_unix( var_vax )
INPUT-OUTPUT PARAMETER:
variable
The data variable to be converted. This may be a scalar
or an array. All IDL datatypes are valid (including structures).
The result of the conversion is returned by the function.
INPUT KEYWORD:
TARGET_ARCH = name (string) of desired target architecture
if using this function on a VAX.
otherwise !VERSION.ARCH is used to determine the conversion.
Valid names are 'sparc','386','386i',',or 'mipsel'
EXAMPLE:
Read a 100 by 100 matrix of floating point numbers from a data
file created on a VAX. Then convert the matrix values into Sun format.
IDL> openr,1,'vax_float.dat'
IDL> data = fltarr(100,100)
IDL> forrd,1,data
IDL> data = conv_vax_unix( data )
MODIFICATION HISTORY:
Written F. Varosi August 1990
Added support for MIPSEL (DecStation) P. Keegstra April 1992
(See /host/bluemoon/usr2/idllib/uit/pro/conv_vax_unix.pro)
NAME
COORDPLOT
PURPOSE
Compares two sets of coordinates by plotting vectors between original
and final positions. Results are plotted on an IDL plot window.
CALLING SEQUENCE
Coordplot, First_x, First_y, Second_x, Second_y [,window = w, mag = m, $
/large, /hardcopy, title= t]
INPUTS:
First_x, First_y: Vectors containing X and Y coordinates of points in
the first image
Second_x, Second_y: vectors containing X and Y coodinates of points in
the second image. SEE RESTRICTIONS.
OPTIONAL INPUTS:
Window: Specify IDL Window number. If no number is specified, routine
selects a currently free window.
Mag: Specify magnitude of differential vectors. Default is x10.
Large: Output window is 824 x 824 pixels. Default is 512 x 512
Hardcopy: If present and non-zero, routine will automatically print
out the coordplotted window (intended for use with the LARGE
keyword). This uses the TVLASER routine. See TVLASER for
more details.
Title: Specify title of plot for hardcopy
OUTPUTS:
None.
SIDE EFFECTS:
A plot window is created.
RESTRICTIONS:
First_x, First_y, Second_x, Second_y must all be one-dimensional arrays
and all have the same number of elements. There must be a one-to-one
relation between the points in the four sets (i.e. The Nth item of each
array must correspond to the same image data point in all four cases)
COMMON BLOCKS:
None.
MODIFICATION HISTORY
Created from scratch by Joel D. Offenberg, STX, Aug 1991
Based on a concept by Kanav Bhagat, STX.
(See /host/bluemoon/usr2/idllib/uit/pro/coordplot.pro)
NAME: COORD_INDEX PURPOSE: A SHOWPHOT procedure to find cross-index two sets of coordinates, looking for unique matches. CALLING SEQUENCE: coord_index, x1, y1, x2, y2, ind1, ind2 [, SEPARATION=sep] INPUTS: x1 An array containing the first coord. of the first set of coords. y1 An array containing the second coord. of the first set of coords. x2 An array containing the first coord. of the second set of coords. y2 An array containing the second coord. of the second set of coords. OUTPUTS: ind1 The array of indices indicating which elements in the second coordinate set match the elements in the first. -1's indicate unmatched elements. ind2 The array of indices indicating which elements in the first coordinate set match the elements in the second. -1's indicate unmatched elements. KEYWORDS: SEPARATION Indicates the maximum separation allowed between matching coordinates. This parameter may be no less than 0.5 and it defaults to 1. RESTRICTIONS: The two components of each set of coordinates must have the same length. The two sets of coordinates need not. PROCEDURE: SRCOR is used to find the matches between the two tables. The index arrays returned by this procedure are then converted into the format required by SHOWPHOT (seen the OUTPUTS section above). MODIFICATION HISTORY: Written by Michael R. Greason, Hughes STX, 28 April 1992. Rewritten using SRCOR. MRG, Hughes STX, 15 May 1992.
(See /host/bluemoon/usr2/idllib/uit/pro/coord_index.pro)
NAME: COPYCHAN PURPOSE: To copy an image from one window to another. X-windows version CALLING SEQUENCE: copychan, in, out, [ /PIXMAP] OPTIONAL INPUTS: in - window to be copied (0-127), this window must already exist out - window to copy to (0-127). If the output window does not already exist, it will be created COPYCHAN will prompt for the input and output windows if not supplied OUTPUTS: none SIDE EFFECTS: Image on input window is copied to output window. The active window is not changed. EXAMPLE: An image in plane 0 will have graphics written over it by VIDEO. Save the pristine image in a PIXMAP so that it can be quickly redisplayed. IDL> COPYCHAN,0,5,/PIX ;Save image in pixmap on window 5 .........VIDEO graphics overlay commands IDL> COPYCHAN,5,0 ;Restore the pristine image REVISION HISTORY: written by W. Landsman February, 1991
(See /host/bluemoon/usr2/idllib/uit/pro/copychan.pro)
NAME: correl_images PURPOSE: Computes the 2-D cross-correlation function of two images for a range of (x,y) shifting by pixels of one image relative to the other. CATEGORY: E3 correlation (image) CALLING SEQUENCE: Result = correl_images( image_A, image_B ) INPUTS: image_A, image_B = the two images of interest. KEYWORDS: XSHIFT = the + & - shift to be applied in X direction, default=7. YSHIFT = the Y direction + & - shifting, default=7. XOFFSET_B = initial X pixel offset of image_B relative to image_A. YOFFSET_B = Y pixel offset, defaults are (0,0). REDUCTION = optional reduction factor causes computation of Low resolution correlation of bin averaged images, thus faster. Can be used to get approximate optimal (x,y) offset of images, and then called for successive lower reductions in conjunction with CorrMat_Analyze until REDUCTION=1, getting offset up to single pixel. MAGNIFICATION = option causes computation of high resolution correlation of magnified images, thus much slower. Shifting distance is automatically = 2 + Magnification, and optimal pixel offset should be known and specified. Optimal offset can then be found to fractional pixels using CorrMat_Analyze( correl_images( ) ). /N