fan_plot $SMEI/user/pphick/idl/fancy/fan_plot.pro
[Previous] [Next]
 NAME:
	fan_plot
 PURPOSE:
	Plotting time series
 CATEGORY:
	Plotting
 CALLING SEQUENCE:
	fan_plot
 CALLS: ***
	CLEANPLOT, DACLR, DAVIS, UTXAXIS, UTYAXIS, twin
 INPUTS:
	Through common blocks
 OUTPUTS:
	Plots to terminal screen or PS file
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLED BY:
	fancy
 COMMON BLOCKS:
	common	CFANCY,     IPMAX,IP,BTYP,BLOW,BUP
	common	TFANCY,     YEAR0,DOY0,TUNIT,T0,F0,T1,F1,T2,F2,T3,F3,T4,F4,T5,F5
	common	SFANCY,     IPARR,IPIO,IPAUTO,IPTITLE,IPSYM,IPLIN,IPTHICK,IPSLAB,IPSLABXY
	common	LABELS,     PLOTI,PLOTLAB,PLOTX,PLOTY,PLOTCOMM
 MODIFICATION HISTORY:
	MAY-1991, Paul Hick (ARC)


fan_read $SMEI/user/pphick/idl/fancy/fan_read.pro
[Previous] [Next]
 NAME:
	fan_read
 PURPOSE:
	Read ASCII file containing data for time series
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	fan_read, file=FILE, clear=CLEAR
 CALLS: ***
	CVTIME, ECHO, flt_string
 OPTIONAL INPUT PARAMETERS:
	FILE	Name of ASCII file with time series data (if omitted user is prompted)
	CLEAR	If set, all previously read data are dumped and only the new
	    data file remains in memory)
 OUTPUTS:
	Through COMMON blocks
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLED BY:
	fancy
 COMMON BLOCKS:
	common	CFANCY,     IPMAX,IP,BTYP,BLOW,BUP
	common	TFANCY,     YEAR0,DOY0,TUNIT,T0,F0,T1,F1,T2,F2,T3,F3,T4,F4,T5,F5
 RESTRICTIONS:
	Times with the value -1 will be ignored
 PROCEDURE:
	The input file should have the following layout:
	- Header containing time origin (Year,doy)
	- Subheader containing nr of rows NROW and columns NCOL of data
	- NROW records, each containing NCOL numbers
	The same groupings may be repeated on the same file.
	The odd columns should contains the times; the even columns the
	function values (e.g. intensities).
 MODIFICATION HISTORY:
	MAY-1991, Paul Hick (ARC)


fancy $SMEI/user/pphick/idl/fancy/fancy.pro
[Previous] [Next]
 NAME:
	fancy
 PURPOSE:
	Displaying of time series. Allows adding of labels
 CATEGORY:
	Plotting
 CALLING SEQUENCE:
	fancy
 CALLS: ***
	DAVIS, ECHO, InitVar, SPITPLOT, fan_plot, fan_read, pcursor, twin
 INPUTS:
	From ASCII files (as e.g. created by the TFANCY procedure)
 OUTPUTS:
	Plots to terminal. PostScript files. Hardcopies.
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 COMMON BLOCKS: (shared with FAN_READ and FAN_PLOT)
	common	CFANCY,     ipmax,ip,btyp,blow,bup
	common	TFANCY,     year0,doy0,tunit,T0,F0,T1,F1,T2,F2,T3,F3,T4,F4,T5,F5
	common	SFANCY,     iparr,ipio,ipauto,iptitle,ipsym,iplin,ipthick,ipslab,ipslabxy
	common	DEVICES,    plotdev
	common	LABELS,     ploti,plotlab,plotx,ploty,plotcomm,plotsz
 CALLS: ***
	DAVIS, ECHO, InitVar, SPITPLOT, fan_plot, fan_read, pcursor, twin
 RESTRICTIONS:
	Header of ASCII file must contain year and doy defining time origin.
	Times must be given in hours since the time origin
 PROCEDURE:
	- Choose between linear/logarithmic y-axis
	- Add labels at location selected with spin-hair cursor
	- Add labels for Y-axis (blank by default)
	- Overlay multiple time series
	- Use same Y-axis for overlay or draw new Y-axis

	ip+1	# time series currently in memory
	iparr	indices (from [0,ip]) of time series selected for plotting
 MODIFICATION HISTORY:
	MAY-1991, Paul Hick (ARC)


fileset_sizes $SMEI/user/pphick/idl/network/fileset_sizes.pro
[Previous] [Next]
 NAME:
	fileset_sizes
 PURPOSE:
 CALLING SEQUENCE:
	PRO fileset_sizes, data_file, $
	    file	= file		, $
	    xysize	= xysize	, $
	    silent	= silent	, $
	    time_ago	= time_ago	, $
	    start_time	= start_time	, $
	    stop_time	= stop_time	, $
	    bin_width	= bin_width	, $
	    charsize	= charsize	, $
	    unlabeled	= unlabeled	, $
	    refresh	= refresh	, $
	    show_gaps	= show_gaps	, $
	    cdf 	= cdf		, $
	    ratio	= ratio 	, $
	    title	= title 	, $
	    _extra	= _extra
 INPUT:
	data_file	fully-qualified name with the list of file
			names on which the plot are based.
			Default: telescope_duty_cycle.txt
	file		filename on which names of graphics output
			files are based.
 OPTIONAL INPUTS:

	/cdf

	start_time=start_time
			start time for graphs; default: earliest file
	stop_time=stop_time
			stop time of graphs; default: latest file
	time_ago=time_ago
			instead of start_time, specify a time range:
			start_time then becomes stop_time-time_ago

	/unlabeled	omit labeling
	/show_gaps	used for duty cycle plot to emphasize times were
			no data are present: these time ranges are explicitly
			erased with a final polyfill. This can have the
			unwelcome side effect that very small gaps (less
			then one pixel) are shown as a full pixel wide.
	charsize=charsize
			character size for labeling
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	GetFileSpec, InitVar, IsTime, IsType, MEAN, PlotBars, TimeGet, TimeSet, TimeSplit
	TimeUnit, TimeXAxis, destroyvar, get_page, merge_ranges, set_page, txt_read, who_am_i
 MODIFICATION HISTORY:
	MAR-2017, started adding documentation


filespec_common $SMEI/ucsd/gen/idl/toolbox/files/filespec_common.pro
[Previous] [Next]
 NAME:
	filespec_common
 PURPOSE:
	Contains common block used by filespec procedures
 CATEGORY:
	String manipulation
 CALLING SEQUENCE:
	@filespec_common.pro
 INCLUDED BY:
	PutFileSpec, SetFileSpec
 PROCEDURE:
	File is set by SetFileSpec and updated by PutFileSpec
	File is used read-only by GetFileSpec
	Parts is used read-only by PutFileSpec and GetFileSpec
 MODIFICATION HISTORY:
	JUL-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


Find2DGlitch $SMEI/ucsd/sat/idl/toolbox/find2dglitch.pro
[Previous] [Next]
 NAME:
	Find2DGlitch
 PURPOSE:
	Find 'cosmic rays' in a set of 2D frames
 CATEGORY:
 CALLING SEQUENCE:
	Result = Find2DGlitch(Frames [,sumwidth=SumWidth, /exclude, $
		    sigmathreshold=SigmaThreshold, loc=Loc])
 INPUTS:
	Frames		array[n,l,m]; type: any (float or double needed to use NaN option)
			    stack of 2D frames combined in 3D array; the last dimension counts
			    the number of frames (if it is absent then a dummy dimension of 1
			    is added).
			    Frame elements set to the value !VALUES.F_NAN or D_NAN are ignored
 OPTIONAL INPUT PARAMETERS:
	SumWidth	scalar, type integer, no default
			    defines a box of SumWidth by SumWidth pixels used by procedure FrameMoments
	SpotWidth	scalar, type integer, no default
			    defines a box of SpotWidth by SpotWidth pixels used by procedure CleanGlitchBox
	sigmathreshold	scalar, any type, default: 4.
			    see PROCEDURE
	minthreshold	scalar, any type, default: 0
			    see PROCEDURE
	/exclude	if set, then each pixel in the Frames array is tested based on statistical
			    moments calculated omitting the pixel itself
	/remove 	if set the glitches are replaced by average values calculated
			    after removal of the glitches
	/group		activates grouping of pixels that are close together.
 OUTPUTS:
	Result		scalar, type long integer
			    number of glitches found
 OPTIONAL OUTPUT PARAMETERS:
	loc=Loc 	1-dim array [*], type long integer
			    location of the glitches
			    glitch positions are identified by a one-dimensional array index
	/quiet		if set, the list of glitches found is not printed to the screen

	ngroup=ngroup
	pgroup=pgroup
	lgroup=lgroup	unmodified return arguments from a call to the GroupPixels procedure
	fgroup=fgroup	contains total # adus in each group (after subtraction of underlying average)
 INCLUDE:
	@compile_opt.pro    ; On error, return to caller
 CALLS: ***
	ArrayLocation, BadValue, CleanGlitchBox, FrameMoments, GroupPixels, InitVar
 CALLED BY:
	SMEI_cr_removal, qGlitch_Run, testnic, trypleiades
 PROCEDURE:
	If there are nT frames of dimension nX by nY then Frames has dimensions nX,nY,nT

	For each of the nX*nY pixels an average and standard deviation is calculated by averaging
	all nT boxes of SumWidth^2 pixels (total of SumWidth^2*nT pixels).

	A 'cosmic ray' is defined as a pixel where the frame value is more than SigmaThreshold
	standard deviations above the average.
	If MinThreshold is set than the frame value must be at least MinThreshold above the
	average to count as a glitch. This second test can be used to avoid that lots of points
	are flagged when the standard deviation becomes real small.
 MODIFICATION HISTORY:
	OCT-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


FindAllFiles $SMEI/ucsd/gen/idl/toolbox/files/findallfiles.pro
[Previous] [Next]
 NAME:
	FindAllFiles
 PURPOSE:
	Extended version of FindFile for locating file satisfying
	a list of file specs in a list of directories.
	FindAllFiles is intended to be robust; it is slow compared
	to a direct call to findfile.
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	FUNCTION FindAllFiles, FilesIn	    , $
	    paths	    = PathsIn	    , $
	    count	    = count	    , $
	    separator	    = Separator     , $
	    shortnames	    = ShortNames    , $
	    nodirectories   = NoDirectories , $
	    recursive	    = Recursive     , $
	    symlink	    = symlink	    , $
	    excl_files	    = excl_files    , $
	    excl_paths	    = excl_paths    , $
	    excl_recursive  = excl_recursive, $
	    forcecd	    = ForceCD	    , $
	    ls_style	    = ls_style
 INPUTS:
	Files		list of file specifications, specified as
			a comma-separated list, or a string array
			(default: *.*, NOT *)
 OPTIONAL INPUT PARAMETERS:
	paths=Paths	list of directories to be searched, specified
			as a separated list, or a string array
			(if omitted then the current directory is assumed)

	separator=Separator
			separator used between entries in Files and Paths
	/shortname	if set then only file name, type (and version
			on vms) are returned (default: return fully
			qualified names)
	/recursive	search recursively through all subdirectories
	/symlink	(only on Unix/Linux systems when /recursive is set)
			by default, a recursive search does not descent into
			directories that are symbolic links. If /symlink is
			set then it will (see "IsSymLink").
	/nodirectories	discards directories, i.e. only regular files are
			returned.
	/forcecd	THIS HAS ONLY BEEN TESTED ON LINUX.
			by default the IDL findfile function is called with
			argument of type full_dir+file_name_wildcard.
			The array returned by findfile will then also contain
			fully-qualified filenames. In deeply nested directories
			with lots of matching files findfile may return nothing
			at all (probably because some memory buffer overflows).
			Setting /force_cd will first cd into 'full_dir', then
			do a findfile with only file_name_wildcard. Findfile will
			only return file names (without a directory). 'Full_dir'
			is then explicitly prefixed to the output of findfile.
			This may prevent the buffer overflow.
	/ls_style	passed to findfile_fix. If set then the content
			of subdirectories is included.

	Three additional keywords allow files and/or paths to be excluded:

	excl_files=excl_files
			list of file specifications similar to 'Files'
	excl_paths=excl_paths
			list of directories similar to 'Paths'
	/excl_recursive
			triggers a recursive search similar to '/recursive'

	These three keyword are used as input for a recursive call to
	FindAllFiles. The result is subtracted from the files matching
	found using 'Files' and 'Paths'

 OUTPUTS:
	Result		string array with filenames; if no files are found then
			files is set to the null string (files='')
 OPTIONAL OUTPUT PARAMETERS:
	count=count	number of files located
 INCLUDE:
	@compile_opt.pro	; On error return to caller
 CALLS: ***
	FILEPATH, FindAllSubDirs, GetFileSpec, InitVar, IsType, SetFileSpec, os_separator
	unique_only, where_common
 CALLED BY:
	SetFileSpec, clean, clean_loc_smei, fix_cxlo, forecast_ice, orb_comp
	qView_FileFilter, qView_PickFiles, skyd_cat, smei_base_testcase
	smei_buf_getframe, smei_fixpnt, smei_frm_darkfit, smei_getfile, smei_hdr_update
	smei_mkbase, smei_mkcal_auto, smei_mkorb, smei_mkorb_auto, smei_mksky, smei_rewind
	smei_rmdups, smei_star_split, smei_star_update, smei_www_skymaps, stardistance
	tolowcase, vu_select, www_help_files
 SIDE EFFECTS:
 >	windows: Directories . and .. are omitted
	Trailing delimiter for directories are stripped off
 >	If both Files and Paths are specified as arrays then Separator is
	not used.

	The findfile function on Linux sometimes shows peculiar behavior
	(similar to the Unix ls command). Problems can arise when searching
	a directory with containing only one subdirectory; or when the
	directory contains a symbolic link.
 PROCEDURE:
	Separator is OS dependent: ',' on VMS and Win32, ' ' on all other
	Each entry in the Files list can contain a directory specification;
	in that case the Paths keyword is not used for that entry.
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS)
	AUG-2000, Paul Hick (UCSD/CASS)
	    Added /recursive keyword
	JUN-2001, Paul Hick (UCSD/CASS)
	    Added /symlink
	JAN-2002, Paul Hick (UCSD/CASS)
	    Added exclusion keywords
	SEP-2002, Paul Hick (UCSD/CASS)
	    On Linux output from the IDL findfile function is now filtered
	    through findfile_fix to deal with directories.
	    (this may actually be necessary for all Unix flavors)
	    Added /forcecd and /ls_style keywords. Added check to exclude
	    wildcards in the directory paths.
	MAR-2003, Paul Hick (UCSD/CASS)
	    Improved processing of FileIn=''. This now should handle directories
	    with lots of files better (at least on Linux) by avoiding the used
	    of an explicit wildcard (*.*) in the call to findfile.
	FEB-2004, Paul Hick (UCSD/CASS)
	    Changed check for !version.os to check for !version.os_family.
	    Makes this hopefully it bit more generally useful.
	OCT-2004, Paul Hick (UCSD/CASS)
	    Modified handling of a path specification without a filename.
	    Windows didn't handle the Linux solution correctly.
	OCT-2006, Paul Hick (UCSD/CASS)
	    Added forcecd keyword to FindAllSubDirs call
	JUL-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Replaced findfile by file_search
	    Keyword /forcecd is now ignored.


FindAllSubDirs $SMEI/ucsd/gen/idl/toolbox/files/findallsubdirs.pro
[Previous] [Next]
 NAME:
	FindAllSubDirs
 PURPOSE:
	Return a list of all subdirectories in a specified directory
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	FUNCTION FindAllSubDirs, Path, $
	    count	= count      , $
	    symlink	= symlink    , $
	    recursive	= recursive  , $
	    forcecd	= ForceCD
 INPUTS:
	Path		scalar; type: string; default: current directory
 OPTIONAL INPUT PARAMETERS:
	/symlink	by default, symbolic links to directories are not returned
			unless /symlink is set (ignored on non-unix systems;
			see IsSymLink.
 OUTPUTS:
	List		array; type: string
			    list of subdirectories
			    fully-qualified directory names are returned.
			    on Linux and Win32 the directories include the trailing (back)slash
			    if no subdirectories are found then List = '' is returned.
 OPTIONAL OUTPUT PARAMETERS:
	count=count	scalar; type: integer
			    number of subdirectories
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, GetFileSpec, InitVar, IsSymLink, SetFileSpec
 CALLED BY:
	FindAllFiles, clean, findfile_fix, mk_flick, smei_mkdrives, www_help_tree
 RESTRICTIONS:
	Currently linux, Win32 and vms are implemented.
 PROCEDURE:
	Findfile is used to get a list of files in the specified directories. Then the
	directories are selected.
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS)
	JUN-2001, Paul Hick (UCSD/CASS)
	    added /symlink keyword
	JAN-2002, Paul Hick (UCSD/CASS)
	    Return arg 'count' didn't exist on return if 'path' didn't exist.
	    Now zero is returned.
	JUL-2002, Paul Hick (UCSD/CASS)
	    Fixed a bug caused by peculiar behaviour of IDL findfile on Linux
	    (and presumably every Unix flavor) when a directory is tested
	    containing only a single subdirectory. This apparently reflects
	    the same peculiar behaviour of the Unix 'ls' command.
	MAR-2003, Paul Hick (UCSD/CASS)
	    Added /recursive keyword
	SEP-2006, Paul Hick (UCSD/CASS)
	    Added some code to deal with spaces in directory names (adding
	    explicit quotes). Moved initvar statement for Path to start of function.
	OCT-2006, Paul Hick (UCSD/CASS)
	    Added forcecd keyword.
	JUL-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Replaced findfile by file_search (for unix only). Lot less complicated.
	    Note that /forcecd is no longer used (and if set, is ignored).


findfile_fix $SMEI/ucsd/gen/idl/toolbox/files/findfile_fix.pro
[Previous] [Next]
 NAME:
	findfile_fix
 PURPOSE:
	Applies fix to output from IDL findfile procedure.
 CATEGORY:
	gen/toolbox/files
 CALLING SEQUENCE:
	FUNCTION findfile_fix, dir, file, old_files, count=count, ls_style=ls_style
 INPUTS:
	path
	file
	old_files   array; type: string
		    Output from findfile
 OPTIONAL INPUT PARAMETERS:
	count=count scalar; type: integer
		    Output from findfile (# files)
 OUTPUTS:
	result	    array; type: string
		    Corrected 'old_files' array
 OPTIONAL OUTPUT PARAMETERS:
	count=count scalar; type: integer
		    # entries in new_files
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, FindAllSubDirs, GetFileSpec, InitVar, SetFileSpec, where_common
 PROCEDURE:
	This is kludging at its best. On Linux (maybe even all Unix
	flavors??) a findfile call with a wildcard (in particular a
	single star) can pick up subdirectories:
	    files = findfile('path/*')
	The result is a string array of the form:
	    full_file_1
	    full_file_2
	    ..
	    full_file_n
	    (blank line)
	    full_subdir_1:	(sub dir name followed by colon)
	    file_1_in_subdir_1	(file name without directory)
	    file_2_in_subdir_1	(file name without directory)
	    ..
	    file_n_in_subdir_1	(file name without directory)
	    (blank Line)
	    full_subdir_2:	(sub dir name followed by colon)
	    etc.

	The list of full_file_n at the beginning may not be present.
	Moreover, if only one subdirectory matches the template then
	full_subdir_1 will be missing too, and only the list
	file_n_in_subdir_1 remains. In this last case it is impossible
	to reconstruct the full file names. An attempt is made to recover
	the name of the subdirectory using FindAllSubdirs. If not
	successful then these entries (the whole list of files) is discarded.

	If it is possible to reconstruct full paths, two approaches
	are possible depending on the setting of /ls_style.
	If /ls_style is NOT set, then all entries inside subdirectories
	are discarded, and only the subdirectory name itself is returned.

	If /ls_style IS set, then the content of subdirectories is also
	returned (converted to full paths by prefixing the names of the
	subdirectory). Blank lines are always removed.
 MODIFICATION HISTORY:
	SEP-2002, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added a fix to make sure subdirectories have a trailing slash
	    when output from findfile with only a directory (no filename)
	    as argument is processed.


FindPeaks $SMEI/ucsd/gen/idl/toolbox/findpeaks.pro
[Previous] [Next]
 NAME:
	FindPeaks
 PURPOSE:
	Find local maxima in 2D array
 CATEGORY:
	smei/gen/idl/toolbox
 CALLING SEQUENCE:
	FUNCTION FindPeaks, Box , $
	    mask    = Mask	, $
	    npeak   = npeak	, $
	    flat    = flat	, $
	    relative= relative	, $
	    map     = Map	, $
	    fraction= fraction	, $
	    untested= untested	, $
	    mindist = mindist	, $
	    count   = count
 INPUTS:
	Box	    2D array, any type
 OPTIONAL INPUT PARAMETERS:
	mask=Mask   1D or 2D array, type integer, default: no mask (includes all elements)
			Elements outside the mask are ignored
			1D array: list of indices defining the area in Box to be searched
			for maxima.
			    !!! A 1-element mask MUST be entered as an array of 1-element.
				A scalar is ignored, so put brackets around the input
				argument if necessary)
			2D array: array of same dimensions as Box with value 1 defining
			    the mask and value 0 outside the mask.
	fraction=fraction
		    scalar; same type as input array; default: 1.0
			fraction between 0 and 1. Only this fraction of the image inside
			the mask is searched for local maxima.
	mindist=mindist
		    scalar; type: any; default: 0
			minimum distance between local maxima. Local maxima closer then
			mindist to a higher local maximum are included with the higher
			maximum.
	npeak=npeak scalar; type: integer
			Maximum number of local maxima to be detected. By default the
			whole array is searched for all maxima. If npeak is set then the
			search is interrupted when npeak local maxima have been found.
			In this case the 'map' array will be partially filled with the
			value returned in 'untested' to indicate that this part of Box
			has not been searched for maxima.
	flat=flat   scalar; same type as input array.
			In determing whether neigbour pixels are above/at/below the
			central pixel of a 3x3 group of pixels, above/at/below are defined
			as follows:
			    below:  Vneighbour < Vcenter-flat
			    at	 :  Vcenter-flat <= Vneigbour <= Vcenter+flat
			    above:  Vneighbour > Vcenter+flat
			In a 'noisy' map setting flat to a positive value, suppresses the
			detection of lots of unwanted local maxima. (Probably the same can be
			accomplished by applying the IDL smooth function to the input
			argument Box before calling this function.)
 OUTPUTS:
	Peaks	    1D array, type integer
			Indices of local maxima inside area defined by mask
 OPTIONAL OUTPUT PARAMETERS:
	map=Map     2D array, type long integer, same dimension as Box
			Provisionally divides Box into areas associated with each
			local maxima. The index from the Peaks array is used
			in Map to indicate the associated maximum
	untested=untested
		    value used to indicate untested areas in Box (see npeak keyword)
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar, IsType, boost, where_common
 CALLED BY:
	FitStar, smei_findpnt
 PROCEDURE:
	The entire input image is searched for local maxima. This very quickly
	takes and intolarably long time. Usually keywords fraction and/or npeak need
	to be used to get results reasonably quick.
 MODIFICATION HISTORY:
	OCT-1998, Paul Hick (UCSD/CASS)
	JAN-2003, Paul Hick (UCSD/CASS)
	    Fixed problems with local maxima of equal height. Added keywords npeak,
	    untested and flat. Significant speedup by processing groups of up to
	    nine pixels (3x3 group) instead of only single pixels.
	FEB-2008, Paul Hick (UCSD/CASS)
	    Modified to deal with NaN in Box (always excluded from Mask)
	    Bugfix.


FindStars $SMEI/pro/tool/findstars.pro
[Previous] [Next]
 NAME:
	FindStars
 PURPOSE:
	Locate stars in 2D image based on a 2D template defining the shape of a star
	in the image
 CATEGORY:
 CALLING SEQUENCE:
	FUNCTION FindStars, Image, threshold=Threshold, maxstars=MaxStars, nan=NaN,	$
	    starpix=StarPix, peakpix=PeakPix, starpos=StarPos, peakpos=PeakPos, btest=bTest
 INPUTS:
	Image	    2D array, any type
			Image containing stars
 OPTIONAL INPUT PARAMETERS:
	Threshold	scalar, any type
			    only maxima above Threshold are considered
	MaxStars	scalar, integer
			    maximum number of stars to be removed
	/nan		if set pixels in stars will be replaced by ValuesNaN
 OUTPUTS:
	Image	    2D array, same type as input
			    image with stars removed
 OPTIONAL OUTPUT PARAMETERS:
	StarPix     1D array, type long integer
			indices of pixels in stars
	BadPix	    1D array, type long integer
			indices of areas around local maxima not matching the star criterium
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	ArrayLocation, ECHO, FitStar, InitVar, IsType, UNIQ, VALUESNAN, twin
 CALLED BY:
	trypleiades
 PROCEDURE:
 >	The image is scanned from the maximum down. A box around the maximum is
	matched to a star template to decide whether the maximum is a star.
 >	If a star is located an area covering the star is set to the median of the
	box used to test for a star (or to NaN if the /nan switch is set).
	The star location are accumulated in StarPix
 >	Local maxima not matching the star template are collected in BadPix.
	The intensities of these maxima are not modified.
	Ideally these would be cosmic rays. Some of them may be stars which for some
	reason did not fit well enough to qualify as a star.
 >	The search for stars can be limited in two ways: the 'maxstars' and the 'threshold'
	keywords. The 'threshold' keyword is probably preferable and should be set to
	a value sufficiently far above the noise in the image.
 MODIFICATION HISTORY:
	OCT-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


FishEye $SMEI/ucsd/sat/idl/toolbox/math/fisheye.pro
[Previous] [Next]
 NAME:
	FishEye
 PURPOSE:
	Converts spherical angles to coordinates for a 'fish-eye' plot
 CATEGORY:
	Math: projections
 CALLING SEQUENCE:
	FUNCTION FishEye, Pos	    , $
	    degrees	= degrees   , $
	    maxelo	= maxelo    , $
	    polar	= polar     , $
	    dabg	= dabg	    , $
	    zero_phase	= zero_phase, $
	    inverse	= inverse
 INPUTS:
	Pos		array[2,*]; type: float
			    pos[0,*]: phase angle, longitudes
			    pos[1,*]: latitude
 OPTIONAL INPUT PARAMETERS:
	/degrees	if set, all angles are in degrees (default: radians)
	maxelo=maxelo	scalar; type: float; default: !pi
			    elongation 'maxelo' is scaled to 2*sqrt(2)
	dabg=dabg	array[3]; type: float; default: [0,0,0]
			    Euler angles to be added to the rotation
			    discussed in PROCEDURE.
	zero_phase	scalar; type: float; default: none
			    Additional offset applied to phase angle
			    i.e. adds Euler triplet [zero_phase,0,0] to
			    the rotation discussed in PROCEDURE.
	/inverse	if set, the inverse transformation (from (x,y) in the
			fisheye to phase angle/lat) is done.
 OUTPUTS:
	Result		array[2,*]; type: float
			    x and y coordinates in fish-eye plot
 OPTIONAL OUTPUT PARAMETERS:
	polar=polar	array[2,*]; type: float
			    polar coordinates in fish-eye plot
 INCLUDE:
	@compile_opt.pro	    ; On error, return to caller
 CALLS: ***
	AngleRange, EulerRotate, InitVar, IsType, REVERSE, SyncDims, ToRadians
 CALLED BY:
	ColorSkybox, GetColors [2], GetColors [3], PlotCoronagraph, PlotEarthSkymap [1]
	PlotEarthSkymap [2], PlotEarthSkymap [3], PlotEarthSkymap [4], PlotEloTimeMap
	PlotPolarSkymap, nagoya_plotg2d, projfig, vu_thomson_antifish, vu_thomson_hammer
 PROCEDURE:
 >	The input angles are usually celestial spherical coordinates,
	e.g. ecliptic longitude and latitude, or right ascension and
	declination.
 >	The fish-eye plot uses phase and polar angles relative to a
	coordinate system with the z-axis along longitude=0,latitude=0,
	and the x-axis along longitude=90, latitude=0. The transformation
	to this coordinate system takes Euler angles E=[0,90,90] degrees.
 >	The Euler angle triplet specified in keyword dabg will be
	added to E, i.e. the total rotation applied to the input
	coordinates is E+dabg.
	dabg is used to change the direction for the center of the
	fish-eye plot. E.g. if the input angles are ecliptic coordinates
	and the ecliptic coordinates of the Sun are [lng,dec], then
	dabg = [lng,-dec,0] would put the Sun in the center of the
	fish-eye (the total rotation would be [lng,90-dec,90]).
	Note that in this example the 3rd angle in dabg (set to zero)
	rotates the plot around the center of the fisheye.
 >	In the fish-eye coordinate system the following transformation is used:
	    x = polar*cos( phase )*(2*sqrt(2)/maxelo)
	    y = polar*sin( phase )*(2*sqrt(2)/maxelo)
	i.e. the maximum polar angle 'maxelo' is scaled to 2*sqrt(2)
 >	 scale -sqrt(2),sqrt(2)
	    X-axis: east (left)
	    Y-axis: north (up)
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS)
	JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added keyword /inverse


FitKeplerOrbit $SMEI/user/pphick/idl/drivers/fitkeplerorbit.pro
[Previous] [Next]
 NAME:
	FitKeplerOrbit
 PURPOSE:
	For a given set of orbital data, find the best-fitting orbital parameters
	for a simple Kepler orbit
 CATEGORY:
	Celestial mechanics
 CALLING SEQUENCE:
	PRO FitKeplerOrbit, input_data, orbit=Orbit, degrees=Degrees
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	CV_COORD, DATE_DOY, EulerRotate, IsType, Julian, ToRadians, flt_read
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 SIDE EFFECTS:
 RESTRICTIONS:
	Looking down along tav the motion is direct (counterclockwise), IF the two
	points used to determine tav are less then 180 deg away from each other
	(measured in the direction of motion).
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-1997, Paul Hick (UCSD)


FitPlane $SMEI/ucsd/camera/for/base/fitplane.pro
[Previous] [Next]
 NAME:
	FitPlane
 CALLING SEQUENCE:
	function FitPlane, z, dz=dz, sumzq=sumzq
 INCLUDE:
	@compile_opt.pro
 MODIFICATION HISTORY:


FitStar $SMEI/pro/tool/fitstar.pro
[Previous] [Next]
 NAME:
	FitStar
 PURPOSE:
	Fit star based on a 2D template of intensities
 CATEGORY:
 CALLING SEQUENCE:
	FUNCTION FitStar, Frame,bScan,Star,Box,Mask,BoxBase,BoxDev,BoxMed,BoxM, $
	    template=Template, DevRatio=DevRatio, nofit=NoFit,nearbystar=NearbyStar
 INPUTS:
	Frame	    2D array, any type
			image with suspected star at location Star
	Star	    scalar, type integer
			location of maximum
 OPTIONAL INPUT PARAMETERS:
	/template   if set then argument Mask returns the exact mask used to fit the star
		    template. By default, Mask retuns a mask covering the central peak in box.
 OUTPUTS:
	Box	    2D array, type float, same size as the star template used to fit the star
			the suspected star (pixel Star in Frame) is in the center of Box.
			Box contains the square from Frame around the suspected star.
			Values !VALUES.F_NAN near the edges of Box indicate pixels outside
			the range of the Frame array.
	Mask	    1D array, type long integer
			mask of pixels covering the central peak in Box
	BoxBase
	BoxDev	    scalar, type float
			measure for the fluctuations of the values in the 'outside star' pixels
			in box (~standard deviation)
	BoxMed	    scalar, type float
			median of the 'outside star' pixels in Box
	Residue     2D array, type float, same size as Box
			residual intensities left after subtraction of the Star template
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FindPeaks, GetStarShape, MEAN, STDDEV, UNIQ
 CALLED BY:
	FindStars
 PROCEDURE:
 >	A set of shapes for matching the star is collected from the function
	GetStarShape. The template shape best fitting the star is subtracted.
 >	A single parameter, the total intensity in the star, is fitted.
 MODIFICATION HISTORY:
	OCT-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


fix_cxlo $SMEI/user/pphick/idl/fix_cxlo.pro
[Previous] [Next]
 NAME:
	fix_cxlo
 CALLING SEQUENCE:
	PRO fix_cxlo, check=check
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FXHMODIFY, FXPAR, FindAllFiles, GetFileSpec, HEADFITS, InitVar


fix_version $SMEI/user/pphick/idl/fix_version.pro
[Previous] [Next]
 NAME:
	fix_version
 CALLING SEQUENCE:
	PRO fix_version, f
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	GetFileSpec, READFITS, WRITEFITS


flat_centerofmass $SMEI/ucsd/gen/idl/toolbox/flat_centerofmass.pro
[Previous] [Next]
 NAME:
	flat_centerofmass
 PURPOSE:
	Calculations related to the centroid of a flat density distribution
 CATEGORY:
	gen/idl/toolbox
 CALLING SEQUENCE:
	FUNCTION flat_centerofmass, box, centroid   , $
	    polar	= polar 	, $
	    shift_origin= shift_origin	, $
	    degrees	= degrees

	R = flat_centerofmass(box [, /polar, /degrees])
		Returns centroid of 'box'
	R = flat_centerofmass(box ,/shift_origin [, /polar, /degrees])
		Returns coordinate of 'box' relative to its centroid
	R = flat_centerofmass(box , centroid [, /polar, /degrees])
		Positions box with its centroid matching 'centroid'
 INPUTS:
	If /polar NOT set:
	box	    array[2,2]; type: integer
			defines two corners of box in the form [ [x1,y1], [x2,y2] ]

	If /polar set:
	box	    array[2,2]; type: float
			limiting values in phase angle and radius of the wedge
			in the form [[angle1,radius1],[angle2,radius2]].
			Angle1 and angle2 are in radians between [-!pi,+!pi].
			The wedge runs counterclockwise from 'angle1' to 'angle2'
			over less than 180 degrees: either angle2 > angle1 with
			angle2-angle1 < !pi or angle2 < angle1 with
			angle2+2*!pi-angle1 < !pi. Always radius1 < radius2.
 OPTIONAL INPUT PARAMETERS:
	centroid    array[2]; type: float or integer
			position of centroid in rectangular (if /polar NOT set)
			or polar (if /polar set) coordinates. If this argument is specified
			then box is positioned with its centroid on this point.
	/polar	    if set, box and centroid is specified in polar coordinates
			(default: rectangular coordinates)
	/shift_origin
		    if set, then the centroid of 'box' is calculated. Then the coordinates
			of 'box' relative to this center are returned.
	/degrees    if set, in- and output angles are in degrees (default: radians)
 OUTPUTS:
	R	    array[2]
		    array[2,2]
 INCLUDE:
	@compile_opt.pro	    ; On error, return to caller
 CALLS: ***
	AngleRange, InitVar, IsType, ToRadians
 CALLED BY:
	even_light, qImage_TrackPeak, qView_TrackPeak, stardistance
 PROCEDURE:
	For a rectangular, constant density distribution the centroid is the
	geometric center of the box (the mean of the x and y coordinates of the corners).

	For a wedge shaped box the phase angle of the centroid is the geometric mean
	of the phase angles of the corners: phi(centroid) = (phi1+phi2)/2.
	For the radius, r(centroid)^2 = (r1^2+r2^)/2.

	If /shift_origin is set then the return values are the coordinates
	of 'box' relative to the centroid (i.e. the centroid coordinates are
	subtracted from the box coordinates

	If argument 'centroid' is specified then the centroid of 'box' is calculated.
	Then the box is positioned on 'centroid' such that the box centroid coincides
	with 'centroid'.
 MODIFICATION HISTORY:
	MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


flip_colors $SMEI/ucsd/gen/idl/environment/flip_colors.pro
[Previous] [Next]
 NAME:
	flip_colors
 PURPOSE:
	Reverse color table and/or fore- and background colors
 CATEGORY:
	Annoying
 CALLING SEQUENCE:
	PRO flip_colors, $
	    flip_bw	= flip_bw   , $
	    flip_ct	= flip_ct   , $
	    silent	= silent    , $
	    noflip_bw	= noflip_bw , $
	    noflip_ct	= noflip_ct
 INPUTS:
	(none)
 OPTIONAL INPUT PARAMETERS:
	/flip_bw
	/flip_ct
	/silent
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar, IsType, STRETCH, who_am_i
 CALLED BY:
	IDL_postop_vms, IDL_postop_win, RemoteView_Display2D, RemoteView_Display3D
	get_page, ipsv [1], ipsv [2], ipsv [3], losgeometry, miscfig, qGlitch_Show, set_page
	vu_get_page, vu_image, vu_insitucurve
 PROCEDURE:
 MODIFICATION HISTORY:
	MAR-2009, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


flt_clean $SMEI/ucsd/gen/idl/util/flt_clean.pro
[Previous] [Next]
 NAME:
	flt_clean
 PURPOSE:
	Check a specified format against a specified string.
 CALLING SEQUENCE:
	flt_clean, StrIn, FmtIn, StrOut, FmtOut, /nocheck
 INPUTS:
	StrIn	    character string (usually a record read from file)
	FmtIn	    format to be matched against string
 OPTIONAL INPUTS:
	/nocheck    see procedure
 OUTPUTS:
	StrOut	    reduced character string (see procedure)
	FmtOut	    reduced format; = '()' if the input format does not
		match the input string
 OPTIONAL OUTPUTS:
	StrCrumbs   string array containing the discarded portions of the
		input string
	NumCrumbs   # elements in StrCrumbs
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	flt_read
 PROCEDURE:
	The input format is searched for the character descriptor 'A'. All 'A'
	occurrences are removed from the format, and the corresponding
	substrings are removed from the input string.
	The reduced output format will contain only numeric format desciptors
	(I,F,D,E).
	If the input string does not adequately match the format,
	string '()' is returned as output format. This occurs if:
 >	If the string is longer or shorter than the length implied by the
	input format, i.e. the lengths must match exactly
 >	(Only if the keyword NoCheck is not set)
	If the substring for an 'A' descriptor contains a numerical digit (0..9)
 MODIFICATION HISTORY:
	MAY-1994, Paul Hick (ARC)
	SEP-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Bug fix. If format would end with a string (e.g. A3) then this would not
	    be cleaned up properly.


flt_format $SMEI/ucsd/gen/idl/util/flt_format.pro
[Previous] [Next]
 NAME:
	flt_format
 PURPOSE:
	Simplifies a format specication as produced by flt_string
 CATEGORY:
	gen/idl/util
 CALLING SEQUENCE:
	FUNCTION flt_format, InStr
 INPUTS:
	InStr	scalar; type: string
			any comma-separated list of format specifiers
			(the outer enclosing brackets are optional, but
			there should be no internal brackets)
 OUTPUTS:
	Result	scalar; type: string
			more compact list of format specifiers
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	where_common
 CALLED BY:
	flt_string, smei_star_cleanup, smei_star_writepnt
 RESTRICTIONS:
	The algorithm used tries to find recurring groups of format
	elements, but is somewhat heuristic.
 PROCEDURE:
	The format spec set up by flt_string only takes into account
	immediately neighbouring format specifies, i.e. instead
	of I4,I4,I4 the format will say 3I4. This function looks for
	more complicated repetitions in the flt_string format, e.g
	    str = 'I4,I2,F6.2,I2,F6.2,I3,I4,I2,F6.2,I2,F6.2,I3,I6,I1,I1'
	    print, flt_format(str)
	    2(I4,2(I2,F6.2),I3),I6,2I1
 MODIFICATION HISTORY:
	SEP-2004, Paul Hick (UCSD/CASS)
	JUL-2012, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Explicitly remove all whitespace from input string.
	    (input is still not modified)


flt_read $SMEI/ucsd/gen/idl/util/flt_read.pro
[Previous] [Next]
 NAME:
	flt_read
 PURPOSE:
	Read 2D float array from ASCII file
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	FUNCTION flt_read, InFile, Array	, $
	    nx		    = NX		, $
	    ny		    = NY		, $
	    exponent	    = exponent		, $
	    stopboost	    = stopboost 	, $
	    header	    = header		, $
	    atleast	    = atleast		, $
	    silent	    = silent		, $
	    NoCheck	    = NoCheck		, $
	    timer	    = timer		, $
	    fmts	    = fmts		, $
	    errormessage    = errormessage	, $
	    crumbs	    = Crumbs		, $
	    skipfmt	    = skipfmt		, $
	    comments	    = Comments		, $
	    usefstat	    = UseFSTAT		, $
	    double_precision= double_precision	, $
	    integer	    = integer		, $
	    delay	    = delay		, $
	    padvalue	    = padvalue		, $
	    xfora	    = xfora		, $
	    bad 	    = bad		, $
	    modify_format   = modify_format	, $
	    mask_string     = mask_string	, $
	    comment_char    = comment_char
 INPUTS:
	FILE	    char    name of ASCII file
 OPTIONAL INPUTS:
	nx=NX	    1st dimension of output array Array (if omitted
		    the number of elements in the 1st record is used)
	ny=NY	    2nd dimension of output array Array (if omitted NY is
		    set to the numbers of records in the file)
	atleast=atleast only records with at least 'atleast' numbers in them are
		    accepted
	/exponent   the records read from FILE are checked for exponents
		    (see flt_string procedure)
	/stopboost  only the first NY records are read
	/nocheck    reduces double-checking in flt_clean
	/skipfmt    analyze each record with flt_string, i.e. do NOT try
		    the accumulated formats used to read previous records
	mask_string=mask_string
		    scalar; type: string
			see flt_string.
	/modify_format
		    activates a call to flt_format in all calls to
		    flt_string. This shortens the format specifiers returned
		    in keyword fmts.

		    The reason for introducing this keyword is that there
		    apparently is a limit on the length of format statements.
		    E.g. if a file was written with format
			(I1,4F7.2,I4,183(I8,F7.2))
		    then flt_read without the /modify_format keyword will try
		    to read it with a really long format with 183 pairs of
		    I8,F7.2 in it. The long version of the format causes an
		    error when it is used in a read/write statement.
		    However the short version also has a problem when it is
		    used to read the whole file with a single read statement.

		    While
			readf, iu, format='(F6.1,F10.1,F7.2,F10.1,F7.2)', tmp
		    works correctly, the shorter version
			readf, iu, format='(F6.1,2(F10.1,F7.2))', tmp
		    results in an error (IDL 6.0 and 6.1beta on Linux).
		    This change in format is exactly what /modify_format
		    accomplishes. No error occurs when the latter format is
		    used to read the file record by record.
	silent=silent
		    scalar; type: integer; default: 0
		    controls display of informational messages.
		    Set silent=-1 to generate lots of messages
	/timer	    displays timer information (testing purposes only)
	/double_precision
		    if set then a double precision array is returned
			(default: single precision)
	comment_char=comment_char
		    scalar; type: string; default: ';'
		    lines starting with this character are skipped
 OUTPUTS:
	RtnVal	    0: some error occurred (check 'errormessage')
		    1: file properly read
	Array	    array[n,m]; type: float or double
		    2D array of floating point numbers
		    if something goes wrong Array = -1 is returned
	Crumbs	    string  2D array containing the character substrings
		    not converted into numbers
		    This array will be complete only if /skipfmt is set
		    (processing all records separately). If skipfmt is not
		    set only then usually only the crumbs for the first
		    record is returned.
	errormessage	= '' (null string) if the file is properly read
		    = string describing error is something goes wrong
 OPTIONAL OUTPUT PARAMETERS:
	NX,NY	    dimensions of Array
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	BadValue, InitVar, IsType, boost, destroyvar, do_file, flt_clean, flt_string
	gunzip_file, hide_env, stopwatch
 CALLED BY:
	FitKeplerOrbit, GetColors [2], GetColors [3], GetStarShape, InsituTimeSeries
	PlotEarthSkymap [3], PlotEarthSkymap [4], ReadSynopticMap
	RemoteView_CMEDensity, RemoteView_Colors, RemoteView_rgbo, SkyDriveIn, aurora
	cona, convert_swoops, cvgrd, dusan_earth, edit_smei, editsmei, even_light_figures
	getsmeisources, grayburst, img_read, jpl_test, laserjet, mpc_eph, mpc_eph_range
	nso_fe_read, nso_fe_start, pkt_read, pro ccd, smei_filepath, smei_frm_darkfit
	smei_frm_drive, smei_mkc3mask, smei_mkorb, smei_plot_timeseries, smeidb_mounted
	ulysses_passage, view3d, vu_header, vu_linecut, vu_losmap, vu_planarcut, vu_read
	vu_thomson_antifish, vu_thomson_hammer, wso_read
 COMMON BLOCKS:
	common flt_read_common, old_time
 RESTRICTIONS:
	For each record in the file all formats are tried that were established
	from preceding records. If the record can be read successfully with
	one of these formats than the result is accepted and flt_string is not called
	to analyze the record. This depends on IDL returning an error when a
	record does not fit the record. However, IDL is too tolerant about matching
	formats to strings resulting in wrong results, e.g.
	    x = fltarr(2)
	    reads, '123,456', format='(I2,1X,I3)', x
	    print, x
		12.0000  0.00000
	I.e. no error is generated !!! For uniformly formatted files this is
	usually not a problem. But for irregularly formatted files this pitfall is
	best avoided by setting the /skipfmt keyword.
 PROCEDURE:
 >	Empty records and records starting with a semi-colon (;) are ignored
 >	The function flt_string is used to convert a record read from FILE as
	a string into a floating point array
 >	Only the first NX numbers of each record are stored in subsequent rows
	of Array. NX is explicitly given as input or, if omitted, is set equal
	to the number of elements in the first record of FILE
 >	If less than NX numbers are found in a record, the corresponding
	row in Array is padded with zeros.
 >	A buffer array of size NX by NY is initialized before reading
	the file, where NY is explicitly input or set to # records in the file.
	If FILE contains more than NY records, records following record NY are
	appended to Array by the 'boost' procedure (this is slow for big arrays)
	unless the keyword /stopboost is set.
 MODIFICATION HISTORY:
	OCT-1992, Paul Hick (UCSD/CASS)
	FEB-1995, Paul Hick (UCSD/CASS)
	    Added the 'crumbs' option
	MAR-2000, Paul Hick (UCSD/CASS)
	    Added /double_precision keyword
	JAN-2002, Paul Hick (UCSD/CASS)
	    Added /status keyword
	NOV-2002, Paul Hick (UCSD/CASS)
	    Added padvalue keyword
	MAY-2003, Paul Hick (UCSD/CASS)
	    More strict interpretation of /skipfmt: if set then every record
	    is processed separately by flt_string. No attempt is made anymore to read
	    read more than one record at a time with a single format.
	JUN-2003, Paul Hick (UCSD/CASS)
	    Added option to process .gz files transparently
	OCT-2003, Paul Hick (UCSD/CASS)
	    Added 'bad' keyword.
	SEP-2004, Paul Hick (UCSD/CASS
	    Added /modify_format keyword.
	FEB-2007, Paul Hick (UCSD/CASS)
	    Minor change in processing of /xfora keyword
	    Added check for presense of Crumbs keyword before trying
	    a direct read (the direct read does not fill the Crumbs
	    array).
	AUG-2008, Paul Hick (UCSD/CASS)
	    Empty files now return an status code of zero, instead of
	    aborting.
	JUN-2011, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added keyword comment_char


flt_string $SMEI/ucsd/gen/idl/util/flt_string.pro
[Previous] [Next]
 NAME:
	flt_string
 PURPOSE:
	Extract numbers from string and put them in floating point array
 CATEGORY:
	String processing
 CALLING SEQUENCE:
	FUNCTION flt_string, INPUT		, $
	    exponent	    = exponent		, $
	    xfora	    = xfora		, $
	    double_precision= double_precision	, $
	    integer	    = integer		, $
	    strvec	    = StrVEC		, $
	    fmt 	    = fmt		, $
	    numfmt	    = numfmt		, $
	    lenfmt	    = lenfmt		, $
	    strcrumbs	    = strcrumbs 	, $
	    numcrumbs	    = numcrumbs 	, $
	    lencrumbs	    = lencrumbs 	, $
	    modify_format   = modify_format	, $
	    mask_string     = mask_string	, $
	    is_number	    = is_number 	, $
	    is_integer	    = is_integer	, $
	    positive_only   = positive_only
 INPUTS:
	INPUT		string (e.g. 89/1/12)
 OPTIONAL INPUTS:
	/exponent	if set and nonzero, exponentials of type 'D' and 'E' are
			also interpreted
	/double_precision
			if set then a double precision array is returned
			(default: single precision)
	/xfora
	/modify_format	if set, the format returned in 'fmt' is run
			through the function flt_format to
			shorten the format string.
	mask_string=mask_string
			scalar; type: string
			    string of '0' and '1' with '1' in chars that
			    are explicitly NOT part of a number.
			    (the char will be part of an A or X format in the
			    resulting format specifier returned in 'fmt')
	/is_number	test string; returns non-zero integer for strings that do not have
			    any chars that are not part of a number
			    (i.e. for which numcrumbs=0). The non-zero value
			    counts the numbers found in the string.
	/is_integer	test string; as /is_number, but tests for integers
	/positive_only	assumes that all numbers are positive
			    (effectively this ignores the minus character
			    "-" as not a valid part of the mantissa;
			    it can still occur in an exponent).
 OUTPUTS:
	RtnVal		floating array (e.g. [89,1,12])
	StrVEC		string array (array FltVEC before conversion to float)
	fmt		format string matching the input string
	numfmt		# valid numbers located in the input string
	lenfmt		# chars taken up by the numfmt numbers in the input string
	strcrumbs	string array with part of input string not translated
			into numbers
	numcrumbs	# elements in strcrumbs
	lencrumbs	# total length of all elements in strcrumbs summed
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	BadValue, InitVar, boost, destroyvar, flt_format
 CALLED BY:
	AngleUnits, PlotEarthSkymap [2], TimeSplit, allsky [1], allsky [2], allsky [3]
	allsky_f, cvsmei, fan_read, flt_read, getootyasources, grd_read, ipsg2_conv
	nagoya_glevel, nso_fe_read, physics_constant, qImage_cw_DrawEphem
	qImage_cw_smei_frm, qLine_Curve, qRemoteView_Time, qsmei_sky_pick, skyd_cat
	smei_base_testcase, smei_frm_drive, smei_getfile, smei_mkc3mask
	smei_orbit_stats, smeidb_mounted, test_dumbbell, test_td, tryg, txt_block_read
	vox_read, vu_check, vu_header, vu_quick_movie, vu_set_header_entry
	vu_set_time_entry, vu_timeseries, vu_vox_read, wso_write
 PROCEDURE:
	Checks each character against a list of valid characters.
	Processing characters sequentially going from first to last,
	the largest possible substrings representing valid numbers
	are extracted. Only integer exponents are accepted
	(if the keyword /exponent is set).
 MODIFICATION HISTORY:
	Written Jan 1989 by DMZ (ARC)
	Converted to V2 Dec 1990 by DMZ (ARC)
	OCT-1990, Paul Hick (ARC)
	    Expanded to accept exponentials,
	?-1993, Paul Hick (UCSD)
	    Added construction of format specifiers
	FEB-1995, Paul Hick (UCSD/CASS)
	    Added option to pull out the substrings not translated
	    into numbers
	MAR-2000, Paul Hick (UCSD/CASS)
	    Added /double_precision keyword
	JUL-2002, Paul Hick (UCSD/CASS)
	    Fixed problem dealing with formatting of peculiar exponents.
	    E.g. '(1.dat)' would return format '(D2.-4,A3)'.
	    Now it returns '(D3.0,A2)'
	MAY-2004, Paul Hick (UCSD/CASS)
	    Changed strmid(var,2,999) to strmid(var,2)
	    (extracts to end of string 'var')
	SEP-2004, Paul Hick (UCSD/CASS)
	    Added call to flt_format to shorten the format specifier
	    returned in fmt
	DEC-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added /positive_only keyword


forecast $SMEI/pro/tool/forecast.pro
[Previous] [Next]
 NAME:
	forecast
 PURPOSE:
	Updates all the plots and synoptic maps for the IPS forecast Web pages
	using the output files from the last run of the tomography program.
 CATEGORY:
	pro/tool
 CALLING SEQUENCE:
	PRO forecast, utnow, $
	    raw_files	    = raw_files     , $
	    nocorrelation   = nocorrelation , $
	    fast	    = fast	    , $
	    filter	    = filter	    , $
	    magnetic	    = magnetic	    , $
	    gif 	    = gif	    , $
	    png 	    = png	    , $
	    env_filter	    = env_filter    , $
	    nosave	    = nosave	    , $
	    ftp 	    = ftp	    , $
	    silent	    = silent	    , $
	    _extra	    = _extra
 INPUTS:
	utnow		current time as time structure or Carrington variable
			if not defined, it is set to the system time
 OPTIONAL INPUT PARAMETERS:
	/raw_files	process 'raw' tomography files, i.e. use files directly
			output by the tomography files in the $NAGOYA/slow/raw
			and $NAGOYA/fast/raw directories.
			By default, the processed files in the slow/final and
			fast/final directories are used.
	/nocorrelation	skips production of the fore- and aftcast correlation
			graphs. These take a long time to produce for the
			time-dependent tomography, and are usually created only
			once a day (when the tomography is run)
	/fast		processes ime-dependent tomography files
			(by default the corotating tomography files are processed)
	filter=filter	scalar; type: string
			    either 'nv3d' or 'nv3f';
			    overrides prefix value set by vu_type_insitu
	/magnetic	process magnetic field, instead of plasma
			    density and velocity
	/png, /gif	sets image format for output images (png is the default)
	/nosave 	suppresses output of graphics as GIF files
			    (used for debugging)
	env_filter=env_filter
			NOT SURE ANYMORE WHY THIS IS DONE
			scalar; type: string; default: none
			name of an env var to which the value of 'filter' is
			assigned.
	/ftp		OBSOLETE
			forces html files and images to be copied to a remote
			webserver (used to be cassfos02)
 OUTPUTS:
	(GIF files; HTML files)
 INCLUDE:
	@compile_opt.pro			    ; On error, return to caller
 CALLS: ***
	BadValue, Carrington, FILEPATH, GetFileSpec, InitVar, IsType, TimeGet, TimeOp
	TimeSystem, TimeUnit, big_body, destroyvar, forecast_cfg, forecast_ftp
	forecast_info, gridgen, hide_env, jpl_body, say, vu_earthskymap, vu_get, vu_gettime
	vu_insitu, vu_insitu_raw, vu_localskymap, vu_planarcut, vu_prefix, vu_remoteview
	vu_select, vu_solardisk, vu_synopticmap, vu_type_insitu, vu_type_skymap
	where_common
 CALLED BY:
	run_map
 PROCEDURE:
	The tomography data should be located in $NAGOYAslow. Output files
	(GIF files and updated HTML files) are written to $NAGOYA/slow/image
 MODIFICATION HISTORY:
	MAR-2000, Paul Hick (UCSD/CASS)
	JUL-2002, Paul Hick (UCSD/CASS)
	    Suppressed time axis on synoptic map when time-dependent tomography
	    files are processed.
	    Fixed a couple of problems related to processing of output from time-
	    dependent tomography. The identification of the time of the last
	    tomography run was wrong. The correlation plots now use e3 instead of
	    ea files.
	SEP-2002, Paul Hick (UCSD/CASS)
	    Adapted to accept magnetic field 'bb3d' files
	    Added /forcecd keyword to vu_select
	NOV-2002, Paul Hick (UCSD/CASS)
	    Added keyword /nowrap to one call of vu_gettime (calculating the
	    3D matrices for corotating tomography displays)
	APR-2003, Paul Hick (UCSD/CASS)
	    Completed switch to png files (gif still available through keyword /gif)
	JUL-2003, Paul Hick (UCSD/CASS)
	    Removed calculation of correlations from ea* and e3* files (this produced
	    the cast_insitu_****_v_c_n_c.gif images)
	AUG-2007, Paul Hick (UCSD/CASS)
	    Introduced Carrington calls (replacing arg_time)
	APR-2013, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Reorganized verbosity of all messages.
	    Removed /forcecd keyword everywhere (FindAllSubDirs now ignores this)


forecast_cfg $SMEI/pro/tool/forecast_cfg.pro
[Previous] [Next]
 NAME:
	forecast_cfg
 PURPOSE:
	Configuration routine for the IPS forecast web site
 CATEGORY:
	pro/tool
 CALLING SEQUENCE:
	FUNCTION forecast_cfg, kind, $
	    root	    = root	    , $
	    html	    = html	    , $
	    local2ut	    = local2ut	    , $
	    maxelo_fisheye  = maxelo_fisheye, $
	    degrees	    = degrees	    , $
	    round_time	    = round_time    , $
	    mmsec	    = mmsec	    , $
	    disk_dtime	    = disk_dtime    , $
	    scale_skymap    = scale_skymap  , $
	    crformat	    = CRformat	    , $
	    roi_offset	    = roi_offset    , $
	    insitu_delt     = insitu_delt   , $
	    insitu_tstep    = insitu_tstep  , $
	    insitu_trange   = insitu_trange , $
	    remote_volsize  = remote_volsize, $
	    remote_ngrid    = remote_ngrid  , $
	    remote_fovsize  = remote_fovsize, $
	    remote_location = remote_location,$
	    remote_color_v  = remote_color_v, $
	    remote_range_v  = remote_range_v, $
	    remote_opacity_v= remote_opacity_v,$
	    remote_opacity_power_v=remote_opacity_power_v,$
	    remote_color_n  = remote_color_n, $
	    remote_range_n  = remote_range_n, $
	    remote_opacity_n= remote_opacity_n,$
	    remote_opacity_power_n=remote_opacity_power_n,$
	    aftcast	    = aftcast	    , $
	    forecast	    = forecast	    , $
	    ylshow	    = ylshow	    , $
	    movie_delay     = movie_delay   , $
	    movie_skip	    = movie_skip    , $
	    movie_time	    = movie_time    , $
	    movie_nday	    = movie_nday    , $
	    movie_ut_extra  = movie_ut_extra, $
	    movie_trange    = movie_trange  , $
	    planarcut_break_n = planarcut_break_n, $
	    planarcut_break_v = planarcut_break_v, $
	    movie_dtime     = movie_dtime
 OPTIONAL INPUT PARAMETERS:
	Set only one keyword at at time:

	/root		return directory where all data are stored
			    (=$NAGOYA)
	/html		return root directory for IPS forecast web site
			    (=$SMEI/html)
	/local2ut	return offset between local time and UT
			    Usually 7 (taking daylight savings time into account)
	/maxelo_fisheye return max elongation for fish-eye plots
			    units (radians or degrees depend on setting /degrees)
	/round_time	return time unit for round-off of times
			    /mmsec NOT set: return value of TimeUnit
			    /mmsec set	  : returns # milli-seconds in time unit
	/disk_dtime	return time-offset used for disk maps
			    as a time difference structure
	/crformat	return format string for displaying Carrington times
	/remote_volsize return limits of volume for remote views (AU)
	/insitu_delt	return smoothing applied to s/c time series (days)
	/aftcast_dtime	return aftcast time offset in days
	/forecast_dtime return forecast time offset in days
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro	    ; On error, return to caller
 CALLS: ***
	BadValue, FILEPATH, InitVar, IsTime, TimeSet, TimeUnit, ToDegrees, big_eph, gridgen
	jpl_body
 CALLED BY:
	forecast, forecast_ice, forecast_info, forecast_movie, vu_update_marker
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2002, Paul Hick (UCSD/CASS)
	OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Automatic detection of offset local time with UT on Unix system
	    by spawning shell command data +%z (should return e.g. '-0700')


forecast_env $SMEI/pro/tool/forecast_env.pro
[Previous] [Next]
 NAME:
	forecast_env
 PURPOSE:
	Pick up env var for Nagoya IPS forecast
 CATEGORY:
	pro/tool
 CALLING SEQUENCE:
	PRO forecast_env, kind, magnetic=magnetic, prefixes, silent=silent
 INPUTS:
	Through env vars BB_PREFIX, BB_PREFIX_SLOW, BB_PREFIX_FAST
 OUTPUTS:
	prefixes
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	InitVar, destroyvar, say
 CALLED BY:
	run_map, run_mean, run_movie
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


forecast_ftp $SMEI/pro/tool/forecast_ftp.pro
[Previous] [Next]
 NAME:
	forecast_ftp
 PURPOSE:
	Uses ftp to copy files to cassfos02
 CATEGORY:
	WWW
 CALLING SEQUENCE:
	PRO forecast_ftp, kind, bin_file, asc_file, silent=silent
 INPUTS:
	kind		scalar; type: string
			    'slow' or 'fast'
 CALLS: ***
	FILEPATH, GetFileSpec, InitVar, SetFileSpec, boost, destroyvar, do_file, say
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	forecast, forecast_movie_cp
 PROCEDURE:
	Note that automatic ftp to cassfos02 needs to be set up with the
	appropriate entry into .netrc (ftp needs a username and password
	to access cassfos02)
 MODIFICATION HISTORY:
	APR-2001, Paul Hick (UCSD/CASS)
	AUG-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Removed 'cd' ftp-commands to remote directory, and switched to 'put'
	    commands for individual images instead of 'mput' for the whole bunch.


forecast_html $SMEI/pro/tool/forecast_html.pro
[Previous] [Next]
 NAME:
	forecast_html
 PURPOSE:
	Creates all the html files that drive the IPS forecast site
	(except title_top.html and splash.html)
 CATEGORY:
	WWW: html
 CALLING SEQUENCE:
	forecast_html, root, quick_refresh=quick_refresh, slow_refresh=slow_refresh
 INPUTS:
	dir	    scalar; type: string
			directory where the html files are stored
			If not specified then html files are created in
			    $smei/html/forecast in subdirecteries 'slow' and 'fast'.
 OPTIONAL INPUT PARAMETERS:
	quick_refresh=quick_refresh
		    scalar; type: integer; default: 300
			refresh rate applied to single images (hourly updates)
	slow_refresh=slow_refresh
		    scalar; type: integer; default: 300
			refresh rate applied to movies, aft- and forecast plots
 OUTPUTS:
	(updated html files are stored in 'root')
 CALLS: ***
	CheckDir, FILEPATH, FORECAST_HTML_IMAGE, FORECAST_HTML_INDEX, FORECAST_HTML_INFO
	FORECAST_HTML_LAUNCH, FORECAST_HTML_LEFTMENU, FORECAST_HTML_LEFTMENU_BLOCK
	FORECAST_HTML_LEFTMENU_HEADER, FORECAST_HTML_SPLIT, InitVar, IsType, TimeGet
	TimeSystem, boost, vu_type_insitu, vu_type_skymap, who_am_i
 PROCEDURE:
	So far we have 10 different types of displays.
	Seven of these are directly accessed from leftmenu.html
	The other three are indirectly accessed from the _info files.
	'label' is used to generate the necessary file names
	'title' is used as title in each html file.

	'sublabel' and 'subtitle' are 2D array with the first dim
	listing the data types (speed, density, brad and btang) and the
	2nd dim corresponding to a display type.

	Each of the split files fires up a pair of html files, each of which
	display some graphics. These is either a pair of IPS velocity and g-level,
	or a pair of solar wind velocity and density maps.

	For all of the individual graphics an html file loading the corresponding
	png or gif is made. For most (but not all) there is an html file loading a mng
	or gif animation.
 MODIFICATION HISTORY:
	SEP-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	May-2004, Susan Rappoport (UCSD/CASS; srappoport@ucsd.edu)
	    Fixed problem with width of left menu (now 250 pixels wide)
	    Added link to Solar System Space Weather page.
   Jul-2021, Matthew Bracamontes (UCSD/CASS; mtbracam@ucsd.edu)
       Updated links, STELab -> ISEE


forecast_ice $SMEI/pro/tool/forecast_ice.pro
[Previous] [Next]
 NAME:
	forecast_ice
 PURPOSE:
	Moves old output files from the tomography to a backup
	directory to avoid problems with the IDL findfile functions
	when lots of file accumulate in a directory.
 CATEGORY:
	pro/tool
 CALLING SEQUENCE:
	PRO forecast_ice, kind, ut=ut, delta_ut=delta_ut, create_dir=create_dir, silent=silent
 INPUTS:
	kind	    scalar; type: string
			'slow' or 'fast' for corotating and time-
			dependent tomography only
 OPTIONAL INPUT PARAMETERS:
	ut=ut	    scalar; type: float; default: TimeSystem(7)
		    array[1]; type: time structure
			current time as float Carrington time
			or time structure
	delta_ut=delta_ut
		    scalar; type: float
		    array[1]; type: time difference structure
			time difference with 'ut' in days
			or specified as time difference structure.
			files older than ut+delta_ut are
			moved out of the way. Note that
			delta_ut is a negative offset.
	/create_dir files are moved to a subdirectory 'ice'.
		    If this directory does not exist and this keyword
		    is set then the directory is created.
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	Carrington, CheckDir, FILEPATH, FindAllFiles, InitVar, IsTime, TimeOp, TimeSet
	TimeSystem, boost, destroyvar, do_file, forecast_cfg, vu_select
 CALLED BY:
	run_marker, run_mean
 RESTRICTIONS:
	File times are determined from their file names by running the
	file name through vu_select. This procedure expects to find
	a Carrington time in the file name in format '(F9.4)'.
 PROCEDURE:
	Subdirectories 'raw' and 'final' are checked.
 MODIFICATION HISTORY:
	SEP-2002, Paul Hick (UCSD/CASS)
	NOV-2002, Paul Hick (UCSD/CASS)
	    Added keyword /forcecd to FindAllFiles calls
	APR-2013, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Removed /forcecd (not used anymore)


forecast_info $SMEI/pro/tool/forecast_info.pro
[Previous] [Next]
 NAME:
	forecast_info
 PURPOSE:
	Use several template html files containing placeholders for several times, and
	replaces them with actual times. The resulting html pages contain information
	that goes with several of the plots used in the IPS forecast Web pages.
 CATEGORY:
	WWW: html
 CALLING SEQUENCE:
	PRO forecast_info, kind, dir, file, $
	    utnow   = utnow	, $
	    time    = time	, $
	    utnoon  = utnoon	, $
	    upto    = upto	, $
	    silent  = silent
 INPUTS:
	kind		scalar; type: string
			    'slow' or 'fast' for corotating or time-dependent tomography
			    respectively.
	dir		scalar; type: string
			    directory where the html info files are stored.
			    The procedure looks for the the templates in ./html.
	file		scalar; type: string
			    identifier for the html pages, e.g. 'earth_insitu_slow_v_n',
			    'synoptic_fast_v_n', etc. Note that 'kind' is a substring of 'file'
 OPTIONAL INPUT PARAMETERS:
	utnow=utnow	array[1]; time structure
			    the current time (usually the system time in UT)
	time=time	array[1]; time structure
			    last time at which tomography was run. Usually extracted
			    from the 1st record of a t3d file
	utnoon=utnoon	array[1]; time structure
			    time when it was noon a specific location on Earth.
			    Currently used in conjunction with the 'sky sweep' maps made
			    by vu_localskymap
 OUTPUTS:
	(updated html files are stored in 'dir')
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, InitVar, TimeGet, TimeOp, TimeSet, TimeUnit, forecast_cfg, hide_env
	txt_read, who_am_i
 CALLED BY:
	forecast
 RESTRICTIONS:
	The template must be located in a subdirectory 'html' of the directory where
	this procedure is located. If this directory does not exist then the directory
	'dir' specified as 1st argument is used.
 PROCEDURE:
	The template files have names 'file'.html.
	They contain placeholders of the type '(insert system time here)' corresponding
	to each of the time keywords. After being replaced by the values in the keywords
	the files are saved to disk as 'file'_info.html.
 MODIFICATION HISTORY:
	MAR-2000, Paul Hick (UCSD/CASS)
	AUG-2000, Paul Hick (UCSD/CASS)
	    Move the html template files to $SSW_SMEI/sys, and modified the
	    procedure to look in $SSW_SMEI/sys for the templates (if it is defined).
	JUL-2002, Paul Hick (UCSD/CASS)
	    Rather then looking for whole lines to replace, the procedure now looks
	    for substrings.
	SEP-2002, Paul Hick (UCSD/CASS)
	    Moved templates from ./html
	    Added capability to handle magnetic info files.
	APR-2004, Paul Hick (UCSD/CASS)
	    Fixed bug in call to get movie_time (TimeSet instead of TimeGet was used)


forecast_movie $SMEI/pro/tool/forecast_movie.pro
[Previous] [Next]
 NAME:
	forecast_movie
 PURPOSE:
	Updates movies for IPS forecast web site
 CATEGORY:
	WWW
 CALLING SEQUENCE:
	PRO forecast_movie, hdr, ff, $
	    filter	= filter    , $
	    ftp 	= ftp	    , $
	    magnetic	= magnetic  , $
	    synoptic	= synoptic  , $
	    skymap	= skymap    , $
	    skysweep	= skysweep  , $
	    insitu	= insitu    , $
	    remote	= remote    , $
	    solardisk	= solardisk , $
	    planarcut	= planarcut , $
	    fast	= fast	    , $
	    silent	= silent    , $
	    png 	= png	    , $
	    gif 	= gif	    , $
	    ut		= ut	    , $
	    nv_filter	= nv_filter , $
	    planets	= planets   , $
	    env_filter	= env_filter

 INPUTS:
	(none)
 OUTPUTS:
	(none)
 OPTIONAL INPUTS:
	/magnetic	    if set, make movies from magnetic field data (wson files)
				(default is to use 'nv3d' files
	/fast		    use time-dependent tomography files from
				$NAGOYA/fast (default: corotating tomography files
				from $NAGOYA/slow
	filter=filter	    explicitly sets the file name filter (overriding the defaults
				'nv3d' or 'wson'
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsType, TimeGet, TimeOp, TimeSystem, TimeUnit, big_body, forecast_cfg
	forecast_movie_cp, jpl_body, vu_movie, vu_prefix, vu_type_insitu
 CALLED BY:
	run_movie
 RESTRICTIONS:
	Can onLy be run on Linux
	idl_startup.pro needs to be run. This requires that the environment
	variable IDL_STARTUP is set.
 PROCEDURE:
	This is run as part of the cron job sync_daily_ips after new
	final (averaged) tomography files have been created.

 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS)
	SEP-2002, Paul Hick (UCSD/CASS)
	    Adapted to accept magnetic field 'bb3d' files
	    Added /forcecd keyword to the vu_movie calls that read files (to be passed
	    down to vu_select and eventually FindAllFiles).
	JUN-2003, Paul Hick (UCSD/CASS)
	    bb3d files are now called wson files
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Adapted to make movies of remoteviews with hcs embedded


forecast_movie_cp $SMEI/pro/tool/forecast_movie_cp.pro
[Previous] [Next]
 NAME:
	forecast_movie_cp
 PURPOSE:
 CALLING SEQUENCE:
	PRO forecast_movie_cp, kind, movie_file, htm_dir, ftp, silent=silent
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar, forecast_ftp
 CALLED BY:
	forecast_movie
 MODIFICATION HISTORY:
	SEP-2007, Paul Hick (UCSD/CASS)
	    Extracted from forecast_movie.pro


FrameMoments $SMEI/ucsd/sat/idl/toolbox/math/framemoments.pro
[Previous] [Next]
 NAME:
	FrameMoments
 PURPOSE:
	Calculate average and standard deviations sigma
 CATEGORY:
	Statistics
 CALLING SEQUENCE:
	PRO FrameMoments, Frames, Average, Sigma, sumwidth=SumWidth, exclude=Exclude, pixels=Pixels
 INPUTS:
	Frames	    3D-array, any type, but should be float to use !VALUES.F_NAN
			to indicate missing pixels.
			stack of 2D frames combined in 3D array; the last dimension counts
			the number of frames
			Frame elements set to the value !VALUES.F_NAN are ignored
 OPTIONAL INPUT PARAMETERS:
	sumWidth    scalar, type integer, default: 3. (single frame) or 1. (multiple frames)
			defines a box of sumwidth by sumwidth pixels
			(should be ODD; argument is passed to the IDL 'smooth' function).
	/exclude    if set, the statistical moment for each pixel in the Frames
			array is calculating, excluding the pixel itself
 OUTPUTS:
	Average, Sigma
		    arrays of same structure as Frames, type float
			mean, standard deviation
			If /exclude is not set all frames in the Average and Sigma
			arrays will be identical
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	ArrayLocation, SuperArray
 CALLED BY:
	Find2DGlitch
 PROCEDURE:
	For each pixel the statistical moments are calculated by summing over
	sumwidth^2 x (# frames) pixels.
	The summing needed to calculate the statistical moments is done using
	'total' (to sum over frames) and 'smooth' (to sum over sumwidth^2 pixels in each frame)
 MODIFICATION HISTORY:
	OCT-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


FUNCTION smeilatest lastorbit $SMEI/ucsd/camera/idl/toolbox/smei_mklatest.pro
[Previous] [Next]
 NAME:
	FUNCTION smeilatest, lastorbit
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	FINDLASTORB, GetFileSpec, InitVar, SMEILATEST, SMEI_MKLATEST, STRSPLIT, TimeSet, boost
	smei_coriolis, smei_sky, txt_read