QDCB_GRID $SSW/gen/idl_libs/astron/astro/qdcb_grid.pro
[Previous] [Next]
 NAME:
	QDCB_GRID

 PURPOSE:
	Produce an overlay of latitude and longitude lines over a plot or image
 EXPLANATION:
	Grid is plotted on the current graphics device assuming that the 
	current plot is a map  in the so called quad cube projection. The 
	output plot range is assumed to go from 7.0 to -1.0 on the X axis and 
	-3.0 to 3.0 on the Y axis. Within this plotting space, the quad cube 
	faces are laid out as follows (X=Empty, Astronomical Layout shown - 
	X axis can be swapped for geographic maps):

	    3.0_
		XXX0
		4321
	   -3.0_XXX5
		|  |
	      7.0  -1.0

 CATEGORY:
	Mapping Support Routine

 CALLING SEQUENCE:

	QDCB_GRID,[,DLONG,DLAT,[LINESTYLE=N,/LABELS]

 INPUT PARAMETERS:

	DLONG	= Optional input longitude line spacing in degrees. If left
		  out, defaults to 30.

	DLAT    = Optional input lattitude line spacing in degrees. If left
		  out, defaults to 30.


 OPTIONAL KEYWORD PARAMETERS:

	LINESTYLE	= Optional input integer specifying the linestyle to
			  use for drawing the grid lines.

	LABELS		= Optional keyword specifying that the lattitude and
			  longitude lines on the prime meridian and the
			  equator should be labeled in degrees. If LABELS is
			  given a value of 2, i.e. LABELS=2, then the longitude
			  labels will be in hours and minutes instead of
			  degrees.

 OUTPUT PARAMETERS:

	NONE

 CALLS: ***
	SIXTY, WCSSPH2XY
 PROCEDURE:

	Uses WCSSPH2XY.PRO with projection 23 ("QSC" - COBE Quadrilatieralized
	Spherical Cube) to compute positions of grid lines and labels.

 COPYRIGHT NOTICE:

	Copyright 1991, The Regents of the University of California. This
	software was produced under U.S. Government contract (W-7405-ENG-36)
	by Los Alamos National Laboratory, which is operated by the
	University of California for the U.S. Department of Energy.
	The U.S. Government is licensed to use, reproduce, and distribute
	this software. Neither the Government nor the University makes
	any warranty, express or implied, or assumes any liability or
	responsibility for the use of this software.

 AUTHOR:

	Jeff Bloch

 MODIFICATIONS/REVISION LEVEL:

	%I%	%G%
	Use WCSSPH2XY instead of QDCB   Wayne Landsman   December 1994
	Converted to IDL V5.0   W. Landsman   September 1997


QGET_STRING $SSW/gen/idl_libs/astron/misc/qget_string.pro
[Previous] [Next]
 NAME:
     QGET_STRING
 PURPOSE:
     To get a string from the keyboard without echoing it to the screen.

 CALLING SEQUENCE:
     string = QGET_STRING() 

 INPUTS:
     None.

 OUTPUTS:
     string   The string read from the keyboard.

 SIDE EFFECTS:
     A string variable is created and filled.

 PROCEDURE:
     The IDL GET_KBRD functions is used to get each character in
     the string.  Each character is added to the string until a
     carriage return is struck.  The carriage return is not appended
     to the string.  Striking the delete key or the backspace key
     removes the previous character from the string (only the backspace
     key will work in VMS IDL).

 NOTES:
     For a widget password procedure see 
     http://www.dfanning.com/tip_examples/password.pro
 MODIFICATION HISTORY:
     Written by Michael R. Greason, STX, 8 January 1991.
     Work for Mac and Windows IDL  W. Landsman    September 1995
     Converted to IDL V5.0   W. Landsman   September 1997


QMCLOSE [1] $SSW/gen/idl/system/qmclose.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : 
	QMCLOSE
 Purpose     : 
	Close a QMS plot file and reset the graphics device.
 Explanation : 
	The currently opened QMS plot file is closed, and the graphics device
	is reset to what was used previously.
 Use         : 
	QMCLOSE

	QMS				;Open QMS plot file
	   ... plotting commands ...	;Create plot
	QMPLOT				;Close & plot file, reset to prev. dev.
	   or
	QMCLOSE				;Close w/o printing,  "    "   "    "

 Inputs      : 
	None.
 Opt. Inputs : 
	None.
 Outputs     : 
	A message is printed to the screen.
 Opt. Outputs: 
	None.
 Keywords    : 
	None.
 Calls       : ***
	SETPLOT [1], SETPLOT [2], TRIM
 Common      : 
	QMS_FILE which contains QMS_FILENAME, the name of the plotting file,
	and LAST_DEVICE, which is the name of the previous graphics device.
 Restrictions: 
	In general, the SERTS graphics devices routines use the special system
	variables !BCOLOR and !ASPECT.  These system variables are defined in
	the procedure DEVICELIB.  It is suggested that the command DEVICELIB be
	placed in the user's IDL_STARTUP file.

 Side effects: 
	The previous plotting device is reset.
 Category    : 
	Utilities, Devices.
 Prev. Hist. : 
	William Thompson, Feb. 1991, from PSCLOSE
 Written     : 
	William Thompson, GSFC, February 1991.
 Modified    : 
	Version 1, William Thompson, GSFC, 27 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 27 April 1993.


QMPLOT [1] $SSW/gen/idl/system/qmplot.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : 
	QMPLOT
 Purpose     : 
	Print a QMS plot file and reset the graphics device.
 Explanation : 
	Sends a QMS plot file generated by IDL to the QMS laser printer.  The
	default queue is defined by the logical name/environment variable
	LASER.  The graphics device is reset to what was used previously.
 Use         : 
	QMPLOT  [, FILE ]  [, /DELETE ]

	QMS				;Open QMS plot file
	   ... plotting commands ...	;Create plot
	QMPLOT				;Close & plot file, reset to prev. dev.
	   or
	QMCLOSE				;Close w/o printing,  "    "   "    "

 Inputs      : 
	None required.
 Opt. Inputs : 
	The default filename is either taken from the last call to the QMS
	routine, or is "idl.bit".

	A filename other than the default can be passed in one of three ways:

		Explicitly:		e.g. QMPLOT,'graph.bit'
		By number (VMS)		e.g. QMPLOT,3   for "idl.bit;3"
		All versions (VMS)	e.g. QMPLOT,'*' for "idl.bit;*"
		All ".bit" files (UNIX)	e.g. QMPLOT,'*' for "*.bit"
 Outputs     : 
	A message is printed to the screen.
 Opt. Outputs: 
	None.
 Keywords    : 
	DELETE	= If set, then file is deleted after printing.
	QUEUE	= Name of printer queue to be used in printing the file.
	COMMAND	= (Unix only.)  Command to be used to send the plot file to the
		  printer.  If not passed, then the environment variable
		  PRINTCOM is checked.  If neither of these is set, then the
		  standard command "lpr" is used.
 Calls       : 
	SETPLOT [1], SETPLOT [2]
 Common      : 
	QMS_FILE which contains QMS_FILENAME, the name of the plotting file,
	and LAST_DEVICE, which is the name of the previous graphics device.
 Restrictions: 
	The requested plot file must exist.

	In general, the SERTS graphics devices routines use the special system
	variables !BCOLOR and !ASPECT.  These system variables are defined in
	the procedure DEVICELIB.  It is suggested that the command DEVICELIB be
	placed in the user's IDL_STARTUP file.

 Side effects: 
	The plot file is queued on the printer LASER.  Also, any files
	"idl.bit" that may be open will be closed.  The previous plotting
	device is reset.
 Category    : 
	Utilities, Devices.
 Prev. Hist. : 
	W.T.T., February, 1991, from PSPLOT.
	W.T.T., May 1991, extended environment variable LASER to UNIX.
	W.T.T., Jul 1992, added check for QMS_FILENAME in common block.
 Written     : 
	William Thompson, GSFC, February 1991.
 Modified    : 
	Version 1, William Thompson, GSFC, 27 April 1993.
		Incorporated into CDS library.
	Version 2, William Thompson, GSFC, 3 June 1993.
		Fixed bug with ENDIF/ENDELSE statements.
	Version 3, William Thompson, GSFC, 8 June 1994
		Added keyword COMMAND
 Version     : 
	Version 3, 8 June 1994


QMS [1] $SSW/gen/idl/system/qms.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : 
	QMS
 Purpose     : 
	Sets graphics device to QMS Quikplot file.
 Explanation : 
	This procedure sets the system variables needed to write QMS plot
	files.  The plot is done in landscape mode, using most of the paper.

	SETPLOT is called to save and set the system variables, and DEVICE is
	called to set the plot window size and orientation, and to open the
	file.

	If the plot file is already open, then calling QMS without any
	parameters or keywords allows the user to write into the already opened
	file, in the same mode as before.

 Use         : 
	QMS  [, FILENAME ]

	QMS				;Open QMS plot file
	   ... plotting commands ...	;Create plot
	QMPLOT				;Close & plot file, reset to prev. dev.
	   or
	QMCLOSE				;Close w/o printing,  "    "   "    "

 Inputs      : 
	None required.
 Opt. Inputs : 
	FILENAME - Name of QMS plot file to be opened.  If not passed, and no
		   filename was previously passed, "idl.bit" is assumed.
 Outputs     : 
	A message is printed to the screen.
 Opt. Outputs: 
	None.
 Keywords    : 
	LANDSCAPE = If set, then plotting is done in LANDSCAPE mode (default).
	PORTRAIT  = If set, then plotting is done in PORTRAIT mode.  PORTRAIT
		    takes precedent over LANDSCAPE.
 Calls       : ***
	FORM_FILENAME [1], FORM_FILENAME [2], SETPLOT [1], SETPLOT [2]
 Common      : 
	QMS_FILE which contains QMS_FILENAME, the name of the plotting file,
	and LAST_DEVICE, which is the name of the previous graphics device.
 
	Also calls SETPLOT, which uses common block PLOTFILE.
 
 Restrictions: 
	Only the routines QMPLOT and QMCLOSE can be used to close the QMS plot
	file.  It is best if the routines TEK, REGIS, etc. (i.e. those
	routines that use SETPLOT) are used to change the plotting device.

	In general, the SERTS graphics devices routines use the special system
	variables !BCOLOR and !ASPECT.  These system variables are defined in
	the procedure DEVICELIB.  It is suggested that the command DEVICELIB be
	placed in the user's IDL_STARTUP file.

 Side effects: 
	If the FILENAME parameter, or either the LANDSCAPE or PORTRAIT
	keywords, is passed then DEVICE is called to open a new file.  Any
	previously opened QMS plot file would be closed.
 
	If a new file is opened, then the DEVICE routine is called with the
	/LANDSCAPE or /PORTRAIT switch to set the size and orientation of the
	plot window.
 
	If not the first time this routine is called, then system variables
	that affect plotting are reset to previous values.  If it is the first 
	time the routine is called, !FANCY is set to 1.

	In UNIX, if a new file is opened with the same name as an existing
	file, then the old file is lost.
 
 Category    : 
	Utilities, Devices.
 Prev. Hist. : 
	W.T.T., Feb. 1991, from PS.PRO.
 Written     : 
	William Thompson, GSFC, February 1991.
 Modified    : 
	Version 1, William Thompson, GSFC, 27 April 1993.
		Incorporated into CDS library.
 Version     : 
	Version 1, 27 April 1993.


QSIMP $SSW/gen/idl_libs/astron/math/qsimp.pro
[Previous] [Next]
 NAME:
       QSIMP
 PURPOSE:
       Integrate using Simpson's rule to specified accuracy.
 EXPLANATION:
       Integrate a function to specified accuracy using the extended 
       trapezoidal rule.   Adapted from algorithm in Numerical Recipes, 
       by Press et al. (1992, 2nd edition), Section 4.2.     This procedure
       has been partly obsolete since IDL V3.5 with the introduction of the 
       intrinsic function QSIMP(), but see notes below.

 CALLING SEQUENCE:
       QSIMP, func, A, B, S, [ EPS = , MAX_ITER =, _EXTRA =  ]

 INPUTS:
       func - scalar string giving name of function of one variable to 
               be integrated
       A,B  - numeric scalars giving the lower and upper bound of the 
               integration

 OUTPUTS:
       S - Scalar giving the approximation to the integral of the specified
               function between A and B.

 OPTIONAL KEYWORD PARAMETERS:
       EPS - scalar specifying the fractional accuracy before ending the 
               iteration.  Default = 1E-6
       MAX_ITER - Integer specifying the total number iterations at which 
               QSIMP will terminate even if the specified accuracy has not yet
               been met.   The maximum number of function evaluations will be
               2^(MAX_ITER).    Default value is MAX_ITER = 20

       Any other keywords are passed directly to the user-supplied function
       via the _EXTRA facility.
 NOTES:
       (1) The function QTRAP is robust way of doing integrals that are not 
       very smooth.  However, if the function has a continuous 3rd derivative
       then QSIMP will likely be more efficient at performing the integral.

       (2) QSIMP can be *much* faster than the intrinsic QSIMP() function (as
       of IDL V5.3).   This is because the intrinsic QSIMP() function only 
       requires that the user supplied function accept a *scalar* variable.
       Thus on the the 16th iteration, the intrinsic QSIMP() makes 32,767
       calls to the user function, whereas this procedure makes one call 
       with a  32,767 element vector.  Also, unlike the intrinsic QSIMP(), this
       procedure allows keywords in the user-supplied function.

       (3) Since the intrinsic QSIMP() is a function, and this file contains a 
       procedure, there should be no name conflict.
 CALLS: ***
	TRAPZD, ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
 CALLED BY:
	GALAGE, LUMDIST
 EXAMPLE:
       Compute the integral of sin(x) from 0 to !PI/3.
    
       IDL> QSIMP, 'sin', 0, !PI/3, S   & print, S
   
       The value obtained should be cos(!PI/3) = 0.5

 PROCEDURES CALLED:
       TRAPZD, ZPARCHECK

 REVISION HISTORY:
       W. Landsman         ST Systems Co.         August, 1991
       Continue after max iter warning message   W. Landsman   March, 1996
       Converted to IDL V5.0   W. Landsman   September 1997
       Pass keyword to function via _EXTRA facility  W. Landsman July 1999


QTRAP $SSW/gen/idl_libs/astron/math/qtrap.pro
[Previous] [Next]
 NAME:
       QTRAP
 PURPOSE:
       Integrate using trapezoidal rule to specified accuracy.
 EXPLANATION:
       Integrate a function to specified accuracy using the extended 
       trapezoidal rule.   Adapted from Numerical Recipes (1992, 2nd edition),
       Section 4.2. 

 CALLING SEQUENCE:
       QTRAP, func, A, B, S, [EPS = , MAX_ITER =, _EXTRA = ]

 INPUTS:
       func - scalar string giving name of function of one variable to 
               be integrated
       A,B  - numeric scalars giving the lower and upper bound of the 
               integration

 OUTPUTS:
       S - Scalar giving the approximation to the integral of the specified
               function between A and B.

 OPTIONAL KEYWORD PARAMETERS:
       EPS - scalar specify the fractional accuracy before ending the 
             iteration.    Default = 1E-6
       MAX_ITER - Integer specifying the total number iterations at which 
               QTRAP will terminate even if the specified accuracy has not yet
               been met.    The maximum number of function evaluations will 
               be 2^(MAX_ITER).   Default value is MAX_ITER = 20

       Any other keywords are passed directly to the user-supplied function
       via the _EXTRA facility.
 NOTES:
       QTRAP is robust way of doing integrals that are not very smooth.  If the
       function has a continuous 3rd derivative then the function QSIMP will 
          likely be more efficient at performing the integral.
 CALLS: ***
	TRAPZD, ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
 EXAMPLE:
       Compute the integral of sin(x) from 0 to !PI/3.
    
       IDL> QTRAP, 'sin', 0, !PI/3, S   & print,S
   
       The value obtained should be cos(!PI/3) = 0.5

 PROCEDURES CALLED:
       TRAPZD, ZPARCHECK
 REVISION HISTORY:
       W. Landsman         ST Systems Co.         August, 1991
       Continue after Max Iter warning message, W. Landsman  March 1996
       Converted to IDL V5.0   W. Landsman   September 1997
       Pass keyword to function via _EXTRA facility  W. Landsman July 1999


QUADTERP $SSW/gen/idl_libs/astron/math/quadterp.pro
[Previous] [Next]
 NAME:
       QUADTERP     
 PURPOSE:
       Quadratic interpolation of X,Y vectors onto a new X grid
 EXPLANATION:
       Interpolate a function Y = f(X) at specified grid points using an
       average of two neighboring 3 point quadratic (Lagrangian) interpolants.
       Use LINTERP for linear interpolation

 CALLING SEQUENCE:
       QUADTERP, Xtab, Ytab, Xint, Yint, [ MISSING = ]

 INPUT: 
       Xtab - Vector (X TABle) containing the current independent variable 
               Must be either monotonic increasing or decreasing
       Ytab - Vector (Y TABle) containing the dependent variable defined
               at each of the points of XTAB.
       Xint - Scalar or vector giving the values of X for which interpolated 
               Y values are sought

 OUTPUT: 
       Yint - Interpolated value(s) of Y, same number of points as Xint

 OPTIONAL INPUT KEYWORD:
       MISSING - Scalar specifying Yint value(s) to be assigned, when Xint
               value(s) are outside of the range of Xtab.     Default is to
               truncate the out of range Yint value(s) to the nearest value 
               of Ytab.   See the help for the INTERPOLATE function.
 METHOD:
       3-point Lagrangian interpolation.  The average of the two quadratics 
       derived from the four nearest  points is returned in YTAB.   A single
       quadratic is used near the end points.   VALUE_LOCATE is used 
       to locate center point of the interpolation.

 NOTES:
       QUADTERP provides one method of high-order interpolation.   The 
           RSI interpol.pro function includes the following alternatives:

       interpol(/LSQUADRATIC) - least squares quadratic fit to a 4 pt 
               neighborhood
       interpol(/QUADRATIC) - quadratic fit to a 3 pt neighborhood
       interpol(/SPLINE) - cubic spline fit to a 4 pt neighborhood

       Also, the IDL Astro function HERMITE fits a cubic polynomial and its
             derivative to the two nearest points. 
 CALLS: ***
	ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
 RESTRICTIONS:
       Unless MISSING keyword is set, points outside the range of Xtab in 
       which valid quadratics can be computed are returned at the value 
       of the nearest end point of Ytab (i.e. Ytab[0] and Ytab[NPTS-1] ).

 EXAMPLE:
       A spectrum has been defined using a wavelength vector WAVE and a
       flux vector FLUX.  Interpolate onto a new wavelength grid, e.g. 

       IDL> wgrid = [1540.,1541.,1542.,1543.,1544.,1545.]
       IDL> quadterp, wave, flux, wgrid, fgrid 
     
       FGRID will be a 5 element vector containing the quadratically
       interpolated values of FLUX at the wavelengths given in WGRID.

  EXTERNAL ROUTINES:
       ZPARCHECK
  REVISION HISTORY:
       31 October 1986 by B. Boothman, adapted from the IUE RDAF
       12 December 1988 J. Murthy, corrected error in Xint
       September 1992, W. Landsman, fixed problem with double precision
       August 1993, W. Landsman, added MISSING keyword
       June, 1995, W. Landsman, use single quadratic near end points
       Converted to IDL V5.0   W. Landsman   September 1997
       Fix occasional problem with integer X table,  
       YINT is a scalar if XINT is a scalar   W. Landsman Dec 1999
       Use VALUE_LOCATE instead of TABINV W. Landsman  Feb. 2000


quality_filter $SSW/gen/idl/http/quality_filter.pro
[Previous] [Next]
   Name: quality_filter

   Purpose: filter data with some qualitative checks

 CALLED BY:
	special_movie
   Restrictions:
      functional place holder

   History:
      12-sep-1998 - S.L.Freeland - online but under construction
                    (called by 'special_movie.pro')

 CALLS: ***
	data_quality, prstr [1], prstr [2], strjustify
   Side Effects:
     may change index & data (filter out 'bad' data)  


QueryDSS $SSW/gen/idl_libs/astron/sockets/querydss.pro
[Previous] [Next]
 NAME: 
   QueryDSS

 PURPOSE: 
    Query the digital sky survey (DSS) on-line at  the ESO or STSCI servers

 EXPLANATION: 
     The script can query the DSS survey and retrieve an image and FITS 
     header either from the European Southern Observatory (ESO) or the 
     Space Telescope Science Institute (STScI) servers.
     See http://archive.eso.org/dss/dss and/or
     http://archive.stsci.edu/dss/index.html for details.

 CALLING SEQUENCE: 
      QueryDSS, targetname_or_coords, Im, Hdr, [IMSIZE= , /ESO, /STSCI ]

 INPUTS:
      TARGETNAME_OR_COORDS - Either a scalar string giving a target name, 
          (with J2000 coordinates determined by SIMBAD (default) or NED), or 
          a 2-element numeric vector giving the J2000 right ascension in 
          *degrees* and the target declination in degrees.

 OPTIONAL INPUTS: 
          None

 OPTIONAL KEYWORD PARAMETERS: 
     ImSize - Numeric scalar giving size of the image to be retrieved in 
                 arcminutes.    Default is 10 arcminute.

     /ESO - Use the ESO server for image retrieval.    Default is to use
            the STScI server if user is in the Western hemisphere, and 
            otherwise to use the ESO server.

     /NED - Query the Nasa Extragalactic Database (NED) for the
            target's coordinates.  The default is to use Simbad for
            the target search.

     /STSCI - Use the STSCI server for image retrieval.  Default is to use
            the STScI server if user is in the Western hemisphere, and 
            otherwise to use the ESO server.    

     SURVEY - Scalar string specifying which survey to retrieve.  
          Possible values are 
          '1' - First generation (red), this is the default
          '2b' - Second generation blue
          '2r' - Second generation red
          '2i' - Second generation near-infrared
 
      Note that 2nd generation images may not be available for all regions
      of the sky.   Also note that the first two letters of the 'REGION'
      keyword in the FITS header gives the bandpass 'XP' - Red IIIaF, 
      'XJ' - Blue IIIaJ, 'XF' - Near-IR IVN

 OUTPUTS: 
       Im - The image returned by the server. If there is an error, this 
             contains a single 0.

       Hdr - The FITS header of the image. Empty string in case of errors.

       If the OutFile keyword is set then no outputs are returned (only the
       file is written).
 CALLS: ***
	QUERYSIMBAD, WEBGET
 SIDE EFFECTS: 
     If Im and Hdr exist in advance,  they are overwritten.

 RESTRICTIONS: 
      Relies on a working network connection. 

 PROCEDURE: 
      Construct a query-url,  call WEBGET() and sort out the server's 
      answer.

 EXAMPLE:           
      Retrieve an 10'  image surrounding the ultracompact HII region
       G45.45+0.06.   Obtain the 2nd generation blue image.

       IDL> QueryDSS, 'GAL045.45+00.06', image, header, survey = '2b'
       IDL> tvscl, image
       IDL> hprint, header
       IDL> writefits,'dss_image.fits', image, header
 Note that the coordinates could have been specified directly, rather than
 giving the target name.
       IDL> QueryDSS, [288.587, 11.1510], image, header,survey='2b'

 To write a file directly to disk, use the OutFile keyword

       IDL> QueryDSS, [288.587, 11.1510], survey='2b', out='gal045_2b.fits'
   
 PROCEDURES CALLED:
       QUERYSIMBAD, WEBGET()
 MINIMUM IDL VERSION:
       V5.4  (uses SOCKET)
 MODIFICATION HISTORY: 
       Written by M. Feldt, Heidelberg, Oct 2001 <mfeldt@mpia.de>
       Option to supply target name instead of coords  W. Landsman Aug. 2002
       Added OUTFILE, /NED keywords W. Landsman   April 2003
       Don't abort on Simbad failure W. landsman/J. Brauher  June 2003


QUERYGSC $SSW/gen/idl_libs/astron/sockets/querygsc.pro
[Previous] [Next]
 NAME: 
   QUERYGSC

 PURPOSE: 
   Query the Guide Star Catalog (GSC V2.2) at STScI by position
 
 EXPLANATION:
   Uses the IDL SOCKET command to query the GSC 2.2 database over the Web.    
   Requires IDL V5.4 or later.
 
   The GSC  all-sky catalog will contain an estimated 2 billion objects
   and will be complete to a magnitude of at least J=18 and as faint as J=21 at
   high galactic latitudes. Using the observations in different bandpasses at 
   different epochs allows the computation of both colors and proper motions. 
   These data are in an object-oriented database at 
   http://www-gsss.stsci.edu/support/data_access.htm .The final version
   (GSC 2.3),  expected to be released in 2004, will also contain proper 
   motions.   

 CALLING SEQUENCE: 
     info = QueryGSC(targetname_or_coords, [ dis, Magrange =, /HOURS] )

 INPUTS: 
      TARGETNAME_OR_COORDS - Either a scalar string giving a target name, 
          (with J2000 coordinates determined by SIMBAD), or a 2-element
          numeric vector giving the J2000 right ascension in *degrees* (or 
          hours if /HOURS is set) and the target declination in degrees.

 OPTIONAL INPUT:
    dis - Search radius in arcminutes to search around specified target
          Default is 5 arcminutes

 OPTIONAL INPUT KEYWORDS:

    /HOURS - If set, then the right ascension is both input and output (in
             the info .ra tag) in hours instead of degrees

    MAGRANGE - two element vector giving the magnitude range (on either the
           F plate or the J plate) to search for  GSC stars.   
           Default is [0,30]

 OUTPUTS: 
   info - IDL structure containing information on the GSC stars within the 
          specified distance of the specified center.   There are (currently)
          23 tags in this structure  -- for further information see
           http://www-gsss.stsci.edu/gsc/gsc2/gsc22_release_notes.htm

          .GSCID2 - GSC 2.2 identification number
          .RA,.DEC - Position in degrees (double precision).   RA is given in
                   hours if the /HOURS keyword is set.
          .RAERR, .DECERR - uncertainty (in arcseconds) in the RA and Dec
          .EPOCH - mean epoch of the observation
          .RAPM,DECPM - RA and Dec proper motion (mas/year) 
          .RAPMERR,DECPMERR - Uncertainty RA and Dec proper motion (mas/year) 
          .FMAG, .FMAGERR - magnitude and error in photographic F
          .JMAG, .JMAGERR - magnitude and error in photographic J
          .VMAG, .VMAGERR - V magnitude and error 
          .NMAG, .NMAGERR - magnitude and error
          .A - semi-major axis in pixels
          .E - eccentricity of extended objects
          .PA - Position angle of extended objects in degrees
          .C - classification (0-5): 0-star, 1-galaxy, 2-blend, 3-nonstar,
                                     4-unclassified, 5-defect
          .STATUS -10 digit field  used to encode more detailed information 
              about the properties of the catalog object.   For more info, see 
http://www-gsss.stsci.edu/gsc/gsc2/gsc22_release_notes.htm#SourceStatusFlagCodes

 CALLS: ***
	QUERYSIMBAD, RADEC, WEBGET, strsplit
 EXAMPLE: 
          Plot a histogram of the photographic J magnitudes of all GSC 2.2 
          stars within 10 arcminutes of the center of the globular cluster M13 

          IDL> info = querygsc('M13',10)
          IDL> plothist,info.jmag,xran=[10,20]

 PROCEDURES USED:
          QUERYSIMBAD, RADEC, WEBGET()

 MINIMUM IDL VERSION
         V5.4  (uses SOCKET)
 MODIFICATION HISTORY: 
         Written by W. Landsman  SSAI  August 2002
         Fixed parsing of RA and Dec  W. Landsman September 2002


QUERYSIMBAD $SSW/gen/idl_libs/astron/sockets/querysimbad.pro
[Previous] [Next]
 NAME: 
   QUERYSIMBAD

 PURPOSE: 
   Query the SIMBAD or NED astronomical name resolver to obtain coordinates

 EXPLANATION: 
   Uses the IDL SOCKET command to query either the SIMBAD or NED nameserver 
   over the Web to return J2000 coordinates.     Requires IDL V5.4 or later.

   For details on the SIMBAD service, see http://simbad.u-strasbg.fr/Simbad
   and for the NED service, see http://ned.ipac.caltech.edu/

 CALLING SEQUENCE: 
    QuerySimbad, name, ra, dec, [ id, Found=, /NED, ERRMSG=]

 INPUTS: 
    name - a scalar string containing the target name in SIMBAD (or NED)
           nomenclature. For SIMBAD details see
           http://vizier.u-strasbg.fr/cgi-bin/Dic-Simbad .

 OUTPUTS: 
     ra - the right ascension of the target in J2000.0 in *degrees* 
     dec - declination of the target in degrees

 OPTIONAL INPUT KEYWORD:
     /NED - if set, then nameserver of the NASA Extragalactic database is
           used to resolve the name and return coordinates.   Note that
           /NED cannot be used with Galactic objects
 OPTIONAL OUTPUT: 
     id - the primary SIMBAD (or NED) ID of the target, scalar string

 OPTIONAL KEYWORD OUTPUT:
     found - set to 1 if the translation was successful, or to 0 if the
           the object name could not be translated by SIMBAD or NED
     Errmsg - if supplied, then any error messages are returned in this
            keyword, rather than being printed at the terminal.   May be either
            a scalar or array.
            
 CALLS: ***
	REPSTR [1], REPSTR [2], REPSTR [3], TEN, WEBGET, strsplit
 CALLED BY:
	DBTARGET [1], DBTARGET [2], QUERYGSC, QUERYUSNO, QueryDSS
 EXAMPLES:
     (1) Find the J2000 coordinates for the ultracompact HII region
         G45.45+0.06 

      IDL> QuerySimbad,'GAL045.45+00.06', ra, dec
      IDL> print, adstring(ra,dec,1)
           ===>19 14 20.77  +11 09  3.6
 PROCEDURES USED:
       REPSTR(), WEBGET()

 NOTES:
     The actual SIMBAD query is made to the SKYCAT system 
      http://archive.eso.org/skycat/ which has suffered from occasional
     downtime.   This routine will be modified to use a direct SIMBAD
     query once SIMBAD 4 (http://simbad.u-strasbg.fr/simbad4.htx ) is released.
 MINIMUM IDL VERSION:
    V5.4 (uses SOCKET)
 MODIFICATION HISTORY: 
     Written by M. Feldt, Heidelberg, Oct 2001   <mfeldt@mpia.de>
     Minor updates, W. Landsman   August 2002
     Added option to use NED server, better parsing of SIMBAD names such as 
          IRAS F10190+5349    W. Landsman  March 2003
     Turn off extended name search for NED server, fix negative declination
     with /NED    W. Landsman  April 2003


QUERYUSNO $SSW/gen/idl_libs/astron/sockets/queryusno.pro
[Previous] [Next]
 NAME: 
   QUERYUSNO

 PURPOSE: 
   Query the USNO-A2.0 Catalog at the ESO/ST-ECF Archive by position
 
 EXPLANATION:
   Uses the IDL SOCKET command to query the USNO-A2.0 database over the Web.    
   Requires IDL V5.4 or later.
 
   With the introduction of QUERYVIZIER this routine became mostly obsolete
   as the newer USNO-B1 catalog can be accessed from QUERYVIZIER.

   USNO-A2.0 contains entries for over a half billion stars (526,230,881, to 
   be exact!) which were detected in the digitized images of three photographic
   sky surveys. For the entire northern sky and the southern sky down to 
   declinations of -30°, all the photographic plates were part of the original
   Palomar Optical Sky Survey (POSS-I).  Photographs were taken on blue- and 
   red-sensitive emulsions. Only those stars which were detected in both colors
   were included in the USNO-A2.0 catalog. The rest of the southern sky was 
   covered by the Science Research Council (SRC)-J survey and the European 
   Southern Observatory (ESO)-R survey.  Only stars appearing in both 
   colors were accepted for the final catalogue.   Coordinates are J2000 
   at the epoch of the mean of the blue and red exposure. 

 CALLING SEQUENCE: 
     info = QueryUSNO(targetname_or_coords, [ dis, Magrange =, /HOURS] )

 INPUTS: 
      TARGETNAME_OR_COORDS - Either a scalar string giving a target name, 
          (with J2000 coordinates determined by SIMBAD), or a 2-element
          numeric vector giving the J2000 right ascension in *degrees* and
          the target declination in degrees.

 OPTIONAL INPUT:
    dis - Search radius in arcminutes to search around specified target
          Default is 5 arcminutes

 OPTIONAL INPUT KEYWORDS:

    /HOURS - If set, then the right ascension is both input and output (in
             the info .ra tag) in hours instead of degrees

    MAGRANGE - two element vector giving the magnitude range (on the
           r plate) to search for  stars.   Default is to return all stars

 OUTPUTS: 
   info - IDL structure containing information on the USNO-A2 stars within the 
          specified distance of the specified center.   There are (currently)
          5 tags in this structure  -- for further information see
           http://ftp.nofs.navy.mil/projects/pmm/readme.html

          .ID - USNO-A2.0 identification number
          .RA,.DEC - Position in degrees (double precision).   RA is given in
                   hours if the /HOURS keyword is set.
          .r_mag, .b_mag - magnitudes on the red and blue plates

 CALLS: ***
	QUERYSIMBAD, RADEC, WEBGET, strsplit
 EXAMPLE: 
          Plot a histogram of the photographic r magnitudes of all USNO-A2 
          stars within 10 arcminutes of the center of the globular cluster M13 

          IDL> info = queryusno('M13',10)
          IDL> plothist,info.r_mag,xran=[10,20]

 PROCEDURES USED:
          QuerySIMBAD, RADEC, WEBGET()

 MODIFICATION HISTORY: 
         Written by W. Landsman  SSAI  September 2002


QUERYVIZIER $SSW/gen/idl_libs/astron/sockets/queryvizier.pro
[Previous] [Next]
 NAME: 
   QUERYVIZIER

 PURPOSE: 
   Query any catalog in the Vizier database by position
 
 EXPLANATION:
   Uses the IDL SOCKET command to provide a positional query of any catalog 
   in the the Vizier (http://vizier.u-strasbg.fr/ )database over the Web and
   return results in an IDL structure.    
   Modified in May 2006 to return an anonymous rather than a named structure.
 
    
 CALLING SEQUENCE: 
     info = QueryVizier(catalog, targetname_or_coords, [ dis
                        /ALLCOLUMNS, /CANADA, CONSTRAINT= ,/VERBOSE ])

 INPUTS: 
      CATALOG - Scalar string giving the name of the VIZIER catalog to be
            searched.    The complete list of catalog names is available at
            http://vizier.u-strasbg.fr/vizier/cats/U.htx .

            Popular VIZIER catalogs include  
            '2MASS-PSC' - 2MASS point source catalog (2003)
            'GSC2.2' - Version 2.2 of the HST Guide Star Catalog (2003)
            'USNO-B1' - Verson B1 of the US Naval Observatory catalog (2003)
            'NVSS'  - NRAO VLA Sky Survey (1998)
            'B/DENIS/DENIS' - 2nd Deep Near Infrared Survey of southern Sky
            'I/259/TYC2' - Tycho-2 main catalog (2000)
            'I/239/HIP_MAIN' - Hipparcos main catalog (1997)

          Note that some names will prompt a search of multiple catalogs
          and QUERYVIZIER will only return the result of the first search.
          Thus, setting catalog to "HIPPARCOS" will search all catalogs 
          associated with the Hipparcos mission, and return results for the
          first catalog found.    To specifically search the Hipparcos or
          Tycho main catalogs use the VIZIER catalog names listed above
                             
      TARGETNAME_OR_COORDS - Either a scalar string giving a target name, 
          (with J2000 coordinates determined by SIMBAD), or a 2-element
          numeric vector giving the J2000 right ascension in *degrees* and 
          the target declination in degrees.
          If the targetname is set to 'NONE' then QUERYVIZIER will perform
          an all-sky search using the constraints given in the CONSTRAINT
          keyword.   
 OPTIONAL INPUT:
    dis - scalar or 2-element vector.   If one value is supplied then this
          is the search radius in arcminutes.     If two values are supplied
          then this is the width (i.e., in longitude direction) and height
          of the search box.   Default is a radius search with radius of
          5 arcminutes

 OUTPUTS: 
   info - Anonymous IDL structure containing information on the catalog stars 
          within the specified distance of the specified center.     The 
          structure tag names are identical with the VIZIER  catalog column 
          names, with the exception of an occasional underscore
          addition, if necessary to convert the column name to a valid 
          structure tag.    The VIZIER Web  page should consulted for the 
          column names and their meaning for each particular catalog..
           
          If the tagname is numeric and the catalog field is blank then either
          NaN  (if floating) or -1 (if integer) is placed in the tag.

          If no sources are found within the specified radius, or an
          error occurs in the query then -1 is returned. 
 OPTIONAL KEYWORDS:
          /ALLCOLUMNS - if set, then all columns for the catalog are returned
                 The default is to return a smaller VIZIER default set. 

          /CANADA - By default, the query is sent to the main VIZIER site in
            Strasbourg, France.   If /CANADA is set then the VIZIER site
            at the Canadian Astronomical Data Center (CADC) is used instead.
            Note that not all Vizier sites have the option to return
            tab-separated values (TSV) which is required by this program.
   
          CONSTRAINT - string giving additional nonpositional numeric 
            constraints on the entries to be selected.     For example, when 
            in the GSC2.2  catalog, to only select sources with Rmag < 16 set 
            Constraint = 'Rmag < 16'.    Multiple constraints can be 
            separated by commas.    Use '!=' for "not equal", '<=' for smaller
            or equal, ">=" for greater than or equal.  See the complete list
            of operators at  
                 http://vizier.u-strasbg.fr/doc/asu.html#AnnexQual
            For this keyword only, **THE COLUMN NAME IS CASE SENSITIVE** and 
            must be written exactly as displayed on the VIZIER Web page.  
            Thus for the GSC2.2 catalog one must use 'Rmag' and not 'rmag' or
            'RMAG'.
         
           /VERBOSE - If set then the query sent to the VIZIER site is
               displayed, along with the returned title(s) of found catalog(s)
 CALLS: ***
	GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], REMCHAR [1], REMCHAR [2]
	REMCHAR [3], REMOVE [1], REMOVE [2], REPSTR [1], REPSTR [2], REPSTR [3], WEBGET
 EXAMPLES: 
          (1) Plot a histogram of the J magnitudes of all 2MASS point sources 
          stars within 10 arcminutes of the center of the globular cluster M13 

          IDL>  info = queryvizier('2MASS-PSC','m13',10)
          IDL> plothist,info.jmag,xran=[10,20]

          (2)  Find the brightest R magnitude GSC2.2 source within 3' of the 
               J2000 position ra = 10:12:34, dec = -23:34:35
          
          IDL> str = queryvizier('GSC2.2',[ten(10,12,34)*15,ten(-23,34,35)],3)
          IDL> print,min(str.rmag,/NAN)

          (3) Find sources with V < 19 in the Magellanic Clouds Photometric 
              Survey (Zaritsky+, 2002) within 5 arc minutes of  the position 
              00:47:34 -73:06:27

              Checking the VIZIER Web page we find that this catalog is
          IDL>  catname =  'J/AJ/123/855/table1'
          IDL>  ra = ten(0,47,34)*15 & dec = ten(-73,6,27)
          IDL> str = queryvizier(catname, [ra,dec], 5, constra='Vmag<19')

          (4) Perform an all-sky search of the Tycho-2 catalog for stars with
              BTmag = 13+/-0.1

         IDL> str = queryvizier('I/259/TYC2','NONE',constrain='BTmag=13+/-0.1')

 PROCEDURES USED:
          GETTOK(),IDL_VALIDNAME()(if prior to V6.0), REMCHAR, REPSTR(),
          WEBGET()
 TO DO:
       (1) Allow specification of output sorting
 MODIFICATION HISTORY: 
         Written by W. Landsman  SSAI  October 2003
         Give structure name returned by VIZIER not that given by user
                    W. Landsman   Feburary 2004 
         Don't assume same format for all found sources W. L. March 2004
         Added CONSTRAINT keyword for non-positional constraints WL July 2004
         Remove use of EXECUTE() statement WL June 2005
         Make dis optional as advertised WL August 2005
         Update for change in Vizier output format WL February 2006
         Fix problem in Feb 2006 update when only 1 object found
                     WL/D.Apai        March 2006
         Accept 'E' format for floating point. M. Perrin April 2006
         Added /ALLCOLUMNS option to return even more data.  M. Perrin, May 2006
         Return anonymous structure W. Landsman  May 2006
         Removed V6.0 notation to restore V5 compatibility W.Landsman July2006
         Accept target='NONE' for all-sky search, allow '+/-' constraints
                W. Landsman  October 2006


QZDBASE $SSW/gen/idl/database/qzdbase.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : QZDBASE
               
 Purpose     : Print the current value of env. var. ZDBASE
               
 Explanation : 
               
 Use         : IDL> qzdbase
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	FIND_ALL_DIR [1], FIND_ALL_DIR [2], FIND_ALL_DIR [3]
 CALLED BY:
	FIX_LINELIST
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Database
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 3-Feb-95
               
 Modified    : Handle case when ZDBASE not defined.  CDP, 17-May-95
               Use FIND_ALL_DIR.    CDP< 09-Aug-96

 Version     : Version 3, 09-Aug-96