N_bytes $SSW/gen/idl_libs/astron/misc/n_bytes.pro
[Previous] [Next]
 NAME:
       N_bytes()

 PURPOSE:
       To return the total number of bytes in data element

 CALLING SEQUENCE:
       result = N_bytes(a)

 INPUTS:
       a - any idl data element, scalar or array

 OUTPUTS:
       total number of bytes in a is returned as the function value
       (64bit longword scalar)
 NOTES:
       (1) Not valid for object or pointer data types
       (2) For a string array, the number of bytes is computed after conversion
           with the BYTE() function, i.e. each element has the same length,
           equal to the maximum individual string length.

 CALLED BY:
	CHECKSUM32, MODFITS
 MODIFICATION HISTORY:
       Version 1  By D. Lindler  Oct. 1986
       Include new IDL data types    W. Landsman          June 2001
       Now return a 64bit integer    W. Landsman          April 2006


N_DIMENSIONS $SSW/gen/idl/util/n_dimensions.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : N_DIMENSIONS()
               
 Purpose     : Returns number of dimensions of a variable.  
               
 Explanation : Returns number of dimensions of a variable.  
               cf. n_elements etc.

 Use         : n = n_dimensions(data)
    
 Inputs      : data - variable to be investigated.
               
 Opt. Inputs : None
               
 Outputs     : Function value returns number of dimensions.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
 CALLED BY:
	FORMAT_INTERVALS, MCURVEFIT, PLOT_EXPINT, SHOW_AXES, SHOW_SYNOPTIC, fits2rm, plotman
	read_hessi_4_ospex, read_hessi_4_spex [1], read_hessi_4_spex [2]
	read_xsm_4_ospex, rm2fits
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : Idea by Stein Vidar Haugan.

 Written     : C D Pike, RAL, 13-Jan-94
               
 Modified    : 

 Version     : Version 1, 13-Jan-94


N_STRUCT $SSW/gen/idl_libs/astron/structure/n_struct.pro
[Previous] [Next]
 NAME:
	N_STRUCT 

 PURPOSE:
	To determine if variable is a structure and return number of elements.

 CALLING SEQUENCE:
	n = N_struct( var, ntags )

 INPUT:
	var = any variable.

 OUTPUT:
	ntags = number of structure tags.

 RESULT:
	Returns zero if variable is not a structure, otherwise returns # elems.

 CALLED BY:
	PRINT_STRUCT
 PROCEDURE:
	Determine if argument is a structure by checking for # of tags.
	If structure, use size function to get # of elements
	(instead of N_elements) so that it works on I/O associated structures.

 MODIFICATION HISTORY:
	Written, Frank Varosi NASA/GSFC 1989.
	Converted to IDL V5.0   W. Landsman   September 1997


NANCAY__DEFINE $SSW/gen/idl/synoptic/nancay__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : NANCAY__DEFINE

 Purpose     : Define a Nancay data site object

 Category    : Ancillary GBO Synoptic Objects

 Syntax      : IDL> c=obj_new('nancay')

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, GET_UTC
	NANCAY::CLEANUP, NANCAY::INDEX2FITS, NANCAY::INIT, NANCAY::SETPROP
	NANCAY::SYNOP, PB0R, REM_TAG [1], REM_TAG [2], TRIM, synop_link
 History     : Written 3 March 2000, D. Zarro, SM&A/GSFC

 Contact     : dzarro@solar.stanford.edu


NDIM_INDICES $SSW/gen/idl/genutil/ndim_indices.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NDIM_INDICES()
               
 Purpose     : Return n-dimensional indices from a one-dimensional index
               
 Explanation : WHERE() returns a one-dimensional index - this routine
               converts that index into N indices pointing to the same
               element of an N-dimensional block. To do this, both the
               one-dimensional index and the N-dimensional data block must be
               supplied.
               
 Use         : indices=get_indices(data,index)
    
 Inputs      : DATA : The N-dimensional data block.

               INDEX : The one-dimensional index.
 
 Opt. Inputs : None
               
 Outputs     : Returns n-dimensional indices as a LONG array.
               
 Opt. Outputs: None.
               
 Keywords    : None.

 Calls       : None.
 CALLED BY:
	XCFIT_BLOCK
 Common      : None.
               
 Restrictions: ..
               
 Side effects: None.
               
 Category    : Array utility
               
 Prev. Hist. : None.

 Written     : SVH Haugan, UiO, 15 September 1997
               
 Modified    : Version 1, SVHH, 15 January 1999
                       Renamed from GET_INDICES() to avoid conflict
                       with Yohkoh routine by the same name.

 Version     : 1, 15 January 1999


NEAR_TIME $SSW/gen/idl/time/near_time.pro
[Previous] [Next]
 Project     : HESSI

 Name        : NEAR_TIME

 Purpose     : Find index of time array nearest input time

 Category    : time, utility

 Syntax      : IDL> chk=near_time(times,itime)

 Inputs      : TIMES = time array to search
               ITIME = time value to search on

 Outputs     : INDEX = index of nearest time element
               
 CALLS: ***
	ANYTIM2TAI, EXIST, IS_STRING, VALID_TIME
 CALLED BY:
	EIT__DEFINE
 History     : Written,  1-Dec-2003, Zarro (L-3Com/GSFC)
               Improved, 28-Dec-2005, Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


NEAREST [1] $SSW/gen/idl/fund_lib/jhuapl/nearest.pro
[Previous] [Next]
 NAME:
       NEAREST
 PURPOSE:
       Return multiple of a given step nearest a target value.
 CATEGORY:
 CALLING SEQUENCE:
       v = nearest( s, t, [ vlo, vhi ])
 INPUTS:
       s = step size.                      in
       t = target value.                   in
 KEYWORD PARAMETERS:
 OUTPUTS:
       vlo =  largest multiple of S <= T.  out
       vhi = smallest multiple of S >= T.  out
       v = multiple of S nearest T.        out
 CALLED BY:
	INRANGE [1], INRANGE [2], INRANGE [3]
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       R. Sterner  10 Apr, 1986.
       Johns Hopkins University Applied Physics Laboratory.

 Copyright (C) 1986, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.


nearest_fid [1] $SSW/gen/idl/genutil/nearest_fid.pro
[Previous] [Next]
	NAME: nearest_fid
	Purpose: Using the input fid "tfid" find and return the index 
		to the nearest fid from the list of fileids fids.
	Calling Sequence:
		ifid = nearest_fid(testfid, fids)
	Input:
		testfid		fileid in the format of yymmdd.hhmm
		fids		list of file ids
	Return:
		the index of the nearest file id.

 CALLS: ***
	fid2ex [1], fid2ex [2], int2secarr [1], int2secarr [2]
 CALLED BY:
	GetRng
	History: written 6-May-94...


NEAREST_GEV $SSW/gen/idl/solar/nearest_gev.pro
[Previous] [Next]
 Project     : HESSI

 Name        : NEAREST_GEV

 Purpose     : determine nearest GOES event to a particular time

 Category    : synoptic
;
 Syntax      : IDL> gev=nearest_gev(time,during=during)

 Inputs      : TIME = time to check

 Outputs     : GEV = GOES event structure

 Keywords    : DURING = 1/0 if time is during GOES event

 CALLS: ***
	ANYTIM2TAI, GET_GEV, PR_SYNTAX, VALID_TIME, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	MDI_GBO
 History     : 6-Dec-2001, D.M. Zarro (EIT/GSFC),  Written

 Contact     : DZARRO@SOLAR.STANFORD.EDU


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

   Purpose: control Netscape client process(es) from within SSW/IDL

   Input Parameters:
      item    - optional url or file name for action (ex: to open)
      remote -  optional remote control command (synonym for keyword: REMOTE_COMMAND)
      SEE: http://home.netscape.com/newsref/std/x-remote.html

   Keyword Parameters:
      which_netscape          - Full Netscape path (default assume in $path)
      install                 - privatecolor map
      noinstall               - shared color map
      iconic                  - start iconified
      id                      window id
      display                 X Client(s) Default=current OR last specified
                              [may be an array]
      splash                  include license info (default=NOSPLASH)
      raise                   raise Netscape window
      noraise                 do not raise Netscape window
      geometry                Position / size of window
                              String "WxH+X+Y" -OR- 4 element array [W,H,X,Y]
      remote_command          explicit remote command (synonym for positional)
      openURL                 if set, open URL  (via ITEM)
      openFile                open File (via ITEM)
      new_window              open in url or file in a New Netscape window
      exit                    if set, sends remote 'exit' command
      nospawn                 Do not spawn the command
      nobackground            Do not background command
      netscape_command (OUTPUT) - implied/spawned command
      command_output   (OUTPUT) - output from spawned command(s)

   Calling Sequence:
      IDL> netscape_control [,URL] [,display=IP] [,/install] [,/iconic], $
                            [,/openURL] [,/nobackground] [/noraise] ...

   Calling Example:
    1. Initial Call - open a Netscape Client on the designated display
                      Optionally supply an initial URL
    IDL> netscape_control,'http://www.lmsal.com/SXT/html/First_Light.html',$
                           display='sxt1.lmsal.com', /install

    2. Open a new URL in an existing Netscape Client (opened in preceding)
    IDL> netscape_control, /openURL, $
            'http://vestige.lmsal.com/TRACE/last_movies/ '

    3. Same - this time kick of a JavaScript movie in existing Client
    IDL> netscape_control, /openURL, $
            'http://www.lmsal.com/SXT/movies/sxt_goes_last72hours_j.html '

         a) display defaults to previous call
         b) uses 'remote' control capabilities of Netscape; 'openURL' in this
            example.

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BOX_MESSAGE, ESPAWN, OS_FAMILY, data_chk [1], data_chk [2]
	str_replace [1], str_replace [2]
   Restrictions:
      X Client must permit X requests from the Server (IDL caller)

   History:
      25-April-2000  S.L.Freeland - "leverage" browser technologies
                                    simplify SSWIDL<->Netscape interface
                     Initially for automated QKL/NRT display of solar data
      26-April-2000  S.L.Freeland - fix 'id' typo

       3-May-2000    S.L.Freeland - add /NEW_WINDOW keyword and function
                                    add /EXIT, implement GEOMETRY
                                    use D.M.Zarro 'espawn'
      15-Oct-2001    Kim Tolbert - if Windows, just start the file that was passed in
                                   as item.  None of the keywords has any effect.  The
                                   file should be an html, otherwise opens in whatever
                                   application the file is associated with.


new_version [1] $SSW/gen/idl/genutil/new_version.pro
[Previous] [Next]
   Name: new_version
 
   Purpose: construct new file name using VMS-like syntax 

   Input Parameters:
      filename - string containing current file name (may include path)

   Optional Keyword Paramters:
      move - if switch (=1) then change name (move) on same path
	      if string pathname, copy new file to move with new name

   Output Paramters:
      function returns new file name (including path)

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], REVERSE, break_file [4], concat_dir [4], curdir [1], curdir [2]
	file_list [1], file_list [2]
 CALLED BY:
	add_pro [1], add_pro [2]
   Side effects:
      if move or copy keywords set, new file is written to specified path
      (otherwise, filename is constructed but no file action is taken)

  Restrictions: 
	unix only for now?
	assumes all charcters after the semicolon represent the integer
	version number

   History: 
	slf, 1-Dec-1992		


next_window [1] $SSW/gen/idl/genutil/next_window.pro
[Previous] [Next]
   Name: next_window

   Purpose: return next available window number, so they can be known in advance
            (one use is to allow window Title which include this# prior to window creation)

   Calling Sequence:
      wind=next_window( [/free, /user] )

   Calling Examples:
      wind=next_window(/free)			; IDL will use this for next /free
      wind=next_window(/user)			; next explicit avail (0-31)

      wdef,zz,512,512,title='My Title' + next_window(/free,/label)
      (create a window with defined title which includes window number for info)
      
 CALLED BY:
	FIG_OPEN, FIRST_LIGHT [1], FIRST_LIGHT [2], FWD_DECOMPOSE, FWD_DEC_GAUSS
	FWD_MINIMUM, HSI_MAP_CLEAN [1], HSI_MEM_SATO [1], show_contacts, xanal_emi
	xdisp_fits, xdisp_trace [1], xdisp_trace2, xdisp_trace3
   History:
      7-oct-1994 (SLF)

   Restrictions:


NGP $SSW/gen/idl_libs/astron/math/ngp.pro
[Previous] [Next]
 NAME:
       NGP

 PURPOSE:
       Interpolate an irregularly sampled field using Nearest Grid Point

 EXPLANATION:
       This function interpolates irregularly gridded points to a
       regular grid using Nearest Grid Point.

 CATEGORY:
       Mathematical functions, Interpolation

 CALLING SEQUENCE:
       Result = NGP, VALUE, POSX, NX[, POSY, NY, POSZ, NZ, 
                     /AVERAGE, /WRAPAROUND, /NO_MESSAGE]

 INPUTS:
       VALUE: Array of sample weights (field values). For e.g. a
              temperature field this would be the temperature and the
              keyword AVERAGE should be set. For e.g. a density field
              this could be either the particle mass (AVERAGE should
              not be set) or the density (AVERAGE should be set).
       POSX:  Array of X coordinates of field samples, unit indices: [0,NX>.
       NX:    Desired number of grid points in X-direction.
       
 OPTIONAL INPUTS:
      POSY: Array of Y coordinates of field samples, unit indices: [0,NY>.
      NY:   Desired number of grid points in Y-direction.
      POSZ: Array of Z coordinates of field samples, unit indices: [0,NZ>.
      NZ:   Desired number of grid points in Z-direction.

 KEYWORD PARAMETERS:
       AVERAGE:    Set this keyword if the nodes contain field samples
                   (e.g. a temperature field). The value at each grid
                   point will then be the average of all the samples
                   allocated to it. If this keyword is not set, the
                   value at each grid point will be the sum of all the
                   nodes allocated to it (e.g. for a density field from
                   a distribution of particles). (D=0). 
       WRAPAROUND: Set this keyword if the data is periodic and if you
                   want the first grid point to contain samples of both
                   sides of the volume (see below). (D=0).
       NO_MESSAGE: Suppress informational messages.

 Example of default NGP allocation: n0=4, *=gridpoint.

     0   1   2   3     Index of gridpoints
     *   *   *   *     Grid points
   |---|---|---|---|   Range allocated to gridpoints ([0.0,1.0> --> 0, etc.)
   0   1   2   3   4   posx

 Example of NGP allocation for WRAPAROUND: n0=4, *=gridpoint.

   0   1   2   3         Index of gridpoints
   *   *   *   *         Grid points
 |---|---|---|---|--     Range allocated to gridpoints ([0.5,1.5> --> 1, etc.)
   0   1   2   3   4=0   posx


 OUTPUTS:
       Prints that a NGP interpolation is being performed of x
       samples to y grid points, unless NO_MESSAGE is set. 

 RESTRICTIONS:
       All input arrays must have the same dimensions.
       Postition coordinates should be in `index units' of the
       desired grid: POSX=[0,NX>, etc.

 PROCEDURE:
       Nearest grid point is determined for each sample.
       Samples are allocated to nearest grid points.
       Grid point values are computed (sum or average of samples).

 EXAMPLE:
       nx = 20
       ny = 10
       posx = randomu(s,1000)
       posy = randomu(s,1000)
       value = posx^2+posy^2
       field = ngp(value,posx*nx,nx,posy*ny,ny,/average)
       surface,field,/lego

 NOTES:
       Use tsc.pro or cic.pro for a higher order interpolation schemes.    A 
       standard reference for these interpolation methods is:   R.W. Hockney 
       and J.W. Eastwood, Computer Simulations Using Particles (New York: 
       McGraw-Hill, 1981).
 MODIFICATION HISTORY:
       Written by Joop Schaye, Feb 1999.
       Check for LONG overflow  P. Riley/W. Landsman   December 1999


NINT [1] $SSW/gen/idl/util/nint.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NINT()
               
 Purpose     : Returns the nearest integers to the input values.
               
 Explanation : Returns the nearest integer (2 or 4 byte) to the input scalar
               or array.  Note this function should be used instead of 
               relying on the IDL FIX or LONG functions to convert a real
               number. Eg fix(1.0/0.001) = 999 but nint(1.0/0.001) = 1000
               
 Use         : IDL> n = nint(x)
    
 Inputs      : x   array for which nearest integers are to be found.
               
 Opt. Inputs : None
               
 Outputs     : Function value  - the nearest integers.
               
 Opt. Outputs: None
               
 Keywords    : LONG	= If this keyword is set and non-zero, then the result
			  of NINT is of type LONG.  Otherwise, the result is
			  either of type INTEGER or LONG depending on the
			  extent of the data.

 Calls       : None
 CALLED BY:
	ACALCHEK, ACFIT, AMPHIT, APCAL_ADD_27MANT [1], APCAL_ADD_27M_RL, APCAL_ADD_2MANT
	APCAL_ADD_2M_RL, APPLY_CAL, BASEPHZ, BREAK_MAP, CALSPEC, CAL_INFO, CSCALE, DAILY
	DAILY_PLOT, DLASCAN, EIS_IMAGE_TOOL [1], EIS_IMAGE_TOOL [2], FCALCHEK, FCAL_UPDATE
	FIND_CAT, FLAGGER, FTEMAP, GETGPSLIST, GET_CDS_STATE, GET_MAP_FOV, GET_RID, GET_SID
	HELIOG, IMAGE_TOOL, JSMOVIE, JSMOVIE2, LIMFIT, MAKE_APCAL, MAKE_APCAL2, MAKE_APCAL3
	MAKE_SOLCALTRAJ, OVSA_EXPLORER formerly OVSA_PRESUB, OVSA_FINTERP, OVSA_PRESUB
	PHZFIT, PLOT_HELIO [1], PLOT_HELIO [2], PLOT_MAP, PNTCHEK, POLY_SPEC, REDUCE_MAP
	RESPACE_MAP, SATCALCHEK, SCFIT, SCHEDULE, SCOPE_CURSOR, SHOW_OSC, SITE__DEFINE
	SMART_FTP, SRBL_2M_CAL, TCFIT, TOPRINTER, TPCAL_ADD2M, WANALYZE, WATCHER, WGETGPS
	WGETSATS, WRITE_DAILY, WRITE_GAINREC, coreg, hsi_phz_stacker, reformat_data
	st_merge
 Restrictions: The nearest integer of 2.5 is 3
               the nearest integer of -2.5 is -3
               
 Side effects: None
               
 Category    : Util, Numerical
               
 Prev. Hist. : Unknown

 Written     : Unknown
               
 Modified    : To CDS format, C D Pike, RaL, 18-May-1993
		Version 2, William Thompson, GSFC, 27 July 1993.
			Added LONG keyword, taken from routine of same name
			written by Wayne Landsman.
		Version 3, William Thompson, GSFC, 17 February 1998
			Use ROUND function
		Version 4, William Thompson, GSFC, 19 February 1998
			Allow string inputs

 Version     : Version 4, 19 February 1998


NINT [2] $SSW/gen/idl_libs/astron/misc/nint.pro
[Previous] [Next]
 NAME:
	NINT
 PURPOSE:
	Nearest integer function.
 EXPLANATION:   
	NINT() is similar to the intrinsic ROUND function, with the following
	two differences:
	(1) if no absolute value exceeds 32767, then the array is returned as
		as a type INTEGER instead of LONG
	(2) NINT will work on strings, e.g. print,nint(['3.4','-0.9']) will
		give [3,-1], whereas ROUND() gives an error message

 CALLING SEQUENCE:
	result = nint( x, [ /LONG] )

 INPUT:
	X - An IDL variable, scalar or vector, usually floating or double
		Unless the LONG keyword is set, X must be between -32767.5 and 
		32767.5 to avoid integer overflow

 OUTPUT
	RESULT - Nearest integer to X

 CALLED BY:
	ACALCHEK, ACFIT, AMPHIT, APCAL_ADD_27MANT [1], APCAL_ADD_27M_RL, APCAL_ADD_2MANT
	APCAL_ADD_2M_RL, APPLY_CAL, BASEPHZ, BREAK_MAP, CALSPEC, CAL_INFO, CSCALE, DAILY
	DAILY_PLOT, DLASCAN, EIS_IMAGE_TOOL [1], EIS_IMAGE_TOOL [2], FCALCHEK, FCAL_UPDATE
	FIND_CAT, FLAGGER, FTEMAP, GETGPSLIST, GET_CDS_STATE, GET_MAP_FOV, GET_RID, GET_SID
	HELIOG, IMAGE_TOOL, JSMOVIE, JSMOVIE2, LIMFIT, MAKE_APCAL, MAKE_APCAL2, MAKE_APCAL3
	MAKE_SOLCALTRAJ, OVSA_EXPLORER formerly OVSA_PRESUB, OVSA_FINTERP, OVSA_PRESUB
	PHZFIT, PLOT_HELIO [1], PLOT_HELIO [2], PLOT_MAP, PNTCHEK, POLY_SPEC, REDUCE_MAP
	RESPACE_MAP, SATCALCHEK, SCFIT, SCHEDULE, SCOPE_CURSOR, SHOW_OSC, SITE__DEFINE
	SMART_FTP, SRBL_2M_CAL, TCFIT, TOPRINTER, TPCAL_ADD2M, WANALYZE, WATCHER, WGETGPS
	WGETSATS, WRITE_DAILY, WRITE_GAINREC, coreg, hsi_phz_stacker, reformat_data
	st_merge
 OPTIONAL KEYWORD INPUT:
	LONG - If this keyword is set and non-zero, then the result of NINT
		is of type LONG.   Otherwise, the result is of type LONG if
		any absolute values exceed 32767, and type INTEGER if all
		all absolute values are less than 32767.
 EXAMPLE:
	If X = [-0.9,-0.1,0.1,0.9] then NINT(X) = [-1,0,0,1]

 PROCEDURE CALL:
	None:
 REVISION HISTORY:
	Written W. Landsman        January 1989
	Added LONG keyword         November 1991
	Use ROUND if since V3.1.0  June 1993
	Always start with ROUND function    April 1995
	Return LONG values, if some input value exceed 32767
		and accept string values   February 1998 
       Use size(/TNAME) instead of DATATYPE()      October 2001


NL_LSQFIT $SSW/gen/idl/fitting/nl_lsqfit.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       NL_LSQFIT

 PURPOSE: 
       Fit a user-supplied nonlinear function to two-dimensional data

 CALLING SEQUENCE: 
       NL_LSQFIT, x, y, sig, a, chisq, funcs=funcs

 INPUTS:
       X
       SIG
       A
       IA

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       CHISQ
       COVAR

 OPTIONAL OUTPUTS:
       None.

 KEYWORD PARAMETERS: 
       FUNC
       STD_ERR 

 CALLS: ***
	NL_MRQMIN
 CALLED BY:
	ITOOL_LIMBFITTER, MAKE_AUTO_FIT, MAKE_MANUAL_FIT, MK_LIMBFIT_BS, UPDATE_FITLIMB
 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 PREVIOUS HISTORY:
       Written November 10, 1994, by Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
       Version 2, July 17, 1997, Liyun Wang, NASA/GSFC
          Changed call from MRQMIN (which becomes a built-in function
             in IDL 5.0) to NL_MRQMIN
       
 VERSION:
       Version 2, July 17, 1997


NL_MRQMIN $SSW/gen/idl/fitting/nl_mrqmin.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS

 NAME:
       NL_MRQMIN

 PURPOSE: 
       Internal routine called by NL_LSQFIT

 EXPLANATION:
       
 CALLING SEQUENCE: 
       NL_MRQMIN, x, y, sig, a, chisq, alamda, funcs=funcs [,covar=covar]

 INPUTS:
       X   -- A matrix with M x N elements containing the observation points,
              where M is the number of independent variables, and N is the
              number of observing points.
       Y   -- N element vector, value of the fitted function. 
       SIG -- Measurement error (standard deviation, N elements); If the
              measurement errors are not know, they can all be set to 1.
       A   -- Fit parameter, M element vector, initial guessing. Will be
              changed upon exit.
       ALAMDA -- Fudge factor. On the first call, set it to be a negative
                 value, it will then be changed to a small positive value. If
                 a step succeeds, it decreases by a factor of 10; if a step
                 fials, it grows by a factor of 10.
       FUNCS -- Name of the user-supplied procedure that returns values of
                the model function and its first derivative. Its calling
                sequence must be:
                     FUNCS, x0, a, ymod, dyda

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       CHISQ -- Value of the merit function
       A     -- Fit parameters.

 OPTIONAL OUTPUTS:
       COVAR -- Covariance matrix with M x M elements, used for calculating
                the uncertainties.

 KEYWORD PARAMETERS: 
       None.

 CALLS: ***
	COVSRT, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], GAUSSJ, MRQCOF
	delvarx [5]
 CALLED BY:
	NL_LSQFIT
 COMMON BLOCKS:
       nl_mrqmin -- Internal common block used for saving some variables

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 CATEGORY:
       ulitities, numerical recipes

 PREVIOUS HISTORY:
       Written November 10, 1994, by Liyun Wang, NASA/GSFC

 MODIFICATION HISTORY:
       Version 2, July 17, 1997, Liyun Wang, NASA/GSFC
          Renamed from MRQMIN, which is used as a built-in routine in
             IDL 5.0
       
 VERSION:
       Version 2, July 17, 1997


NOBE__DEFINE $SSW/gen/idl/synoptic/nobe__define.pro
[Previous] [Next]
 Project     : HESSI

 Name        : NOBE__DEFINE

 Purpose     : Define a NOBE data object for Nobeyama Radio Obs.

 Category    : Ancillary GBO Synoptic Objects

 Syntax      : IDL> c=obj_new('nobe')

 CALLS: ***
	DPRINT, GET_UTC, IS_STRING, NOBE::CLEANUP, NOBE::GET_SDIR, NOBE::INDEX2FITS
	NOBE::INIT, NOBE::PARSE_TIME, NOBE::RENAME_FILES, NOBE::SETPROP, NOBE::SYNOP
	PARSE_TIME, TIME2FID, TRIM, synop_link
 History     : Written 22 Aug 2000, D. Zarro (EIT/GSFC)

 Contact     : dzarro@solar.stanford.edu


nobeyama_struct $SSW/gen/idl_test/genutil/nobeyama_struct.pro
[Previous] [Next]
   Name: nobeyama_struct

   Purpose: return nobeyama_structure 

   Input Parameters:
      number (optional) - number structures returned  - default is one  
  
   Keyword Parameters:
      catalog - if set, return catalog structure (subset)

   Calling Sequence:
      str=nobeyama_struct( [number] )

   History:
      27-apr-1996 S.L.Freeland (map FITs header)
      24-may-1996 S.L.Freeland (add .VERSION, make .MJD long)
      15-aug-1996 S.L.Freeland (Version 2, naxis3 - add /CATALOG switch)
      27-oct-1996 S.L.Freeland (typo (BCALE->BSCALE))
      11-dec-1996 S.L.Freeland (add /CATALOG keyword for testing)
      11-feb-1997 S.L.Freeland (convert eit_struct->nobeyama_struct) 


normalize_cube $SSW/gen/idl/genutil/normalize_cube.pro
[Previous] [Next]
   Name: normalize_cube

   Purpose: empirically normalize cube of data from relative signal levels

   Input Parameters:
      incube - 3D data (cube)
      x,y,nx,ny - (optional) - sub-cube to use for normalization (def=center)

   Output
      function returns pseudo-normalized cube OR  factors if /factors is set

   Keyword Parameters:
      center - switch, if set, take cube core from image center 
      corner - switch, if set, take cube core from corner
      factors - switch, if set, return normalization vector instead of norm data
      overwrite - switch, if set, conserve memory by OVERWRITING INPUT
      normfact (output) - normalization vector
      tcube (output)   - sub cube used in normaaliztion (nx,ny,nimages)
  

   Calling Sequnce:
      nc=normalize_cube(incube [x,y,nx,ny, /center, /corner, normfact=normfact])

   History:
      18-mar-1996 (S.L.Freeland) originally for EIT (unknown exposure times)
       7-jun-1997 (S.L.Freeland) fix bug with /OVERWRITE  option

 CALLS: ***
	data_chk [1], data_chk [2]
   Restrictions:
      Presumes that that sub-cube is not where the action is


nospike $SSW/gen/idl/image/nospike.pro
[Previous] [Next]
NAME:    nospike.pro    

PURPOSE: Despike an image using a median filter / dilation 

Method:  spikes exceeding `threshold' percent ( default = 15% in
         normal areas, and default = 20 % in areas brighter than 
         avg(image)+stdev(image) ) and brighter than 'minimum' 
         ( default = avg(image) ). 
         Fills hits with median of neighbouring pixels that were not
         flagged as radiation hits. If the /flare keyword is set,
         the brightthreshold is put to 30%, so that flare kernels
         are not flagged as radiation hits. This can also be set
         manually by using the "brighttreshold" keyword.
         Contrary to trace_despike, this routine often doesn't need 
         iterations, and two iterations usually suffices.
         
         
SUBROUTINES:   
                  wv_a_trous

CALLING SEQUENCE: image=nospike(image)

OUTPUT: returns despiked image array

 CALLED BY:
	ssw_flare_locator, trace_special_movie [3]
EXAMPLE: 

  im=nospike(readfits('file'))           simple correction
  im=nospike(trace_nospike(im0))         double correct. for faint fields
  im=nospike(im0,minimum=200)            corr. above I=200   
  im=nospike(im0,thre=0.17,bright=0.25)  pixels brighter than 1.17
                                               or 1.25 of local average
                                               in normal or bright
                                               regions, respectively
                                               are flagged as hits
  im=nospike(im0,nspikes=nspikes,imap=imap) to return the number of
                                                  pikes removed
                                                  and a pixel map
  im=nospike(im0,/flare)                 to keep flare kernels

CALLS: ***
	AVG [1], AVG [2], BOX_MESSAGE, SINCE_VERSION [1], SINCE_VERSION [2], STDEV
	WV_A_TROUS
OPTIONAL KEYWORD INPUT:

  nspikes	       number of spikes (not pixels) removed
  imap                map of corrected pixels
  threshold           fractional threshold for brightness
  brightthreshold     fractional threshold for brightness in bright regions
  minimum             do not correct pixels dimmer than minimum
  flare               sets brightthreshold to 0.3
  silent              doesn't print out messages

Restrictions:
   the call to RSI 'dilate' varies slightly between pre/after V5.3
   (RSI added '/constrain' and 'background' keywords in 5.3)

HISTORY:

 Bart De Pontieu (BDP)  27 October 2000.
                        31-October 2000, S.L.Freeland rename Bart's
                        'trace_nospike.pro' to 'nospike.pro' and add it
                        to the growing SSW/gen CCD cleanup arsenal
                        added version dependent 'dilate' call
 Zarro (EER/GSFC) 28 May 2003 - added "where" check

TODO: - someone (volunteers?) needs to a review of all possible SSW 
 CCD detector/image cleanup routines and generate a 
 effectiveness/application matrix....
 clean_exposure.pro, despike_gen.pro unspike.pro ssw_unspike_cube.pro
 and many others (not to mention the ~general routines which are
 buried in trace,eit,sxt,lasco... instrument specific libraries.


NOTEPAD $SSW/gen/idl/fund_lib/sdac/notepad.pro
[Previous] [Next]
 NAME:		
       NOTEPAD
 PURPOSE:	
       Call the NOTEPAD editor to edit a file.
 CATEGORY:
	GEN
 CALLING SEQUENCE:
       NOTEPAD                ;Prompt for filename
	NOTEPAD, File
 INPUTS:
	File = Name of file to edit, scalar string
 OUTPUTS:
	None.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHKLOG [1], CHKLOG [2]
	break_file [4]
 COMMON BLOCKS:
	LASTFILE -- Contains the single variable FILENAME.
 PROCEDURE:
	spawn is used to call the notepad editor, dxnotepad, or
	vue$library:vue$notepad.com  On ultrix or osf the process is launched.

 NOTES:

 RESTRICTIONS:
       Only DEC supports the notepad, on other X library machines, xedit is launched.

 MODIFICATION HISTORY:
	ras 3-apr-95
	ras, 13-july-1996, spawn with /nowait under VMS


NSTAR $SSW/gen/idl_libs/astron/idlphot/nstar.pro
[Previous] [Next]
 NAME:
       NSTAR
 PURPOSE:
       Simultaneous point spread function fitting (adapted from DAOPHOT)
 EXPLANATION:
       This PSF fitting algorithm is based on a very old (~1987) version of 
       DAOPHOT, and much better algorithms (e.g. ALLSTAR) are now available
       -- though not in IDL.
       
 CALLING SEQUENCE:
       NSTAR, image, id, xc, yc, mags, sky, group, [ phpadu, readns, psfname,
               magerr, iter, chisq, peak, /PRINT , /SILENT, /VARSKY, /DEBUG ]

 INPUTS:
       image - image array
       id    - vector of stellar ID numbers given by FIND
       xc    - vector containing X position centroids of stars (e.g. as found
               by FIND)
       yc    - vector of Y position centroids
       mags  - vector of aperture magnitudes (e.g. as found by APER)
               If 9 or more parameters are supplied then, upon output
               ID,XC,YC, and MAGS will be modified to contain the new
               values of these parameters as determined by NSTAR.
               Note that the number of output stars may be less than 
               the number of input stars since stars may converge, or 
               "disappear" because they are too faint.
       sky   - vector of sky background values (e.g. as found by APER)
       group - vector containing group id's of stars as found by GROUP

 OPTIONAL INPUT:
       phpadu - numeric scalar giving number of photons per digital unit.  
               Needed for computing Poisson error statistics.   
       readns - readout noise per pixel, numeric scalar.   If not supplied, 
               NSTAR will try to read the values of READNS and PHPADU from
               the PSF header.  If still not found, user will be prompted.
       psfname - name of FITS image file containing the point spread
               function residuals as determined by GETPSF, scalar string.  
               If omitted, then NSTAR will prompt for this parameter.

 OPTIONAL OUTPUTS:
       MAGERR - vector of errors in the magnitudes found by NSTAR
       ITER - vector containing the number of iterations required for
               each output star.  
       CHISQ- vector containing the chi square of the PSF fit for each
               output star.
       PEAK - vector containing the difference of the mean residual of
               the pixels in the outer half of the fitting circle and
               the mean residual of pixels in the inner half of the
               fitting circle

 OPTIONAL KEYWORD INPUTS:
       /SILENT - if set and non-zero, then NSTAR will not display its results
               at the terminal
       /PRINT - if set and non-zero then NSTAR will also write its results to
               a file nstar.prt.   One also can specify the output file name
               by setting PRINT = 'filename'.
       /VARSKY - if this keyword is set and non-zero, then the sky level of
               each group is set as a free parameter.
       /DEBUG - if this keyword is set and non-zero, then the result of each
               fitting iteration will be displayed.

 PROCEDURES USED:
       DAO_VALUE(), READFITS(), REMOVE, SPEC_DIR(), STRN(), SXPAR()

 COMMON BLOCK:
       RINTER - contains pre-tabulated values for cubic interpolation
 REVISION HISTORY
       W. Landsman                 ST Systems Co.       May, 1988
       Adapted for IDL Version 2, J. Isensee, September, 1990
       Minor fixes so that PRINT='filename' really prints to 'filename', and
       it really silent if SILENT is set.  J.Wm.Parker HSTX 1995-Oct-31
       Added /VARSKY option   W. Landsman   HSTX      May 1996
       Converted to IDL V5.0   W. Landsman   September 1997
       Replace DATATYPE() with size(/TNAME)  W. Landsman November 2001
       Assume since V5.5, remove VMS calls W. Landsman September 2006
 CALLS:
 CALLED BY
	T_NSTAR


NTRIM $SSW/gen/idl/string/ntrim.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NTRIM()
               
 Purpose     : Calls TRIM(BYTE2INT(NUMBER),...)
               
 Explanation : Avoids formatting BYTE variables as texts in TRIM().
               
 Use         : PRINT,NTRIM(NUMBER)
    
 Inputs      : NUMBER: Any variable that can be passed to TRIM
               
 Opt. Inputs : FORMAT 
               - Format specification for STRING function.  Must be a string
		  variable, start with the "(" character, end with the ")"
		  character, and be a valid FORTRAN format specification.  If
		  NUMBER is complex, then FORMAT will be applied separately to
		  the real and imaginary parts.

               FLAG
               - Flag passed to STRTRIM to control the type of trimming:

			FLAG = 0	Trim trailing blanks.
			FLAG = 1	Trim leading blanks.
			FLAG = 2	Trim both leading and trailing blanks.

		  The default value is 2.  If NUMBER is complex, then FORMAT
		  will be applied separately to the real and imaginary parts.

 Outputs     : Returns TRIM(BYTE2INT(NUMBER),...)
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	BYTE2INT, TRIM
 CALLED BY:
	AN_NIMCP, AN_NIMCP_1_2, AN_NIMCP_AVG, DSP_INFO, FIND_CDS_STUDIES, FITSHEAD2WCS
	GET_NIMCP, GET_WAVECAL, GET_WIDTH_CORR, MK_SYNOPTIC, READ_NIMCP_CAL, SNAP_MOVIE
	VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_ROTATE, WCS2FITSHEAD, WCS_FIND_PIXEL_LIST
	WCS_FIND_SPECTRUM, WCS_FIND_TABLE, WCS_HCLEAN, WCS_INV_PROJ_AIR
	WCS_INV_PROJ_AIT, WCS_INV_PROJ_ARC, WCS_INV_PROJ_AZP, WCS_INV_PROJ_BON
	WCS_INV_PROJ_CAR, WCS_INV_PROJ_CEA, WCS_INV_PROJ_COD, WCS_INV_PROJ_COE
	WCS_INV_PROJ_COO, WCS_INV_PROJ_COP, WCS_INV_PROJ_CSC, WCS_INV_PROJ_CYP
	WCS_INV_PROJ_GRA, WCS_INV_PROJ_GRI, WCS_INV_PROJ_MER, WCS_INV_PROJ_MOL
	WCS_INV_PROJ_PAR, WCS_INV_PROJ_PCO, WCS_INV_PROJ_QSC, WCS_INV_PROJ_SFL
	WCS_INV_PROJ_SIN, WCS_INV_PROJ_STG, WCS_INV_PROJ_SZP, WCS_INV_PROJ_TAB
	WCS_INV_PROJ_TAN, WCS_INV_PROJ_TSC, WCS_INV_PROJ_ZEA, WCS_INV_PROJ_ZPN
	WCS_PARSE_UNITS, WCS_PROJ_AIR, WCS_PROJ_AIT, WCS_PROJ_ARC, WCS_PROJ_AZP
	WCS_PROJ_BON, WCS_PROJ_CAR, WCS_PROJ_CEA, WCS_PROJ_COD, WCS_PROJ_COE, WCS_PROJ_COO
	WCS_PROJ_COP, WCS_PROJ_CSC, WCS_PROJ_CYP, WCS_PROJ_GRA, WCS_PROJ_GRI, WCS_PROJ_MER
	WCS_PROJ_MOL, WCS_PROJ_PAR, WCS_PROJ_PCO, WCS_PROJ_QSC, WCS_PROJ_SFL, WCS_PROJ_SIN
	WCS_PROJ_STG, WCS_PROJ_SZP, WCS_PROJ_TAB, WCS_PROJ_TAN, WCS_PROJ_TSC, WCS_PROJ_ZEA
	WCS_PROJ_ZPN, WCS_RECTIFY, WCS_SIMPLIFY, WEEK2UTC, XPL_STRUCT, XRECORDER
	struct2fitshead
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Utility
               
 Prev. Hist. : None.

 Written     : Stein Vidar H. Haugan, UiO, 26-February-1996
               
 Modified    : Never.

 Version     : 1, 26-February-1996


NULLTRIM $SSW/gen/idl_libs/astron/misc/nulltrim.pro
[Previous] [Next]
 NAME:
	NULLTRIM
 PURPOSE:
	Trim a string of all characters after and including the first null
 EXPLANATION:
	The null character is an ascii 0b

 CALLING SEQUENCE:
	result = nulltrim( st )

 INPUTS:
	st = input string
 OUTPUTS:
	trimmed string returned as the function value.
 CALLED BY:
	TABLE_HELP, TAB_COL, TAB_NULL, TAB_PRINT, TAB_READ, TAB_VAL
 HISTORY:
	D. Lindler  July, 1987
	Converted to IDL V5.0   W. Landsman   September 1997


NUM2LET $SSW/gen/idl/util/num2let.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	NUM2LET

 Purpose     :	Returns a letter ('A', 'B') from an input integer (1, 2).

 Explanation :	In the creation of file names, sometimes one would rather
		suffix a filename with a letter instead of an integer (i.e.,
		't111a.dat', 't111b.dat' instead of 't1111.dat', 't1112.dat').
		This procedure prevents the user from defining an array of
		alphabetic letters in each procedure where it is needed.

 Use         :	LET = NUM2LET(I)

 Inputs      :	I =	Integer between 1 and 26.  Accepts either scalars or
			arrays.

 Opt. Inputs :	None.

 Outputs     :	LET =	Letter, returns 'a' for I=1 and 'z' for I=26.  Returns
			'_' for any other number input.

 Opt. Outputs:	None.

 Keywords    :	CAPS:	Return a capital letter instead of a small letter.

 Calls       :	None.
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Category    :	Utility.

 Prev. Hist. :	None.

 Written     :	Donald G. Luttermoser, GSFC/ARC,  8 December 1995

 Modified    :	Version 1, Donald G. Luttermoser, GSFC/ARC,  8 December 1995
			Initial program.

 Version     :	Version 1,  8 December 1995


NUM2STR $SSW/gen/idl/string/num2str.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NUM2STR()
               
 Purpose     : Convert number to unpadded string
               
 Explanation : 
	The main and original purpose of this procedure is to convert a number
	to an unpadded string (i.e. with no blanks around it.)  However, it 
	has been expanded to be a multi-purpose formatting tool.  You may 
	specify a length for the output string; the returned string is either 
	set to that length or padded to be that length.  You may specify 
	characters to be used in padding and which side to be padded.  Finally,
	you may also specify a format for the number.  NOTE that the input 
	"number" need not be a number; it may be a string, or anything.  It is
	converted to string.
               
 Use         :  IDL> tmp = NUM2STR(number,[LENGTH=,PADTYPE=,PADCHAR=,FORMAT=])
               
	         eg. print,'Used ',num2str(stars),' stars.'  
                    ==> 'Used 22 stars.'
	             print,num2str('M81 Star List',length=80,padtype=2)
	             ==> an 80 character line with 'M81 Star List' centered.
	             print,'Error: ',num2str(err,format='(f15.2)')
	             ==> 'Error: 3.24'     or ==> 'Error: 323535.22'
    
 Inputs      :  NUMBER    This is the input variable to be operated on.  
                          Traditionally it was a number, but it may be 
                          any scalar type.
               
 Opt. Inputs :  None
               
 Outputs     :  TMP       The formatted string
               
 Opt. Outputs:  None
               
 Keywords    :  LENGTH    Specifies the length of the returned string.  
		           If the output would have been longer, it is 
                          truncated.  If the output would have been shorter, 
                          it is padded to the right length.

	         PADTYPE   This KEYWORD specifies the type of padding to be 
                          used, if any.  0=Padded at End, 1=Padded at front, 
                          2=Centered (pad front/end) IF not specified, 
                          PADTYPE=1

                PADCHAR   This KEYWORD specifies the character to be used 
                          when padding. The default is a space (' ').

                FORMAT    This keyword allows the FORTRAN type formatting 
                          of the input number (e.g. '(f6.2)')

 Calls       :  None
 CALLED BY:
	ADD_DATAWIN, ADD_F_RASTER, ADD_F_STUDY, ADD_LINELIST, ADD_T_STUDY, ADD_V_RASTER
	ADD_V_STUDY, CDS_STACK, CHK_DATAWIN, CHK_F_RASTER, CHK_F_STUDY, CHK_LINELIST
	CHK_T_STUDY, CHK_V_RASTER, CHK_V_STUDY, CURSOR_INFO, DROT_XY, EIS_IMAGE_TOOL [1]
	EIS_IMAGE_TOOL [2], EIS_IMAGE_TOOL_EVENT [1], EIS_IMAGE_TOOL_EVENT [2]
	EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2], FIND_CDS_STUDY, FMT_VECT
	FTP_MLSO_IMAGES, GET_GEV, GET_NAR, GET_OBS_DATE, GET_RASTER_PAR, GET_SUMER_FILES
	IMAGE_TOOL, IMAGE_TOOL_EVENT, INDEX2MAP, ITOOL_GET_TIME, ITOOL_LIMBFITTER
	ITOOL_PTOOL, JSMOVIE, JSMOVIE2, LVIEW_XY, MAKE_AUTO_FIT, MAKE_MANUAL_FIT, MKLOG_LIST
	MK_CDS_IMAP, MK_CDS_PLAN, MK_EIT_MAP, MK_LIMBFIT_BS, MK_PLAN_ORDER, MK_POINT_BASE
	MK_RASTER, MK_SOHO, MK_STUDY, PRINT_GEV, PRINT_NAR, SUMER_POINT_STC, UPDATE_FITLIMB
	WHERE_OFF_LIMB, WINCOPY, db_gbo, hessi_build_srm, hsi_default_resolutions
	hsi_default_tailfracs, hsi_get_e_edges [1], hsi_lambda_vs_t, hsi_rm_detmod
	hsi_rm_earth, hsi_rm_grid2scat, hsi_rm_spacecraft, ihy_db, roll_xy
 Restrictions:  None
               
 Side effects:  None
               
 Category    :  Util, Numerical, String
               
 Prev. Hist. :  Original STRN written by Eric W. Deutsch

 Written     :  E. W Deutsch
               
 Modified    :  CDS version C D Pike, RAL, 13-May-93

 Version     :  Version 1, 13-May-1993


NUM_CHK $SSW/gen/idl/util/num_chk.pro
[Previous] [Next]
 PROJECT:
       ADAS IBM MVS to   UNIX conversion

 NAME:
	NUM_CHK()

 PURPOSE:
	Checks to see if a string is a valid representation of an
	integer or floating point number.

 EXPLANATION:
	The IDL functions FIX and FLOAT will convert strings into number
	values.  However FIX and FLOAT only require that the string
	begins with a valid number.  For example FIX('38%h224') will
	return the integer value 38 and no error is flagged.  This
	function, NUM_CHK will check the entire string for errors.
	You will still need to use FIX or FLOAT afterwards once NUM_CHK
	has confirmed that the string is valid.

 USE:
	Example;
		error = num_chk(string,/integer)
		if error eq 0 then begin
			i = fix(string)
		endif else begin
			message,'Illegal integer input'
		endelse

 INPUTS:
	STRING   - The string to be checked.

 OPTIONAL INPUTS:
	None

 OUTPUTS:
	This function returns 0 if the string represents a valid number and
	1 if it does not.

 OPTIONAL OUTPUTS:
	None

 KEYWORD PARAMETERS:
       INTEGER  - Set this keyword to specify that the string should
		   represent an integer.  The default is that the string
		   is assumed to represent a floating point value.

	SIGN     -  if sign < 0, then only negative numbers allowed
		    if sign = 0, then either sign allowed
		    if sign > 0, then only positive values allowed.

 CALLS:
	None
 CALLED BY:
	ITOOL_RD_FITS, RD_IMAGE_FITS, SET_CURSOR_SHAPE, TP_EDIT_TABLE, XTEXT
 SIDE EFFECTS:
	None

 CATEGORY:
	Data entry utility.
	
 WRITTEN:
       Andrew Bowen, Tessella Support Services plc, 8-Mar-1993

 MODIFIED:
       Version 1       Andrew Bowen    28-May-1993
                       First release.

	Version 1.1     Lalit Jalota    17-Feb-1995
			Added SIGN keyword.
	Version 1.2     Lalit Jalota    27-Feb-1995
			Added ESIGNS which allows exponent to be of any sign
			even if number as a whole is negative or positive.
 VERSION:
       1       28-May-1993
       1.1     17-Feb-1995  
       1.2     27-Feb-1995  


NUMCHAR $SSW/gen/idl/string/numchar.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : NUMCHAR()

 Purpose     : Count all appearances of a character in a string.

 Explanation : Count all appearances of character (char) in string (st).

 Use         : IDL> nc = numchar(st,char)

 Inputs      : ST  - String (array) from which character will be removed.  
               CHAR- Character to be removed from string. 

 Opt. Inputs : None.

 Outputs     : Function returns the number of occurrences.
 
 Opt. Outputs: None 
	
 Keywords    : None
	
 Calls       : None
 Common      : None

 Restrictions: None
	
 Side effects: None
	
 Category    : Utilities, strings.

 Prev. Hist. : Based on REMCHAR

 Written     : C D Pike, RAL 4-Jun-97

 Modified    : 

 Version     : Version 1, 4-Jun-97


NUMLINES [1] $SSW/gen/idl/io/numlines.pro
[Previous] [Next]
 NAME:
     NUMLINES() 
 PURPOSE:
     Return the number of lines in a file

     This procedures became mostly obsolete in V5.6 with the introduction of
     the FILE_LINES() procedure
 CALLING SEQUENCE:
     nl = NUMLINES( filename )
 INPUT:
     filename = name of file, scalar string
 OUTPUT:
     nl = number of lines in the file, scalar longword
          Set to -1 if the number of lines could not be determined
 METHOD:
     If Unix then spawn to wc; otherwise read 1 line at a time and count
     Call FILE_LINES() if V5.6 or later

 PROCEDURE CALLS:
     EXPAND_TILDE(), SPEC_DIR()
 CALLS: ***
	EXPAND_TILDE [1], EXPAND_TILDE [2]
 CALLED BY:
	HESSI SOHDATA CLASS DEFINITION, RDFLOAT, READCOL [1], READCOL [2], READCOL [3]
	READFMT
 MODIFICATION HISTORY:
     W. Landsman                              February 1996
     Use /bin/sh shell with wc under Unix     March 1997
     Use EXPAND_TILDE() under Unix         September 1997
     Converted to IDL V5.0   W. Landsman   September 1997
     Call intrinsic FILE_LINES() if V5.6 or later   December 2002
     Always return a scalar even if 1 element array is input  March 2004


NUMLINES [2] $SSW/gen/idl_libs/astron/misc/numlines.pro
[Previous] [Next]
 NAME:
     NUMLINES() 
 PURPOSE:
     Return the number of lines in a file

     This procedures became mostly obsolete in V5.6 with the introduction of
     the FILE_LINES() procedure
 CALLING SEQUENCE:
     nl = NUMLINES( filename )
 INPUT:
     filename = name of file, scalar string
 OUTPUT:
     nl = number of lines in the file, scalar longword
          Set to -1 if the number of lines could not be determined
 METHOD:
     If Unix then spawn to wc; otherwise read 1 line at a time and count
     Call FILE_LINES() if V5.6 or later

 PROCEDURE CALLS:
     EXPAND_TILDE(), SPEC_DIR()
 CALLS: ***
	EXPAND_TILDE [1], EXPAND_TILDE [2]
 CALLED BY:
	HESSI SOHDATA CLASS DEFINITION, RDFLOAT, READCOL [1], READCOL [2], READCOL [3]
	READFMT
 MODIFICATION HISTORY:
     W. Landsman                              February 1996
     Use /bin/sh shell with wc under Unix     March 1997
     Use EXPAND_TILDE() under Unix         September 1997
     Converted to IDL V5.0   W. Landsman   September 1997
     Call intrinsic FILE_LINES() if V5.6 or later   December 2002
     Always return a scalar even if 1 element array is input  March 2004
     Handle Unix files with spaces prior to IDL V5.6  W. Landsman Feb 2006
     Assume since V5.4, use FILE_EXPAND_PATH   W. Landsman April 2006
     Assume since V5.5, remove VMS path  W. Landsman Sep 2006


NUTATE $SSW/gen/idl_libs/astron/astro/nutate.pro
[Previous] [Next]
 NAME:
       NUTATE
 PURPOSE:
       Return the nutation in longitude and obliquity for a given Julian date

 CALLING SEQUENCE:
       NUTATE, jd, Nut_long, Nut_obliq

 INPUT:
       jd - Julian ephemeris date, scalar or vector, double precision  
 OUTPUT:
       Nut_long - the nutation in longitude, same # of elements as jd
       Nut_obliq - nutation in latitude, same # of elements as jd

 CALLS: ***
	CIRRANGE, ISARRAY [1], ISARRAY [2], ISARRAY [3], POLY
 CALLED BY:
	CO_ABERRATION, CO_NUTATE, MOONPOS
 EXAMPLE:
       (1) Find the nutation in longitude and obliquity 1987 on Apr 10 at Oh.
              This is example 22.a from Meeus
        IDL> jdcnv,1987,4,10,0,jul
        IDL> nutate, jul, nut_long, nut_obliq
             ==> nut_long = -3.788    nut_obliq = 9.443
            
       (2) Plot the large-scale variation of the nutation in longitude 
               during the 20th century

       IDL> yr = 1900 + indgen(100)     ;Compute once a year        
       IDL> jdcnv,yr,1,1,0,jul          ;Find Julian date of first day of year
       IDL> nutate,jul, nut_long        ;Nutation in longitude
       IDL> plot, yr, nut_long

       This plot will reveal the dominant (18.6 year) period, but a finer
       grid is needed to display the shorter periods in the nutation.
 METHOD:
       Uses the formula in Chapter 22 of ``Astronomical Algorithms'' by Jean 
       Meeus (1998, 2nd ed.) which is based on the 1980 IAU Theory of Nutation
       and includes all terms larger than 0.0003".

 PROCEDURES CALLED:
       POLY()                       (from IDL User's Library)
       CIRRANGE, ISARRAY()          (from IDL Astronomy Library)

 REVISION HISTORY:
       Written, W.Landsman (Goddard/HSTX)      June 1996       
       Converted to IDL V5.0   W. Landsman   September 1997
       Corrected minor typos in values of d_lng W. Landsman  December 2000
       Updated typo in cdelt term              December 2000
       Avoid overflow for more than 32767 input dates W. Landsman January 2005