[Previous]
[Next]
NAME:
ZANG
PURPOSE:
Determine the angular size of an object as a function of redshift
EXPLANATION:
Requires an input size in kpc and returns an angular size in arc seconds
Default cosmology has a Hubble constant of 70 km/s/Mpc, Omega (matter)
=0.3 and a normalized cosmological constant Lambda = 0.7; however these
values can be changed with apropriate keywords.
CALLING SEQUENCE:
angsiz = zang( dl, [ z, H0 =, Omega_m =, Lambda0 = , q0 = , k =,
/SILENT] )
INPUTS:
dl - linear size of the object *in kpc*, non-negative scalar or vector
z - redshift of object, postive scalar or vector
Either dl and z must have the same number of elements, or at least
one of them must be a vector.
OPTIONAL INPUT KEYWORDS
H0 - Hubble constant in km/s/Mpc, default is 70
No more than two of the following four parameters should be
specified. None of them need be specified, default values are given
k - curvature constant, normalized to the closure density. Default is
0, indicating a flat universe
Omega_m - Matter density, normalized to the closure density, default
is 0.3. Must be non-negative
Lambda0 - Cosmological constant, normalized to the closure density,
default is 0.7
q0 - Deceleration parameter, numeric scalar = -R*(R'')/(R')^2, default
is -0.5
Note that Omega_m + lambda0 + k = 1 and q0 = 0.5*omega_m - lambda0
OUTPUT:
angsiz - Angular size of the object at the given redshift in
arc seconds
CALLS: ***
LUMDIST
EXAMPLE:
(1) What would be the angular size of galaxy of diameter 50 kpc at a redshift
of 1.5 in an open universe with Lambda = 0 and Omega (matter) = 0.3.
Assume the default Hubble constant value of 70 km/s/Mpc.
IDL> print,zang(50,1.5, Lambda = 0,omega_m = 0.3)
====> 6.58 arc seconds
(2) Now plot the angular size of a 50 kpc diameter galaxy as a function of
redshift for the default cosmology (Lambda = 0.7, Omega_m=0.3) up to
z = 0.5
IDL> z = findgen(50)/10. + 0.1 ;Angular size undefined at z = 0
IDL> plot,z,zang(50,z),xtit='z',ytit='Angular Size (")'
NOTES:
This procedure underwent a major revision in April 2000 to allow for a
cosmological constant, ***including a change of the calling sequence***
Be sure to supply the input linear size dl in units of kpc.
PROCEDURES CALLED:
LUMDIST() -- Calculates the luminosity distance
REVISION HISTORY:
Written J. Hill STX July, 1988
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite to call LUMDIST function W. Landsman April 2000
[Previous]
[Next]
NAME:
ZBRENT
PURPOSE:
Find the zero of a 1-D function up to specified tolerance.
EXPLANTION:
This routine assumes that the function is known to have a zero.
Adapted from procedure of the same name in "Numerical Recipes" by
Press et al. (1992), Section 9.3
CALLING:
x_zero = ZBRENT( x1, x2, FUNC_NAME="name", MaX_Iter=, Tolerance= )
INPUTS:
x1, x2 = scalars, 2 points which bracket location of function zero,
that is, F(x1) < 0 < F(x2).
CALLED BY:
FIND_TANGENT, FITEXY, temcal
Note: computations are performed with
same precision (single/double) as the inputs and user supplied function.
REQUIRED INPUT KEYWORD:
FUNC_NAME = function name (string)
Calling mechanism should be: F = func_name( px )
where: px = scalar independent variable, input.
F = scalar value of function at px,
should be same precision (single/double) as input.
OPTIONAL INPUT KEYWORDS:
MAX_ITER = maximum allowed number iterations, default=100.
TOLERANCE = desired accuracy of minimum location, default = 1.e-3.
OUTPUTS:
Returns the location of zero, with accuracy of specified tolerance.
PROCEDURE:
Brent's method to find zero of a function by using bracketing,
bisection, and inverse quadratic interpolation,
EXAMPLE:
Find the root of the COSINE function between 1. and 2. radians
IDL> print, zbrent( 1, 2, FUNC = 'COS')
and the result will be !PI/2 within the specified tolerance
MODIFICATION HISTORY:
Written, Frank Varosi NASA/GSFC 1992.
FV.1994, mod to check for single/double prec. and set zeps accordingly.
Converted to IDL V5.0 W. Landsman September 1997
Use MACHAR() to define machine precision W. Landsman September 2002
[Previous]
[Next]
Name: zbuff2file
Purpose:
write the image current Z-buffer image to an image file
(gif,tiff,jpeg and png supported formats)
Input Parameters:
filename - filename for (output) image file
r,g,b - optional color table (gif, png, and tiff only)
- default is current
Keyword Parameters:
gif - switch, if set, use write_gif (file gets .gif extension)
png - switch, if set, use write_png (file gets .png extension)
tiff - switch, if set, use tiff_write (file gets .tiff extention)
jpeg - switch, if set, use write_jpeg (file gets .jpg extentsion)
outdir - output directory (may also be supplied as part of FILENAME)
quality - passed to write_jpeg
xwin - switch, if set, read the current window and transfer to zbuff
Calling Sequence:
zbuff2file, filename [,r,g,b, /gif, /png, /jpeg, /tiff, outdir=outdir]
CALLED BY:
LATEST_SFDS_GIF, ROLL_PLOT, data2files, disp_gen [1], disp_gen [2]
disp_sci160k [1], disp_sci160k [2], eit_proton_summary, fits_disp_month [1]
fits_disp_month [2], full_graph_gif, image2movie, jitter_gif_xyimg
mon_health [1], mon_health [2], new_disp_sci5k [1], new_disp_sci5k [2]
new_edac_summary, new_mon_health [1], new_mon_health [2], plot_door_open
plot_loi_summary [1], plot_loi_summary [2], plot_shutter_perf, show_contacts
soon_cadence, soon_catstat, sooncat_cadence, ssw_findstuff2html, timeline
trace_cosmic2hist_accum, write_trace, wrt_sci160k_img, xdisp_fits
Restrictions:
image must currently reside in Z-buffer
History:
17-jul-1995 (S.L.Freeland)
9-jun-1996 (S.L.Freeland) default quality
10-feb-1997 (S.L.Freeland) fix problem when outfile contained "."
19-Nov-1998 (M.D.Morrison) Added /xwin
8-Jun-1999 (M.D.Morrison) Reapplied 5-Aug-1998 patch to merge two
diverging versions
5-Aug-1998>> (M.D.Morrison) Don't do SET_PLOT if device was zbuff
(since it resets !p parameters like
!p.color and !p.background)
13-Sep-1999 (S.L.Freeland) - merge SLF 11-aug-1999 change
WARN/dont abort on null images
11-Apr-2000 (S.L.Freeland) - fix the endif/endcase (V5.3 requirement)
19-Nov-2000 (B.N.Handy) - Add PNG support
21-Nov-2000 (B.N.Handy) - Document PNG support
13-Aug-2003, William Thompson, Use SSW_WRITE_GIF instead of WRITE_GIF
[Previous]
[Next]
NAME:
ZENPOS
PURPOSE:
Return the zenith RA and Dec in radians for a given Julian date.
CALLING SEQUENCE:
ZENPOS, Date, Ra, Dec
INPUT:
Date The Julian date, in double precision, of the date and time
for which the zenith position is desired, scalar or vector.
OUTPUTS:
Ra The right ascension in RADIANS of the zenith.
Dec The declination in RADIANS of the zenith.
PROCEDURE:
The local sidereal time is computed; this is the RA of the zenith.
It and the observatories latitude (corresponding to the Dec.) are
converted to radians and returned as the zenith direction.
PROMPTS:
ZENPOS will prompt for the following 3 parameters if they are not
defined in the common block SITE (see below)
LAT,LNG - north latitude and east longitude of the desired location
in DEGREES
TZONE - Time Zone (in hours) of the desired location (e.g. 4 = EDT,
5 = EST)
CALLS: ***
CT2LST
COMMON BLOCKS:
SITE - This common block should contain the three scalars LAT, LNG
and TZONE
PROCEDURE CALLS:
CT2LST - Convert to Local Mean Sidereal Time
MODIFICATION HISTORY:
Written by Michael R. Greason, STX, 14 October 1988.
Converted to IDL V5.0 W. Landsman September 1997
Update documentation, longitude now *east* of Greenwich W.L. July 2000
[Previous]
[Next]
NAME:
zformat
PURPOSE:
To format some output as hex. It's needed because of
handling of negative integer numbers and because of
a problem with the alpha's
SAMPLE CALLING SEQUENCE:
out = zformat(888)
out = zformat(in, n)
CALLS: ***
ARR2STR [1], Arr2Str [2]
CALLED BY:
mk_ff_patch, timeline, topsdb [1], topsdb [2], web_seq
OPTIONAL KEYWORD INPUT:
caps - If set, make the alphabetic characters upper
case
mdi_leading - If set, prepend a "0x" to the output.
string - If set, then make the output a single string
HISTORY:
Written 11-Jul-96 by M.Morrison
[Previous]
[Next]
NAME:
ZIMAGE
PURPOSE:
The purpose of this program is to display an image which
can be zoomed by drawing a rubberband box on top of it. The
"zoomed" image appears in its own window.
AUTHOR:
FANNING SOFTWARE CONSULTING
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
CATEGORY:
Image Processing, Widgets.
CALLING SEQUENCE:
ZIMAGE, image
INPUTS:
image: A 2D array of image data.
KEYWORD PARAMETERS:
BOTTOM: The lowest color index of the colors to be used (see
NCOLORS). The default is 0.
COLORINDEX: The color index for the rubberband box. This index will
be loaded with a green color. Whatever color is there will
be restored when the ZIMAGE program exits. The default is
NCOLORS + BOTTOM.
NCOLORS: This is the number of colors to use when displaying the
image. The default is !D.N_COLORS-2.
GROUP_LEADER: This keyword is used to assign a group leader to this
program. This program will be destroyed when the group
leader is destroyed. Use this keyword if you are calling
ZIMAGE from another widget program.
NOINTERPOLATION: Setting this keyword causes nearest neighbor resampling of
of the zoomed image instead of the default bilinear interpolation
of resampled pixels.
OUTPUTS:
None.
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], FILEPATH, WHAT_BUTTON_PRESSED
WHAT_BUTTON_RELEASED, XCOLORS [1], XCOLORS [2], XCOLORS [3], XCOLORS [4]
XCOLORS [5], XMANAGER, ZIMAGE_CLEANUP, ZIMAGE_COLORS, ZIMAGE_DRAW_EVENTS
ZIMAGE_FACTOR, ZIMAGE_QUITTER
COMMON BLOCKS:
None.
SIDE EFFECTS:
The COLORINDEX color is turned to green while the rubberband box
is being drawn. The color is restored after the box is drawn.
RESTRICTIONS:
Uses XCOLORS from the Coyote Library:
http://www.dfanning.com/programs/xcolors.pro
PROCEDURE:
Clicking the left mouse button allows you to drag a rubberband box
over the portion of the window you want to zoom into.
Clicking the right mouse button calls up hidden controls that allow
you to load different color tables and set the zoom factor.
The rubberband box is drawn with pixmaps and the "device copy"
technique.
This is an excellent example of how you can take advantage of the
widget program *as* the loop do to something (i.e., draw the box)
that in a regular IDL program would have to be done in a loop. Motion
events are only turned on for the draw widget when the box has to be
drawn.
EXAMPLE:
To display an image you can zoom into, type:
ZIMAGE, image
MODIFICATION HISTORY:
Written by: David Fanning, 15 August 96.
Fixed a !D.N_Colors problem. 17 June 98.
Made modifications so program works in 24-bit environment. 28 July 98. DWF.
Fixed a problem with the pop-up controls under certain circumstances.
13 Oct 98. DWF.
Added 24-bit color response. 13 Oct 98. DWF.
Added ability for each window to have its own color changing tool. 9 Oct 99. DWF.
Small changes, error checking. 24 April 2000. DWF.
Modified draw widget error handling to be consistent with current programming
practices. 26 April 2001. DWF.
[Previous]
[Next]
NAME:
zoom_blink
PURPOSE:
To super-impose two images and blink between them.
SAMPLE CALLING SEQUENCE:
zoom_blink img1, img2
zoom_blink img1, img2, delay
CALLS: ***
BOX_RESTORE, EXPAND, GRID_OVER
HISTORY:
Received from Alan Title (Karl Schriver) 7-May-96
and put online by M.Morrison
7-May-96 (MDM) - Replaced all "nint" references with "round"
[Previous]
[Next]
PROJECT:
SDAC
NAME:
ZOOM_COOR
PURPOSE: This provides a query to mark the corners of an image box range.
CATEGORY: graphics
CALLING SEQUENCE: zoom_coor,x,y
CALLED BY:
FSPLOT, HXRBS, PLOT_CRAB
EXAMPLES: zoom_coor,x,y
INPUTS: none.
OUTPUTS: x & y ; start and stop limits on x and y axis from chosen points.
CALLS: ***
CROSSBAR [1], CROSSBAR [2]
RESTRICTIONS: Works on all IDL graphics supported by cursor.
HISTORY: Shelby Kennard 21Feb1991
CONTACT: richard.schwartz@gsfc.nasa.gov
[Previous]
[Next]
NAME:
ZOOM_SINGLE
PURPOSE:
Display part of an image (or graphics) from the current window
expanded in another window and exit - version for event driven
CATEGORY:
Display.
CALLING SEQUENCE:
Zoom, .... Keyword parameters.
INPUTS:
All input parameters are keywords.
Fact = zoom expansion factor, default = 4.
Interp = 1 or set to interpolate, otherwise pixel replication is used.
xsize = X size of new window, if omitted, 512.
ysize = Y size of new window, default = 512.
scale - if set, tvscl
Continuous = keyword param which obviates the need to press the
left mouse button. The zoom window tracks the mouse.
Only works well on fast computers.
CALLED BY:
update_image, xspr [1], xspr [2], xstepper_event
COMMON BLOCKS:
None.
SIDE EFFECTS:
A window is created / destroyed.
RESTRICTIONS:
Only works with color systems.
PROCEDURE:
Straightforward.
MODIFICATION HISTORY:
SLF, revision of ZOOM which exits immediately - used for widget
event drivers (loop removed)
[Previous]
[Next]
NAME:
ZOOM_XY
PURPOSE:
Converts X, Y position on the image array to the the X,Y position
in the current window. (These positions are identical
only for an unroamed, zoomed image with with pixel (0,0) of the
image placed at position (0,0) on the TV.)
CALLING SEQUENCE:
ZOOM_XY, Xim,Yim,Xtv,Ytv, [ OFFSET =, ZOOM = ]
INPUTS:
XIM - Scalar or vector giving X position(s) as read on the image
display (e.g. with CURSOR,XIM,YIM,/DEVICE)
YIM - Like XTV but giving Y position(s) as read on the image display.
If only 2 parameters are supplied then XIM and YIM will be modfied
on output to contain the converted coordinates.
CALLED BY:
TVLASER
OPTIONAL KEYWORD INPUT:
OFFSET - 2 element vector giving the location of the image pixel (0,0)
on the window display. OFFSET can be positive (e.g if the
image is centered in a larger window) or negative (e.g. if the
only the central region of an image much larger than the window
is being displayed.
Default value is [0,0], or no offset.
ZOOM - Scalar specifying the magnification of the window with respect
to the image variable.
OUTPUTS:
XTV,YTV - REAL*4 X and Y coordinates of the image corresponding to the
cursor position on the TV display. Same number of elements as
XIM, YIM.
COMMON BLOCKS:
If present, ZOOM_XY will use the TV and IMAGE common blocks which are
defined in the MOUSSE software system (see
http://archive.stsci.edu/uit/analysis.html )If the user is not using
the MOUSSE software (which keeps track of the offset and zoom in each
window) then the common blocks are ignored.
NOTES:
The integer value of a pixel is assumed to refer to the *center*
of a pixel.
REVISON HISTORY:
Adapted from MOUSSE procedure of the same name W. Landsman HSTX Mar 1996
Converted to IDL V5.0 W. Landsman September 1997
Properly include ZOOM keyword W. Landsman May 2000
Put back common blocks for MOUSSE compatibility September 2004
[Previous]
[Next]
NAME:
ZPARCHECK
PURPOSE:
Routine to check user parameters to a procedure
CALLING SEQUENCE:
zparcheck, progname, parameter, parnum, types, dimens, [ message ]
INPUTS:
progname - scalar string name of calling procedure
parameter - parameter passed to the routine
parnum - integer parameter number
types - integer scalar or vector of valid types
1 - byte 2 - integer 3 - int*4
4 - real*4 5 - real*8 6 - complex
7 - string 8 - structure 9 - double complex
10 - pointer 11 - object ref 12 - Unsigned integer
13 - unsigned int*4
14 - int*8
15 - Unsigned int*8
dimens - integer scalar or vector giving number
of allowed dimensions.
OPTIONAL INPUT:
message - string message describing the parameter to be printed if an
error is found
OUTPUTS:
none
CALLED BY:
ABSCAL, ARROWS, CMOUSE, DBCREATE [1], DBCREATE [2], DBCREATE [3], DBDELETE [1]
DBDELETE [2], DBDELETE [3], DBEDIT [1], DBEDIT [2], DBEDIT [3], DBEDIT_BASIC [1]
DBEDIT_BASIC [2], DBEDIT_BASIC [3], DBEXT [1], DBEXT [2], DBEXT [3], DBEXT [4]
DBFIND [1], DBFIND [2], DBFIND [3], DBOPEN [1], DBOPEN [2], DBOPEN [3], DBPRINT [1]
DBPRINT [2], DBPRINT [3], DBSORT [1], DBSORT [2], DBSORT [3], DBUPDATE [1]
DB_OR [1], DB_OR [2], DB_OR [3], EXTAST, FINDPRO, FTHELP, GETPRO, GET_EQUINOX, HASTROM
HCONGRID, HELIO_JD, HESSI SOHDATA CLASS DEFINITION, HPRECESS, HREBIN, LINTERP, NSTAR
PUTAST, QSIMP, QTRAP, QUADTERP, READCOL [3], READFMT, SXHWRITE, TBHELP, TVBOX, TVLASER
T_GETPSF
EXAMPLE:
IDL> zparcheck, 'HREBIN', hdr, 2, 7, 1, 'FITS Image Header'
This example checks whether the parameter 'hdr' is of type string (=7)
and is a vector (1 dimension). If either of these tests fail, a
message will be printed
"Parameter 2 (FITS Image Header) is undefined"
"Valid dimensions are 1"
"Valid types are string"
SIDE EFFECTS:
If an error in the parameter is a message is printed
a RETALL issued
HISTORY
version 1 D. Lindler Dec. 86
documentation updated. M. Greason, May 1990.
Recognize double complex datatype W. Landsman September 1995
Converted to IDL V5.0 W. Landsman September 1997
Check for new data types (e.g. unsigned) W. Landsman February 2000
[Previous]
NAME:
ZPARCHECK
PURPOSE:
Routine to check user parameters to a procedure
CALLING SEQUENCE:
zparcheck, progname, parameter, parnum, types, dimens, [ message ]
INPUTS:
progname - scalar string name of calling procedure
parameter - parameter passed to the routine
parnum - integer parameter number
types - integer scalar or vector of valid types
1 - byte 2 - integer 3 - int*4
4 - real*4 5 - real*8 6 - complex
7 - string 8 - structure 9 - double complex
10 - pointer 11 - object ref 12 - Unsigned integer
13 - unsigned int*4
14 - int*8
15 - Unsigned int*8
dimens - integer scalar or vector giving number
of allowed dimensions.
OPTIONAL INPUT:
message - string message describing the parameter to be printed if an
error is found
OUTPUTS:
none
CALLED BY:
ABSCAL, ARROWS, CMOUSE, DBCREATE [1], DBCREATE [2], DBCREATE [3], DBDELETE [1]
DBDELETE [2], DBDELETE [3], DBEDIT [1], DBEDIT [2], DBEDIT [3], DBEDIT_BASIC [1]
DBEDIT_BASIC [2], DBEDIT_BASIC [3], DBEXT [1], DBEXT [2], DBEXT [3], DBEXT [4]
DBFIND [1], DBFIND [2], DBFIND [3], DBOPEN [1], DBOPEN [2], DBOPEN [3], DBPRINT [1]
DBPRINT [2], DBPRINT [3], DBSORT [1], DBSORT [2], DBSORT [3], DBUPDATE [1]
DB_OR [1], DB_OR [2], DB_OR [3], EXTAST, FINDPRO, FTHELP, GETPRO, GET_EQUINOX, HASTROM
HCONGRID, HELIO_JD, HESSI SOHDATA CLASS DEFINITION, HPRECESS, HREBIN, LINTERP, NSTAR
PUTAST, QSIMP, QTRAP, QUADTERP, READCOL [3], READFMT, SXHWRITE, TBHELP, TVBOX, TVLASER
T_GETPSF
EXAMPLE:
IDL> zparcheck, 'HREBIN', hdr, 2, 7, 1, 'FITS Image Header'
This example checks whether the parameter 'hdr' is of type string (=7)
and is a vector (1 dimension). If either of these tests fail, a
message will be printed
"Parameter 2 (FITS Image Header) is undefined"
"Valid dimensions are 1"
"Valid types are string"
SIDE EFFECTS:
If an error in the parameter is a message is printed
a RETALL issued
HISTORY
version 1 D. Lindler Dec. 86
documentation updated. M. Greason, May 1990.
Recognize double complex datatype W. Landsman September 1995
Converted to IDL V5.0 W. Landsman September 1997
Check for new data types (e.g. unsigned) W. Landsman February 2000