NDSPSPEC $SSW/soho/cds/idl/sci/data_anal/ql/ql_disp/ndspspec.pro
[Previous] [Next]
 Project     : SOHO - CDS
                   
 Name        : NDSPSPEC()

 Purpose     : Displays all Spectral Windows from specific exposures.

 Explanation : The individual Spectral Windows are deselected 
               into their corresponding positions on the detector.
               Line selection and windows given in Blue Book
               can be displayed. 
               Measurements of wavelengths and positions on the 
               detector is possible together with line identification.
               
 Use         : ndspspec,QLDS
    
 Inputs      : QLDS: A CDS QL data structure
               
 Opt. Inputs : None.
               
 Outputs     : None.
                      
               
 Opt. Outputs: Should return the displayed data for further analyses
                        and PostScript file. To be written. 

 Keywords    : GROUP_LEADER:
                       If this invoked by any other CDS QuickLook 
                       display routine (group leader responsible for 
                       keeping the QLDS), this keyword should have
                       the widget ID of the top level base of the
                       calling routine.

               NOCHECK :
                       Set to skip QLMGR parameter check.

 Calls       : ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], ASSIGN_NOCOPY, BSCALE, Bell, CDSLOG, CDSNOTIFY
	CDS_SLINE, CLIPBOX, CMOUSE, CMOUSE_ACTION, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], CW_LOADCT, CW_PSELECT, DATATYPE [1], DATATYPE [2], DATATYPE [3]
	DSP_POINT, DSP_RASTER, GT_CDS_TIME, GT_DETY, GT_SCANY, GT_SOLARX, GT_SOLARY, GT_START
	LOAD_RED, LOAD_WAVECAL, NDSPEC_DRAW, NDSPEC_LOG, NDSPSPEC_EVENT, NDSP_REDISPLAY
	NMAKE_SPEC, PCONVERT, PFIND, PICK_LINE, PIX2WAVE, PQLPROFILE, PQLZOOM, PRESTORE, PS [1]
	PS [2], PSPLOT [1], PSPLOT [2], PSTORE, PUT_NLINES, PUT_NSPECTRA, QLDS_CHECKIN
	QLDS_REPORT, QLMGR, QL_DIMENSIONS, QL_RD_LLIST, QL_SIZE, SETWINDOW [1]
	SETWINDOW [2], TRIM, WIDG_HELP, XLOADCT [1], XLOADCT [2], XLOADCT [3], XMANAGER
	XPDMENU, XPS_SETUP, concat_dir [4]
 CALLED BY:
	DSPSPEC
 Common      : QLSAVE: See QLDS_CHECKIN
               
 Restrictions: QLDS must be a valid CDS QL data structure
               Requires dummy NIS spectrum $CDS_VDS_MODEL/vds_dummy.dat
               Looks for line lists in $CDS_PLAN_TECH and $CDS_INFO,
               with names 'llist_*'.
               For HELP displays the file $CDS_INFO/ndspspec.hlp
               
 Side effects: 
               
 Category    : QuickLook, Display, NIS
               
 Prev. Hist. : None.

 Written     : Paal Brekke, 17 November 1993
               
 Modified    : SVHH, 20 November 1993
                       Brushed up documentation.
               SVHH & PB, Jan-March 1993
                       Zoom & Profile added, logging of status line info,
                       Line identification
               SVHH, 16 May 1994
                       Added call to CONCAT_DIR('$CDS_VDS_MODEL',..)
               SVHH, Version 1.5, 30 May 1994
                       Switched QLPROFILE/QLZOOM -> PQL.../PQL...
               SVHH, Version 2, 7 June 1994
                       Modified cursor action selection,
                       added on-screen plot of LLIST_??
                       Added PostScript dump.
               PB,   July 6, 1994
                       Added call to help routine QLHELP
               PB,   August 26, 1994
                       Changed dety --> detx
                               detz --> dety  in nmake_spect.pro
               PB,   Sept 21 - 94    Added Help using WIDG_HELP
               SVHH, Nov 15, Fixed XTICKS/XRANGE conflict for IDL 3.6c
               SVHH, Dec 10, Added CMOUSE/CMOUSE_ACTION functionality,
                       and added x/y-format/units in PQLZOOM-call.
               SVHH, 20-Feb-1995, New data storage format, according
                       to Bill's note on generating FITS files from
                       telemetry. Incorporated the use of QL_DIMENSIONS()
                       to check dimensionality. Should be more robust.
                       Requires change of EXPSLICE as well.
               SVHH, 21-Aug-1995, Version 3
                       Modified call to QL_SIZE
               Version 4, SVHH, 13-December-1995
                       Started using GT_SCANY.
               Version 5, SVHH, 20-December-1995
                       Added SOLAR_Y axis (left) and moved
                       the Y index axis to the right. Blanking the
                       information line when selecting new exposure.
               Version5.1, P.B, 20-February-1996
                       Changed the reading procedure for 
                       VDS_DUMMY now stored in another format.
                       Line list selection added
               Version5.2, P.B, 26-February-1996
                       Added SOLAR_Y axis in PS mode as well
                       Writing header info to PS file, and
                       moved locations of plot
                       Raster location passed on to IMAGE_TOOL
               Version 6, SVHH, 4 March 1996
                       Fixed a bug in calling gt_solarx/gt_solary/gt_time.
               Version 7, SVHH, 12 April 1996
                       Renamed gt_time -> gt_cds_time
               Version 8, SVHH, 14 April 1996
                       Using LOAD_WAVECAL.
               Version 9, SVHH, 20 May 1996
                       Fixed bug in calculating XIX/TIX from exposure.
               Version 10, SVHH, 27 November 1996
                       Using dsp_point to call IMAGE_TOOL. Changed button
                       layout etc to have enough space for the exposure
                       slider even with IDL's standard font. Also improved
                       color scaling somewhat by taking MISSING into
                       account.
               Version 11, SVHH, 29 January 1997
                       Made necessary modifications to work (sort of)
                       with SUMLINE compression.

 Version     : 11, 29 January 1997


NE2MASS $SSW/soho/lasco/idl/cme/ne2mass.pro
[Previous] [Next]
 NAME:
	NE2MASS

 PURPOSE:
	This function converts electron density into mass

 CATEGORY:
	CME 

 CALLING SEQUENCE:
	Result = NE2MASS (Num_el)

 INPUTS:
	Num_el:	The number of electrons

 OUTPUTS:
	This function returns the mass corresponding to the electron density.

 CALLED BY:
	CALC_CME_MASS
 PROCEDURE:
	
 MODIFICATION HISTORY:
 	Written by:	R.A. Howard, NRL, 18 September 1996

 @(#)ne2mass.pro	1.1 04/18/99 :LASCO IDL LIBRARY



NE_FROM_PB $SSW/soho/lasco/idl/data_anal/ne_from_pb.pro
[Previous] [Next]
 NAME:
	NE_FROM_PB

 PURPOSE:
	This function does the inversion of a radial fit to pB to electron density.

 CATEGORY:
	LASCO DATA_ANALYSIS

 CALLING SEQUENCE:
	NE_FROM_PB,Radii,Q,Coeff,Exps

 INPUTS:
	Radii:	An array of radial points for which the inversion is to be done
	Q:	The limb darkening parameter (0<1)
	Coeff:	The coefficients in the fit of pB versus R
	Exps:	The coefficients in the expansion of pB versus R

 OUTPUTS:
	This function returns the electron density inverted from the fit of pB.

 CALLS: ***
	VDHAN [1], VDHAN [2], VDHCOEFF
 CALLED BY:
	PB_INVERTER
 RESTRICTIONS:
	The pB fit is assumed to be only of the K-corona.  Any F-coronal contribution
	must be removed.

 PROCEDURE:
	The procedure follows the method of van de Hulst, Bull Astron Institutes Netherlands, 
	vol XI, 2 Feb 1950, pp135-150

 EXAMPLE:

 MODIFICATION HISTORY:
 	Written by:	RA Howard, NRL, 27 Nov 1998

	@(#)ne_from_pb.pro	1.1 11/28/98 LASCO IDL LIBRARY


nearest_fid [2] $SSW/soho/mdi/idl_old/gen/ys_util/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...


new_disp_sci5k [1] $SSW/soho/mdi/idl/ops/new_disp_sci5k.pro
[Previous] [Next]
SAMPLE CALLING SEQUENCE:
	new_disp_sci5k, '1-Jun-97'
	new_disp_sci5k, '2-Jul-97', disp_size=256, dpc_filter='168*', win_size=400
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONGRID [1], CONGRID [2]
	CONGRID [3], GET_MDI_SCALE, LOADCT, MEAN, RFITS [1], RFITS [2], RFITS [3]
	SCI5K_DISP_IMG, SSW_FILE_DELETE, STDDEV, SXPAR [1], SXPAR [2], SXPAR [3]
	anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], concat_dir [4]
	data_type [1], data_type [2], ex2fid [1], ex2fid [2], fid2ex [1], fid2ex [2]
	file_list [1], file_list [2], fmt_tim [1], fmt_tim [2], get_dpc_info
	int2secarr [1], int2secarr [2], mk_dpc_image, str_replace [1], str_replace [2]
	tim2dset [1], tim2dset [2], tv2 [1], tv2 [2], wc_where [1], wc_where [2]
	xyouts2 [1], xyouts2 [2], zbuff2file [1], zbuff2file [2]
HISTORY:
	Written Feb-96 by M.Morrison
	14-Mar-96 (MDM) - Added "missing" keyword option
			- Dropped the last data point from the scaling
	 2-Apr-96 (MDM) - Scale only for the range of values which are non -32768 (missing)
			- let missing be 0 by default
			- display the min/max excluding the missing
	28-May-96 (MDM) - Added special handling of LOI image
	12-Sep-96 (MDM) - Modified to not grab the image on the edge
			  of the requested time since it is probably
			  incomplete
	14-Apr-97 (MDM) - Added call to GET_MDI_SCALE to force magnetogram scaling
	 2-Jul-97 (MDM) - Added DISP_SIZE and DPC_FILTER options, WIN_SIZE
	27-May-99 (RIB) - Selected only 0* and 168* dpcs
	 8-Oct-99 (RIB) - Reworked to allow gif image output, renamed to new_disp_sci5k


new_disp_sci5k [2] $SSW/soho/mdi/idl/test/new_disp_sci5k.pro
[Previous] [Next]
SAMPLE CALLING SEQUENCE:
	new_disp_sci5k, '1-Jun-97'
	new_disp_sci5k, '2-Jul-97', disp_size=256, dpc_filter='168*', win_size=400
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONGRID [1], CONGRID [2]
	CONGRID [3], GET_MDI_SCALE, LOADCT, MEAN, RFITS [1], RFITS [2], RFITS [3]
	SCI5K_DISP_IMG, SSW_FILE_DELETE, STDDEV, SXPAR [1], SXPAR [2], SXPAR [3]
	anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], concat_dir [4]
	data_type [1], data_type [2], ex2fid [1], ex2fid [2], fid2ex [1], fid2ex [2]
	file_list [1], file_list [2], fmt_tim [1], fmt_tim [2], get_dpc_info
	int2secarr [1], int2secarr [2], mk_dpc_image, str_replace [1], str_replace [2]
	tim2dset [1], tim2dset [2], tv2 [1], tv2 [2], wc_where [1], wc_where [2]
	xyouts2 [1], xyouts2 [2], zbuff2file [1], zbuff2file [2]
HISTORY:
	Written Feb-96 by M.Morrison
	14-Mar-96 (MDM) - Added "missing" keyword option
			- Dropped the last data point from the scaling
	 2-Apr-96 (MDM) - Scale only for the range of values which are non -32768 (missing)
			- let missing be 0 by default
			- display the min/max excluding the missing
	28-May-96 (MDM) - Added special handling of LOI image
	12-Sep-96 (MDM) - Modified to not grab the image on the edge
			  of the requested time since it is probably
			  incomplete
	14-Apr-97 (MDM) - Added call to GET_MDI_SCALE to force magnetogram scaling
	 2-Jul-97 (MDM) - Added DISP_SIZE and DPC_FILTER options, WIN_SIZE
	27-May-99 (RIB) - Selected only 0* and 168* dpcs
	 8-Oct-99 (RIB) - Reworked to allow gif image output, renamed to new_disp_sci5k


new_dpath [1] $SSW/soho/mdi/idl_old/gen/ys_util/new_dpath.pro
[Previous] [Next]
   Name: new_dpath

   Purpose: update data paths common area 

   Input Parameters:
      inpath - string or string array of paths to add (or remove)

   Keyword Parameters:
      remove  -  switch, if set, remove instead of add
      home    -  switch, if set, include home directory (add/remove)
      current - switch, if set, include current directory (add/remove)
      prepend - switch, if set, users new stuff comes first
      init    - switch, if set, re-initiailize before adding new path(s)
      empty   - switch, if set, empty before adding new path(s)
		 -- NOTE:initialize=system defaults, empty=empty --
      loud    - switch, if set, extra messages
      file    - two options: if switch set, read file: HOME/setup.ysdpaths
			      if string, read paths from specified file 
      save    - switch, if set, save current dpaths to HOME/setup.ysdpaths
      
   Calling Examples:
      new_dpath			   ; add current directory
      new_dpath,/current,/home		   ; same plus home directory
      new_dpath,'/usr/name/data'	   ; add named path/path arrray
      new_dpath,'/usr/name/data',/prepend ; same, but first, not last
      new_dpath,'/usr/name/data',/remove  ; remove named path/path array
      new_dpath,/init			   ; reinitialize (system defaults)
      new_dpath,/empty,/current	   ; empty and add current
      new_dpath,data_paths(),/remove	   ; same as empty
      new_dpath,/file			   ; adds whatever paths are listed
					   ; in file: HOME/setup.ysdpaths
      new_dpath,/save			   ; save current paths in file:
					   ; HOME/setup.ysdpaths

   Restrictions: proto-routine uses common block, not system variables 
		  todo - add recursive (+path) feature??

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATA_PATHS, concat_dir [4]
	curdir [1], curdir [2], file_append [1], file_append [2], file_info2 [1]
	file_info2 [2], rd_tfile [1], rd_tfile [2], rem_elem [1], rem_elem [2], uniqo [1]
	uniqo [2]
   Common Blocks:
      data_paths - contains string array of data paths

   History:
      slf -  7-may-93
      slf -  8-may-93	add file keyword and function
      slf -  9-may-93  changed default file name to setyp.ysdpaths
			changed default-to-add-current-path restrictions
      slf - 20-may-93  improved save option (call uniqo,file_delete)
      slf - 22-may-93  add doc header terminator
      slf - 26-may-93  read of DIR_SITE_SETUP/setup.ysdpaths on init


new_edac_summary $SSW/soho/mdi/idl/ops/new_edac_summary.pro
[Previous] [Next]
NAME:
	new_edac_summary
PURPOSE:
	To plot the EDAC error rates
SAMPLE CALLING SEQUENCE:

	new_edac_summary, '0*_*000.fits', sttim='1-feb',entim='2-feb', log_list='edac_summary'

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], LOADCT, RFITS2 [1], RFITS2 [2]
	SSW_FILE_DELETE, SXPAR [1], SXPAR [2], SXPAR [3], UNSIGN, UTPLOT [1], UTPLOT [2]
	UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], anytim2ints [1], anytim2ints [2]
	break_file [4], fid2ex [1], fid2ex [2], file_list [1], file_list [2], fmt_tim [1]
	fmt_tim [2], plottime [1], plottime [2], sel_filetimes [1], sel_filetimes [2]
	tv2 [1], tv2 [2], ut_time [1], ut_time [2], zbuff2file [1], zbuff2file [2]
HISTORY:
	Written May 2001 by R. Bush based on edac_summary


NEW_EDIT_ITEM $SSW/soho/gen/idl/plan/science/new_edit_item.pro
[Previous] [Next]
 PROJECT:
       SOHO - CDS/SUMER

 NAME:
       NEW_EDIT_ITEM()

 PURPOSE: 
       Rearrange REQ_ITEMS in CUSTOM_STC 

 CATEGORY:
       Utitility, Planning
 
 EXPLANATION:
       
 SYNTAX: 
       Result = new_edit_item(custom_stc, new_item)

 CALLED BY:
	MK_CDS_PLAN
 EXAMPLES:
       IF new_edit_item(custom_stc, 'CDS-SCI') NE 0 THEN ...

 INPUTS:
       CUSTOM_STC - Customization strcuture that has a tag REQ_ITEMS
                    as a string array listing items to be plotted; will
                    be modified upon a successful return.
       NEW_ITEM   - String of plan item to be edited

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RESULT - 1 if NEW_ITEM can be made editable, 0 otherwise

       Note: CUSTOM_STC is modified upon a successful return

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], REP_TAG_VALUE
 COMMON:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       CUSTOM_STC is changed upon a successful return.

 HISTORY:
       Version 1, August 29, 1995, Liyun Wang, GSFC/ARC. Written

 CONTACT:
       Liyun Wang, GSFC/ARC (Liyun.Wang.1@gsfc.nasa.gov)


NEW_FF_DEMO $SSW/soho/cds/idl/sci/engineering/new_ff_demo.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NEW_FF_DEMO
               
 Purpose     : Demonstrates application of Flat Field and its effects
               
 Explanation : When the ground based flat field is applied to raw data
               a considerable improvement in image quality it seen. However
               for those regions where in-flight data are available they are
               shown to improve the data still further.  The effect of these
               corrections on line profile fitting is also shown.
               
 Use         : IDL> new_ff_demo
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	CIRCLE_SYM, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], EXPTV, YES_NO
	concat_dir [4]
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Calibration
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 12-Nov-96
               
 Modified    : 

 Version     : Version 1, 12-Nov-96


new_mon_health [1] $SSW/soho/mdi/idl/ops/new_mon_health.pro
[Previous] [Next]
NAME:
	new_mon_health
PURPOSE:
	To generate the health monitoring data
 CALLS: ***
	LOADCT, MONH_GENERAL, MONH_HK_PLOT, MONH_IMAGES, MONH_IMAGES_RANGE, MONH_LOI_IMG
	MONH_LOI_PLOT, MONH_OUTFIL, RD_LOI_MMAD, RFITS [1], RFITS [2], RFITS [3], RFITS2 [1]
	RFITS2 [2], SSW_FILE_DELETE, SXPAR [1], SXPAR [2], SXPAR [3], UNIQ [1], UNIQ [2]
	UNIQ [3], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	anytim2ints [1], anytim2ints [2], file_list [1], file_list [2], fmt_tim [1]
	fmt_tim [2], int2secarr [1], int2secarr [2], mk_dpc_image, plot_pzt_corr
	plottime [1], plottime [2], quick_hkplot [1], quick_hkplot [2], sxpar2 [1]
	sxpar2 [2], tv2 [1], tv2 [2], ut_time [1], ut_time [2], xyouts2 [1], xyouts2 [2]
	zbuff2file [1], zbuff2file [2]
HISTORY:
	Written  8-Dec-99 by R. Bush
	Based on mon_health.pro written by M. Morrison
	 5-Oct-99 (RIB) - Complete restructuring of the output options
      5-Jan-2000 (RIB) - Version ready for long term testing
      16-Aug-2006 (SEG) - Adding check for CROT=180 to correct for roll
			   for 160k latest image, not for 5k images


new_mon_health [2] $SSW/soho/mdi/idl/test/new_mon_health.pro
[Previous] [Next]
NAME:
	new_mon_health
PURPOSE:
	To generate the health monitoring data
 CALLS: ***
	LOADCT, MONH_GENERAL, MONH_HK_PLOT, MONH_IMAGES, MONH_IMAGES_RANGE, MONH_LOI_IMG
	MONH_LOI_PLOT, MONH_OUTFIL, RD_LOI_MMAD, RFITS [1], RFITS [2], RFITS [3], RFITS2 [1]
	RFITS2 [2], SSW_FILE_DELETE, SXPAR [1], SXPAR [2], SXPAR [3], UNIQ [1], UNIQ [2]
	UNIQ [3], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	anytim2ints [1], anytim2ints [2], file_list [1], file_list [2], fmt_tim [1]
	fmt_tim [2], int2secarr [1], int2secarr [2], mk_dpc_image, plot_pzt_corr
	plottime [1], plottime [2], quick_hkplot [1], quick_hkplot [2], sxpar2 [1]
	sxpar2 [2], tv2 [1], tv2 [2], ut_time [1], ut_time [2], xyouts2 [1], xyouts2 [2]
	zbuff2file [1], zbuff2file [2]
HISTORY:
	Written  8-Dec-99 by R. Bush
	Based on mon_health.pro written by M. Morrison
	 5-Oct-99 (RIB) - Complete restructuring of the output options
      5-Jan-2000 (RIB) - Version ready for long term testing


NEW_SPIKE $SSW/soho/cds/idl/util/misc/new_spike.pro
[Previous] [Next]
 PROJECT:

	SOHO - CDS

 NAME:

	NEW_SPIKE

 CATEGORY: 

	General utility.

 PURPOSE:

	Remove cosmic ray hits from CDS-NIS data-sets.

 EXPLANATION:

	A revised version of the routine CLEAN_SPIKE.PRO which applies a 
	very similar technique for finding the cosmic rays, but is 
	significantly quicker. This extra speed is made by using the IDL 
	CONVOL routine.

	The fundamental philosophy of this routine lies in identifying 
	pixels that have a significant strength when compared with 
	neighbouring exposures. Sometimes, however, such a method will 
	flag real data as a cosmic ray, e.g., if a strong brightening 
	suddenly appears in the data. Such a brightening is different from 
	a cosmic ray in that it will be continuous in detector-X and Y 
	directions, and so this routine only flags a cosmic ray if a spike 
	is also seen in one of the detector-X or detector-Y directions.

	The checks made in the detector-Y direction are not simply with 
	nearest neighbour, but also with pixels one away. The criteria are 
	more stringent for this test, however.

	An additional check is made by comparing a pixel value with the 
	median value of a 5x5 array of (detector-Y x exposure) array pixels. 
	If the pixel is flagged and a spike is seen in both the detector-Y 
	and detector-X directions, then the pixel is identified as a cosmic 
	ray. This is useful if there are a lot of cosmic rays in the data.

 CALLED BY:
	CDS_NEW_SPIKE, NIS_QUICKLOOK
 EXAMPLE:

	Create a 3-D NIS array and clean:

		qlds=readcdsfits('s3073r00')
		data=gt_windata(qlds,0)
		new_spike,data,data_clean,/neighbours,/info

 INPUTS:

	IN_ARRAY -	A 3D array, with exposures assumed to be contained 
			in the 2nd dimension.

 OPTIONAL INPUTS:

	MISSING -	The value for missing data (default=-100.)

 OPTIONAL OUTPUTS:

	OUT_ARRAY -	The output, cleaned array

	SWTCH -		An integer array of the same size as IN_ARRAY, 
			containing 1's at the position of cosmic rays 
			and 0's elsewhere.

 KEYWORDS:

	NEIGHBOURS -	Flag the detector-X and detector-Y nearest neighbours 
			to the cosmic rays.

	FILL -		Replace the cosmic ray intensity values with the 
			median of the surrounding 5x5 pixel area.

	INFO -		Display the number of cosmic rays found.

 CALLS: ***
	FMEDIAN
 RESTRICTIONS:

	The data should be de-biassed before using NEW_SPIKE.

	The smallest dimensions possible for IN_ARRAY are (4,3,6) for the 
	array (det-X,exp,det-Y).

	Occasional cosmic rays appear as `blocks' of size 2x2 or 3x3 pixels, 
	and may not be completely cleaned by NEW_SPIKE.

	Some weak, single-pixel events are not removed, although their 
	signals should not be a problem.

	Some cosmic rays that hit the peak of a line profile are not 
	removed. This seems to be because, if the signal in the line is 
	strong, say 300, then the cosmic ray is required to give a total 
	signal of at least 510 in order to be flagged, and so some quite 
	significant events are skipped over.

 PROGRAMMING NOTES

       David Brooks pointed out that real solar data was being removed when
       data-set s25413r43 was cleaned. The particular data in question is
       in the O V window (gt_windata(qlds,2)), and the profile ov[*,1,19].

       The problem lies in the fact that this data is binned in the
       Y-direction. All the tests I had done were on normal, unbinned data
       (Y-binning was not used until around mid-1998 for CDS). The parameters
       I had set up for determining cosmic rays (CUTOFF and BCKGRND)
       unintentionally assumed a certain 'smoothness' in the data that is
       due to the CDS PSF being broader than the pixel size. I.e., real
       data should never show sharp spikes because of the PSF, and so must
       be cosmic rays. When binning in the Y-direction, the Y-pixel size
       becomes closer to the width of the PSF and so real data-spikes do
       become possible, as witnessed by the above data-set.

       I have now increased CUTOFF to 0.65, but also defined XCUTOFF and
       YCUTOFF (where X, Y are the detector axes) to be 0.8*CUTOFF, i.e.,
       I've *lowered* the threshold. When the keyword /YBIN is set
       YCUTOFF=CUTOFF, increasing the threshold in this case, making it
       harder to flag spikes when there is Y-binning.

       The lowering of the threshold in the X and Y directions flags a few
       more cosmic rays, but does not (from the tests I've done) remove real
       data.

       In the Y-direction, NEW_SPIKE checks next-neighbours for reasons
       explained above. When /YBIN is set I now change the cutoff to be
       YCUTOFF*3 rather than YCUTOFF*2, as next-neighbours become less
       important when binning.

 HISTORY:

	Ver. 1 - PRY, 18-Aug-98
	Ver. 2 - PRY, 2-Sep-98, if all pixels in an array have intensities 
			less than 50 or greater than 50, then an error was 
			generated. This is now corrected.
	Ver. 3 - PRY, 4-Sep-98, if med_array was 0. at some pixel, then 
			arithmetic errors were generated for some rasters. 
			Corrected this.
	Ver. 4 - PRY, 16-Nov-98, if ind was empty, then routine crashed. 
			Now corrected.
	Ver. 5 - PRY, 2-Feb-99, corrected another problem with ind
       Ver. 6 - Danielle Bewsher, 9-May-01, corrected problem with switch
                       for compatability with IDL 5.4
       Ver. 7 - PRY, 20-Feb-03
                 Flags problem when IN_ARRAY is too small.
                 Also, if there are less than 5 exposures the program 
                 switches to using a 3x7 median filter rather than the 5x5 
                 filter.
       Ver. 8 - PRY, 21-Jul-03
                 Program was not returning the SWTCH array, so corrected
                 this now.
       Ver. 9 - PRY, 15-Aug-03
                 Added YBIN= keyword, and modified the parameters that
                 identify a cosmic ray. See Programming Notes above.

 CONTACT:

	Peter Young, Rutherford Appleton Laboratory, p.r.young@rl.ac.uk


new_version [2] $SSW/soho/mdi/idl_old/gen/ys_util/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		


newfiles [1] $SSW/soho/mdi/idl_old/gen/ys_util/newfiles.pro
[Previous] [Next]
   Name: newfiles

   Purpose: return file name(s) of new data 

   Calling Sequence:
	files=newfiles( [nfiles, /sfd, /sfr, /spd, /spr, /bda, /wda, /hda
			 	,oldfiles=oldfiles]
   
   Optional Keyword Parameters:

 CALLS: ***
	STR2ARR [1], STR2ARR [2], file_list [1], file_list [2], gbo_paths [1]
	gbo_paths [2], uniq_fid [1], uniq_fid [2], wmenu_sel [1], wmenu_sel [2]
 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], LATEST_SFDS_GIF, QUICKSTRAY [2], chk_pointing
	daily_forecast [2], first_bcs, fl_goesplot [1], fl_goesplot [2], fl_goesplot [3]
	fl_sxtobsnar [1], fl_sxtobsnar [2], last_lc, lastspd, ref_term [2], sxt2mpeg
	xspr [1], xspr [2]
   History: 
	10-sep-1993 (SLF) extracted and genericized code from newsfd.pro
	 4-Mar-1994 (SLF) print warning if no files
	 9-Mar-1994 (SLF) fix bug when last keyword not used
       16-sep-1994 (SLF) expanded to GBO data


NEXPOSURES $SSW/soho/cds/idl/sci/data_anal/ql/interface/nexposures.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NEXPOSURES()
               
 Purpose     : Return the number of "exposures" in a QLDS
               
 Explanation : Returns the number of exposures, defined as the
		size of the larger of the DEL_TIME and the SSOLAR_X
		dimensions.
               
 Use         : NEXP = NEXPOSURES(QLDS)
    
 Inputs      : QLDS:	A "CDS QL data strucure"
               
 Opt. Inputs : None.
               
 Outputs     : Ret.value.
               
 Opt. Outputs: None.
               
 Keywords    : NOCHECK:
			Set to avoid checking with QLMGR whether
			the QLDS is acceptable. Set to speed up...

 Calls       : ***
	QLMGR, QL_DIMENSIONS
 CALLED BY:
	DSPEXP, DSPWAV
 Common      : None.
               
 Restrictions: QLDS == QL data structure.
               
 Side effects: None.
               
 Category    : CDS, QuickLook
               
 Prev. Hist. : Used to be called nraster, but change of terminology
		(RASTER -> EXPOSURE) prompted name change.

 Written     : Stein Vidar Hagfors Haugan, October 1993.
               
 Modified    : SVHH, 6-March-1995, Altered to use the ql_dimensions()
			routine after altering the data format slightly.

 Version     : 1.1, 6-March-1995


next_window [2] $SSW/soho/mdi/idl_old/gen/ys_util/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:


NIMCP_DEPTH_FUNCT $SSW/soho/cds/idl/sci/cal/vds/inten/nimcp_depth_funct.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	NIMCP_DEPTH_FUNCT()

 Purpose     :	Function used by GET_NIMCP

 Category    :	Class4, Calibration

 Explanation :	Function used by GET_NIMCP to express the VDS burn-in depth as
		an exponential decline.  Called by GET_NIMCP.

 Syntax      :	Result = NIMCP_DEPTH_FUNCT(DTAI, PD  [, PDERIV ])

 CALLED BY:
	CDS_SLIT6_BURNIN, DISPLAY_CDS_BURNIN, GET_NIMCP, VDS_BURNIN_NEW
 Examples    :	

 Inputs      :	DTAI	= Number of TAI seconds since 1995-12-02T00:00:00Z.
		PD	= The parameters of the function.  Can also be an array
			  of parameters of dimensions (3,N)

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	PDERIV	= A placeholder to make LSTSQR work, this always
			  returns zero.

 Keywords    :	None.

 Calls       :	None.
 Common      :	None.

 Restrictions:	None.

 Side effects:	None.

 Prev. Hist. :	None.

 History     :	Version 1, 25-Feb-1997, William Thompson, GSFC
		Version 2, 06-Aug-1997, William Thompson, GSFC
			Allow DTAI to be a vector.

 Contact     :	WTHOMPSON


nimg_in_tfr fnam [1] $SSW/soho/mdi/idl/egse/nimg_in_tfr.pro
[Previous] [Next]
FUNCTION: nimg_in_tfr, fnam

 Returns number of images in a data set
 CALLS: ***
	NIMG_IN_TFR, dec2sun [1], dec2sun [2], get_host [1], get_host [2], mk_tfi
HISTORY:
	17-Mar-94 (MDM) - Renamed from NUM_IMAGES to NIMG_IN_TFR
			- Added a FREE_LUN call


nimg_in_tfr fnam [2] $SSW/soho/mdi/idl/egse/rdtfr0.pro
[Previous] [Next]
FUNCTION: nimg_in_tfr, fnam

 Returns number of images in a data set
HISTORY:
	17-Mar-94 (MDM) - Renamed from NUM_IMAGES to NIMG_IN_TFR
			- Added a FREE_LUN call


nimg_in_tfr fnam [3] $SSW/soho/mdi/idl/egse/rdtfr2.pro
[Previous] [Next]
FUNCTION: nimg_in_tfr, fnam

 Returns number of images in a data set
HISTORY:
	17-Mar-94 (MDM) - Renamed from NUM_IMAGES to NIMG_IN_TFR
			- Added a FREE_LUN call


NIS1_RELCAL $SSW/soho/cds/idl/sci/engineering/nis1_relcal.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NIS1_RELCAL
               
 Purpose     : Demonstrate possible NIS1 relative intensity calibration.
               
 Explanation : Using pairs of density insensitive lines the relative 
               intensity calibration for the NIS1 waveband was bootstrapped
               from the short wavelength lines.
               
 Use         : IDL> nis1_relcal
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	CIRCLE_SYM, POLY, POLY_FIT
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Demonstration, intensity, calibration
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 16-Aug-96
               
 Modified    : 

 Version     : Version 1, 16-Aug-96 


NIS2_RELCAL $SSW/soho/cds/idl/sci/engineering/nis2_relcal.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NIS2_RELCAL
               
 Purpose     : Demonstrate possible NIS2 relative intensity calibration.
               
 Explanation : Using pairs of density insensitive lines the relative 
               intensity calibration for the NIS2 waveband was bootstrapped
               from the long wavelength lines.
               
 Use         : IDL> nis2_relcal
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	CIRCLE_SYM, POLY, POLY_FIT
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Demonstration, intensity, calibration
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 16-Aug-96
               
 Modified    : 

 Version     : Version 1, 16-Aug-96 


NIS_AVG_SPECT_DEMO $SSW/soho/cds/idl/sci/engineering/nis_avg_spect_demo.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	NIS_AVG_SPECT_DEMO

 Purpose     :	Demonstrate the NIS average quiet sun spectra.

 Category    :	Class2, CDS, Calibration, Spectrum

 Explanation :	This routine demonstrates the average spectra which were
		obtained by combining a large number of NISAT_S runs which were
		taken over a several month period.  These date are stored in
		the files:

			avg_qs_nis1_debias.fts
			avg_qs_nis2_debias.fts
			avg_qs_nis1_calib.fts
			avg_qs_nis2_calib.fts

		which should be in the $CDS_NIS directory.  The first two files
		contain the average of spectra which have only had the
		VDS_DEBIAS routine applied to them, while the last two have had
		NIS_CALIB applied.  What is shown in this routine is the
		average along the slit, but the files contain complete slit
		images.

		Possible uses of these data are:

		* Serving as a baseline average quiet sun spectrum to compare
		  other data against.

		* Measuring the tilt, possibly as a function of wavelength,
		  since any solar effects should be washed out by the large
		  number of spectra which were averaged together.

		* Measuring any non-uniformities in slit 4, i.e. features in
		  the velocity or intensity which can be replicated from line
		  to line.

		One effect that this data demonstrates is that there is some
		constant background which is not yet accounted for in our
		calibration.  Possibly this is due to scattered Lyman alpha
		radiation in the spectrograph.  The dashed lines in the second
		set of plots shows the effect of the calibration software on a
		uniform background.

 Syntax      :	NIS_AVG_SPECT_DEMO

 Examples    :	To send to a PostScript printer, use the following sequence:

			PS
			NIS_AVG_SPECT_DEMO
			PSPLOT

 Inputs      :	None.

 Opt. Inputs :	None.

 Outputs     :	None.

 Opt. Outputs:	None.

 Keywords    :	None.

 Calls       : ***
	AVERAGE, FIND_WITH_DEF [1], FIND_WITH_DEF [2], FIND_WITH_DEF [3], FXREAD [1]
	FXREAD [2], GET_WAVE_EFF, PIX2WAVE, POLY, SETVIEW [1], SETVIEW [2], YES_NO
 Common      :	None.

 Restrictions:	The FITS files must exist.  Also, the wave_eff database must be
		accessible.

 Side effects:	None.

 Prev. Hist. :	None.

 History     :	Version 1,  4-Oct-1996, William Thompson, GSFC.

 Contact     :	WTHOMPSON


NIS_BIAS_DEMO $SSW/soho/cds/idl/sci/engineering/nis_bias_demo.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NIS_BIAS_DEMO
               
 Purpose     : Demonstrates NIS bias levels from daily synoptic scans.
               
 Explanation : The NIS bias levels drift slowly with time and sometimes
               is subject to sudden changes.  These plots not only
               show the slow trends but also the glitches as deduced 
               from the daily synoptic scans.
               
 Use         : IDL> nis_bias_demo
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], CIRCLE_SYM, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], UTPLOT [1], UTPLOT [2]
	UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], concat_dir [4]
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Calibration
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 13-Nov-96
               
 Modified    : Latest data, complete to 24-Jul-97.  28-Jul-97
                            complete to 28-May-98 
                            added a bit of post-recovery data
                            added data to May 2000

 Version     : Version 2, 28-Jul-97
               Version 3, 29-May-98
               Version 4, 13-Nov-98
               version 5, 17-May-00


NIS_CALIB $SSW/soho/cds/idl/sci/cal/vds/inten/nis_calib.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	NIS_CALIB

 Purpose     :	Applies calibration factors to NIS images.

 Explanation :	Applies the calibration factors for the NIS spectrograph to CDS
		data.  The resulting data is then in physical units.  If the
		calibration routines for the VDS detector, VDS_DEBIAS and
		VDS_CALIB, have not already been called, then this routine will
		call them automatically.

		A number of databases are consulted to retrieve calibration
		parameters to apply to the data.  These databases are found in
		the "calib" subdirectory of the CDS database tree.

		The default units for the returned data are

			PHOTONS/CM^2/SEC/ARCSEC^2

		However, there are other options, which are controllable
		through keywords.  For example, using the call

			NIS_CALIB, DATA, /ERGS, /STERAD, /ANG

		would return the data in the units

			ERGS/CM^2/SEC/STERAD/ANGSTROM

		Note, however, that the /ANGSTROM keyword is ignored for
		certain data, as explained below.

		It's important to realize that the units (without /ANGSTROM)
		only apply when all the data in the line profile is added
		together.

 Use         :	NIS_CALIB, DATA

 Inputs      :	DATA	= Structure variable as read by READCDSFITS.

 Opt. Inputs :	None.

 Outputs     :	DATA	= The calibrated data will be returned as a new
			  structure variable with the same format as the input.

 Opt. Outputs:	None.

 Keywords    :	There are a number of options for the units that the data can
		be returned in.  The following keywords can be used to control
		the units.  The default is "PHOTONS/CM^2/SEC/ARCSEC^2".

		ERGS	   = If set, then the data is returned in units of ergs
			     instead of photons.

		STERADIANS = If set, then the data is returned as per steradian
			     instead of per arcsecond^2.

		ANGSTROMS  = If set, then the data is returned as per Angstrom.
			     This keyword is ignored when the data has been
			     summed over wavelength (SUMLINE or SUMWIN
			     compression) or when the instrument is operated in
			     spectroheliogram mode with the 90x240 arcsecond
			     slit.

		Additional keywords are:

		SLITVAR	= If set, then the instrumental intensity variation
			  along the slit will be removed from the data.

			  As of 21 September 1999, the default is for SLITVAR
			  to be set.  To not apply this correction, use
			  SLITVAR=0.

		SECOND_ORDER = If set, then the second-order correction is
			  applied to the data rather than the first order
			  correction.  The best way to use this is to first
			  make a copy of the data, and then apply the first
			  order correction to one copy, and the second order
			  correction to the other, e.g.

				VDS_CALIB, DATA
				DATA2 = COPY_QLDS(DATA)
				NIS_CALIB, DATA, ...
				NIS_CALIB, DATA2, /SECOND_ORDER, ...

			  *** WARNING ***   When this keyword is used, all
			  NIS-2 windows are processed in second order.

		ERRMSG	= If defined and passed, then any error messages will
			  be returned to the user in this parameter rather than
			  depending on the MESSAGE routine in IDL.  If no
			  errors are encountered, then a null string is
			  returned.  In order to use this feature, ERRMSG must
			  be defined first, e.g.

				ERRMSG = ''
				NIS_CALIB, ERRMSG=ERRMSG, ...
				IF ERRMSG NE '' THEN ...

		In addition, any keyword used by VDS_CALIB can also be passed,
		such as /SLIT6.

 Calls       : ***
	Bell, DATATYPE [1], DATATYPE [2], DATATYPE [3], DETDATA, DETDESC, FILL_MISSING
	FIND_WITH_DEF [1], FIND_WITH_DEF [2], FIND_WITH_DEF [3], GET_EFFICIENCY
	GET_EFF_AREA, GET_VDS_SLITPOS, GET_WAVE_EFF, PIX2WAVE, POLY, REARRANGE, ST_WINDATA
	TRIM, VDS_CALIB
 CALLED BY:
	MK_CDS_ANALYSIS
 Common      :	None.

 Restrictions:	Before this procedure can be used, the calibration for the VDS
		detector must be applied, via the VDS_DEBIAS and VDS_CALIB
		routines.  If not already done, then this routine will attempt
		to use the automatic facilities of those routines.

 Side effects:	None.

 Category    :	Calibration, NIS, Intensity.

 Prev. Hist. :	None.

 Written     :	William Thompson, GSFC, 16 September 1996

 Modified    :	Version 1, William Thompson, GSFC, 16 September 1996
		Version 2, William Thompson, GSFC, 22 October 1996
			Call MESSAGE with /CONTINUE
		Version 3, William Thompson, GSFC, 28 October 1996
			Only use /CONTINUE if data has already been calibrated.
		Version 4, William Thompson, GSFC, 21 January 1997
			Corrected bug when only one exposure was taken.
		Version 5, William Thompson, GSFC, 4 August 1997
			Change units of all windows
		Version 6, William Thompson, GSFC, 9 October 1998
			Added keyword SLITVAR
		Version 7, William Thompson, GSFC, 2 September 1999
			Allow all VDS_CALIB keywords to pass through.
		Version 8, William Thompson, GSFC, 21 September 1999
			Provide error message if cdhsstate database not found
			Make /SLITVAR the default.
		Version 9, William Thompson, GSFC, 07-Aug-2002
			Added keyword SECOND_ORDER

 Version     : Version 9, 07-Aug-2002


NIS_IN_WINDOW $SSW/soho/cds/idl/sci/plan/tech/nis_in_window.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NIS_IN_WINDOW()
               
 Purpose     : Decide which NIS line_window cursor is in, if any.
               
 Explanation : In the technical planning display, decide whether the current
               cursor position falls within the bounds of any of the currently
               defined NIS line windows.
               
 Use         : IDL> hit = nis_in_window(line_structure, cur_x, cur_y)
    
 Inputs      : line_structure  - the data structure containing details of the
                                 currently defined line windows list.  The 
                                 structure is defined in tp_def_struct.

               cur_x           - the current x-value of the cursor position.
               cur_y           - the current y-value of the cursor position.
               
 Opt. Inputs : None
               
 Outputs     : The function return value is the number of the identified 
               line-window.  A value of -1 is returned if the cursor position
               is not within a window.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
 CALLED BY:
	MK_RASTER
 Restrictions: Returns only the first line-window found, tough on overlapping
               windows.
               
 Side effects: None
               
 Category    : Technical planning
               
 Prev. Hist. :

 Written     : C D Pike, RAL, 14-May-93
               
 Modified    : 

 Version     : Version 1, 14-May-1993


NIS_MRGDATA $SSW/soho/cds/idl/sci/cal/vds/inten/nis_mrgdata.pro
[Previous] [Next]
 Name:
      NIS_MRGDATA
 Purpose:
      Merge continguous/overlapping windows in a CDS/NIS raster
 Calling sequence:
      qlm=NIS_MRGDATA(ql [ , /NOCHECK ] )
 Input:
      ql : CDS QLDS (Quick Look Data Structure)
 Keyword parameters:
      NOCHECK= (0/1) check whether the input structure is a valid QLDS
 Output:
      qlm: new QLDS structure 
 Common blocks:
      None
 Calls: ***
	COPY_QLDS, GT_DETECTOR, GT_DIMENSION, GT_NUMWIN, GT_WINDATA, QLMGR, REP_TAG_VALUE
	ST_WINDATA, TRIM
 Side effects:
      In some instances the Y-size of some windows is increased too, due 
      to a different offset in the overlapping windows (<- spectral slant).
      The Y-size of all other windows is adjusted accordingly. For the 
      future, it might be worth considering letting the Y-size vary as 
      well (perhaps adding a PADDING keyword too). 
 Restrictions:
      - Only works on NIS data with 3 (WAVELNTH,SOLAR_X,SOLAR_Y) or 4 
      dimensions (WAVELNTH,SOLAR_X,SOLAR_Y,DEL_TIME).
      - Assumes that pixels in the common areas of overlapping windows have 
      the same values (but allowing for data drop-outs in one of the 
      windows). If data have been processed with, e.g., VDS_DEBIAS, VDS_CALIB 
      or NIS_CALIB (keyword ANGSTROM=0), that should be strictly true; the 
      use of VDS_ROTATE and such, on the other hand, obviously invalidates 
      this assumption. 
      Also, if data have been binned, there might be problems with offsets 
      between windows of sub-(binned-)pixel resolution. Example: a 35-pixels 
      wide window starts at (X,Y)=(524,576), while the next one, because of 
      the spectral slant on the detector, starts at (558,577). The last 
      column of the first window overlaps with the first column of the 
      second, but offset of 1 pixel in the Y direction on the detector. 
      If data are binned in pairs in the Y direction, the bottom-right binned 
      data element in the first window is the sum of detector pixels 
      (524,576) and (524,577), while the corresponding (bottom-left) binned 
      data element in the second window is the sum of pixels (524,577) 
      and (524,578).
 Modification history:
      V. Andretta (15/Dec/1997): Written; based on older routine MRG_NISDATA
      V. Andretta (19/Jan/1998): Take into account binning (BINX/Y);
                                 Allows for time sequences.
 v1.0 V. Andretta (19/Jan/1998): Allows for header-only QLDS (read with 
                                 /HEADER keyword from READCDSFITS)
 v2.0 V. Andretta (26/Oct/1998): Eliminated duplicated call to COPY_QLDS
 v3.0 V. Andretta (23/Aug/2000): Fixed some problems appearing with binned 
                                 data.


NIS_PIX_ANALYSE $SSW/soho/cds/idl/sci/data_handling/soho/cds/nis_pix_analyse.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : NIS_PIX_ANALYSE

 Purpose     : Complementary routine to NIS_QUICKLOOK. Allows the spectrum 
		from an image pixel chosen in NIS_QUICKLOOK to be viewed.
		Also works as a stand-alone routine.

 Category    : Data analysis

 Explanation : On passing the data structure, A, and a co-ordinate (X,Y), 
		the NIS spectrum for that pixel is extracted. A simple menu 
		allows this spectrum to be viewed in detail.

		The window number from which the original image was extracted 
		is passed so that, on selecting a pixel in the image, you 
		are first presented with a view of this portion of the 
		spectrum.

 Syntax      : NIS_PIX_ANALYSE, A, XIX, YIX, WIN_NO

 CALLED BY:
	NIS_QUICKLOOK
 Examples    : 

 Inputs      : A	= CDS data structure

		XIX	= Exposure number

		YIX	= Detector Y value

		WIN_NO	= window number

 Opt. Inputs : None

 Outputs     : None

 Opt. Outputs: None

 Keywords    : None

 Calls       : ***
	GT_LAMBDA, GT_NUMWIN, GT_SPECTRUM, GT_WINSIZE, GT_WLABEL, PIX2WAVE, PSCLOSE [1]
	PSCLOSE [2], PS_MINE
 Common      : None.

 Restrictions: 

 Side effects: None.

 Prev. Hist. : None.

 History     : Version 1, Peter Young, Cambridge University, 5 September 1996.

 Contact     : Peter Young, Cambridge University.


NIS_QUICKLOOK $SSW/soho/cds/idl/sci/data_handling/soho/cds/nis_quicklook.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : NIS_QUICKLOOK

 Purpose     : Allows a quick-look at CDS data

 Category    : Data analysis

 Explanation : Upon running NIS_QUICKLOOK, the set of wavelength windows in
		the data will be displayed. Choosing one brings up the 
		spectrum of this window averaged over the whole raster area. 
		Clicking on one of the wavelength pixels in this window 
		brings up an image of the observed region at this particular 
		wavelength.

		If the option GET_PIX is given then one of the spatial pixels 
		can be chosen and the spectrum at this location can be 
		analysed - see also the routine NIS_PIX_ANALYSE.

		Will still work with wavelength windows only 1 pixel wide - 
		the routine goes directly to displaying the image.

		Any drop-outs in the data are assumed to have the value 
		-100, and will be re-set to the value -5 to ensure the 
		image is reasonably displayed.

		There are many useful keywords - see below for details.

 Syntax      : NIS_QUICKLOOK, A, [, PIX3, GET_PIX, CLEAN, IMAGE=IMAGE
					WIND=WIND]

 Examples    : NIS_QUICKLOOK, A

		   - basic operation

		NIS_QUICKLOOK, A, /CLEAN, /REM_BACK, WIND=7

		   - clean the image of cosmic rays, remove background from
                    image, and use idl window 7

		NIS_QUICKLOOK, A, IMAGE=IM, /GET

		   - save the displayed image to an array IM, and allow the
                    spectrum at a chosen image pixel to be viewed

 Inputs      : A	= CDS quick-look data structure

 Opt. Inputs ;	WIND	= The window that the image/spectra are sent to is by
			  default window 5. This keyword allows the
			  specification of a different window.

		ADD_CONT = A contour plot of the same size as the displayed 
			   image that will be overplotted on the displayed 
			   image

		EXPTIME = after vds_calib has been run on a data-set, the 
			  y-scale can be rather small, so this routine 
			  multiplies the displayed spectra by EXPTIME

 Outputs     : None

 Opt. Outputs: IMAGE	= The displayed image is sent to the array IMAGE, for
			  further manipulation in IDL.

 Keywords    : CLEAN 	= By default, the raw image is displayed. If CLEAN is
			  set, then a cosmic ray removal routine is used.

		PIX3	= construct image from the sum of three wavelength
			  pixels, rather than just one

		FILL	= If set, all missing data pixels in the selected 
			  data window will be filled using the FILL_MISSING 
			  routine.

		REM_BACK = If this keyword is set, then after the wavelength
			   is selected with the mouse, two additional
			   wavelengths can be chosen which are taken to
			   correspond to continuum on either side of the
     			   chosen line. These "continuum images" are averaged
			   and subtracted from the "line images".

		GET_PIX = once the image is displayed, GET_PIX allows an
			  image pixel to be chosen. The routine
			  NIS_PIX_ANALYSE is then called, allowing the
			  spectrum at that particular pixel to be viewed.

		NISAT	= tells NIS_QUICKLOOK that the data contains complete 
			  NIS spectra, and so when the averaged spectra are 
			  displayed a window can be selected with the mouse

 Calls       : ***
	AVERAGE, CONTV, FILL_MISSING, GT_NUMWIN, GT_WINDATA, GT_WINSIZE, GT_WLABEL, NEW_SPIKE
	NIS_PIX_ANALYSE, PLOT_IMAGE
 Common      : None.

 Restrictions: Only works on 3-D arrays, i.e., (lambda,x,y). Won't work with 
		repeated exposures at the same location.

		When using GET_PIX keyword, be careful using data containing 
		entire NIS wavebands. The chosen spectrum will not come from 
		a consistent spatial pixel (because of the slant in the NIS 
		spectra).

 Side effects: None.

 Prev. Hist. : None.

 History     : Ver.1 5-sep-96 
		Ver.2 18-jan-97  added REM_BACK keyword.
		Ver.3 15-oct-97  tidied up the way routine handles missing 
                                data.
		Ver.4 18-nov-97  corrected error in the display of the 
				 averaged spectrum
		Ver.5 6-jan-98   added FILL keyword
		Ver.6 20-may-98  added EXPTIME and NISAT keyword
		Ver.7 2-sep-98	 now calls new_spike to remove cosmic rays

 Contact     : Peter Young, Cambridge University (pry10@damtp.cam.ac.uk)


NIS_ROTATE $SSW/soho/cds/idl/sci/cal/vds/inten/nis_rotate.pro
[Previous] [Next]
 Project     :	SOHO - CDS

 Name        :	NIS_ROTATE

 Purpose     :	Applies slant and tilt corrections to VDS images.

 Explanation :	Applies the slant and tilt corrections of VDS_ROTATE to all the
		windows in a CDS/NIS data structure.  The tilt values are taken
		from GET_TILTCAL.

 Use         :	NIS_ROTATE, DATA

 Inputs      :	DATA	= Structure variable as read by READCDSFITS.

 Opt. Inputs :	None.

 Outputs     :	DATA	= The calibrated data will be returned as a new
			  structure variable with the same format as the input.

 Opt. Outputs:	None.

 Keywords    :	BILINEAR = Allows bilinear interpolation during rectification.
			   This is the default.  If nearest-neighbor
			   interpolation is desired, then set BILINEAR=0.

               CUBIC    = Allows cubic interpolation during rectification

                          (NOTE: both of these change the intensity values.)

		BOTTOM	 = If set, then the data is aligned so that the bottom
			   of the slit is aligned with the bottom of the array.
			   Ignored unless the data contains a full spectral
			   readout.

		MIRROR_SHIFT = If set, then interpolate to take out the
			       spectral shifts due to the scan mirror.

		ALIGN	 = If set, then the NIS-1 windows are moved to be
			   aligned with the NIS-2 windows.

 CALLED BY:
	MK_CDS_MAP
			   Note:  Use of the /ALIGN keyword tends to broaden
			   cosmic rays.  It's best to remove the cosmic rays
			   first, e.g. through CDS_CLEAN_EXP.

			   There is a small amount of smoothing which occurs
			   with the use of /ALIGN.  This smoothing is not
			   significant compared with the actual instrument
			   resolution.  However, one can avoid the smoothing by
			   setting BILINEAR=0.

			   If the observation is of the "sit-and-stare" type,
			   where the scan mirror never moves, then the
			   alignment will only be in the Y-direction, and the
			   X-direction offsets will be ignored.

		ERRMSG = If defined and passed, then any error messages will be
			 returned to the user in this parameter rather than
			 depending on the MESSAGE routine in IDL.  If no errors
			 are encountered, then a null string is returned.  In
			 order to use this feature, ERRMSG must be defined
			 first, e.g.

				ERRMSG = ''
				NIS_ROTATE, ERRMSG=ERRMSG, ...
				IF ERRMSG NE '' THEN ...

 Calls       : ***
	ADD_TAG [1], ADD_TAG [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1]
	DELVARX [2], DELVARX [3], DELVARX [4], FILL_MISSING, GET_MIRSHIFT, GET_TILTCAL
	GT_NIS_ALIGNMENT, GT_WINDATA, GT_WINDESC, POLY, ST_WINDATA, TAG_EXIST [1]
	TAG_EXIST [2], VDS_CALIB, VDS_ROTATE, delvarx [5]
 Common      :	None.

 Restrictions:	Before this procedure can be used, the calibration for the VDS
		detector must be applied, via the VDS_DEBIAS and VDS_CALIB
		routines.  If not already done, then this routine will attempt
		to use the automatic facilities of those routines.

 Side effects:	None.

 Category    :	Calibration, VDS

 Prev. Hist. :	None.

 Written     :	William Thompson, GSFC, 6 February 1998

 Modified    :	Version 1, 6-Feb-1998, William Thompson, GSFC
		Version 2, 5-Oct-1998, William Thompson, GSFC
			Added keyword MISSING to call to VDS_ROTATE
		Version 3, 4-Dec-1998, William Thompson, GSFC
			Call GT_WINDATA and ST_WINDATA with NOPAD.
			This fixes problem when full spectral readout and
			windows are mixed in the same study (e.g. SERTSCAL).
		Version 4, 23-Sep-1999, William Thompson, GSFC
			Added keyword MIRROR_SHIFT.
			Take vertical binning into account.
		Version 5, 30-Aug-2000, William Thompson, GSFC
			Added keyword ALIGN
		Version 6, 13-Oct-2000, William Thompson, GSFC
			Fixed bug with advanced QLDS memory model
		Version 7, 09-May-2003, William Thompson, GSFC
			With /ALIGN, ignore X offset if sit-and-stare.

 Version     : Version 7, 09-May-2003


NIS_WAVECAL_DEMO $SSW/soho/cds/idl/sci/engineering/nis_wavecal_demo.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : NIS_WAVECAL_DEMO
               
 Purpose     : Demonstrate NIS wavelength calibration.
               
 Explanation : Demonstrates the data used to form the NIS wavecal.  Pixel
               values were derived from composite spectral atlas data
               (study NISAT) by McWhirter, Brooks et al) and the wavelengths
               are from the Chianti line lists.
               
 Use         : IDL> nis_wavecal_demo
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : OLD - display pre-loss calibration 

 Calls       : ***
	AVERAGE, CIRCLE_SYM, POLY, POLY_FIT, STDEV, YES_NO
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Calibration, wavelength
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 30-Jul-96
               
 Modified    : Updated for post-recovery data.  CDP, 12-Nov-98 

 Version     : Version 2, 12-Nov-98


NLINE_DISPLAY $SSW/soho/sumer/idl/contrib/germerott/misc/nline_display.pro
[Previous] [Next]
 PROJECT:
       SOHO - SUMER

 NAME:
       NLINE_DISPLAY

 PURPOSE: 
       Display data stucture as movie

 CATEGORY:
       Data Display
 
 EXPLANATION:
       This Routine builds total of data and opens 2 windows, then
       each image is displayed as spectra and total in wavelength and
       in the second window the line profile

 SYNTAX: 
       nline_display, instc 

 EXAMPLES:
       ff=findfile('sumop1$dra6:[restore.20020411]sum_r*.11180_08')
       ff=ff(0:400)  ;~400 images because of memory
       collect_images,'',oo,file=ff,/full;full image mode
       nline_display,oo

 INPUTS:
       instc - data input structure (see collect_images in fullimage_ mode)

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       step_ - contol execution bu keyboard (b - back,i - info,
               q - quit, anykey - forward)

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], UTC_HEAD, WAVEL
 COMMON:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 HISTORY:
       Version 1, April 10, 2002, Dietmar Germerott, MPAE Lindau. Written

 CONTACT:
       Dietmar Germerott, MPAE Lindau (germerott@linmpi.mpg.de)


NLM [2] $SSW/soho/mdi/idl/site/nlm.pro
[Previous] [Next]
 NAME:
	NLM

 PURPOSE: 
	Shorthand for "N_ELEMENTS" (sounds like "EN-ELEM")

 CALLED BY
	FIELDLINE, GETV4TYPE, GREEN_POT_FLAT, MAKE_DIPOLES, MAKE_SYNOP, MREADGIF, NLINEAR
	PIX2V4, PLOT_PTLIST, ROLL_PLOT, SUNEARTHDIST, V4, V4DIFF_ROT, V4HELP, V4OK, V4PRINT
	V4XCARR2HEL, V4XFORM, V4XHEL2CARR, V4XSC2HC [1], V4XSC2HC [2], V4XSC2HEC
	V4_RESOLVE_XFORM, ZCONTAINS, ZHDRUNIT, ZHOVER, ZINRANGE, ZLASCO_SUM, ZPAD, ZUNPAD
	closest_time, cube_interp, equalize_rasters, find_launchpoints, fixinate_eit
	fixinate_mdi, fixinate_trace, later, local_mag_extrap, make_grid_sphere
	radial_bkg, struct_eq, trace_field, unpack_trace, zanytim2cds, zcheck_hdr, zcurs_ok
	zdeheliographinize, zheliographinize, zmatch, zmontage, zmovie, zmovify, zpb0r [1]
	zpb0r [2], zradialize, zscale, ztrack, zunits, zunspike, zunwrap


norm_warn $SSW/soho/lasco/idl/exposure/norm_warn.pro
[Previous] [Next]
 NORM_WARN
	Confirm the QUIT operation.

 Usage:
	iquit=norm_warn()

 Arguments and keywords: none:

 CALLS: ***
	NORM_EVENT
 History:
	original: 19/1/95; SJT


NRL2EIT $SSW/soho/eit/idl/util/nrl2eit.pro
[Previous] [Next]
 NAME:
	NRL2EIT

 PURPOSE:
       To make a NRL formatted EIT FITS file compatible with EIT software.

 CATEGORY:
	FITS processing

 CALLING SEQUENCE:
       eithdr = nrl2eit(nrlhdr)

 INPUTS:  NRL formatted FITS header

 KEYWORD PARAMETERS: none

 OUTPUTS:
	FITS header comptaible with EIT software.

 CALLS: ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], EIT_FXPAR, EIT_PIXSIZE, FXADDPAR [1], FXADDPAR [2]
	FXPAR [1], FXPAR [2]
 CALLED BY:
	EIT_PREP
 COMMON BLOCKS: none.

 SIDE EFFECTS: none.

 RESTRICTIONS: none.

 PROCEDURE:
          The only changes needed are to add new keywords to the 
          header which already contains this info. The necessary info
          is grabbed out and re-written.

 MODIFICATION HISTORY:
 	Written by:  J. Newmark 	Date.  Oct 08 1996
	2001.6.21, N.Rich - Fixed date_obs and object
       2002.8.06 J. Newmark, fixed EXPTIME
	2003.4.22, N.Rich - For MAP compatibility, Fixed date_obs AGAIN; 
			    added CDELT1,2


NUM_TO_FUZZY $SSW/soho/lasco/idl/reduce/fuzzy/num_to_fuzzy.pro
[Previous] [Next]
 NAME:
	NUM_TO_FUZZY

 PURPOSE:
	Converts a number to a fuzzy number

 PROPCEDURE:
	Converts a number (or array of numbers) to a fuzzy number (resp. array
	of fuzzy numbers with the same dimensions)

	A "fuzzy number" is a confidence interval around a given number.
	Given 1 number a0 (highest confidence case) and a [min,max] interval
	(lowest confidence case), the fuzzy number is an compromise beetween
	[amin,amax] and [a0, a0] according to a confidence level (0 to 1) for
	the number a0.
;	
 CALLING SEQUENCE:
	afuzzy = num_to_fuzzy (a0, amin, amax, conf)

 INPUTS:
	a0		a non-complex number or array of numbers
	amin		the minimum value for a confidence level 0
	amax		the maximum value for a confidence level 0
	conf		a confidence level, ranging from 0 (no confidence in
			the number a0) to 1 (total confidence in the number a0)

 OUTPUTS:
	A fuzzy number (structure with the form {low,high})
 CALLED BY
	FUZZY_BLOCK


nums2string $SSW/soho/lasco/idl/util/nums2string.pro
[Previous] [Next]
 FUNCTION: nums2string

 Converts an array of numbers to a space delimited list of numeric characters

 INPUTS:
	nums 	FIX,FLOAT,BYT ARR

 OUTPUTS:
	numstring	CHAR

 KEYWORDS:
 	DELIM	Set = character to use as delimiter, default is ' '

 AUTHOR:
  Nathan Rich, NRL/Interferometrics, 2001

	@(#)nums2string.pro	1.1, 11/08/01 - NRL IDL LASCO Library

 CALLS:
 CALLED BY
	REDUCE_LEVEL_1