[Previous]
[Next]
NAME:
F_ATAN
PURPOSE:
Shell around IDL's ATAN function to prevent the NaN's in the returned value. NaN's are set to 0.
PROJECT:
HESSI
CATEGORY:
UTIL
CALLING SEQUENCE:
ang = f_atan(x) or ang = f_atan(y,x)
INPUTS:
X - The tangent of the desired angle.
Y - An optional argument. If this argument is supplied, ATAN returns the angle
whose tangent is equal to Y/X. If both arguments are zero, the result is 0.
CALLED BY:
HSI_XY2ANNSEC_INDEX
EXAMPLE:
IDL> print,f_atan(1.) * !radeg
45.0000
IDL> print,f_atan(.3,.6)
0.463648
CALLS:
Function returns the angle (in radians) whose tangent is x, OUTPUT:, atan
or y/x
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
MODIFICATION HISTORY:
Written: 29-May-2002, kim.tolbert@gsfc.nasa.gov
[Previous]
[Next]
NAME:
F_ATIME
PURPOSE:
Changes time info from numbers into formatted strings
restricted to no more than 256 separate times.
For ATIME, put date information, Year, Month, Day, Hour, Minute, Sec
into ATIME format YY/MM/DD, HHMM:SS.XXX
CALLING SEQUENCE:
RESULT = F_ATIME(yr, month, dom, h, m, s [,/pub,/yohkoh])
= F_ATIME(tarr=tarr [,/pub,/yohkoh])
INPUTS:
YR - Year
MONTH - 1 to 12
DOM - Day of Month
H - hour
M - minute
S - second
OPTIONAL INPUTS:
TARR - 7xn array of time as integers,
The "standard" Yohkoh 7 element external representation
of time (HH,MM,SS,MSEC,DD,MM,YY)
/PUB - Publication format = "YY/MM/DD, HH:MM:SS.XXX"
/Yohkoh
- Yohkoh string format, e.g. '07-Mar-93 21:05:30.461'
/Y2K - If set, then the four digit year format is preserved.
CALLS: ***
gt_day [1], gt_day [2], gt_time [1], gt_time [2]
MODIFICATION HISTORY:
Written by Richard Schwartz for IDL Version 2, July 1992
Optional Yohkoh format, and tarr, April 1993
07-Feb-2002, William Thompson, added keyword Y2K
[Previous]
[Next]
PROJECT:
SDAC
NAME:
F_CROSSP
PURPOSE:
This function returns the Vector (Cross) product of vectors v1 and v2.
CATEGORY:
MATH, UTILITY, GEOMETRY
CALLING SEQUENCE:
Result = F_CROSSP(v1,v2)
CALLED BY:
BATSE_POINTING, DET_POINT, GRO_POINT, ORBIT_FILL
EXAMPLES:
yc=f_crossp(zc,xc)
INPUTS:
v1 = 3 element vector or n vector arrays, 3 x n format.
v2 = 3 element vector or n vector arrays, 3 x n format.
OUTPUTS:
Result = 3 element floating vector or 3 x n array.
RESTRICTIONS:
Vectors must have 3 elements or arrays must be 3 x n
PROCEDURE:
v1 X v2 = | i j k | = (b1c2 - b2c1)i+(c1a2-c2a1)j+(a1b2-a2b1)k
| a1 b1 c1 |
| a2 b2 c2 |
MODIFICATION HISTORY:
Written, DMS, Aug, 1983;
Mod. 06/22/95 by AES - renamed to f_crossp
Mod. 05/09/96 by RCJ. Added documentation.
CONTACT:
richard.schwartz@gsfc.nasa.gov
[Previous]
[Next]
PROJECT:
SDAC
NAME:
F_DIV
PURPOSE:
THIS FUNCTION RETURNS THE QUOTIENT WITH ZERO CHECKING.
CATEGORY:
MATH, NUMERICAL ANALYSIS, UTILITY
CALLING SEQUENCE:
Result = F_DIV( Numerator, Denominator)
CALLED BY:
AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], Accum [1], Accum [2], Array_Despike
BATSE_DEADTM, BATSE_FLARES_WEEK, BATSE_LAD_DRM, BATSE_SPEC_DRM, CLEAN_GOES
CNTRATE, COMPARE_SHUTTERS, CURVFIT [1], CURVFIT [2], DECOMPOSE_BATSE_DRM
DESPIKE_1D, DISCSC_PL, DISCSP_BANDS, EVAL_LINE_COMPLEX, Energy_res [1]
Energy_res [2], FGAUSSINT_FUNCT, FILTER_ATTEN, FIT_BACKGRND, FIX_CONT, FIX_CONT2
FIX_DISCSP, FIX_DISCSP2, F_LINE, F_NLINE, F_NUCLEAR, F_POW, GAUSSINTFIT, GAUSS_INTG
GET_HXRBS_FITS, GE_WINDOW [1], GOES_DEGLITCH, GRS_RESP
HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
HESSI FRAMEWORK TEMPLATE CLASS [2], HESSI FRAMEWORK TEMPLATE CLASS [3]
HESSI HSI_PILEUP CLASS, HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3]
HSI_ANNSEC_BPROJ_WEIGHT [1], HSI_ANNSEC_BPROJ_WEIGHT [2]
HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
HSI_CALIBEVENT_PROFILE [1], HSI_DECIM_CORRECTION [1]
HSI_DECIM_CORRECTION [2], HSI_DRM_MOD CLASS, HSI_DRM_MOD_CONTROL__DEFINE
HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_GET_DATA, HSI_GSMOOTH, HSI_HIST_GROUP
HSI_IMAGE_ERROR, HSI_MEM_SATO [1], HSI_MODUL_PATTERN_BPROJ, HSI_SCORE_BPROJ
HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
HSI_SPECTROGRAM_DECIM_TABLE, HSI_SPECTROGRAM_REDISTRIBUTE
HSI_SPECTRUM__DEFINE, HXFITS, HXRBS_DEGLITCH, HXT_CAL_DRM [1], HXT_CAL_DRM [2]
HXT_CAL_FIX [1], HXT_CAL_FIX [2], INTERPOL8, Load_sher, MAP_DISCLA2CONT
MAP_MATRIX, MCURVEFIT, MELD_DISCSP [1], MK_MER_CONT, NEAR_PC_RESP [1]
NEAR_PC_RESP [2], NEAR_PIN_RESP [1], NEAR_PIN_RESP [2], OCC_AVG, PARA_LIVETIME
PLOT_OCC_ONDAY, PULSE_SPREAD, RD_NEAR_PIN [1], RD_NEAR_PIN [2]
READ_HXRS_4_SPEX [1], READ_HXRS_4_SPEX [2], READ_HXRS_4_SPEX [3]
RUN_CURVEFIT [1], RUN_CURVEFIT [2], SPECTROGRAM CLASS DEFINITION
SPECTRUM CLASS DEFINITION, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_DATA_GENX [1], SPEX_DATA_GENX [2]
SPEX_DRM__DEFINE, SPEX_FITALG_GEN__DEFINE, SPEX_GEN__DEFINE
SPEX_PLOT_SAVED [1], SPEX_PLOT_SAVED [2], SPEX_PROC [1], SPEX_PROC [2]
SPEX_SAVE_DATA [1], SPEX_SAVE_DATA [2], SPEX_THISTORY [1], SPEX_THISTORY [2]
SPEX__DEFINE, SSW_REBIN, Shers_load [1], TGRS_LIVETIME [1], TGRS_LIVETIME [2]
countsmod_plot [1], countsmod_plot [2], deriv_lud, drm_4_spex [1]
drm_4_spex [2], edge_products, energy_res class, f_pder [1], f_pder [2]
filter_cmpnd, get_conversion [1], get_conversion [2], help_merge [1]
help_merge [2], hsi_calib_ev2vis, hsi_ls_amp_pha_ctr, hsi_ls_sin_cos
hsi_phz_stacker, hsi_pixon_residuals, hsi_rm_interp_fit
hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
hsi_spectrogram__define [2], hsi_spectrogram__define [3]
hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1], mark_intervals
plotman_zoom, rd_wbs_pha [1], rd_wbs_pha [2], read_batse_4_spex [1]
read_batse_4_spex [2], read_hessi_4_spex [1], read_hessi_4_spex [2]
read_hessi_fits_4_spex [1], read_hessi_fits_4_spex [2]
read_hirex_4_spex [1], read_hirex_4_spex [2], read_smm_4_spex [1]
read_smm_4_spex [2], read_yohkoh_4_spex [1], read_yohkoh_4_spex [2]
spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4], spectral_ratio [1]
spectral_ratio [2], spex_bk__define, spex_delete [1], spex_delete [2]
spex_hessi_image__define, spex_hold [1], spex_hold [2], spex_intervals [1]
spex_intervals [2], spex_merge [1], spex_merge [2], spex_source [1]
spex_source [2], spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3]
spex_spec_plot [4], ssw_rebin_assign, ssw_rebinner
EXAMPLES:
count_sec = f_div( total(counts,1) , delta_t )
count_sec_prm = f_div( count_sec , 1.- f_div(dead_channel # counts,delta_t) )
INPUTS:
NUMERATOR - dividend in a quotient
DENOMINATOR - divisor in a quotient
KEYWORDS:
DEFAULT - if DENOMINATOR is zero, value is set to 0.0 or to DEFAULT. (INPUT)
PROCEDURE:
The divisor is scanned for zeroes which are excluded from the quotient.
The value for those elements is 0.0 or the DEFAULT.
RESTRICTIONS:
Real numbers only.
CALLS: ***
EXIST
COMMON BLOCKS:
None.
MODIFICATION HISTORY:
mod, 22-dec-93, ras, returns vector if numerator or denominator are vectors and other scalar
ras, 17-jun-94 renamed div to f_div
ras, 14-oct-94, liberal use of temporary
Version 4, richard.schwartz@gsfc.nasa.gov, 7-sep-1997, more documentation
Version 5, richard.schwartz@gsfc.nasa.gov, 26-jul-2002, made the division work like
IDL's division operator. The size of the quotient follows the size of the normal
division operator. Previously, the size of the quotient was the same as the size of
the denominator.
22-jan-2003, richard.schwartz@gsfc.nasa.gov, return DENOMINATOR to original values
if changed.
[Previous]
[Next]
NAME:
F_FORMAT
PURPOSE:
Choose a nice floating format for displaying an array of REAL data.
EXPLANATION:
Called by TVLIST, IMLIST.
CALLING SEQUENCE:
fmt = F_FORMAT( minval, maxval, factor, [ length ] )
INPUTS:
MINVAL - REAL scalar giving the minimum value of an array of numbers
for which one desires a nice format.
MAXVAL - REAL scalar giving maximum value in array of numbers
OPTIONAL INPUT:
LENGTH - length of the output F format (default = 5)
must be an integer scalar > 2
OUTPUT:
FMT - an F or I format string, e.g. 'F5.1'
FACTOR - factor of 10 by which to multiply array of numbers to achieve
a pretty display using format FMT.
CALLED BY:
IMLIST
EXAMPLE:
Find a nice format to print an array of numbers with a minimum of 5.2e-3
and a maximum of 4.2e-2.
IDL> fmt = F_FORMAT( 5.2e-3, 4.2e-2, factor )
yields fmt = '(F5.2)' and factor = .01, i.e. the array can be displayed
with a F5.2 format after multiplication by 100.
REVISION HISTORY:
Written W. Landsman December 1988
Deal with factors < 1. August 1991
Deal with factors < 1. *and* a large range October 1992
Now returns In format rather than Fn.0 February, 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
PROJECT:
SDAC
NAME:
F_GAUSS_INTG
PURPOSE:
This function returns the sum of a Gaussian and 2nd order polynomial.
CATEGORY:
E2 - CURVE AND SURFACE FITTING.
CALLS: ***
GAUSS_INTG
CALLING SEQUENCE:
out = F_GAUSS_INTG(X,A)
CALLED BY:
BATSE_SPEC_DRM, F_LINE, F_NLINE
EXAMPLES:
if a(4+i*3) ne 0.0 then line(0) =line + $
f_gauss_intg( x, [ f_div( a(4+i*3)/sqrt(2*!pi), a(6+i*3)), a(5+i*3+ w2 )] )
INPUTS:
X = VALUES OF INDEPENDENT VARIABLE, 2 X N, LO AND HI EDGES
A = PARAMETERS OF EQUATION DESCRIBED BELOW.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
COMMON BLOCKS:
NONE.
SIDE EFFECTS:
NONE.
RESTRICTIONS:
NONE.
PROCEDURE:
THIS GAUSSIAN IS EVALUATED BY INTEGRATING A GAUSSIAN OVER
AN INTERVAL AND DIVIDING BY THE INTERVAL WIDTH.
IT USES THE FUNCTION GAUSSINT TO INTEGRATE THE GAUSSIAN.
F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2
Z = (X-A(1))/A(2)
F IS INTEGRATED FROM X_LO TO X_HI
MODIFICATION HISTORY:
changed gaussian to integrating gaussian over an interval
RAS, 21-MAR-95
CONTACT:
richard.schwartz@gsfc.nasa.gov
[Previous]
[Next]
PROJECT:
SDAC
NAME: f_pder
PURPOSE:
This function returns the partial derivative of a function.
CALLING SEQUENCE: result = f_pder( funct=function_name, param=a, data=x, npar=n )
CALLED BY:
DECOMPOSE_BATSE_DRM, FGAUSSINT_FUNCT, GAUSSINTFIT, GAUSS_INTG, funct1 [1]
funct1 [2]
EXAMPLES:
pder(*,i)=f_pder(funct=function_name, par=a(0:*), data=x, n=i)
pder(*,i)= f_pder(funct=f_model, par=a, data=x, n=free(i))
pder(*,1) = f_pder( funct='f_gauss_intg',param=a,data=xin,npar=1)
KEYWORD INPUTS:
funct - function name, string
parameters - A vector of parameter values required by the function.
data_points - input to the function, defined on points (M values)
or edges (2xM values low and high)
npar - differentiate with respect to PARAMETERS(NPAR)
OPTIONAL INPUTS:
OUTPUTS:
function returns the computed partial derivative at each data point
OPTIONAL OUTPUTS:
PROCEDURE:
uses call_function to generate functional values + and - .1% of parameter
then calculates this partial derivative arithmetically
CALLS: ***
F_DIV
COMMON BLOCKS:
RESTRICTIONS:
MODIFICATION HISTORY:
ras, 23-mar-95, added documentation
CONTACT:
richard.schwartz@gsfc.nasa.gov
[Previous]
[Next]
PROJECT:
SDAC
NAME: f_pder
PURPOSE:
This function returns the partial derivative of a function.
CALLING SEQUENCE: result = f_pder( funct=function_name, param=a, data=x, npar=n )
CALLED BY:
DECOMPOSE_BATSE_DRM, FGAUSSINT_FUNCT, GAUSSINTFIT, GAUSS_INTG, funct1 [1]
funct1 [2]
EXAMPLES:
pder(*,i)=f_pder(funct=function_name, par=a(0:*), data=x, n=i)
pder(*,i)= f_pder(funct=f_model, par=a, data=x, n=free(i))
pder(*,1) = f_pder( funct='f_gauss_intg',param=a,data=xin,npar=1)
KEYWORD INPUTS:
funct - function name, string
parameters - A vector of parameter values required by the function.
data_points - input to the function, defined on points (M values)
or edges (2xM values low and high)
npar - differentiate with respect to PARAMETERS(NPAR)
OPTIONAL INPUTS:
OUTPUTS:
function returns the computed partial derivative at each data point
OPTIONAL OUTPUTS:
PROCEDURE:
uses call_function to generate functional values + and - .1% of parameter
then calculates this partial derivative arithmetically
CALLS: ***
F_DIV
COMMON BLOCKS:
RESTRICTIONS:
MODIFICATION HISTORY:
ras, 23-mar-95, added documentation
CONTACT:
richard.schwartz@gsfc.nasa.gov
[Previous]
[Next]
PROJECT:
SDAC
NAME: F_USE_WIDGET
PURPOSE: This function provides global control over allowed use of widget interfaces.
CATEGORY: WIDGETS
CALLING SEQUENCE:
res =f_use_widget()
res =f_use_widget(0, /use) ;enables widgets if possible
res =f_use_widget(0, /nouse) ;disables widgets, f_use_widget will return 0
res =f_use_widget(0, /test) ;returns 1 if widgets available, 0 otherwise
KEYWORD INPUTS:
USE- If set,enables widgets if possible.
NOUSE- If set,disables widgets, f_use_widget will return 0.
TEST- If set,function returns 1 if widgets available, 0 otherwise.
CONTINUE- If set, allow continue on widget use error.
Outputs:
None
Function returns 1 if widgets can be used, 0 otherwise.
CALLS: ***
FCHECK, HAVE_WINDOWS [1], HAVE_WINDOWS [2]
CALLED BY:
CAL_SHER, FILE_SEARCHER [1], FILE_SEARCHER [2], Model_components [1]
Model_components [2], POINT [1], SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
SPEX_SAVE_DATA [1], SPEX_SAVE_DATA [2], point [2], setup_spex [1]
setup_spex [2], spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4]
spex_intervals [1], spex_intervals [2], spex_merge_control [1]
spex_merge_control [2], spex_spec_plot [1], spex_spec_plot [2]
spex_spec_plot [3], spex_spec_plot [4]
COMMON BLOCKS:
f_use_widg_com
MODIFICATION HISTORY:
ras, 10-jun-94
CONTACT:
richard.schwartz@gsfc.nasa.gov
Version 2, richard.schwartz@gsfc.nasa.gov, utilize have_windows()
[Previous]
[Next]
NAME:
FACTOR
PURPOSE:
Find prime factors of a given number.
CATEGORY:
CALLING SEQUENCE:
factor, x, p, n
INPUTS:
x = Number to factor (>1). in
KEYWORD PARAMETERS:
Keywords:
/QUIET means do not print factors.
/DEBUG Means list steps as they happen.
/TRY Go beyond 20000 primes.
OUTPUTS:
p = Array of prime numbers. out
n = Count of each element of p. out
CALLS: ***
PRIME, PRINT_FACT, SPC
CALLED BY:
FILTER_IMAGE
COMMON BLOCKS:
NOTES:
Note: see also prime, numfactors, print_fact.
MODIFICATION HISTORY:
R. Sterner. 4 Oct, 1988.
RES 25 Oct, 1990 --- converted to IDL V2.
R. Sterner, 1999 Jun 30 --- Improved (faster, bigger).
R. Sterner, 1999 Jul 7 --- Bigger values (used unsigned).
R. Sterner, 1999 Jul 9 --- Tried to make backward compatable.
R. Sterner, 2000 Jan 06 --- Fixed to ignore non-positive numbers.
Johns Hopkins University Applied Physics Laboratory.
Copyright (C) 1988, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FAKE_POINT_STC()
PURPOSE:
Create a fake pointing structure for IMAGE_TOOL to use
EXPLANATION:
CALLING SEQUENCE:
Result = fake_point_stc()
INPUTS:
None required.
OPTIONAL INPUTS:
P_MODE - Pointing mode; valid values are -1, 0, and 1. Default: 0
OUTPUTS:
RESULT - Pointing structure suitable for use by IMAGE_TOOL. It has the
following tags:
INSTRUME - Code specifying the instrument; e.g., 'C' for CDS
G_LABEL - Generic label for the pointing; e.g., 'RASTER'
X_LABEL - Label for X coordinate of pointing; e.g., 'INS_X'
Y_LABEL - Label for Y coordinate of pointing; e.g., 'INS_Y'
DATE_OBS - Date/time of beginning of observation, in TAI format
DO_POINTING- An integer of value 0 or 1 indicating whether pointing
should be handled at the planning level (i.e., by
IMAGE_TOOL); default is set to 1.
N_POINTINGS- Number of pointings to be performed by IMAGE_TOOL
POINTINGS - A structure array (with N_POINTINGS elements) of type
"DETAIL_POINT" to be handled by IMAGE_TOOL. It has
the following tags:
POINT_ID - A string scalar for pointing ID
INS_X - X coordinate of pointing area center in arcs
INS_Y - Y coordinate of pointing area center in arcs
WIDTH - Area width (E/W extent) in arcsec
HEIGHT - Area height (N/S extent) in arcsec
OFF_LIMB - An interger with value 1 or 0 indicating
whether or not the pointing area should
be off limb
N_RASTERS - Number of rasters for each pointing (this is
irrelevant to the SUMER)
RASTERS - A structure array (N_RASTERS-element) of type
"RASTER_POINT" that contains raster size and pointing
information (this is irrelevant to the SUMER). It has
the following tags:
POINTING - Pointing handling code; valis
values are: 1, 0, and -1
INS_X - Together with INS_Y, the pointing to use
when user-supplied values are not
allowed. Only valid when POINTING=0
(absolute) or POINTING=-1 (relative to
1st raster).
INS_Y - ...
WIDTH - Width (E/W extent) of the raster, in arcs
HEIGHT - Height (N/S extent) of the raster, in arcs
Note: For the case of CDS, pointings.width, pointings.height,
pointings.ins_x, and pointings.ins_y should match the first
raster's rasters.width, rasters.height, rasters.ins_x, and
rasters.ins_y, respectively.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
N_POINTINGS - Number of pointing areas; default: 4
N_RASTERS - Number of rasters in each pointing area; default: 6
CALLS: ***
DPRINT, GET_UTC, MK_POINT_STC, UTC2TAI
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written March 27, 1995, Liyun Wang, NASA/GSFC
MODIFICATION HISTORY:
Version 1, created, Liyun Wang, NASA/GSFC, March 27, 1995
VERSION:
Version 1, March 27, 1995
[Previous]
[Next]
Project : SOHO - CDS
Name : FASTFIT
Purpose : Least-squares fit of linear function without error analysis
Explanation : Fits a linear function to a series of data points via a
least-squares technique.
This routine differs from FITTER in that no error analysis is
performed, and the correlation matrix is not calculated.
Use : FASTFIT, X, Y, FDER, PARAM
Inputs : X = Positions.
Y = Data values.
FDER = Array of partial derivatives of fitted function.
This array will have the dimensions: FDER(
N_ELEMENTS(X) , N_ELEMENTS(PARAM) )
Opt. Inputs : None.
Outputs : PARAM = Returned parameters of fit.
Opt. Outputs: None.
Keywords : POISSON = If set, then a Poisson error distribution is assumed,
and the weights are set accordingly to 1/Y.
ERROR = Array of errors. The weights are set accordingly to
1/ERROR^2. Overrides POISSON.
WEIGHT = Array of weights to use in fitting. Overrides
POISSON and ERROR.
Calls : ***
TRIM
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities, Curve_Fitting
Prev. Hist. : William Thompson, June 1991, modified to use keywords.
Written : William Thompson, GSFC, June 1991
Modified : Version 1, William Thompson, GSFC, 9 January 1995
Incorporated into CDS library
Version : Version 1, 9 January 1995
[Previous]
[Next]
Project : YOHKOH-BCS
Name : FBLUE
Purpose : Compute 2 component gaussian where one is blueshifted
Explanation : Gaussian is sum of 2 gaussians in which
width of blueshifted component is proportional to blueshift
velocity.
Category : fitting
Syntax : f=fblue(x,a,pder)
Inputs : x = dependent variable
a = background + gaussian coefficients such that,
f = a(0)+a(1)*x+a(2)*x^2+a(3)*exp -[(x-a(4))/a(5)]^2 +
a(6)*exp -[(x-a(4)+a(7))/fac*a(7)]^2
Outputs : f = 2 component gaussian
Opt Outputs : pder = partial derivatives wrt 'a'
Keywords : extra = extra optional variable in which user can return
miscellaneous information.
Common : FBLUE - contains proportionality constant between
Doppler width of blueshifted component and blueshift velocity
--> width=fac*blueshift
Restrictions: None.
Side effects: None.
History : Version 1, 17-July-1993, D M Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : YOHKOH-BCS
Name : FBLUE_FIT
Purpose : Fit double gaussian + quadratic using a blueshift model
Explanation:
Category : fitting
Syntax : yfit = fblue_fit(x,y,a,fac=fac)
Inputs : y = data to fit
x = bin or wavelength
Outputs : yfit, a = fitted function + parameters
yfit = a(0)+a(1)*x+a(2)*x^2+a(3)*exp -[(x-a(4))/a(5)]^2 +
a(6)*exp -[(x-a(4)+a(7))/f*a(7)]^2
Opt. Outputs: sigmaa = sigma errors
Keywords : weights = data weights
nfree = number of free parameters
chi2 = chi^2
last = set to use input 'a' values as starting values
fixp = indicies of parameters to fix
fac = doppler broadening = fac * blueshift [def=1]
CALLED BY:
FIT_SPEC
Restrictions: Input spectrum must at least look asymmetric
CALLS: ***
FUNCT_FIT, GUESS_FIT_PAR
Side effects: None
History : Version 1, 17-July-1993, D M Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : SDAC
Name : FCHECK
Purpose : This functions checks sets a non-existent variable
to its default values.
Category : GEN
Explanation : The variable is checked to see if it is defined,
if it's not defined it is set to the given
default. The ultimate default value is 0.
Use :
Inputs : P1 - The variable to be checked for existence.
If P1 does not exist, then it is set to
to P2 or 0 if P2 does not exist.
Opt. Inputs : None
Outputs : None
Opt. Outputs: None
Keywords :
Calls : None
CALLED BY:
ANYTIM_REPORT, AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], BATSE_CRAB_RESP
BATSE_FLARES_WEEK, BATSE_LAD_DRM, BATSE_ON, BATSE_SPEC_DRM, BAT_MERGE
CALIBRATE [1], CH_SCALE, CLEAN_GOES, CONVERT_2_STREAM, Create_update_tar, DATPLOT
DECOMPOSE_BATSE_DRM, DEFAULTS, DELTA_CONTROL, DIFF_DRM, DISCLA_EDGES, DISCP_RESP
FAST_RATIO, FCOLOR [1], FDBREAD, FIT_BACKGRND, FLARE_XRAY_MODEL, FLUORESCENCE, FSOC
F_BPOW, F_USE_WIDGET, Fits_spectra [1], Fits_spectra [2], GD, GET_DISCSP511
GET_GDFILE, GET_OCC_ONDAY, GET_SPEC_GAIN, GE_WINDOW [1], GOES_CHIANTI_TEM
GOES_MEWE_TEM, GOES_TF, GOES_TF_COEFF, GOES_TRANSFER, GRS_EXTRACT, GRS_SPEFF
HESSI BINNED EVENTLIST CLASS DEFINITION
HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
HESSI CALIBRATED EVENTLIST CLASS DEFINITION [2]
HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HESSI Packet to EventList
HESSI_ATTENUATOR_SPECTRA, HESSI_FILTERS, HSI_ANNSEC_BPROJ [1]
HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_BPROJ_WEIGHT_MAP [1]
HSI_ANNSEC_BPROJ_WEIGHT_MAP [2], HSI_APP100_UNPACK, HSI_APP100_UNPACK_TIME
HSI_CSPECTRUM_DIST, HSI_HIST_GROUP, HSI_LOC_FILE, HSI_MAP2GAUSSIANS
HSI_MK_PACKETHEADER, HSI_RD_PACKET_TIMES, HSI_SCORE2FILE
HSI_SPECTROGRAMACCBIN [5], HSI_SPECTROGRAMCHAN_OVERLAP_FIX
HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE
HSI_SPECTRUM__DEFINE, HSI_SRM__DEFINE, HXT_CAL_FIX [1], HXT_CAL_FIX [2]
LAD_PHA_EDGES, LAD_RESP, LOCAL_DIFFS, MERGE_DISCSP_HKG_OCC, MK_DISCSP_CAL
Model_components [1], Model_components [2], NEAR_PIN_RESP [1]
NEAR_PIN_RESP [2], NOFILL_ARE, OCC_AVG, OPLOT_DIFF, OP_COM [1], OP_COM [2]
OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], PLOTBATSE, PLOTBATSE_QL, PLOT_DIFF
PLOT_FLARE, PLOT_GRSPCH, PLOT_GRSPCL, PLOT_GRSPHH, PLOT_GRSPHL, PLOT_HXSPC
PLOT_HXSPH, PLOT_OCCS, PLOT_OCCS_RES, PLOT_OCC_ONDAY, PL_SCALE, POINT [1], READQUAL
READ_DISCLA, READ_DISCLA_FITS, READ_STTE, RESOLVE_NEW_OBS, RESTORE_OVERFLOW
ROUTINE_NAME [1], RUN_CURVEFIT [1], RUN_CURVEFIT [2], SETUP_BATSE
SETUP_BATSE_ARRAYS, SET_FUNCTION_COM, SET_PENDLETON, SET_UTPLOT [1]
SET_UTPLOT [2], SLED, SNU, SPECTRA2FITS, SPECTROGRAM CLASS DEFINITION
SPECTRUM CLASS DEFINITION, SPEC_SENSITIVITY, SPEX_COMMONS [2]
SPEX_COMMONS [4], SPEX_DATA_GENX [1], SPEX_DATA_GENX [2], SPEX_ENV [2]
SPEX_ENV [4], SPEX_ENV [5], SPEX_HANDLES [1], SPEX_HANDLES [2]
SPEX_PLOT_SAVED [1], SPEX_PLOT_SAVED [2], SPEX_PROC [1], SPEX_PROC [2]
SPEX_RUN_CURVEFIT [1], SPEX_RUN_CURVEFIT [2], SPEX_THISTORY [1]
SPEX_THISTORY [2], SPFDPLOT_GRS, SPFDPLOT_HXS, SPPLOT_GRS, SPPLOT_HXS
Shers_load [1], TEST_CAL, TIMESTAMP, USERLABEL, UTPLOT [1], UTPLOT [2], UTPLOT [3]
UTPLOT [4], UTPLOT [5], Vlth, WRITE_FDB, XDEVICE, XR_RD_ABUNDANCE
batse_file_search [1], batse_file_search [2]
ch_scale scale xyoutsxyouts xcorr xcorr, drm_4_spex [1], drm_4_spex [2]
drm_correct_albedo, fcolor [2], fcount_rate [1], fcount_rate [2], fit_comp_kw
function_counts2photons, get_slider, help_merge [1], help_merge [2]
hessi_build_srm, hessi_correct_pileup [1], hessi_display_diag
hessi_display_srm, hessi_drm_4image, hsi_chan_ranges, hsi_default_resolutions
hsi_default_tailfracs, hsi_find_pli, hsi_get_e_edges [1], hsi_lambda_vs_t
hsi_livecorr_event, hsi_matmult, hsi_remake_gains, hsi_remake_lambda
hsi_remake_resol, hsi_remake_tailfrac, hsi_rm_interp_calc, hsi_rm_interp_rows
hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
hsi_spectrogram__define [2], hsi_spectrogram__define [3]
hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
hsi_spectrum__filewrite, hsi_subdivide_bins, hxrbs_response
inv_counts2electrons, inv_counts2photons, make_goes_chianti_response [1]
make_goes_chianti_response [2], make_goes_chianti_response [3]
make_goes_chianti_response [4], option_changer [1], option_changer [2]
option_toggle [1], option_toggle [2], other_filters [1], other_filters [2]
out_spectra_4_designer, pl_scale d xcorr xcorr ycorrycorr, plotman
plott_hi_sum, plott_low_sum, plott_med1_sum, plott_med2_sum, point [2], popup_menu
printx [1], printx [2], rd_wbs_pha [1], rd_wbs_pha [2], read_4_spex [1]
read_4_spex [2], read_batse_4_spex [1], read_batse_4_spex [2]
read_yohkoh_4_spex [1], read_yohkoh_4_spex [2], select_widg, set_field
setup_spex [1], setup_spex [2], spec_plot [1], spec_plot [2], spec_plot [3]
spec_plot [4], spex_batse_preview [1], spex_batse_preview [2]
spex_current [1], spex_current [2], spex_delete [1], spex_delete [2]
spex_evnt [1], spex_evnt [2], spex_hold [1], spex_hold [2], spex_intervals [1]
spex_intervals [2], spex_merge [1], spex_merge [2], spex_merge_control [1]
spex_merge_control [2], spex_source [1], spex_source [2], spex_spec_plot [1]
spex_spec_plot [2], spex_spec_plot [3], spex_spec_plot [4], t_utplot [1]
t_utplot [2], wbs_response [1], wbs_response [2], where_are [1], where_are [2]
wrt_rate_ext
Common : None
Restrictions:
Side effects: None.
Prev. Hist :
First written by RAS, 1987
Modified :
Version 2, RAS, 16-Nov-1989
Version 3, RAS, 5-Feb-1997
[Previous]
[Next]
PROJECT:
SDAC
NAME:
FCOLOR
PURPOSE:
This function is used with LINECOLORS.PRO for defaults if the device does
not support colors.
CALLING SEQUENCE
color = fcolor(icolor)
CALLED BY:
CAL_SHER, FS_ARCHIVE_DRAW, QL_DAY_PLOT, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_FLASH [1], SPEX_FLASH [2]
SPEX_PROC [1], SPEX_PROC [2], SPEX_THISTORY [1], SPEX_THISTORY [2], TIMESTAMP
USERLABEL, VERT_LINE, countsmod_plot [1], countsmod_plot [2], rd_sxs_pha [1]
rd_sxs_pha [2], read_yohkoh_4_spex [1], read_yohkoh_4_spex [2], spec_plot [1]
spec_plot [2], spec_plot [3], spec_plot [4], spex_intervals [1]
spex_intervals [2], spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3]
spex_spec_plot [4]
EXAMPLES:
oplot, archive_sec, yy, psym=10, color=fcolor(5)
xyouts, nx1lab, ylab, 'N', /normal, chars = ch_scale(.8,/xy), col=fcolor(9)
CALLS: ***
CHECKVAR [1], FCHECK, checkvar [2]
INPUTS:
icolor - the linecolor index, i.e. 5 is yellow
COMMON BLOCKS:
common fcolor_ps, pscolor - used to communicate ps color state
with ps.pro
HISTORY:
Written by: RAS, ~1991.
CONTACT:
richard.schwartz@gsfc.nasa.gov
[Previous]
[Next]
NAME:
FDECOMP
PURPOSE:
Routine to decompose file name(s) for any operating system. V5.3 or later
CALLING SEQUENCE:
FDECOMP, filename, disk, dir, name, qual, version, [OSFamily = ]
INPUT:
filename - string file name(s), scalar or vector
OUTPUTS:
All the output parameters will have the same number of elements as
input filename
disk - disk name, always '' on a Unix machine, scalar or vector string
dir - directory name, scalar or vector string
name - file name, scalar or vector string
qual - qualifier, set equal to the characters beyond the last "."
version - version number, always '' on a non-VMS machine, scalar string
OPTIONAL INPUT KEYWORD:
OSFamily - one of the four scalar strings specifying the operating
system: 'vms','Windows','MacOS' or 'unix'. If not supplied,
then !VERSION.OS_FAMILY is used to determine the OS.
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
CALLED BY:
CONCAT4DOS [1], CONCAT4DOS [2], CREATE_STRUCT [1], CREATE_STRUCT [2], DBHELP [1]
DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3], FCS, FINDPRO, FITSDIR
FLAG_LONG_NAMES [1], FLAG_LONG_NAMES [2], FXTPIO_WRITE, GETPRO, IRAFDIR, IRAFRD
SPEC_DIR [1], SPEC_DIR [2], SPEC_DIR [3], SXHWRITE, TAB_READ, TVLASER, WFPC2_READ
EXAMPLES:
Consider the following file names
unix: file = '/rsi/idl40/avg.pro'
vms: file = '$1$dua5:[rsi.idl40]avg.pro;3
MacOS: file = 'Macintosh HD:Programs:avg.pro'
Windows: file = 'd:\rsi\idl40\avg.pro'
then IDL> FDECOMP, file, disk, dir, name, qual, version
will return the following
Disk Dir Name Qual Version
Unix: '' '/rsi/idl40/' 'avg' 'pro' ''
VMS: '$1$dua5' '[RSI.IDL40]' 'avg' 'pro' '3'
Mac: 'Macintosh HD' ':Programs:' 'avg' 'pro' ''
Windows: 'd:' \rsi\idl40\ 'avg' 'pro' ''
NOTES:
(1) All tokens are removed between
1) name and qual (i.e period is removed)
2) qual and ver (i.e. VMS semicolon is removed)
(2) On VMS the filenames "MOTD" and "MOTD." are distinguished by the
fact that qual = '' for the former and qual = ' ' for the latter.
ROUTINES CALLED:
None.
HISTORY
version 1 D. Lindler Oct 1986
Include VMS DECNET machine name in disk W. Landsman HSTX Feb. 94
Converted to Mac IDL, I. Freedman HSTX March 1994
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite to accept vector filenames V5.3 W. Landsman June 2000
Fix cases where disk name not always present W. Landsman Sep. 2000
Make sure version defined for Windows W. Landsman April 2004
[Previous]
[Next]
NAME:
FDECOMP
PURPOSE:
Routine to decompose file name(s) for any operating system.
CALLING SEQUENCE:
FDECOMP, filename, disk, dir, name, qual, [OSFamily = ]
INPUT:
filename - string file name(s), scalar or vector
OUTPUTS:
All the output parameters will have the same number of elements as
input filename
disk - disk name, always '' on a Unix machine, scalar or vector string
dir - directory name, scalar or vector string
name - file name, scalar or vector string
qual - qualifier, set equal to the characters beyond the last "."
version - obsolete (was for VMS) always ''
OPTIONAL INPUT KEYWORD:
OSFamily - one of the four scalar strings specifying the operating
system: 'Windows','MacOS' or 'unix'. If not supplied,
then !VERSION.OS_FAMILY is used to determine the OS.
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
CALLED BY:
CONCAT4DOS [1], CONCAT4DOS [2], CREATE_STRUCT [1], CREATE_STRUCT [2], DBHELP [1]
DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3], FCS, FINDPRO, FITSDIR
FLAG_LONG_NAMES [1], FLAG_LONG_NAMES [2], FXTPIO_WRITE, GETPRO, IRAFDIR, IRAFRD
SPEC_DIR [1], SPEC_DIR [2], SPEC_DIR [3], SXHWRITE, TAB_READ, TVLASER, WFPC2_READ
EXAMPLES:
Consider the following file names
unix: file = '/rsi/idl63/avg.pro'
MacOS: file = 'Macintosh HD:Programs:avg.pro'
Windows: file = 'd:\rsi\idl63\avg.pro'
then IDL> FDECOMP, file, disk, dir, name, qual, version
will return the following
Disk Dir Name Qual
Unix: '' '/rsi/idl63/' 'avg' 'pro'
; Mac: 'Macintosh HD' ':Programs:' 'avg' 'pro'
Windows: 'd:' \rsi\idl63\ 'avg' 'pro'
NOTES:
All tokens are removed between the name and qualifier
(i.e period is removed)
ROUTINES CALLED:
None.
HISTORY
version 1 D. Lindler Oct 1986
Include VMS DECNET machine name in disk W. Landsman HSTX Feb. 94
Converted to Mac IDL, I. Freedman HSTX March 1994
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite to accept vector filenames V5.3 W. Landsman June 2000
Fix cases where disk name not always present W. Landsman Sep. 2000
Make sure version defined for Windows W. Landsman April 2004
Include final delimiter in directory under Windows as advertised
W. Landsman May 2006
Remove VMS support, W. Landsman September 2006
[Previous]
[Next]
NAME: fft_crosscorr
PURPOSE
Computes the cross correlation of two real arrays A and B (same size)
INPUTS:
A, B = floating point arrays (1-D or 2-D) of equal size
OUTPUTS:
cc = cross correlation of (A,B) -- a complex array, size of A & B
CALLS: ***
MEAN
CALLED BY:
hsi_bproj2size
EXAMPLE:
a=shift(dist(256),128,128) & b=a
c=crosscorr(a,b)
tvscl,shift(c,128,128)
VERSION HISTORY
schmahl@hessi.gsfc.nasa.gov 2002
[Previous]
[Next]
NAME:
fid2ex
PURPOSE:
Given a fileID, generate the 7-element time array
CALLING SEQUENCE:
tarr = fid2ex(fid)
INPUT:
fid
CALLED BY:
BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], BCS_CREATE_CAT, JITTER_HTML, OBS_PLOT
SELECT_24HR, WOBS_PLOT, bcs_path, check_oldprocess [1], check_oldprocess [2]
check_oldprocess [3], check_oldprocess [4], delete_week [1], delete_week [2]
disp_sci5k, edac_summary, fidrange [1], fidrange [2], find_dbo_dir, gbo_pfi
gen_file_id [1], gen_file_id [2], get1gbo, get_afile_size [1]
get_afile_size [2], get_gbo_pfi, get_hk_info [1], get_hk_info [2], get_mk3 [1]
get_mk3 [2], get_seq_tab, getwid, goes3sec_copy, gtab_summary, mk_gif_mag_index
mk_gsn_obs_s1, mk_gx, mk_hst_summary, mk_pnt, mk_sdmi, mk_week_file [1]
mk_week_file [2], mo_check, nearest_fid [1], nearest_fid [2], new_disp_sci5k [1]
new_disp_sci5k [2], new_edac_summary, nts_copy [1], nts_copy [2], pfi_dominant
rd_hk [1], rd_hk [2], rd_selsisi, read_msok_jpg, read_spartan, ref_day_plot
sel_fileinfo, sel_filetimes [1], sel_filetimes [2], tim2dbase, wfile, xspr [1]
xspr [2], yoyo_man2
HISTORY:
Written 11-Dec-91 by M.Morrison
24-Aug-92 (MDM) - Modified to accept an array of FIDs
5-Jan-93 (MDM) - Modified to handle case where there are blank
spaces in funny places
[Previous]
[Next]
Project : SOHO - SUMER
Name : FID2TIME
Purpose : Infer file time from file ID name with "_yymmdd_hhmmss"
Category : I/O
Explanation : Same as EXTRACT_FID, but sets missing elements to 0
Syntax : IDL> times=fid2time(files)
Inputs : FILES = file names (e.g. sum_961020_201023.fits)
Opt. Inputs : None
Outputs : TIMES = string times (e.g. 20-Oct-96 20:10:23)
Opt. Outputs: None
Keywords : DELIM = time delimiter (def= '_')
TAI = return time in TAI format
YMD = return yymmdd
COUNT= number of files processed
DATE_ONLY = return date only
NO_MIN = exclude MIN and SEC
NO_SEC = exclude sec
;
CALLS: ***
ANYTIM2TAI, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1]
DATATYPE [2], DATATYPE [3], DPRINT, GET_MONTH, PR_SYNTAX, TRIM2, break_file [4]
is_number [1], is_number [2]
CALLED BY:
FILE2FID, ITOOL_GETFILE, MK_SUMER_DBASE
History : Version 1, 20-May-1998, Zarro (SM&A) - written
Version 2, 1-Feb-1999, Zarro - made Y2K compliant
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : HESSI
Name : FID__DEFINE
Purpose : Define a FID (file id) object
Category : objects
CALLS: ***
ANYTIM2TAI, DATATYPE [1], DATATYPE [2], DATATYPE [3], DPRINT, FID::CLEANUP
FID::EXTRACT_TIME, FID::FILE2TIME, FID::INIT, FID::PARSE_TIME, FID::Y2KFIX
GET_MONTH, TRIM, is_number [1], is_number [2]
History : Written 3 April 2001, D. Zarro, EIT/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HESSI
Name : FIFO__DEFINE
Purpose : Define a FIFO object
Category : Objects
Explanation : A first in first out FIFO object to store anything
Syntax : IDL> new=obj_new('fifo')
Inputs : MAX_SIZE = max # of elements to cache [def=10]. Once
exceeded, initial data will be overwritten.
Methods : ->SET,ID,INPUT ; store input
INPUT = any data type
ID = unique string identifier for INPUT
->GET,ID,OUTPUT ; retrieve input
->EMPTY ;-- empty fifo
->SHOW ;-- show fifo contents
CALLS: ***
DPRINT, EXIST, FIFO::CLEANUP, FIFO::CREATE, FIFO::DELETE, FIFO::EMPTY, FIFO::GET
FIFO::GET, FIFO::GET_POS, FIFO::INIT, FIFO::SET, FIFO::SHOW, IPRINT, IS_STRING
PTR_EXIST, TRIM, is_number [1], is_number [2]
History : Version 1, 6-DEC-1999, D.M. Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Name : FIG_CLOSE
Purpose : Finish a plot in a postscript-file of a figure
Category : Graphics, Utility
Explanation : Draws figure label, closes postscript file, and
choses a suitable plotfilename
Syntax : IDL> fig_close,io,fignr,ref,plotname,plotfile
CALLED BY:
FWD_DISPLAY, STEREO_LOOP
Examples : IDL> io =1 ;creates postscript file
IDL> form=0 ;landscape format
IDL> char=0.8 ;smaller character size
IDL> fignr='1' ;figure number
IDL> plotname='f'
IDL> ref=' (Aschwanden et al. 1998)' ;label at bottom of Fig.
IDL> plotname='f'
IDL> fig_open,io,form,char,fignr,plotname
IDL> plot,randomu(seed,100)
IDL> fig_close,io,fignr,ref
IDL> $lpr plotfile
Inputs : io - selection of plot option
io=0 screen (X-window)
io=1 postscript file *.ps
io=2 encapsulated postscript file
io=3 color postscript file
fignr - string concatenated with name of plotfile
ref - text string going into figure label
plotname - string for plotfile name
Outputs : plotfile - full name of plotfile
History : 1998-Oct-09, written. aschwand@sag.lmsal.com
2000-Jan-24, common fig_open_setplot,original_device -> set_plot,original_device
2000-Jan-26, filenaming is moved to routine FIG_OPEN (device-independent)
31-Jul-2000 setting original_device disabled if ps-file was produced previously
[Previous]
[Next]
Project : YOHKOH/SXT,HXT - SOHO/EIT,CDS - TRACE
Name : FIG_MULTI_POS()
Purpose : multi-plot !p.positions maintaining correct aspect ratio of
x- and y-axis
Category : Graphics, Utility
Explanation : A mutli-plot configuration containing N columns and M rows of
plot frames is arranged. The aspect ratio of the images
(!y.range/!x.range) is correctly scaled, regardless of the
aspect ratio of the device window (!d.y_vsize y_device/x_device).
Syntax : IDL> fig_multi_pos,x_range,y_range,ncol,nrow,qgap,p_position
CALLED BY:
STEREO_LOOP
Example : IDL> window,0,xsize=640,ysize=512
IDL> x_range =[0,1]
IDL> y_range =[0,1]
IDL> ncol =3
IDL> nrow =3
IDL> qgap =0.1
IDL> fig_multi_pos,x_range,y_range,ncol,nrow,qgap,p_position
IDL> phi=findgen(361)/float(360)
IDL> for i=0,ncol*nrow-1 do
IDL> !p.position=p_position(*,i)
IDL> plot,cos(phi),sin(phi)
IDL> endfor
(This example draws a 3x3 multi-plots of circles with correct
ascpect ratios. Note that !p.multi=[0,3,3,0,0] would turn
circles into ellipses)
Inputs : x_range - !x.range of individual plots
y_range - !y.range of individual plots
ncol - number of columns in mutli-plot arrangement
nrow - number of rows in mutli-plot arrangement
qgap - gap between plots, measured with respect to
individual plot size
Outputs : p_position - fltarr(4,n) of indiviudal plot positions
e.g. place plot_i by !p.position=p_position(*,i)
Side effects: Window size has to be defined before calling FIG_MULTI_POS,
because it uses device parameters !d.y_vsize and !d.x_vsize
History : 9-Oct-1998, Written. aschwanden@sag.lmsal.com
[Previous]
[Next]
Name : FIG_MULTI_TV()
Purpose : multi-plot of images in grey-scale representation
Category : Graphics, Utility
Explanation : A multi-plot configuration containing N columns and M rows of
grey-scale plots, placed at plot positions p_position(*,i)
within x-ranges(*,i) and y-ranges(*,i), i=0,...,N*M-1
Syntax : fig_multi_tv,index,data,x_range,y_range,z_range,p_position,$
ncol,nrow,io,x_label,y_label,grid
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], COORD_HELIO_SPHERE
CALLED BY:
STEREO_LOOP
Example : IDL> window,0,xsize=640,ysize=512
IDL> x_range =[0,1]
IDL> y_range =[0,1]
IDL> ncol =2
IDL> nrow =2
IDL> qgap =0.1
IDL> fig_multi_pos,x_range,y_range,ncol,nrow,qgap,p_position
IDL> fig_multi_tv,index,data,x_range,y_range,z_range,$
p_position,x_label,y_label,ncol,nrow,io,grid
Inputs : index - strarr(n) n structures
data - fltarr(*,*,n) n images
x_range - fltarr(2,n) !x.range of n plotframes
y_range - fltarr(2,n) !y.range of n plotframes
z_range - fltarr(2,n) !z.range clipping of data
p_position - fltarr(4,n) !p.position of n plotframes
x_label - string for title on x-axis
y_label - string for title on y-axis
ncol - number of columns in mutli-plot arrangement
nrow - number of rows in mutli-plot arrangement
io - io=1 X-window screen
io=1 postscript files
grid - spacing of heliographic coordinate grid
(if grid > 0)
History : 9-Oct-1998, Written. aschwand@lmsal.com
[Previous]
[Next]
Name : FIG_OPEN
Purpose : Set device parameters to start a display or postscript-file
of a Figure
Explanation : Controls setting of plot parameters regarding window size,
format, fonts, so that identical displays are produced
on the screen and in postscript files.
Syntax : IDL> fig_open,io,form,char
CALLS: ***
EXIST, clearplot [1], clearplot [2], next_window [1], next_window [2]
CALLED BY:
FWD_DISPLAY, STEREO_LOOP
Examples : IDL> io =1 ;creates postscript file
IDL> form=0 ;landscape format
IDL> char=0.8 ;smaller character size
IDL> fignr='1' ;figure number
IDL> plotname='f'
IDL> ref=' (Aschwanden et al. 1998)' ;label at bottom of Fig.
IDL> fig_open,io,form,char,fignr,plotname
IDL> plot,randomu(seed,100)
IDL> fig_close,io,fignr,ref
Inputs : io - selection of plot option
io=0 screen (X-window)
io=1 postscript file *.ps
io=2 encapsulated postscript file
io=3 color postscript file
form - plot format
form=0 landscape format
form=1 portrait format
char - character size = !p.charsize
plotname - string for plotfile name
History : 1990, written
9-OCT-1998, contribution to STEREO package, aschwand@lmsal.com
21-Jan-2000, devicename=!d.name, set_plot,devicename
24-Jan-2000, common fig_open_setplot,original_device --> fig_close
set_plot='X' in unix, set_plot='WIN' for microsoft windows
original_devicename is reset after producing ps-file in fig_close.pro
26-Jan-2000, add plotfilename as keyword to device
no device-dependent renaming required after creating idl.ps
31-Jul-2000 setting original_device disabled if ps-file was produced previously
26-Jan-2001 use free window unit window,0-->window,/free
[Previous]
[Next]
Name : FIG_TV()
Purpose : plot of image in grey-scale representation
at predifined location in plot
Inputs image - fltarr(*,*) image
x_range - fltarr(2) !x.range of n plotframes
y_range - fltarr(2) !y.range of n plotframes
z_range - fltarr(2) !z.range clipping of data
p_position - fltarr(4) !p.position of n plotframes
x_label - string for title on x-axis
y_label - string for title on y-axis
io - io=1 X-window screen
io=1 postscript files
ct - color table
invert if negative
Contact : aschwanden@sag.lmsal.com
CALLS:
[Previous]
[Next]
Project : SOHO-CDS
Name : FILE2FID
Purpose : move files from a directory into another based on file
date/time
Category : planning
Explanation : looks at files encoded with "_yyyymmdd_hhmm"
and moves them into appropriate directory
e.g. out_dir/yymmdd
Syntax : file2fid,files,out_dir
Inputs : FILES = array of filenames, complete with path
OUT_DIR = target directory for files
;
Keywords : COPY = copy files instead of move
NOCLOBBER = don't clobber existing files
OUT_FILES = renamed output files
CALLS: ***
APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
CONCAT_DIR [2], CONCAT_DIR [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
ESPAWN, FID2TIME, IS_BLANK, IS_DIR, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MK_DIR
OS_FAMILY, PR_SYNTAX, TEST_DIR, break_file [4], concat_dir [4], curdir [1]
curdir [2], delvarx [5]
CALLED BY:
FTP_SYNOP
Restrictions: Unix only
History : Written 1 Feb 1999 D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FILE_ACC
Purpose : Determine existence, type and access of file on UNIX system.
Explanation :
This routine is intended to supplement the IDL findfile function.
For a given unix path name, e.g '/disk2/bowen/adas/file', this
routine returns certain information.
1. Whether the path exists.
2. Whether the user has read permission.
3. Whether the user has write permission.
4. Whether the user has execute permission.
5. What the file type is i.e file, directory etc.
The routine works by spawning various UNIX commands and
interpreting the information returned. A directory listing
command is used to get basic file information; on ULTRIX 'ls -ld',
which establishes whether the file exists and also returns the
file type, access and ownership information. The 'd' parameter
ensures that directory information is listed rather than the
contents of a directory.
Before the access information can be interpreted the current user
is found by spawning the 'whoami' UNIX command. If the user is not
the owner of the file the UNIX 'groups' command is used to determine
whether or not the owner and the user are in the same group.
Using all of this information the correct read, write and execute
permissions are derived from the owner, group or world access
codes given in the directory listing information.
This processing is performed in a group of four routines which
are all incorporated in the file_acc.pro file.
Note: the syntax of the UNIX commands and the output which is
returned may vary from one operating system to another. The
operating system is checked and specific code executed for that
system. Currently the routine has specific code for;
**** File listing command: ****
ULTRIX: Command 'ls -ld /.../file.dat'
Output '-rw-r--r-- 1 bowen 5688 May 27 17:15 file.dat'
OSF: (Same command as ULTRIX but different output, difference
doesn't matter though, only first three fields used.)
Output '-rw-r--r-- 1 bowen user 5688 May 27 17:15 file.dat'
SUNOS: (Same command and output as ULTRIX)
All others: (same as ULTRIX code)
**** Groups identification: ****
ULTRIX: Command 'groups root'
Output 'system daemon tty'
OSF: (Same command and output as ULTRIX)
SUNOS: (Same command but, importantly, different output)
Command 'groups root'
Output 'system daemon tty'
All others: (Same as ULTRIX code)
**** User identification: ****
ULTRIX, OSF and SUNOS: Command 'whoami'
Output 'name'
Use :
Example of file_acc usage;
file = '/disk2/fred/data'
file_acc, file, exist, read, write, execute, filetype
if exist eq 1 then begin
print,'Permissions for file ',file,' are;'
if read eq 1 print,'read'
if write eq 1 print,'write'
if execute eq 1 print,'execute'
print,'The file type is ',filetype
end else begin
print,file,' does not exist'
end
Inputs :
FILE - The UNIX system name of the file. For example
'file.dat' refers to the current directory and
'/disk2/fred/data' is a full path name.
Opt. inputs :
None
Outputs :
EXIST - Integer, 1 if the file exists, 0 if it does not.
READ - Integer, 1 if the user has read permission 0 if not.
WRITE - Integer, 1 if the user has write permission 0 if not.
EXECUTE - Integer, 1 if the user has execute permission 0 if not.
FILETYPE- String, the file description character from the
directory listing output. e.g for ULTRIX '-' indicates
a file and 'd' indicates a directory file.
Opt. outputs:
None
Keywords :
None
Calls: ***
FILE_ACC_DET, FILE_ACC_GRP, FILE_ACC_SPLIT
Restrictions: None
Sise effects:
A number of UNIX commands are spawned.
Category:
UNIX system IDL utility.
Prev. Hist. : None
Written:
Andrew Bowen, Tessella Support Services plc, 29-Apr-1993
Modified: Version 2, Header format updated, C D Pike, 7-Oct-93
Modified: Version 2.1, Added /SH flag to spawn command to get rid of errors 07/07/97, S.Paswaters
Version 2.2 Use "/bin/ls -ld" in file_acc_det, N B Rich, 01 Dec 1998
Version 2.3 The assumed output of 'groups' was incorrect for sunos; corrected pro file_acc_grp
Version: Version 2.2 12-Nov-1998
[Previous]
[Next]
Name: file_append
Purpose: append text to text file - optionally, only append uniq text
Input Parameters:
file - file name - if no such file exists, open new file
text - text to append - string or string array
Keyword Parameters:
uniq - if set, only append uniq lines of text
nlines - number of new appended lines (same as n_elements(text) if
uniq is not set
loud - if sent, print informational messages
newfile - if set, open use a new file (on unix, deletes existing)
Calling Sequence:
file_append, file, text [,/uniq, nlines=nlines, /newfile, /loud]
CALLS: ***
rd_tfile [1], rd_tfile [2]
CALLED BY:
ADD_METHOD, DISPLOI_MON5K, JSMOVIE, JSMOVIE2, MDI_SUMMARY, UNIX_SPAWN, WIN_SPAWN
check_compile [1], check_compile [2], check_oldprocess [1]
check_oldprocess [2], check_oldprocess [3], check_oldprocess [4]
check_process [1], check_process [2], daily_forecast [2], dbase2disk
disp_sci160k [1], disp_sci160k [2], dpc_summary, eit_mirror, eit_proton_summary
fl_mktext, flares2disk, ftp_copy [1], ftp_copy [2], ftp_copy_new, ftp_defprompt
genx2html [1], genx2html [2], go_batch [1], go_batch [2], go_mk_cd
go_sxt_sss2secondary, go_yo_prod_batch, goes2str, goes_gaps, html_basics, html_doc
html_form_addtime [1], html_form_addtime [2], html_form_addtime [3]
html_linklist, html_remove_template, image2movie, is_bestnode [1]
is_bestnode [2], laststat [1], laststat [2], mail [1], mail [2], make_mirror
map_env2dir, mk_bad_pix_map_load, mk_cd [1], mk_cd [2], mk_hst_summary
mk_lasteit_movie, mk_pix [1], mk_pix [2], mk_pubydb, mk_sfc [1], mk_sfc [2]
mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], mk_ssc_batch [1], mk_ssc_batch [2]
mk_ydb_list, mk_ydbtab, mk_ydbtape [1], mk_ydbtape [2], mo_check, mo_job0, mo_job1
mo_patch, mobad_summ, modvolume_inf [1], modvolume_inf [2], monitor_center [1]
mostrip, multi_hda2hxi, new_dpath [1], new_dpath [2], pr_tr_header, pref_super
rd_ydbtap, ref_term [2], search_obs, sfc_check, soon_catstat, soon_com2html
soon_search [1], soon_search [3], soon_search_www, special_movie, ssw_conflicts
ssw_findstuff2html, ssw_install [1], ssw_install [2], ssw_move
ssw_start_rpcserver, ssw_strfind, ssw_swmap_bestof, ssw_swmap_info
ssw_swmap_uniqinfo, ssw_track_demo, ssw_unspike_cube, ssw_upgrade [1]
ssw_upgrade [2], sswdb_info, sswdb_install, sw2tree [1], sw2tree [2], sxt2mpeg
sxt_html, sxt_ssn2fits [1], term_times, tim2dbase, tim2tfss, timeline, topsdb [1]
topsdb [2], trace_cat2cosmic, trace_cosmic2hist_accum, trace_do_data_requests
trace_get1www_image, trace_last_movie [1], trace_last_movie [2]
trace_last_movie [3], trace_movie_index [1], trace_movie_index [2]
trace_recent_movie_summary, trace_request_summary, trace_special_movie [1]
trace_special_movie [2], trace_special_movie [3], trace_special_movie2
trace_submit_request, trace_success_file, trace_unspike_time, ucon_check
web_seq, write_access [1], write_access [2], wwwidl_server_check
wwwidl_watchdog [1], wwwidl_watchdog [2], xdisp_fits, xdisp_trace [1]
xdisp_trace2, xdisp_trace3, xhkplot, xset_chain [1], xset_chain [2], xso_search
xsw2tree, xsw2tree_event, xswlist [2], xwrite_hist, ycopy, ydb_install [1]
ydb_install [2], ydump
History:
slf, 10-mar-1993
slf, 4-May-1993 ; added newfile option
slf, 3-mar-1995 ; add flush (for fast machines)
slf, 8-mar-1995 ; quiet failure, add ERROR
[Previous]
[Next]
Name: file_compress
Purpose: provide IDL interface to gzip and Unix compress utility
Input Paramters:
inname - file name or vector of file names to compress
Output Parameters:
outname - compressed file names (same dimension as inname)
(usually, = inname.Z, if type_comp=2 is set, then = inname.gz
null if problem w/input or compress)
Optional Keyword Parameters
noreplace - (input) - switch, if set, don't replace inname with outname
newname - (input) NOT IMPLEMENTED specify outname
type_comp - (input) - values: none, 1: use Unix compress; 2: use gzip
Calling Sequence:
file_compress, inname [, outname ,/noreplace]
CALLS: ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], concat_dir [4]
file_exist [1], file_exist [3], tbeep [1], tbeep [2], tbeep [3]
CALLED BY:
data_compress [1], data_compress [2], data_compress [3], do_ads, mk_sdm
rd_week_file [1], rd_week_file [3], rd_week_file [4]
History: 30-Jun-93 (SLF)
11-Jul-93 (SLF) Added dirs keyword and function
15-Mar-93 (SLF) enclose in quotes (embedded meta-characters)
11-apr-95 (SLF) made the default quiet - use /loud to override
09-Dec-97 (PGS) Added type_comp = 2 cause compression with gzip
[Previous]
[Next]
Project : HESSI
Name : FILE_CONTENT
Purpose : Determine file content (access time, size in bytes, etc)
Category : utility system
Inputs : FILE = scalar or array of file names
Outputs : VALUE depending upon keyword
Keywords : /SIZE = return byte size
: /TIME = return creation time
: /TAI = time in TAI
: ERR = string error
CALLS: ***
ANYTIM2TAI, ANYTIM2UTC [1], ANYTIM2UTC [2], EXIST, IS_BLANK
CALLED BY:
FILE_SINCE
History : 22-Feb-2002, D.M. Zarro (EITI/GSFC) Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : HESSI
Name : FILE_COPY2
Purpose : Wrapper around FILE_COPY that works for IDL < 5.6
Category : system utility
Syntax : IDL> file_copy2,infile,outfile
Inputs : INFILE = input filenames to copy
Outputs : OUTFILE = output filenames
Keywords : See FILE_COPY
CALLS: ***
ESPAWN, IS_BLANK, OS_FAMILY, SINCE_VERSION [1], SINCE_VERSION [2]
History : 30 March 2006, D.M. Zarro (L-3Com/GSFC) Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Name: file_delete
Purpose: system/shell independent file delete
Input Parameters:
files - scaler string or vector string array of filenames to delete
Output Paramters:
status - sucess 1 -> deleted or not there to begin with
0 -> couldnt delete (it's still there)
(scaler or vector depending on files)
*** NOTE: This parameter is obsolete! ***
Keyword Parameters:
quiet - if set, dont print message on failures
Calling Sequence:
file_delete, files [,status , /quiet]
History:
slf, 8-feb-1993
12-May-2003, William Thompson, added obsolete warning
Zarro, 15-May-2003 - added _EXTRA to catch stray keywords
CALLS: ***
FILE_EXIST [2], file_exist [1], file_exist [3]
Restrictions: must have write priviledge to requested files
*** IMPORTANT NOTE ***
This routine conflicts with an IDL built-in routine of the same name,
introduced in version 5.4. The syntax is very similar, except that the
built-in routine does not support the STATUS parameter. If one wishes
to use the procedure rather than the built-in routine, use
SSW_FILE_DELETE instead.
[Previous]
[Next]
Name: file_delete
Purpose: system/shell independent file delete
Input Parameters:
files - scaler string or vector string array of filenames to delete
Output Paramters:
status - sucess 1 -> deleted or not there to begin with
0 -> couldnt delete (it's still there)
(scaler or vector depending on files)
Keyword Parameters:
quiet - if set, dont print message on failures
Calling Sequence:
file_delete, files [,status , /quiet]
History:
slf, 8-feb-1993
S.L.Freeland - made 'ssw_file_delete' from 'file_delete'
since RSI screwed me
CALLS: ***
FILE_EXIST [2], SSW_FILE_DELETE, file_exist [1], file_exist [3]
Restrictions: must have write priviledge to requested files
[Previous]
[Next]
Name: file_diff
Purpose: check for ascii file difference (boolean)
Input Parameters:
f1, f2 - ascii file names
Calling Sequence:
truth=file_diff(file1, file2 [/idlpro] )
truth = file_diff(file1, file2, /binary, ssmask=indgen(2800))
Keyword Parameters:
idlpro - if set, check for header/code differences (";"=comment)
mess - output summary string
status - 0=nodiff, >0=diff, [/idlpro only: 2=header , 3=code]
[/binary only: 10=file size difference, 11=data difference]
-1=files don't exist
binary - If set, then do a binary difference
ssmask - Optional subscripts of the data portion to ignore (byte positions)
CALLS: ***
FILE_DIFF_S1, FILE_EXIST [2], file_exist [1], file_exist [3], rd_tfile [1]
rd_tfile [2]
CALLED BY:
CMP_FILES, LOCAL_DIFFS, ssw_check_contrib, ssw_conflicts, ssw_move, tr_reformat
History:
29-Aug-1996 S.L.Freeland (extracted code from chk_conflict.pro)
13-Jul-1998 M.D.Morrison - Added /BINARY option
22-Jul-1998 M.D.Morrison - Changed code slightly to make it not
such a memory hog for large files
21-Aug-1998 M.D.Morrison - Mod to do large files with piece-meal
reads.
[Previous]
[Next]
Name: file_exist
Purpose: returns true(1) if any files match pattern=file
false(0) if no files found
Input Parameters:
file - file, pathname or file filter to check
Optional Keyword Parameters
direct - set if want full check (slower) - use if might be an
empty directory you are looking for
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], Bell, FILE_STAT [1], FILE_STAT [2]
STR_LASTPOS [1], break_file [4], file_stat [3], str_lastpos [2]
CALLED BY:
ANDRIL_SXT, BCS_COMP, BUILD_SSX, CATEGORY, CAT_DIRECTORY, CAT_RAW, CDS_AR_OBS
CDS_VEL_SLICE [2], CDS_WAVE_CAT, CDS_WAVE_FILES, CFITSLIST, CHIANTI_DEM
CH_LINE_LIST, CH_SYNTHETIC, CW_LOADCT, EIS_LOAD_IMAGE [1], EIS_LOAD_IMAGE [2]
EIT_MKMOVIE, EMISS_CALC, FB_RAD_LOSS, FIRST_LIGHT [1], FIRST_LIGHT [2]
FLUSH_CATALOG, Files_Handling [1], Files_Handling [2], GETBKGIMG, GET_CACHE
GET_ORBIT_CDF2, GHOST_AMOUNT, GOES_TF, GOES_TF_COEFF, GT_EXPTIME [2], GT_MIRRPOS
GT_NUMEXP, GT_NUMWIN, GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL
GT_WLIMITS, GT_WNUM, HEADCAT, HESSI, HESSI_DATA_PATHS [1], HESSI_SHUTTERS
HESSI_SPEX [1], HESSI_SPEX [2], HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4]
HSI_SPECTRUM_FITSPASTE, HXTPIXON, HXT_QLOOK, IDL5TO4, IMAGE_TOOL, IMAGE_TOOL_EVENT
ISOTHERMAL, ITOOL_EIT_DEGRID, ITOOL_LOAD_IMAGE, ITOOL_OVERLAYER, ITOOL_RD_GIF
LOCK_DATABASE, MAKE_CHIANTI_SPEC, MAKE_DAILY_IMAGE, MKMOVIE
MKMOVIE0 obsolete version of mkmoviepro, MK_RASTER, NET_DIR_DIFF
OVSA_EXPLORER formerly OVSA_PRESUB, Open Packet File, Open Score File
PICKFITS, PICK_CAN_PRELIM, PLOT_CHIANTI_NE, PLOT_CHIANTI_TE, PLOT_DELTAT
PLOT_SPEC [2], PRG_DETAIL, PRG_PLAN, PURPOSE, RATIO_PLOTTER [1], RD_IMAGE_GIF
READCDSFITS, READ_ANALIST, READ_PS2, REDUCE_LEVEL_1, RFITS2 [1], RFITS2 [2], RTMOVIE
RTMVI [1], SFITSLIST, SHOW_FITS_HDR, SHOW_POPS, SPEX_READ_FIT_RESULTS
SSW_LOCAL_PATH, STUDY_BRIEF, ST_SUMER, SUMER_DISTORT_COR, SUMER_FILE
SUMER_SEARCH_PD_EVENT, SUMER_SERIAL, TP_GET_DUMDATA, TR_FLAT_SUB, TV_SYNOP
USE_CHIANTI, WIN_DUMP, WRT_GEN [1], WRT_GEN [2], WRUNMOVIEM, WR_MOVIE, XCOR_CDS
ZETA_0, add_pro [1], add_pro [2], ads_into_att, break_doc [1], break_doc [2]
break_doc [3], ccd_hdr_info, ccd_sunc [1], ccd_sunc [2], cdrom_files [2], ch_ss
check_compile [1], check_compile [2], check_log [1], check_log [2]
check_process [1], check_process [2], check_ql_after_lz, chk_pointing
color_copy, configure_http, cont2time [1], cont2time [2], ctraj2orbit
daily_forecast [2], data_sum2fits, dbase2disk, delete_week [1], delete_week [2]
disk2_mo [1], disk2_mo [2], disp_synop, disp_therm_rs232, do_ads, do_demo [1]
do_demo [2], do_i0_dps_reformat, do_reg_backup, do_tr_inventory, doc_summ [1]
doc_summ [2], dps_proc_lev0_hk, dps_proc_mem_dump, dsn_check [1], dsn_check [2]
dsp_menu, eit_eff_area, eit_file2path, eit_files, eit_fulldiskdb
eit_proton_summary, eitoversxt, extract_val, file__define, file_compress [1]
file_compress [2], file_delete [1], file_delete [2], file_delete [3], file_diff
file_list2, file_path [1], file_path [2], file_uncompress [1]
file_uncompress [2], fits2time [1], fits2time [2], fits2time [3]
fl_goesplot [1], fl_goesplot [2], fl_goesplot [3], fl_summary [1]
fl_summary [2], fl_summary [3], fl_suntoday [1], fl_suntoday [2]
fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2], fort2hxi [1], fort2hxi [2]
freebound_ion, ft_mng_hm, ftp_copy [1], ftp_copy [2], ftp_copy2sites, ftp_copy_new
genx2html [1], genx2html [2], get1doc [1], get1doc [2], get_ads [1], get_daily [1]
get_daily [2], get_gevloc_data, get_hk_info [1], get_hk_info [2]
get_ksc_holiday, get_mk3 [1], get_mk3 [2], get_selsis, get_sirius_yr
get_solar_indices, get_tty_type [1], get_tty_type [2], get_uvxsections
go_batch [1], go_batch [2], go_ssw_batch, go_yo_prod_batch, goes_log
goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4], goes_plot [5]
gt_exptime [1], hessi_version, hsi_flare_position_image [1]
hsi_flare_position_image [2], hsi_full_sun_image [1], hsi_full_sun_image [2]
hsi_locate_flare [1], hsi_locate_flare [3], html_basics, html_doc
html_form_addtime [1], html_form_addtime [2], html_form_addtime [3]
html_get_files, html_linklist, html_remove_template, hxt_impulsivness
hxt_multimg, hxt_sources, idl_server_command, idl_server_control, image2movie
ip_que_dmpver, is_alive [1], is_alive [2], keyword_db, ksc_commands, lapalma_cat
lapalma_files, lasteit, lastsfd [1], lastsfd [2], laststat [1], laststat [2]
mail [1], mail [2], make_goes_chianti_response [1]
make_goes_chianti_response [2], make_goes_chianti_response [3]
make_goes_chianti_response [4], make_ssw_mirror, map_env2dir, mdi_cat, mdi_files
mdi_write_genxcat, mdimrot, mdipdist, mdiprot, mk_att [1], mk_att [2]
mk_bad_pix_map_load, mk_dpc_image, mk_gsn_obs, mk_gsn_obs_s1, mk_gx
mk_hst_summary, mk_imgsum_html, mk_mo_disk, mk_mo_disk2, mk_mo_log, mk_obs
mk_orbit [1], mk_orbit [2], mk_pix [1], mk_pix [2], mk_pnt, mk_query [1]
mk_query [2], mk_query_genx, mk_sdcs, mk_sdm, mk_sfc [1], mk_sfc [2], mk_sft [1]
mk_sft [2], mk_spd, mk_ssc [1], mk_ssc [2], mk_ssc_batch [1], mk_ssc_batch [2]
mk_sumer_dbase_ff, mk_sxh, mk_syn_sfc [1], mk_syn_sfc [2], mk_trace_i0
mk_week_file [1], mk_week_file [2], mo_patch, mo_tap_dump, mon_health [1]
mon_health [2], mreadfits_header, msok_copy_jpg, msok_poi_copy [1]
msok_poi_copy [2], mwritefits, nobeyama_update, obs_summary, op_get_special
op_rd_special, password_info, phoenix_spg_get, ratio_plotter [2]
raw_list2pixmap, rd_atodat [1], rd_atodat [2], rd_bsc, rd_ccdh_fil, rd_dpc_table
rd_egse_hk_txt, rd_gbl_raw [1], rd_gbl_raw [2], rd_goes_fits, rd_goesp_ascii
rd_goesx_ascii, rd_gsn, rd_hk [1], rd_hk [2], rd_ionbal [1], rd_ionbal [2]
rd_old_obs, rd_pkt_head [1], rd_pkt_head [2], rd_rasm, rd_roadmap [1], rd_sdl
rd_selsis, rd_selsisi_dir, rd_sld, rd_sls, rd_sot, rd_srspas, rd_ssl, rd_sumer_genx
rd_sxa, rd_sxc, rd_sxl, rd_therm_rs232, rd_tr_seq_head, rd_week_file [2], rd_ydbtap
read_genxcat, read_lapalma, read_mdi, read_sooncheck, read_spartan, ref_term [2]
reslot, restgenx, restore_idl_routines, save_idl_routines, savegenx, search [1]
search [2], search_obs, secchi_time2files, selsis_copy [1], selsis_copy [2]
selsisi2fits, setup_spex [1], setup_spex [2], sfc_check, show_pix [1]
show_pix [2], soon_catstat, soon_com2html, special_movie, ssw_bin
ssw_check_contrib, ssw_colors, ssw_conflicts, ssw_contrib_info
ssw_contrib_monitor, ssw_fs_cat2db, ssw_get_sources, ssw_getapplet
ssw_install [2], ssw_install_explinkages, ssw_instr_info, ssw_javamovie
ssw_jsulr2data, ssw_sec_aktxt2struct, ssw_set_chianti, ssw_setsswdb_gen
ssw_start_rpcserver, ssw_swmap_uniqinfo, ssw_time2paths, ssw_upgrade [1]
ssw_upgrade [2], ssw_upgrade_backup, ssw_url2data, ssw_whereis_perl
sswdb_upgrade, strpair2struct, struct_where, sum_FField, sun_today [1]
sun_today [2], sun_today [3], sw2tree [1], sw2tree [2], sxl_analysis, sxt2eit
sxt2file, sxt2mpeg, sxt_etemp, sxt_files, sxt_html, sxt_mornint, sxt_patch_att
sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_ssc2sss, sxt_ssn2fits [1]
sxt_summary, sxt_uvf_info [1], sxt_uvf_info [3], sxt_where, synop_movie
table2struct, term_times, tfr_summary, tfr_summary2, tim2dbase, timeline
timeline2html, topsdb [1], topsdb [2], tr_build_img [1], tr_head_info
tr_inventory_telem, tr_lut_conv, tr_reformat, tr_summary_head, tr_tab_head
trace_cat, trace_cat2data, trace_decode_idl PLEASE USE trace_jpeg_decomp
trace_dph2struct [1], trace_euv_resp [1], trace_file2path, trace_files
trace_get1www_image, trace_get_vignette, trace_jpeg_decomp
trace_last_movie_queue, trace_make_tma, trace_make_tmr [1], trace_make_tmr [2]
trace_movie_index [1], trace_movie_index [2], trace_movies_prioritize [1]
trace_movies_prioritize [2], trace_newmoviedata, trace_rd_jpeg
trace_recent_movie_summary, trace_request_summary, trace_special_movie [1]
trace_special_movie [2], trace_special_movie [3], trace_special_movie2
trace_success_file, trace_uv_resp, trace_where, ucon_path, url_decode, web_seq
weekid [2], write_access [1], write_access [2], write_trace
wrt_fits_bin_exten [2], wrt_sci160k_img, wrtwkdat, wwwidl_server_check
wwwidl_watchdog [1], wwwidl_watchdog [2], xcheckip, xdisp_fits, xdisp_sci5k
xdisp_tfr, xdisp_trace [1], xdisp_trace2, xdisp_trace3, xhkplot, xset_chain [1]
xset_chain [2], xspr [1], xspr [2], xsw2tree, xsw2tree_event, xswlist [2]
ydb_exist [1], ydb_exist [2], ydb_exist [3], ydb_exist [4], ydb_install [1]
ydb_install [2], ydb_use, yo_mkos1_dbase, yo_xda2legacy, yohkoh_legacy_files [1]
yohkoh_legacy_files [2], yopos [1], yopos [2], ys_contrib [1], ys_contrib [2]
History: written by slf, 11/30/91
4-Sep-92 (MDM) - Modified to handle an array of input files
23-sep-93 (slf) - make sure null file returns false
(findfile count=1! when null requested)
17-Mar-94 (SLF) - use file_stat(/exist) for non wild card cases
April Fools'94 (DMZ) -- added check for :: in file name
(file_stat doesn't work across DECNET)
31-May-94 (DMZ) -- added check for VMS directory name input
(file_stat doesn't seem to work on VMS
dir names like '[ys.atest.soft]')
16-Aug-94 (DMZ) -- added another VMS patch to handle
case when user enters a VMS subdirectory name
without a file name.
6-Aug-97 (Zarro/GSFC) -- added check for nonstring input
30-may-99 (rdb) -- stop use of file_stat with WINDOWS
cause access violation - for wildcard search
8-Jan-1999 - S.L.Freeland - put in IDL version check since 5.3/IRIX
(at least) not backwardly compatible (must use findfile)
10-Jan-1999 - S.L.Freeland - extended 8-jan mod to all UNIX 5.3
15-Feb-2000 - S.L.Freeland - removed 5.3 changes (moved fix to file_stat)
10-Feb-2005 - Kim Tolbert - changed '/' to get_delim()
[Previous]
[Next]
NAME:
file_info
PURPSOSE:
To return information about the file that is not included
in the FSTAT return
CALLING SEQUENCE:
nfil = file_info(infil, finfo)
INPUT:
infil - The input file to find the information for. It
can be a wild card since 'findfile' will be used
OUTPUT:
returns - Number of files found
finfo - A structure with the information in the file.
.SIZE
.REC_LEN
.FILENAME
.DIRECTORY
.DATE
.TIME
.PROTECTION
.OWNER
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], MAKE_STR [1], MAKE_STR [2]
STR2ARR [1], STR2ARR [2], break_file [4]
HISTORY:
Written 14-Nov-91
1-Mar-92 (MDM) - Updated the header information
18-Apr-92 (MDM) - Adjusted to accept an array of file name
[Previous]
[Next]
NAME:
file_info2
PURPSOSE:
To return information about the file from "ls -l" output
CALLING SEQUENCE:
nfil = file_info2(infil, finfo)
nfil = file_info2(dummy, finfo, ls=ls)
INPUT:
infil - The input file to find the information for. It
can contain a wild card. It needs to be a scalar if
wild cards are being used.
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], STR2ARR [1], STR2ARR [2]
anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], break_file [4]
fmt_tim [1], fmt_tim [2], int2secarr [1], int2secarr [2]
CALLED BY:
FIND_CAT, FIND_PROC, NET_DIR_DIFF, disp_sci160k [1], disp_sci160k [2], mk_mo_log
mk_sfc [1], mk_sfc [2], mk_ydb_list, new_dpath [1], new_dpath [2], rd_dpc_table
rd_goes3sec [1], rd_goes3sec [2], rd_hist_dbase [1], rd_hist_dbase [2]
ssw_check_contrib
OPTIONAL KEYWORD INPUT:
ls - The "ls -l" results can be passed directly to
this routine.
OUTPUT:
returns - Number of files found
finfo - A structure with the information in the file.
.SIZE
.FILENAME
.DIRECTORY
.DATE
.DAY
.TIME
.PROTECTION
.OWNER
HISTORY:
Written by M.Morrison 7-Aug-92 taking file_info.pro as a start
7-Oct-92 (MDM) - Added QDEBUG
- Fixed problem with recognizing dates from last year
20-Oct-92 (MDM) - Minor mod
22-Oct-92 (MDM) - Modification to the way that year is recognized
12-May-93 (MDM) - Modification to work on the SGI machine
19-May-93 (MDM) - Added " around ls spawn to work on ADS file
28-Jul-93 (DMZ) - Alpha OSF fix (ls command)
27-Jun-94 (MDM) - Changed how routine figured out if "ls" was performed
on SGI or OSF machine. (not based on !version.os)
1-Aug-95 (MDM) - Patched a bug where infil could come in AND ls
is passed in.
3-Jan-96 (MDM) - Added patch to handle the case where the file size is
over 10 megabytes (the filename was being corrupted)
5-Feb-97 (MDM) - Corrected to work with years over 2000
7-May-97 (MDM) - Modified to use /NOSHELL on the spawn command if
the input has no wildcards
- Added some workaround for file not found (kinda
bogus, but at least it won't crash internally)
[Previous]
[Next]
NAME:
file_list
PURPOSE:
Given a set of directories (and optionally a partial
filename with a wildcard), generage a list of file
names/directories
CALLING SEQUENCE:
infil = file_list(data_paths())
infil = file_list(data_paths(), 'spr*')
infil = file_list(data_paths(), 'spr*', /cd)
infil = file_list(data_paths(), /interactive)
INPUTS:
dirs - The directories to search
If not present, it uses the default directory
str - The wildcard partial filename to search for. Be careful
when using wildcards when searching a directory which has
subdirectories, because it will not work properly. For
CALLED BY:
BCS_24HR_PLOT [1], BCS_24HR_PLOT [3], BCS_CAT, BCS_COMPARE, BCS_CREATE_CAT
BCS_FREE_DATA, FINDFILE_LIST, HKG_DBASE, HXT_AUTOIMG, JITTER_HTML, LASTSFD_DIFF
LOCAL_DIFFS, MK_LIBRARY_HELP, NORH_PR_EVX [1], NORH_PR_EVX [2], NORH_PR_INFO [1]
NORH_PR_INFO [2], NORH_PR_REP [1], NORH_PR_REP [2], NORH_RD_TCX [1]
NORH_RD_TCX [2], NORH_RD_TSX [1], NORH_RD_TSX [2], NORH_SYNTH_BYF [1]
NORH_SYNTH_BYF [2], NORP_RD_AVG [1], NORP_RD_AVG [2], NORP_RD_DAILY [1]
NORP_RD_DAILY [2], NORP_RD_DAT, QUICKDARK [2], QUICK_DPE, READ_MERGED_DSN
RTMVIPLAY [2], RdTap [1], RdTap [2], RdTap [3], SEL_AR, TERM_FIDS, TERM_QUICK
TERM_REVIEW, TOK_RD_DAILY, TR_DARK_SUB, TYKW_RD_DAILY, TYKW_RD_DAT, ace_files
ads2att, allpks_html, att_exst, bcs_unpack, calc_mtm_therm, cdrom_files [2]
cfl_summary [1], cfl_summary [2], check_oldprocess [1], check_oldprocess [2]
check_oldprocess [3], check_oldprocess [4], check_ql_after_lz, chk_flares [1]
chk_flares [2], cp_fns [1], cp_fns [2], daily_forecast [2], dbase2disk
delete_week [1], delete_week [2], disp_sci5k, do_demo [1], do_demo [2]
do_disp_month, doc1liners, doc_summ [1], doc_summ [2], dps_proc_lev0_hk
edac_summary, eit_files, emi_plot [1], emi_summary, file_menu [1], file_menu [2]
file_purge_sizes, flares2disk, fort2hxi [1], fort2hxi [2], full_graph_gif, get1gbo
get_daily [1], get_daily [2], get_dc_warm, get_dirtree, get_gevloc_data
get_hist_dbase_fil, get_hk_info [1], get_hk_info [2], get_last_tfr, get_mk3 [1]
get_mk3 [2], get_seq_tab, get_sfm, get_tf_rec fname filnum recnum [1]
go_hxt_hk_temps, go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_nvs4
go_nvs5, go_rdtap [1], go_rdtap [2], go_sxt_sss2secondary, goes3sec_copy
gtab_summary, hist_count, hist_summary, hsi_pixon_smooth_patterns
jitter_gif_xyimg, lastgbo, lastgki, mdi_write_genxcat, merge_genxcat, mk_fem [1]
mk_fem [2], mk_gev [1], mk_gev [2], mk_gif_mag_index, mk_gx, mk_hst_summary
mk_imgsum_html, mk_mapfile [1], mk_mapfile [2], mk_mdi_iap, mk_mo_log
mk_orbit [1], mk_orbit [2], mk_pix [1], mk_pix [2], mk_sd2, mk_sdc [2], mk_sdc [3]
mk_sdc [4], mk_sdcs, mk_sdl, mk_sdm, mk_sdmi, mk_sfc [1], mk_sfc [2], mk_sft [1]
mk_sft [2], mk_sl [1], mk_sl [2], mk_sot, mk_ssl, mk_tfi, mk_week_file [1]
mk_week_file [2], mo_filelist, mo_job0, mo_job1, mobad_summ, mon_health [1]
mon_health [2], month_sfd_fits [1], month_sfd_fits [2], mostrip
msok_poi_copy [1], msok_poi_copy [2], new_disp_sci5k [1], new_disp_sci5k [2]
new_edac_summary, new_mon_health [1], new_mon_health [2], new_version [1]
new_version [2], newfiles [1], newfiles [2], newfiles [3], newsfd, nts_copy [1]
nts_copy [2], pnt_exst, pr_sfc, pref_deldir, pro_list [1], pro_list [2], rd_dt_genx
rd_old_obs, rd_raw_station_plan, rd_so_at_ftr, rd_week_file [1]
rd_week_file [2], rd_week_file [3], rd_week_file [4], rd_xda_same, read_genxcat
read_mdi, read_msok_jpg, read_spartan, run_dsnfil, sea, sel_dc_image [1]
sel_dc_image [2], sel_dc_image [3], sel_filetimes [1], sel_filetimes [2]
sel_leak_image [1], sel_leak_image [3], sel_leak_image [4], set_sci160k_dir
sfc_check, sfc_prep [1], sfc_prep [2], sft2sfc, show_pix [1], show_pix [2]
show_pixf, soon_com2html, ssw_check_contrib, ssw_findstuff2html, ssw_fs_cat2db
ssw_getapplet, ssw_install [2], ssw_start_rpcserver, ssw_swmap_bestof
ssw_time2paths, sswdb_files, stt_plot, sxt_eff_area, sxt_files, sxt_his2dbase
sxt_ssn2fits [1], tap_wrt_chk, timeline, timeline2html, topsdb [1], topsdb [2]
tr_lut_conv, tr_mk_seq_alph, tr_rd_index, tr_rd_inventory, tr_scan_images
tr_summary_head, trace_do_data_requests, trace_euv_resp [1], trace_files
trace_get_vignette, trace_last_movie_queue, trace_movie_index [1]
trace_movie_index [2], trace_recent_movie_summary, trace_uv_resp, uniq_fid [1]
uniq_fid [2], verify_gui, web_seq, weekid [2], wrt_fits_bin_exten [2], xanal_emi
xcheckip, xdisp_fits, xdisp_sci5k, xdisp_tfr, xdisp_trace [1], xdisp_trace [2]
xdisp_trace2, xdisp_trace3, xrd_trace, xset_chain [1], xset_chain [2], xspr [1]
xspr [2], ydb_exist [2], yo_file_check [1], yo_file_check [2], yo_mkos1_dbase
yohkoh_files, yoyo_man2, ys_file_check [1], ys_file_check [2]
example: file_list('~', '*') will not give the proper
answer, but it will if the /CD option is used. This
is an artifact of how the IDL routine FINDFILE works.
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], break_file [4], concat_dir [4], str_replace [1], str_replace [2]
wc_where [1], wc_where [2]
OPTIONAL KEYWORD INPUT:
interactive - If set, ask the user to type in the partial
filename to search for
cd - If set, then set default to the directory first
and then do the listing. This technique is
needed because of "argument overflow" errors duing
"ls" type commands when there are too many files in
a directory. This happens on the SGI much sooner
than Suns or DECs.
nocd - if set, override /CD default for UNIX
bydate - If set, then list the files by date, with the oldest
file in the beginning of the array, and the newest file
as the last element in the array. ONLY WORKS ON UNIX.
OUTPUTS:
RETURNS: The file list (including the path).
OPTIONAL KEYWORD OUTPUT:
files - Just the file names of the filenames
fdirs - Just the directory portion of the filenames
HISTORY:
Written 11-Dec-91 by M.Morrison
8-Mar-93 (MDM) - Modified to optioncally set default to the directory
and then to do the listing
- Modified to accept an array of input file names
16-Mar-93 (MDM) - Modified to set default back to the starting directory
and not leave you in the last directory when using
the /CD option.
12-Aug-93 (MDM) - Changed how the /CD option works (doesn't actually
do a cd now)
- Added translation of ~ if passed in
27-Oct-93 (AKT) - If wildcard search spec doesn't include .something
then append .*. In VMS, findfile needs the .*.
7-Dec-93 (MDM) - Removed the 27-Oct-93 patch unless the system is
VMS. It causes problems in Unix (show hidden
. (dot) files)
22-Dec-93 (MDM) - Made /CD the default when running on SGI
3-Apr-95 (MDM) - Added /BYDATE
28-Feb-96 (MDM) - Added defining output variable FILES
- Also changed the keyword from FILE to FILES
4-Feb-97 (MDM) - Made the FOR loop a long interger
18-Feb-97 (SLF) - Merged SLF change 7-Nov-96 to protect ultrix/IDL 4.01
30-May-99 (RDB) - Prohibit use of /cd with WINDOWS - doesn't work...
3-Jun-99 (SLF) - make /CD default for UNIX family, add /NOCD override
made 'cd' logic -> case instead of bunch of 'ifs'
10-Aug-00 (DMZ) - added /QUIET and call to chklog(dir)
[Previous]
[Next]
NAME:
file_list2
PURPOSE:
Given a set of directories and a list of filenames, return
the full filenames where they exist. No wildcards are
permitted in "dirs" or "str"
CALLING SEQUENCE:
infil = file_list2(dirs, str)
infil = file_list2(data_paths())
infil = file_list2(data_paths(), 'spr*')
INPUTS:
dirs - The directories to search
If not present, it uses the default directory
str - The file names to find
OUTPUTS:
RETURNS: The file list (including the path).
OPTIONAL KEYWORD OUTPUT:
files - Just the file names of the filenames
fdirs - Just the directory portion of the filenames
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], FILE_EXIST [2], break_file [4], concat_dir [4], file_exist [1]
file_exist [3]
HISTORY:
Written 13-Jan-98 by M.Morrison
[Previous]
[Next]
NAME:
file_menu
PURPOSE:
Given a set of directories (and optionally a partial
filename with a wildcard), display a menu to allow the
user to select the file he wants.
INPUTS:
dirs - The directories to search
If not present, it uses the default directory
str - The wildcard partial filename to search for
interactive - If set, ask the user to type in the partial
filename to search for
OUTPUTS:
RETURNS: The file name (including the path). If quit/exit
is selected, then a null string is returned.
LIMITATIONS:
For a filename that is 32 characters long (for example:
/0d0/ops/reformat/ada910903.0046), the routine will only
handle 365 of those files. BEWARE. If the number is too
large, it will bomb.
CALLS: ***
file_list [1], file_list [2], wmenu_sel [1], wmenu_sel [2]
CALLED BY:
BCS2SXSPC, rd_sda_flare, sun_grid
HISTORY:
Written 21-Oct-91 by M.Morrison
18-Mar-92 (MDM) - Changed to use "file_list" and "wmenu_sel"
[Previous]
[Next]
Project : HESSI
Name : FILE_NAME
Purpose : new improved BREAK_FILE that uses STREGEX and no loops
Category : system utility string
Syntax : IDL> name=file_break(file,[/name,/path,/ext,/drive])
Inputs: : FILE = file names (scalar or array)
Outputs : Name part of file (default or if /name)
Keywords : /PATH = return path part of file
/EXTENSION = return extension part of file
/DRIVE = return drive part [Windows or VMS only]
/EXPAND = expand environment variables in name
/NO_EXTENSION = don't include extension in returned filename
Restrictions: Needs IDL version > 5.3
CALLS: ***
CHKLOG [1], CHKLOG [2], COMDIM2, FILE_BREAK
Side Effects: Input file names are trimmed of redundant spaces
History : Written, 11-Nov-2002, Zarro (EER/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO - CDS
Name : FILE_OR_STRING
Purpose : check if a valid filename or string datatype is being input
Category : utility
Explanation : useful when ASCII input to a program can come from an file
or a string variable
Syntax : IDL> file_or_string,file,string,err=err
CALLED BY:
SEND_MAIL, SEND_PRINT, XMAIL
Example: : send_printer,'test.doc',que='soho-laser1',qual='h'
Inputs : See keywords
Opt. Inputs : None
Outputs : None
Opt. Outputs: None
Keywords : ERR - error message (blank if no error found)
FILE = filename to check
STRING = string variable to check
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
Common : None
Restrictions: None
Side effects: None
History : Version 1, 4-Mar-1996, D.M. Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Name: file_path
Purpose: find file in tree (recursive version of RSI filepath.pro)
Input Parameters:
file - file name to find
topdir - top directory for tree search (default is $IDL_DIR)
Calling Sequence:
filename=file_path(file [,treetop])
Calling Examples:
colorfile=file_path('colors1.tbl') ; find file under $IDL_DIR
CALLS: ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], concat_dir [4]
file_exist [1], file_exist [3], get_logenv [1], get_logenv [2], get_subdirs [1]
get_subdirs [2]
History:
23-jun-1995 (SLF)
[Previous]
[Next]
NAME:
file_purge
PURPOSE:
Purge files that have similar file names. Purge is based on
file name (alphabetical listing) or by reverse creation date.
CALLING SEQUENCE:
file_purge, infil [,/interactive,/bydate,keep=keep]
file_purge, infil [,/interactive,/byname,keep=keep]
file_purge, path=path [pattern='filepattern']
INPUTS:
infil = A file name or a vector of file names (wild cards O.K.)
OPTIONAL KEYWORD INPUTS:
interactive = If set, prompt the user before deleting.
keep = The number to keep. Values less than 1 will cause no
action to be taken. Default = 1.
bydate = Delete the oldest files.
byname = Delete the alphabetically. (file ab is deleted before ac).
Specify /bydate or /byname but not both (/byname = default).
directory = if set, do a directory listing (no infil passed)
path = synonym for directory
pattern = only used with DIR keyword - if set, only match this pattern
filter = synonym for PATTERN
OUTPUTS:
None.
CALLS: ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], STR2ARR [1], STR2ARR [2]
concat_dir [4], prstr [1], prstr [2], str_replace [1], str_replace [2], yesnox [1]
yesnox [2]
CALLED BY:
check_oldprocess [1], check_oldprocess [3], daily_forecast [2]
RESTRICTIONS:
For unix only.
MDDIFICATION HISTORY:
Written, 19-sep-92, J. R. Lemen, LPARL.
7-Dec-92 (MDM) - Made the delete command use "-f" option
27-Apr-93 (MDM) - Modification to work even when the input list is
a long list of filenames
7-Aug-93 (SLF) - use file_delete.pro (bypass shell speed/alias probs)
add dir keyword
2-oct-95 (SLF) - add FILTER,PATTERN, and PATH keywords
[Previous]
[Next]
Name: file_purge_sizes
Purpose: purge files > -OR- < some file size threshold
Input Parameters:
files - the file list to consider (may alternately use PATH and PATTERN)
Keyword Parameters:
PATH - path to 'look' in
PATTERN - file pattern to look for
KEEP - number of matching files to keep around
ABOVE_SIZE - only consider purging files > than this size
BELOW_SIZE - only consider purging files < than this size
LOGS - if set, set PATH=>$SSW_SITE_LOGS
TESTING - show what it WOULD have purged without actually doing it
Calling Sequence:
file_purge_sizes, files, keep=nn, below_size=XXX
file_purge_sizes, pattern=xxx, path=zzz, keep=nn, above_size=XXX
CALLS: ***
BOX_MESSAGE, data_chk [1], data_chk [2], file_list [1], file_list [2]
file_size [1], file_size [2], get_logenv [1], get_logenv [2]
History:
18-November-1998 - S.L.Freeland - initially for log file maint.
Example - want to keep all "interesting" logs from
a high cadence cron job where "interesting" is
larger than some threshold size but limit
accumulation of "uninteresting" logs
[Previous]
[Next]
Project : HESSI
Name : FILE_SINCE
Purpose : LOCATE files older/newer than a specified time
Category : utility system
Inputs : See keywords
Outputs : FILES = located files
Keywords : OLDER = find files older than this interval
NEWER = files newer than this interval
DAYS = interval units in days [def]
HOURS = interval units in hours
ERR= string error
TIME_REF = time to reference against [def= current]
COUNT = # of files found
CALLS: ***
ANYTIM2TAI, EXIST, FILE_CONTENT, IS_BLANK, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
VALID_TIME, is_number [1], is_number [2]
CALLED BY:
EIT__DEFINE, GOES__DEFINE, RD_GOES_SDAC
History : 24-Feb-2002, D.M. Zarro (EITI/GSFC) Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Name: file_size
Purpose: return file sizes - optionally as string with units
Keyword Parameters:
string - if set, output is string
auto - if set, auto-scale (ex: Kb, Mb, ....)
total - if set, total all file sizes before string/auto applied
(example, display total transfer for NN files)
CALLS: ***
FILE_STAT [1], FILE_STAT [2], file_stat [3]
CALLED BY:
HTTP__DEFINE, SOCK_SAME, comp_sfr_arch, eit_genx_cat, file_purge_sizes
genx2html [1], genx2html [2], get_dirtree, go_mk_cd, image2movie, is_ps, prep_gendat
sswdb_install, tap_wrt_chk, thumbnail_table_html, tr_inventory_telem
trace_do_data_requests, trace_get1www_image, trace_request_summary
Restrictions:
auto and string not yet vecorized
History:
8-Feb-1995 S.L.Freeland
15-jul-1997 (SLF) - add TOTAL keyword and function
20-aug-2003 (SLF) - change 'string' -> 'fstring' (handle > 1024)
[Previous]
[Next]
Project : SOHO - SSW
Name : FILE_STAT()
Purpose : Vector version of FSTAT
Category : Utility, Operating_system
Explanation : Vector version of FSTAT
Syntax : Result = FILE_STAT( FILES )
CALLED BY:
EIT_PREP, FILE_EXIST [2], GET_CACHE, LASCO_READFITS [1], UNIX_CMD [1]
UNIX_CMD [2], XDIFF, archive_ck [1], archive_ck [2], data_compress [1]
data_compress [2], data_compress [3], delete_week [1], delete_week [2]
file_exist [1], file_exist [3], file_size [1], file_size [2], fl_mktext
hessi_version, mk_orbit [1], mk_orbit [2], mo_check, mo_patch, monitor_scratch [1]
monitor_scratch [2], rd_hk [1], rd_hk [2], yo_file_check [1], yo_file_check [2]
ys_file_check [1], ys_file_check [2]
Examples :
Inputs : FILES = List of files to check.
Opt. Inputs : None.
Outputs : None.
Opt. Outputs: None.
Keywords : EXIST = If set, then the returned values are whether the
files exist or not. This is the default behavior.
SIZE = If set, then the returned values are the sizes of the
files.
FSTAT_ALL = If set, return vector of 'fstat' structures. This
keyword is only compatible with files less than about
2 GB each in size.
Calls : ***
data_chk [1], data_chk [2]
Common : None.
Restrictions: None.
Side effects: None.
Prev. Hist. : 11-Mar-1994 (SLF) Wanted faster file_exist function
History : Version 1, 11-Mar-1994, S. Freeland
Version 1.1 05-Jun-1998, J. Newmark changed loop to long
Version 1.2 15-Feb-2000, S.L.Freeland - work around RSI
Version 5.3 non-backwardly compatible change....
Version 1.3 10-Mar-2000, S.L.Freeland - fix 5.3 /SIZE bug
Version 1.4 14-Jun-2002, S.L.Freeland - add FSTAT_ALL
Version 2, 1-Mar-2005, W.T. Thompson - Add support for files
greater than 2 GB
Contact : SFREELAND
Restrictions:
file size returned for directories under +5.3 is not valid
[Previous]
[Next]
Name: file_uncompress
Purpose: provide IDL interface to standard unix uncompress & gzip utility
Input Paramaters:
inname - file name or vector of file names to gunzip or uncompress
Output Parameters:
outname - uncompressed file names (same dimension as inname)
(usually, inname without .gz or .Z extension, null if problem)
Optional Keyword Parameters
noreplace - (input) - switch, if set, don't replace inname with outname
newname - (input) NOT IMPLEMENTED specify outname
outdir - (input) specify output directory (only if /noreplace)
loud - (input) if set, include Verbose switch on unix call
Calling Sequence:
file_compress, inname [, outname ,/noreplace , outdir=outdir ]
CALLED BY:
RFITS2 [1], RFITS2 [2], data_compress [1], data_compress [2], data_compress [3]
mk_sdm, rd_week_file [1], rd_week_file [3], rd_week_file [4], selsisi_copy
History: 1-Jul-93 (SLF)
7-Oct-93 (SLF) Added OUTDIR keyword parameter
14-Mar-94 (SLF) enclose file names in quotes (embedded meta-char)
11-apr-95 (SLF) make quiet the default, use /loud to override
09-Dec-97 (PGS) added test for .gz extensions and gunzip call
29-Dec-01 (TAK) can now uncompress a combination of .gz and .Z files
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], FILE_EXIST [2], break_file [4], concat_dir [4], file_exist [1]
file_exist [3], str_replace [1], str_replace [2], tbeep [1], tbeep [2], tbeep [3]
Restrictions: UNIX only
[Previous]
[Next]
Name: files2data
Purpose: read multiple files->3D cube w/optional congrid
Input Parameters:
files - vector of gif file names
Output:
function returns 3D data (1 image per <files>)
Output Parameters:
r,g,b - R,G,B (taken from last file read) - only valid for
verified formats
Keyword Parameters:
outsize - optional 1 or 2 element vector - desired [NX,NY] output
diffsize - (switch) - if set, size NX,NY from larges image
[default size is relative to first image in list]
eightbit=eightbit - set if true colors -> 8 bit desired
Calling Sequence:
IDL> cube=files2data(files [,outsize=[nx,ny] ] [,/DIFFSIZE ]
CALLS: ***
BOX_MESSAGE, CONGRID [1], CONGRID [2], CONGRID [3], data_chk [1], data_chk [2]
is_member [1], is_member [2], ssw_strsplit
CALLED BY:
ssw_jsulr2data
History:
17-Feb-2000 - S.L.Freeland - probably done before...
Circa 1-Jan-2003 - add eightbit, use read_trueimage if applicable
20-May-2003 - S.L.Freeland - merge W.Thompson 8-May mod w/above mod
(strsplit -> ssw_strsplit)
4-apr-2006 - S.L.Freeland - fix typo in read_image piece
Method:
GIF and TIFF are only "verified" readers for now.
This uses execute statement for automatic extension to
other 'read_xxx' readers but "user beware" for those.
[Previous]
[Next]
NAME:
files_search
PURPOSE:
Search all files in a set of Unix sub-directories for an input string
CALLING SEQUENCE:
files_search
files_search, indir, instr, outfil, fil_spec=fil_spec
files_search, '/ys', 'makvec'
files_search, '/ys', 'hel2pix', 'dum.dum', fil_spec='*.pro'
INPUT:
indir - The top directory to search. All directories under it will
be searched
instr - The string to search all files in the subdirectories for
OPTIONAL INPUT:
outfil - The name of the file to write the results to. Default is
"FILES_SEARCH.TXT"
OPTIONAL KEYWORD INPUT:
fil_spec- The file specification to search for ('*' for example)
Default is "*.pro"
HISTORY:
Written Nov-91 by M.Morrison
20-Oct-92 (MDM) - Added document header
- Added FIL_SPEC
27-Oct-92 (MDM) - Renamed from SEA.PRO to FILES_SEARCH.PRO
[Previous]
[Next]
Name: files_since
Purpose: return files in <directory> newer than <reference> file
Input Parameters:
directory - directory to start search (recursive if tree)
reference - reference file (ex: a dbase file)
OR integer number of days old
Output Parameters:
count - number files found newer than reference
Calling Sequence:
IDL> newfiles=files_newer(directory, reference [,count])
Calling Example:
IDL> nf=files_newer('$INPUT_DIRECTOR','$DBASE_FILE')
(returns files in $INPUT_DIRECTOR which have been updated
since last update to $DBASE_FILE_
Usage: updating dbase files if any potential input files
have been updated since last dbase update
History:
6-March-1998 - S.L.Freeland - various ssw/dbase management uses
CALLS: ***
BOX_MESSAGE, FILES_NEWER, OS_FAMILY, STR2ARR [1], STR2ARR [2], data_chk [1]
data_chk [2], get_logenv [1], get_logenv [2]
Restrictions:
UNIX only
[Previous]
[Next]
Name: filetimes
Purpose: return start and stop times in Yohkoh reformatted files
Input Parameters:
files - array of reformatted file names
Ouput Paramters:
startt - start time of file in external format (7,n)
stopt - stop time of files in external format (7,n)
Optional Keyword Parameters:
string - if set, return time is converted to string strarr(n)
Method : calls rd_fheader and converts start and stop times
CALLS: ***
Int2Ex [1], Int2Ex [2], Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], gt_day [1]
gt_day [2], gt_time [1], gt_time [2]
CALLED BY:
chk_flares [1], chk_flares [2]
History: slf, 3-August-1992
[Previous]
[Next]
Project : SOHO - CDS
Name : FILL_BOX
Purpose : To fill a plot box with one of a selection of patterns.
Explanation : In a line plot fill column from x-bin/2 to x+bin/2 and
from y=0 to y with the selected pattern.
Use : IDL> fill_box,x,y,bin [,patt, /border, ymin=ymin, /bstyle]
Inputs : x - the x-axis location of the box
y - the maximum y-axis extent of the box
bin - the width of the box on x-axis
Opt. Inputs : patt - 0: solid (default)
1: hatch backward
2: hatch forward
3: vertical
4: horizontal
5: grid
6: cross hatch
7: empty
Outputs : None
Opt. Outputs: None
Keywords : border - if present a border is drawn around the filled box.
ymin - if present the box is filled from ymin to y otherwise
from 0 to y.
bstyle - sets line style for border or if requested
Calls : None
CALLED BY:
DISPLAY_GIS_WIN, PLOT_DEX, PLOT_WINDOWS, TP_PLOT_DEW
Restrictions: Plot must have been performed before call to this routine.
Side effects: None
Category : Utilities, Plotting
Prev. Hist. : None
Written : C D Pike, RAL, 10-May-1993
Modified : Added ymin keyword. CDP 21-Apr-94
Add empty possibility, add bstyle/outline keywords.
CDP 14-Jul-94
Temporarily suspend X-windows mode. CDP, 18-Jul-94
(It was crashing my Alpha)
Version : Version 3, 14-Jul-94
[Previous]
[Next]
Project : SOHO - CDS
Name : FILL_CATEGORY
Purpose : Load save file with current categories
Explanation : Uses the CATEGORY routine to create a list of
relevant names and categories and then stores then in
$CDS_INFO/categories.save for later retrieval by TFTD with
the CAT keyword.
Use : IDL> fill_category [,/prog]
Inputs : None
Opt. Inputs : None
Outputs : Save file created in /cs
Opt. Outputs: None
Keywords : PROG - if present fill tables for 'programmers' routines.
Calls : ***
Bell, CATEGORY, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
Common : None
Restrictions: None
Side effects: None
Category : Util, help
Prev. Hist. : None
Written : C D Pike, RAL, 20-Sep-94
Modified : Use write version of env. variable. CDP, 20-Oct-95
Version : Version 2, 20-Oct-95
[Previous]
[Next]
Project : SOHO - CDS
Name : FILL_MISSING
Purpose : Fill in missing pixels in a data array
Category : Class3, Analysis, Interpolation
Explanation : Uses bilinear interpolation to fill in missing pixels in a data
array
Syntax : FILL_MISSING, ARRAY, MISSING [, DIMENSION ]
CALLED BY:
CDS_CLEAN, CDS_CLEAN_IMAGE, CDS_FILL_MISSING, CDS_MOSAIC, CDS_QUASI_FIT
GET_VDS_BIAS, NIS_CALIB, NIS_QUICKLOOK, NIS_ROTATE
Examples :
Inputs : ARRAY = Array containing missing pixels to fill in.
MISSING = Value flagging missing pixels.
Opt. Inputs : DIMENSION = When ARRAY is multi-dimensional, then the dimension
to use
Outputs : ARRAY = The input array is modified to fill in missing pixels
with interpolated values.
Opt. Outputs: None.
Keywords : EXTRAPOLATE = If set, the extrapolation is used at the ends of
the array. Otherwise, the nearest good value is
extended to the end of the array.
Calls : ***
TRIM, WHERE_MISSING
Common : None.
Restrictions: None.
Side effects: None.
Prev. Hist. : None.
History : Version 1, 26-Mar-1996, William Thompson, GSFC
Version 2, 02-Apr-1996, William Thompson, GSFC
Corrected bug when several pixels are missing at end of
array.
Version 3, 25-Apr-1996, William Thompson, GSFC
Corrected bug when array contains only one good pixel.
Version 4, 07-Jun-1996, William Thompson, GSFC
Fix bug where interpolation goes to missing value.
Version 5, 08-Aug-1997, William Thompson, GSFC
Change so that ends are extended rather than
extrapolated by default. Added /EXTRAPOLATE keyword.
Version 6, 11-May-2005, William Thompson, GSFC
Handle NaN values
Contact : WTHOMPSON
[Previous]
[Next]
Project : SOHO - CDS
Name : FILL_TFTD
Purpose : Load save file with current one-liners
Explanation : Uses the PURPOSE routine to create a list of
relevant one-liners and then stores then in
$CDS_INFO/1liners.save for later retrieval by TFTD.
Use : IDL> fill_tftd [,/prog]
Inputs : None
Opt. Inputs : None
Outputs : Save file created in /cs
Opt. Outputs: None
Keywords : PROG - if present fill tables for 'programmers' routines.
Calls : ***
Bell, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], PURPOSE, concat_dir [4]
Common : None
Restrictions: None
Side effects: None
Category : Util, help
Prev. Hist. : None
Written : C D Pike, RAL, 13-May-94
Modified : Change storage directory of save file, CDP, 20-May-1994
To include list of intrinsic routines. CDP, 25-May-95
Add PROG keyword. CDP, 13-Jun-94
Take account of new directory structure. CDP, 21-Jun-94
Add database directories. CDP, 22-Jul-94
Add ql_disp directory to user lists. CDP, 14-Sep-94
Added specific routines in the planning
directories. CDP, 11-Jan-95
Add wavelength calibration routines. CDP, 30-Jan-95
Add user telemetry calibration programs. CDP, 3-Feb-95
Add /xdr to save file. CDP, 3-Apr-95
Add further telemetry programs. CDP, 18-Jun-95
Add Dere spectral synthesis. CDP, 14-Jul-95
Use write version of env. variable. CDP, 20-Oct-95
Added /cs/update directory. CDP, 28-Jun-96
Added demo engineering directory. CDP, 26-Jul-96
Added intensity calib directory. CDP, 22-Aug-96
Added all CHIANTI directory routines. CDP, 10-Jun-97
Version : Version 18, 10-Jun-97
[Previous]
[Next]
Name: film_thumbnail
Purpose: embed thumbnail image in "film" (make www logos/thumbnails)
Input Parameters:
thumbnail - image to enclose in film
Output:
function returns thumbnail embedded in "film" bitmap (always byte)
mag - if set, film "thickness" (default is auto scale)
pad - if set, increase the size of the surrounding pad (default auto scale)
sample - if set, rebin called with /sample (sharp edge film "holes")
frame_size - if set, draw frame borders (assume equal-width)
nframes - if set, draw frame borders (in lieu of frame_size, equal-width)
fcolor - if set, use this color for frame borders (default is bright)
Calling Sequence:
thumbnail_logo=film_thumbnail(thumbnail [,mag=mag, pad=pad, /sample, $
frame_size=nn, nframes=nn, fcolor=cn])
CALLED BY:
mkthumb
History:
26-oct-1995 (S.L.Freeland) - SXT/YPOP/EIT (etc) WWW movie icons
[Previous]
[Next]
Project : SOHO-CDS
Name : FILT_DATA
Purpose : filter data according to specified criteria
Category : utility
Syntax : ij=filt_data(data)
Inputs : DATA = data array
Outputs : IJ = indicies of filtered data
Keywords : MIN = filter out data below DMIN
MAX = filter out data above DMAX
MISSING = filter out data values that equal MISSING
POSITIVE = filter out negative or zero data
INVERSE = return indicies of unfiltered data
COUNT = # of filtered data values
EXCLUDE = filter out these indicies
NAN = check for NaNs
CALLS: ***
EXIST, PR_SYNTAX
CALLED BY:
DSCALE
History : Written 16 Feb 1999, D. Zarro, SM&A/GSFC
Modified 31 October 2003, Zarro (L-3/GSFC) - added check for NaNs
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HESSI
Name : FILT_EVENTS
Purpose : filter times based on proximity to flare event
Category : synoptic gbo
Syntax : IDL> ftimes=filt_events(times,dur,count=count)
Inputs : TIMES = input times to filter (TAI format)
Optional Inp: DUR = duration for each time (secs)
PREFLARE = minutes of preflare event time
to consider [def=0]
Outputs : FTIMES = times that overlap event start/stop times
Keywords : COUNT = # of overlapping times
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST
RD_GEV, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], decode_gev
get_uniq, is_number [1], is_number [2]
CALLED BY:
SITE__DEFINE
History : Written 18 Jul 2001, D. Zarro, EITI/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
FILTER_IMAGE
PURPOSE:
Identical to MEDIAN or SMOOTH but handle edges and allow iterations.
EXPLANATION:
Computes the average and/or median of pixels in moving box,
replacing center pixel with the computed average and/or median,
(using the IDL SMOOTH() or MEDIAN() functions).
The main reason for using this function is the options to
also process the pixels at edges and corners of image, and,
to apply iterative smoothing simulating convolution with Gaussian,
and/or to convolve image with a Gaussian kernel.
CALLING SEQUENCE:
Result = filter_image( image, SMOOTH=width, MEDIAN = width, /ALL_PIXELS
/ITERATE, FWHM =, /NO_FT_CONVOL)
INPUT:
image = 2-D array (matrix)
OPTIONAL INPUT KEYWORDS:
SMOOTH = scalar (odd) integer specifying the width of a square box
for moving average, in # pixels. /SMOOTH means use box
width = 3 pixels for smoothing.
MEDIAN = scalar (usually odd) integer specifying the width of square
moving box for median filter, in # pixels. /MEDIAN means use
box width = 3 pixels for median filter.
/ALL_PIXELS causes the edges of image to be filtered as well. This
is accomplished by reflecting pixels adjacent to edges outward
(similar to the /EDGE_WRAP keyword in CONVOL).
Note that this is a different algorithm from the /EDGE_TRUCATE
keyword to SMOOTH or CONVOL, which duplicates the nearest pixel.
/ITERATE means apply smooth(image,3) iteratively for a count of
(box_width-1)/2 times (=radius), when box_width >= 5.
This is equivalent to convolution with a Gaussian PSF
of FWHM = 2 * sqrt( radius ) as radius gets large.
Note that /ALL_PIXELS is automatically applied,
giving better results in the iteration limit.
(also, MEDIAN keyword is ignored when /ITER is specified).
FWHM_GAUSSIAN = Full-width half-max of Gaussian to convolve with image.
FWHM can be a single number (circular beam),
or 2 numbers giving axes of elliptical beam.
/NO_FT_CONVOL causes the convolution to be computed directly,
with intrinsic IDL CONVOL function. The default is to use
FFT when factors of size are all LE 13. Note that
external function convolve.pro handles both cases)
OPTIONAL INPUT/OUTPUT KEYWORD:
PSF = Array containing the PSF used during the convolution. This
keyword is only active if the FWHM_GAUSSIAN keyword is also
specified. If PSF is undefined on input, then upon output it
contains the Gaussian convolution specified by the FWHM_GAUSSIAN
keyword. If the PSF array is defined on input then it is used
as the convolution kernel, the value of the FWHM_GAUSSIAN keyword
is ignored. Typically, on a first call set PSF to an undefined
variable, which can be reused for subsequent calls to prevent
recalculation of the Gaussian PSF.
RESULT:
Function returns the smoothed, median filtered, or convolved image.
If both SMOOTH and MEDIAN are specified, median filter is applied first.
CALLS: ***
CONVOLVE, FACTOR, PSF_GAUSSIAN [1], PSF_GAUSSIAN [2]
CALLED BY:
REMOVE_CR, SIGMA_FILTER, point_filter, sigma_mask
EXAMPLES:
To apply 3x3 moving median filter and
then 3x3 moving average, both applied to all pixels:
Result = filter_image( image, /SMOOTH, /MEDIAN, /ALL )
To iteratively apply 3x3 moving average filter for 4 = (9-1)/2 times,
thus approximating convolution with Gaussian of FWHM = 2*sqrt(4) = 4 :
Result = filter_image( image, SMOOTH=9, /ITER )
To convolve all pixels with Gaussian of FWHM = 3.7 x 5.2 pixels:
Result = filter_image( image, FWHM=[3.7,5.2], /ALL )
EXTERNAL CALLS:
function psf_gaussian
function convolve
pro factor
function prime ;all these called only if FWHM is specified
PROCEDURE:
If both /ALL_PIXELS (or /ITERATE) keywords are set then
create a larger image by reflecting the edges outward, then call the
IDL MEDIAN() or SMOOTH() function on the larger image, and just return
the central part (the original size image).
NAN values are recognized during calls to MEDIAN() or SMOOTH(), but
not for convolution with a Gaussian (FWHM keyword supplied).
HISTORY:
Written, 1991, Frank Varosi, NASA/GSFC.
FV, 1992, added /ITERATE option.
FV, 1993, added FWHM_GAUSSIAN= option.
Converted to IDL V5.0 W. Landsman September 1997
Use /EVEN call to median, recognize NAN values in SMOOTH
W. Landsman June 2001
Added PSF keyword, Bjorn Heijligers/WL, September 2001
[Previous]
[Next]
NAME:
FIND
PURPOSE:
Find positive brightness perturbations (i.e stars) in an image
EXPLANATION:
Also returns centroids and shape parameters (roundness & sharpness).
Adapted from 1986 STSDAS version of DAOPHOT.
CALLING SEQUENCE:
FIND, image, [ x, y, flux, sharp, round, hmin, fwhm, roundlim, sharplim
PRINT= , /SILENT ]
INPUTS:
image - 2 dimensional image array (integer or real) for which one
wishes to identify the stars present
OPTIONAL INPUTS:
FIND will prompt for these parameters if not supplied
hmin - Threshold intensity for a point source - should generally
be 3 or 4 sigma above background
fwhm - FWHM to be used in the convolve filter
sharplim - 2 element vector giving low and high cutoff for the
sharpness statistic (Default: [0.2,1.0] ). Change this
default only if the stars have significantly larger or
or smaller concentration than a Gaussian
roundlim - 2 element vector giving low and high cutoff for the
roundness statistic (Default: [-1.0,1.0] ). Change this
default only if the stars are significantly elongated.
OPTIONAL INPUT KEYWORDS:
/SILENT - Normally, FIND will write out each star that meets all
selection criteria. If the SILENT keyword is set and
non-zero, then this printout is suppressed.
PRINT - if set and non-zero then FIND will also write its results to
a file find.prt. Also one can specify a different output file
name by setting PRINT = 'filename'.
OPTIONAL OUTPUTS:
x - vector containing x position of all stars identified by FIND
y- vector containing y position of all stars identified by FIND
flux - vector containing flux of identified stars as determined
by a Gaussian fit. Fluxes are NOT converted to magnitudes.
sharp - vector containing sharpness statistic for identified stars
round - vector containing roundness statistic for identified stars
NOTES:
(1) The sharpness statistic compares the central pixel to the mean of
the surrounding pixels. If this difference is greater than the
originally estimated height of the Gaussian or less than 0.2 the height of the
Gaussian (for the default values of SHARPLIM) then the star will be
rejected.
(2) More recent versions of FIND in DAOPHOT allow the possibility of
ignoring bad pixels. Unfortunately, to implement this in IDL
would preclude the vectorization made possible with the CONVOL function
and would run extremely slowly.
PROCEDURE CALLS:
GETOPT()
REVISION HISTORY:
Written W. Landsman, STX February, 1987
ROUND now an internal function in V3.1 W. Landsman July 1993
Change variable name DERIV to DERIVAT W. Landsman Feb. 1996
Use /PRINT keyword instead of TEXTOUT W. Landsman May 1996
Changed loop indices to type LONG W. Landsman Aug. 1997
Converted to IDL V5.0 W. Landsman September 1997
Replace DATATYPE() with size(/TNAME) W. Landsman Nov. 2001
Fix problem when PRINT= filename W. Landsman October 2002
Fix problems with >32767 stars D. Schlegel/W. Landsman Sep. 2004
CALLS:
CALLED BY
T_FIND
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_ALL_DIR()
Purpose : Finds all directories under a specified directory.
Explanation : This routines finds all the directories in a directory tree
when the root of the tree is specified. This provides the same
functionality as having a directory with a plus in front of it
in the environment variable IDL_PATH.
Use : Result = FIND_ALL_DIR( PATH )
PATHS = FIND_ALL_DIR('+mypath', /PATH_FORMAT)
PATHS = FIND_ALL_DIR('+mypath1:+mypath2')
Inputs : PATH = The path specification for the top directory in the
tree. Optionally this may begin with the '+'
character but the action is the same unless the
PLUS_REQUIRED keyword is set.
One can also path a series of directories separated
by the correct character ("," for VMS, ":" for Unix)
Opt. Inputs : None.
Outputs : The result of the function is a list of directories starting
from the top directory passed and working downward from there.
Normally, this will be a string array with one directory per
array element, but if the PATH_FORMAT keyword is set, then a
single string will be returned, in the correct format to be
incorporated into !PATH.
Opt. Outputs: None.
Keywords : PATH_FORMAT = If set, then a single string is returned, in
the format of !PATH.
PLUS_REQUIRED = If set, then a leading plus sign is required
in order to expand out a directory tree.
This is especially useful if the input is a
series of directories, where some components
should be expanded, but others shouldn't.
RESET = Often FIND_ALL_DIR is used with logical names. It
can be rather slow to search through these
subdirectories. The /RESET keyword can be used to
redefine an environment variable so that subsequent
calls don't need to look for the subdirectories.
To use /RESET, the PATH parameter must contain the
name of a *single* environment variable. For example
setenv,'FITS_DATA=+/datadisk/fits'
dir = find_all_dir('FITS_DATA',/reset,/plus)
The /RESET keyword is usually combined with
/PLUS_REQUIRED.
Calls : ***
BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], FIND_WITH_DEF [1]
FIND_WITH_DEF [2], FIND_WITH_DEF [3]
CALLED BY:
CHECK_INTEG, CMP_LIBS, CMP_TREES, FIND_FILES, FIX_ZDBASE, HESSI_DATA_PATHS [1]
HESSI_DATA_PATHS [2], IDL5TO4, MK_RASTER, MK_SUMER_DBASE, QZDBASE, SET_CDS_SDB
SHOW_DATAWIN, SHOW_LINELIST, SHOW_RASTER, SHOW_STUDY, hessi_grid_trans
Common : None.
Restrictions: PATH must point to a directory that actually exists.
On VMS computers this routine calls a command file,
FIND_ALL_DIR.COM, to find the directories. This command file
must be in one of the directories in IDL's standard search
path, !PATH.
This procedure does not yet work in MacOS. However, some
routines may call this routine anyway with the /PLUS_REQUIRED
keyword. This should be safe to do.
Side effects: None.
Category : Utilities, Operating_system.
Prev. Hist. : None.
Written : William Thompson, GSFC, 3 May 1993.
Modified : Version 1, William Thompson, GSFC, 3 May 1993.
Version 2, William Thompson, GSFC, 6 July 1993.
Added sort to spawned command under Unix.
Version 3, William Thompson, GSFC, 16 May 1995
Modified to support multiple directories.
Added keyword PLUS_REQUIRED
Version 4, William Thompson, GSFC, 6 August 1996
Added keyword RESET
Fixed bug that caused routine to not work right with
environment variables that started with "+"
Version 5, William Thompson, GSFC, 9 August 1996
Try to trap errors where invalid environment names are
passed.
Version 6, William Thompson, GSFC, 20 August 1996
Fixed bug when trying to reset environment variable
that only points to a single directory.
Version 7, William Thompson, GSFC, 13 February 1998
Include Windows and MacOS seperators.
Version 8, William Thompson, GSFC, 8 June 1998
Include call to FIND_WIND_DIR. This gives complete
functionality under Windows.
Version 9, William Thompson, GSFC, 30-Nov-1999
Include call to IS_DIR
Version 10, William Thompson, GSFC, 03-Dec-1999
Don't use IS_DIR output in Unix--possible problem with
automount on some systems.
Version 11, Zarro (SM&A/GSFC), 23-March-00
Removed all calls to IS_DIR
Version 12, William Thompson, GSFC, 02-Feb-2001
In Windows, use built-in expand_path if able.
Version 13, William Thompson, GSFC, 23-Apr-2002
Follow logical links in Unix
(Suggested by Pascal Saint-Hilaire)
Version 14, Zarro (EER/GSFC), 26-Oct-2002
Saved/restored current directory to protect against
often mysterious directory changes caused by
spawning FIND in Unix
Version 15, William Thompson, GSFC, 9-Feb-2004
Resolve environment variables in Windows.
Version : Version 15
[Previous]
[Next]
NAME:
FIND_ALL_DIR()
PURPOSE:
Finds all directories under a specified directory.
EXPLANATION:
This routine finds all the directories in a directory tree when the
root of the tree is specified. This provides the same functionality as
having a directory with a plus in front of it in the environment
variable IDL_PATH.
CALLING SEQUENCE:
Result = FIND_ALL_DIR( PATH )
PATHS = FIND_ALL_DIR('+mypath', /PATH_FORMAT)
PATHS = FIND_ALL_DIR('+mypath1:+mypath2')
INPUTS:
PATH = The path specification for the top directory in the tree.
Optionally this may begin with the '+' character but the action
is the same unless the PLUS_REQUIRED keyword is set.
One can also path a series of directories separated
by the correct character ("," for VMS, ":" for Unix)
OUTPUTS:
The result of the function is a list of directories starting from the
top directory passed and working downward from there. Normally, this
will be a string array with one directory per array element, but if
the PATH_FORMAT keyword is set, then a single string will be returned,
in the correct format to be incorporated into !PATH.
OPTIONAL INPUT KEYWORDS:
PATH_FORMAT = If set, then a single string is returned, in
the format of !PATH.
PLUS_REQUIRED = If set, then a leading plus sign is required
in order to expand out a directory tree.
This is especially useful if the input is a
series of directories, where some components
should be expanded, but others shouldn't.
RESET = Often FIND_ALL_DIR is used with logical names. It
can be rather slow to search through these subdirectories.
The /RESET keyword can be used to redefine an environment
variable so that subsequent calls don't need to look for the
subdirectories.
To use /RESET, the PATH parameter must contain the name of a
*single* environment variable. For example
setenv,'FITS_DATA=+/datadisk/fits'
dir = find_all_dir('FITS_DATA',/reset,/plus)
The /RESET keyword is usually combined with /PLUS_REQUIRED.
PROCEDURE CALLS:
DEF_DIRLIST, FIND_WITH_DEF(), BREAK_PATH()
CALLS: ***
BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], FIND_WITH_DEF [1]
FIND_WITH_DEF [2], FIND_WITH_DEF [3]
CALLED BY:
CHECK_INTEG, CMP_LIBS, CMP_TREES, FIND_FILES, FIX_ZDBASE, HESSI_DATA_PATHS [1]
HESSI_DATA_PATHS [2], IDL5TO4, MK_RASTER, MK_SUMER_DBASE, QZDBASE, SET_CDS_SDB
SHOW_DATAWIN, SHOW_LINELIST, SHOW_RASTER, SHOW_STUDY, hessi_grid_trans
RESTRICTIONS:
PATH must point to a directory that actually exists.
REVISION HISTORY:
Version 11, Zarro (SM&A/GSFC), 23-March-00
Removed all calls to IS_DIR
Version 12, William Thompson, GSFC, 02-Feb-2001
In Windows, use built-in expand_path if able.
Version 13, William Thompson, GSFC, 23-Apr-2002
Follow logical links in Unix
(Suggested by Pascal Saint-Hilaire)
Version 14, Zarro (EER/GSFC), 26-Oct-2002
Saved/restored current directory to protect against
often mysterious directory changes caused by
spawning FIND in Unix
Version 15, William Thompson, GSFC, 9-Feb-2004
Resolve environment variables in Windows.
Version : Version 16 W. Landsman GSFC Sep 2006
Remove VMS support
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_CAT
Category : Utility
Purpose : Find and list routines matching input category string
Explanation : Used in WWW category search engine
Syntax : IDL> find_cat,category
Inputs : CATEGORY = category name (e.g. widgets)
Opt. Inputs : None
Outputs : ITEMS = listing of matching routines
Opt. Outputs: None
Keywords : FILE = output file for listing (otherwise goes to screen)
RESET = force reading of SSW databases
COUNT = number of hits
GEN = only search GEN branches
BEST = search BESTOF database
CLEAN = name of temporary files to delete
PURPOSE = append purpose to listing
MINCHAR = min chars required for input category name
NAME = set to search by name
EXACT = set for exact match
SITE = search SITE specific info databases
UPDATE = update memory copy of DBASE if disk copy changed
CALLS: ***
ANYTIM2TAI, APPEND_ARR, ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2]
BREAK_FILE [3], CACHE_DATA, CHKLOG [1], CHKLOG [2], DATATYPE [1], DATATYPE [2]
DATATYPE [3], ESPAWN, EXIST, NINT [1], NINT [2], PR_SYNTAX, RM_FILE, STR2ARR [1]
STR2ARR [2], STREP [1], STREP [2], STREP [3], STREP [4], STREP [5], STRIP_WILD, TRIM
break_file [4], file_info2 [1], file_info2 [2], rd_tfile [1], rd_tfile [2]
str_replace [1], str_replace [2]
History : Version 1, 1-Oct-1998, D.M. Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : HESSI
Name : find_changes
Purpose : Procedure to find changes of value in an array.
Category : Utility
Syntax : IDL> find_changes, inarray, index, state [, count=count]
Explanation : Output are two arrays: an array of indices into inarray where the value of
the array changes, and an array of the value of inarray at each change. Note
that the start of the array is considered a change, so element 0, and starting
value will always be included in the output arrays. If you just want changes
in the array, ignore the first element in the output arrays.
Inputs : inarray - input vector
Opt. Input Keywords : None
Outputs : index - vector of indices into array where value changes
state - vector of values at beginning of each value change
Opt. Output Keywords: count - number of changes found
CALLED BY:
HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION, XDIFF
hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
hsi_spectrogram__define [2], hsi_spectrogram__define [3]
hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
Examples:
IDL> inarray = [0,0,2,2,3,3,3,0,0,2]
IDL> find_changes, inarray, index, state
IDL> print,index
0 2 4 7 9
IDL> print,state
0 2 3 0 2
Common : None
Restrictions: None
Side effects: None
History : 28-Jan-2002, Kim Tolbert
Contact : kim.tolbert@gsfc.nasa.gov
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_COMMON()
Purpose : Find which elements are common to the input vectors.
Explanation : Returns the indices of the elements in second vector which
are also present in the first vector.
Use : IDL> c = find_common(first, second)
Inputs : first - vector to be searched
second - search vector
Opt. Inputs : None
Outputs : Function returns indices of elements in second vector which
are common to first and second vectors
Opt. Outputs: None
Keywords : None
Calls : ***
REM_DUP [1], REM_DUP [2], REM_DUP [3]
Common : None
Restrictions: None
Side effects: None
Category : Util
Prev. Hist. : None
Written : C D Pike, RAL, 9-Nov-94
Modified : Make loop variable LONG. CDP, 1-Oct-97
Version : Version 2, 1-Oct-97
[Previous]
[Next]
Project : SOHO-SUMER
Name : FIND_COMPRESSED
Purpose : find compressed version of a file
Category : utility,i/o
Explanation : looks for an input file. If not found, looks for a
compressed version (.Z, and .gz), decompresses it
into a temporary directory and returns full path to it.
Syntax : dfile=find_compressed(file)
Inputs : FILE = file to locate
Opt. Inputs : None
Outputs : DFILE = decompressed file (path+name)
Keywords : ERR = error message
STATUS = 1 if decompressed version returned
TEMP_DIR = name of temporary directory in which
decompressed files are saved ($HOME/.decompressed)
USE_DIR = user specified directory for decompressed files
LOOK_ONLY = look only, but don't uncompress
LIMIT = number of decompressed files to keep in temporary
directory
CALLED BY:
EIS_GET_HDR [1], EIS_GET_HDR [2], EIT__DEFINE, FITS__DEFINE, GET_SUMER_FLAT
HXRS__DEFINE, ITOOL_RD_FITS, MRD_HEAD, READ_EIT_FILE
Radiospectrogram FITS File reader [1], XCAT, rd_sumer [1], rd_sumer [2]
rd_week_file [2], weekid [2], ydb_exist [2]
Restrictions: Unix/Windows only
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], DPRINT, EXIST, GET_TEMP_DIR, GREP, IS_BLANK, LOC_FILE [1]
LOC_FILE [2], LOC_FILE [3], PR_SYNTAX, TRIM, WRITE_DIR, break_file [4]
concat_dir [4], is_number [1], is_number [2], str_replace [1], str_replace [2]
uncompress
Side effects: TEMP_DIR is created
History : Written 10 Jan 1999, D. Zarro (SMA/GSFC)
Modified 15 Feb 2000, Zarro (SM&A/GSFC) -- check
for directory creation
Modified 15 April 2000, Zarro (SM&A/GSFC) -- made Windows
compatible
Modified 31 May 2002, Zarro (LAC/GSFC) - added check
for invalid USE_DIR
Modified 10 Feb 2004, Zarro (L-3Com/GSFC) - added LIMIT
Modified 17 Sep 2005, Zarro (L-3Com/GSFC) - replaced TEST_DIR
by WRITE_DIR.
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
find_contig
PURPOSE:
Find the contiguous subscripts. Used for finding
unique peaks.
METHOD:
Return the first subscript
a = [4,5,6, 10, 21,22] returns [4,10,21]
a = [1, 10, 30] returns [1,10,30]
a = [1,2,3,4] returns [1]
a = 10 returns 10
CALLS: ***
deriv_arr [1], deriv_arr [2]
CALLED BY:
SPEX__DEFINE, get_pks
HISTORY:
Written 29-Jul-97 by M.Morrison
22-Jun-2004, Kim Tolbert. Added ss_sel_2d argument to return 2-d array of
start,end indices for contiguous ranges. If a=[4,5,6, 10, 21,22], then
ss_sel_2d is [3,2] and equals [ [0,3,4], [2,3,5] ]. If a=[4,5,6] then
ss_sel_2d equals [0,2]
[Previous]
[Next]
PROJECT: HESSI
NAME: find_contig_ranges
PURPOSE: Compress a set of ranges to leave only the non-contiguous ranges.
CALLED BY:
SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SPEX__DEFINE, XDIFF, XYPLOT__DEFINE
Example: If vals equals the following intarr(2,3):
[2,4]
[4,8]
[10,12]
[12,14]
then result=find_contig_ranges(vals) would return:
[2,8]
[10,14]
CATEGORY: UTIL
CALLING SEQUENCE: result = find_contig_ranges(vals)
INPUTS: none
OPTIONAL INPUTS (KEYWORDS):
EPSILON - If end of interval is within epsilon of start of next interval,
they're considered contiguous.
OUTPUTS: 2xn array of noncontiguous ranges. If input array is not (2,n) then
returns -1.
OPTIONAL OUTPUTS: None
Calls: ***
CHECKVAR [1], checkvar [2]
COMMON BLOCKS: None
PROCEDURE:
RESTRICTIONS: Assumes vals array is monotonically increasing
SIDE EFFECTS: None.
EXAMPLES:
HISTORY:
Written Kim, 30-Apr-2001
Modifications:
29-Jul-2003, Added epsilon keyword.
15-Mar-2006, Correct epsilon check - difference should be divided by magnitude of numbers
and changed epsilon default to 1.e-7
16-Mar-2006, Kim. Correct again. For integers just check difference, for non-integers,
check difference divided by magnitude.
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_DATA_RUNS()
Purpose : Detect runs of data in an array and return their boundaries.
Explanation : This function finds valid data windows in a data array.
Valid windows are those containing data not having a value
equal to the 'invalid' flag and having at least 'min_data_win'
valid data points in them. Groups with less than this number
of data points are ignored. A break in the data window is
also considered to have occurred if the time interval between
successive valid data points is greater than 'max_time_int'
units.
Use : IDL> limits = find_data_runs(x, y, invalid, min_data_win, $
max_time_int [,maxrun=maxrun])
Inputs : x - input data array 'time' values
y - input data array data values
invalid - value of datum to be ignored
min_wind_size - chosen data runs must contain at least this
many data points otherwise they are ignored.
max_time_step - maximum 'time' step which is considered
legitimate within a window. If two
consecutive data points in the x array are
separated in value by more than this then a
new data window is started.
Opt. Inputs : None
Outputs : Function returns start and stop indices (in input arrays) of
runs of valid data as a 2-d array. eg:
dw = find_data_runs(x,y.......)
then dw(0,0) will be the start index of the first run
dx(0,1) the stop index of the first run
dx(1,0) the start index of the second run etc etc
Example:
y = [0,0,1,1,1,0,0,0,1,1,0,1,1]
dw = find_data_runs(indgen(13),y,0,0,1)
print, dw will give
2 8 11
4 9 12
An array [-1,-1] is returned if no valid data runs are found.
Opt. Outputs: None
Keywords : maxrun - max number of data points in a run. A new run
is started when this limit is reached.
Calls : None
Restrictions: x and y array inputsmust be of the same size.
Side effects: None
Category : Util, misc
Prev. Hist. : None
Written : C D Pike, RAL, 16-Nov-93
Modified : Add maxrun keyword. CDP, 1-Nov-94
Version : Version 2, 1-Nov-94
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_DRAW_WIDGET()
Purpose : Find the widget ID corresponding to a draw window.
Explanation : To use the WIDGET_EVENT routine instead of the CURSOR
procedure one needs to be able to find out whether a draw
window is actually a WIDGET_DRAW window, if this is not known
a priori.
This routine simplifies the rewrites necessary to convert
CURSOR-dependent routines into widget-driven
routines. FIND_DRAW_WIDGET() finds and returns the WIDGET_DRAW
ID of the window (if it exists) by performing a search through
possible widget IDs. If the corresponding widget ID is not
found, -1L is returned.
The routine assumes that widgets are given ever-increasing ID
numbers, starting from 0L (or higher).
The routine is also a lot faster than one would expect for
such an exhaustive search - partially because of a cache
system keeping track of which widgets have been searched.
Use : WIDGET = FIND_DRAW_WIDGET(WINDOW)
Inputs : WINDOW : The window number (as in WSET,WINDOW)
Opt. Inputs : None.
Outputs : Returns the WIDGET_DRAW ID corresponding to the draw window,
or -1L if none is found (this means the draw window is *not* a
widget window).
Opt. Outputs: None.
Keywords : None.
Calls : None.
CALLED BY:
BOX_CURSOR, BOX_CURSOR2, ITOOL_ZOOM, TVPROFILE, XCROP_CUBE
Common : None.
Restrictions: Assumes widgets are given ever-increasing ID numbers starting
from zero (or higher).
Side effects: None.
Category : Display, Widgets
Prev. Hist. : None.
Written : Stein Vidar H. Haugan, UiO, 15 May 1997
Modified : Not yet.
Version : 1, 15 May 1997
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_DUP()
Purpose : Function to identify duplicate values in a vector.
Explanation : The function returns a vector pointing to duplicated values
in the input array such that
print,a(find_dup(a))
will print a list of duplicate values. But beware that the
function returns a value -1 if no duplicates are found.
Use : result = find_dup(vector)
Inputs : vector - vector of values from which duplicates are to be found
Opt. Inputs : None
Outputs : A vector of subscripts in 'vector' is returned. Each subscript
points to a duplicated value. If no duplicates are found, a
value -1 is returned.
Opt. Outputs: None
Keywords : None
Calls : ***
BSORT [1], BSORT [2], BSORT [3], BSORT [4]
CALLED BY:
CHECK_CONFLICT, extract_val, hsi_params_write_pro, ospex_params_write_pro
url_decode
Restrictions: None
Side effects: None
Category : Util, misc
Prev. Hist. : Based on REM_DUP by D. Lindler Mar. 87
Written : CDS version by C D Pike, RAL, 12-Nov-93
Modified : Use BSORT to maintain order. CDP, 9-Nov-94
Version 3, 22-May-1997, William Thompson, GSFC
Changed so that loop variable is a long integer
Version 4, 27-May-1997, William Thompson, GSFC
Changed so that NDUP is also long
Version : Version 4, 27-May-1997
[Previous]
[Next]
NAME:
FIND_EDGE_INTERCEPT
PURPOSE:
Finds where the line defined by xline,yline hits the edges of the current plot box
Results returned in xedge, yedge
CATEGORY: HESSI, Graphics
CALLING SEQUENCE:
FIND_EDGE_INTERCEPT, xline, yline, xedge, yedge
INPUTS:
xline - 2-element array of x coordinates of endpoints of line
yline - 2-element array of y coordinates of endpoints of line
OUTPUTS:
xedge - 2-element array of x coordinates of where line crosses plot boundary
yedge - 2-element array of y coordinates of where line crosses plot boundary
CALLS: ***
CRANGE, REVERSE, xy_dist
CALLED BY:
PROFILES2
EXAMPLE:
plot,findgen(20)+5, findgen(20)+30, /xlog,/ylog
xline=[14,15]
yline=[40,45]
find_edge_intercept, xline, yline, xedge, yedge
plots,xline,yline
plots,xedge,yedge
print,xedge,yedge
23.9456 6.21533
100.000 10.0000
Kim Tolbert, March 2002. Extracted from profiles2.
Modifications:
22-Jun-2005, Kim. Do calcs in double so we don't lose anything if inputs were double
[Previous]
[Next]
Project : HESSI
Name : FIND_FID
Purpose : find files based on encoded fid names (yymmdd_hhmm)
Category : HESSI, GBO, utility
Explanation :
Syntax : IDL> find_fid,tstart,tend,files
Inputs : TSTART = search start time
TEND = search end time
Opt. Inputs : None
Outputs : FILES = found files (rounded to nearest day)
Opt. Outputs: None
Keywords : EXT = extension to search for (def = '.gif')
INDIR = root directory name to search
COUNT = # of files found
PATTERN = special pattern to search for (def = '*')
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], DATE_CODE, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
GET_UTC, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PR_SYNTAX, concat_dir [4]
curdir [1], curdir [2], data_chk [1], data_chk [2], delvarx [5]
CALLED BY:
REBIN_FID
Common : None
Restrictions: Unix systems only.
Assumes files are stored in subdirs encoded with "ext/yymmdd".
Side effects: None
History : Version 1, 14-April-1999, D.M. Zarro (SM&A/GSFC), Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_FILE()
Purpose : Fixing builtin FINDFILE() problem
Explanation : The builtin FINDFILE() function has problems on some unixes
whenever *a lot* of files are matching the file
specification. This is due to the fact that filename expansion
is done by the shell *before* interpreting a command. Too many
files cause too long commands, which are not accepted. This
causes FINDFILE() to return an empty list of candidates.
FIND_FILE tries the builtin function first, and whenever the
returned list of files is empty, it tries to recheck through
spawning a "find" command.
Since FINDFILE doesn't discriminate between directories, links
and files, this function will not do this either.
Under unix, however, calls like FINDFILE("*") returns the
unfiltered output of the shell commmand "ls *", including
colon-terminated lines for each subdirectory matching the
specification and empty lines separating each subdirectory
listing. Such silly effects are not implemented in the "find"
version. Be warned, however, that these effects are present
when the builtin function does not "fail" due to a too long
file list.
It is possible (under unix) to use the "find" method as
default by setting the keyword /USEFIND (no effect under other
operating systems).
Use : files = find_file(file_specification)
Inputs : file_specification : A scalar string used to find
files. See FINDFILE()
Opt. Inputs : None.
Outputs : Returns a list of files or a blank string if none found.
Opt. Outputs:
Keywords : COUNT : Returns the number of files
USEFIND : Always use a spawned "find" command under unix.
No effect under other operating systems.
NODOT : Apply a filter to the results from find to prevent
finding the directory itself in a large file expansion.
eg 'find_file,"foo/*"' returns ("foo/","foo/a",...)
but 'find_file,"foo/*",/nodot' returns
("foo/a","foo/b",...) without the leading "foo/".
This behavior is closer to the behavior of findfile()
without the long-directory braindamage. It is
*not* the default so as not to break heritage
code that uses find_file().
Calls : ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], OS_FAMILY, break_file [4]
CALLED BY:
CAT_DIRECTORY, CDSPICKFILE, CF_GIS1A, CF_GIS1B, CF_GIS1C, CF_GIS2A [1], CF_GIS4A
CF_GIS4B, CF_GIS4C, EIT_DISPLAY, FIND_FILES, GIS_CALIB_FF_LTGD, GIS_ERROR
GIS_HV_CAL, IDL5TO4, OVSA_EXPLORER formerly OVSA_PRESUB, REGEN_SYNOP
UPDATE_SXT_CO_INDEX, drm_4_spex [1], drm_4_spex [2], fix_decon_pits
op_term_score
Common : None
Restrictions: As for FINDFILE
Side effects: None, hopefully
Category : Utilities, Operating_system
Prev. Hist. : Lots of problems with FINDFILE is hopefully history.
Written : S.V.H. Haugan, UiO, 12 April 1996
Modified : Version 2, SVHH, 10 June 1996
Moved the CD,curr_path command to avoid
returns without resetting path.
Version 3, SVHH, 26 June 1996
Took away the -type f argument to find, added
/USEFIND keyword.
: Added /nodot keyword C. DeForest 9-August-1998
Version : 3, 26 June 1996
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_FILES
Purpose : Find multiple files in a multiple path
Explanation : FIND_FILES splits the supplied PATHS string by calling
FIND_ALL_DIR and then loops over all paths calling FIND_FILE()
with each path plus the file specification, returning the full
list of matching files. The supplied file specification may
contain standard wildcard characters.
Use : filelist = FIND_FILES(FILE_SPEC,PATHS)
Inputs : FILE_SPEC: File specification, e.g., "s*r00.fits". Should
*not* contain any path. Scalar string.
PATHS: Scalar string containing one or more default paths to
search for files matching the file specification. See
FIND_ALL_DIR for a more detailed description. The
current directory is NOT searched.
Opt. Inputs : None.
Outputs : Returns a string array with full path names of each file
matching the file specification. If no files are found
an empty string is returned.
Opt. Outputs: None.
Keywords : None.
Calls : ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FIND_ALL_DIR [1]
FIND_ALL_DIR [2], FIND_ALL_DIR [3], FIND_FILE, PARCHECK, TYP, concat_dir [4]
CALLED BY:
CAT_DURATION, CAT_FITS, CDS_MOSAIC, CFITSLIST, FIND_DURATION, HSI_CHK_DUPLICATE
IDL5TO4, LIST_FITS, MK_HEAD_CAT, SFITSLIST, hsi_params_write_pro
ospex_params_write_pro
Common : None.
Restrictions: Mmmm?
Side effects: None known.
Category : Utilities, Operating_system
Prev. Hist. : Multi-path CDS_FITS_DATA created a need for it.
Written : SVH Haugan, UiO, 23 April 1996
Modified : Version 2, 6 August 1996
Using find_all_dir for +/dir expansion, and using
concat_dir in an attempt to be portable.
16 May 2006, Zarro (L-3Com/GSFC) - added temporary()
[Previous]
[Next]
Finds the element numbers in tarray and yarray that have bad points that
need to be eliminated and interpolated over. Bad points means any of the
following are true:
1. flux value is -99999.
2. the moon is eclipsing the Sun
3. the detector is off
4. the detector is being calibrated
5. the channel is going through a gain change
The bad elements numbers are returned for channels 0 and 1 in bad0 and bad1.
Kim Tolbert 7/13/93
Modifications:
9-Dec-2005 - stop printing the whoops message if no times match status times. With
new goes obj, could have status from a large time interval, but tarray from a subset.
CALLED BY
CLEAN_GOES
[Previous]
[Next]
NAME:
find_fits_ext
PURPOSE:
Find extension numbers of FITS files with given EXTNAME parameter
CATEGORY: FITS, UTIL
CALLING SEQUENCE:
; Find the second 'rate' extension in the file 'some_fits_file.fits.'
find_fits_ext, file='some_fits_file.fits', setno=2, extname='rate'
INPUTS:
FILE - name of FITS file to search in.
EXTNAME - name of extension to search for in FILE.
OPTIONAL INPUT KEYWORDS:
EXTNO - number of extension to read. Useful to see if extension N
has extname NAME.
SETNO - Set this to number of the extensions with EXTNAME to
read; i.e., read the third 'RATE' extension in FILE
SILENT - set to deactivate printing error messages.
OPTIONAL OUTPUT KEYWORDS:
EXTNUMREAD - actual extension to read
SETNUMREAD - actual number of extension read within subset of
extensions with EXTNAME.
ERR_CODE - set to [ 0 / 1 ] if an error [ did not / did ] occur
ERR_MSG - string containing error message. Null string if no
errors occurred.
CALLS: ***
FITS_OPEN, TRIM, wc_where [1], wc_where [2]
CALLED BY
FITSFILE__DEFINE [1], rd_fits_ext, xsm_rd_fits_ext
[Previous]
[Next]
Project : SDAC
Name : FIND_IX
Purpose : This function finds the nearest neighbor index in the
primary array for the values in the secondary array
Category : UTIL
Explanation : This is a routine needed as the first step in all 1-d
interpolations on irregular grid positions. This routine is
fast because it uses the sort and where functions to find
indices where alternate routines use loops or double loops.
Use :
Inputs : X - The primary array, must be monotonic.
U - The secondary array for which indices are needed for X.
Opt. Inputs : None
Outputs : The function returns the index, I, in X for every value
of U corresponding the the element of X such that
X(I(j)) < U(j) < X(I(j)+1) for X increasing
and
X(I(j)) < U(j) < X(I(j)-1) for X decreasing.
Returns (top+1) or (bottom-1) of range of indices for U out of range.
Opt. Outputs: None
Keywords :
Calls : ***
BSORT [1], BSORT [2], BSORT [3], BSORT [4], MINMAX [1], MINMAX [2], REVERSE
CALLED BY:
FS_ARCHIVE_RW, GE_WINDOW [1], HESSI_PHA, HSI_EVENTLIST_SELECT_BY_TIME [2]
HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_LIVETIME_SIM, HSI_LOCATE_FLARE [2]
HSI_LOCATE_FLARE [4], HSI_SCORE2FASTRATE_SUBPACKET, INTERP2INTEG, INTERPOL8
MAP_DISCLA2CONT, RESTORE_FLARE, SPEX_DATA_GENX [1], SPEX_DATA_GENX [2]
WRITE_MONTH_CAT, hessi_pileup_sim, hsi_badpak_test, hsi_chan_ranges
hsi_flare_position_image [1], hsi_flare_position_image [2]
hsi_full_sun_image [1], hsi_full_sun_image [2], hsi_locate_flare [1]
hsi_locate_flare [3], hsi_obs_summ_flag__define, plotman_draw_event
trace_movie_index [1], trace_movie_index [2]
Common : None
Restrictions: Supports real numbers.
Side effects: None.
Prev. Hist :
Modified : RAS, 6-May-1997, Version 1, written to support INTERPOL.
RAS, 21-May-1997, Version 2, changed do loop to while loop
to support extremely large x arrays. Could be rewritten
to put singles into final array w/o loop.
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FIND_LIMB2
PURPOSE:
Find the solar coordinates from an aspect camera image.
EXPLANATION:
Uses the IDL function SOBEL to differentiate, then fits to circle.
Return sun center coordinates, solar radius, error estimate,
and oblateness estimate determined from the Fourier spectrum
of the limb location. Outputs are in (real) pixel units.
CALLING SEQUENCE:
find_limb, img, $
[x0, y0, r0, r_err, oblateness, ob_angle, bias, $
brightness, sig_bright,/sxt,qtest=qtest]
INPUTS:
img = input image
OUTPUTS:
x0 = pixel location of sun center, x (1st harmonic of radius)
y0 = pixel location of sun center, y
r0 = radius in pixel units
r_err = uncertainty in r0 determination from scatter
oblateness = second harmonic of radius
ob_angle = phase of 2nd harmonic
bias = distortion of limb due higher harmonics
brightness = most probable signal at x0,y0
sig_bright = sigma of brightness
OPTIONAL INPUT PARAMETERS:
qtest = 1 for messages+pause, = 2 for messages+plots+pause,
= 3 for messages+plots (no pause)
KEYWORD PARAMETERS:
SXT -- If set, results will be in units of SXT 1x1 pixels, otherwise
results are in units of pixels of the input image
CALLS: ***
GAUSS_FUNCT2 [1], GAUSS_FUNCT2 [2], POLY_FIT, STDEV, fit_circle [1]
fit_circle [2]
CALLED BY:
LIMB_INFO
RESTRICTIONS:
1. The input image is assumed to have an oblateness that is < 5%.
2. Missing data in the middle of the image will cause large values
in the derivative which are not compensated for.
3. The data is assumed to be ge 0. (Values less than zero will not
be handled correctly by the histogram function).
4. In determining summation mode for SXT=1, uses n_elements(img(*,0)).
5. To compute brightness, uses a box that is 1/3 * r0 centered at x0,y0.
The image must contain this box (i.e., small crescents may be
be absent, but a large portion missing at the middle of the
image will cause problems).
SIDE EFFECTS:
None
CATEGORY :
COMMON BLOCKS:
None
MODIFICATION HISTORY:
HSH written in IDL version 1, Feb. 1991
HSH updated with V.2 on real orbital data, Sep. 1991
19-Nov-91 MDM - Added a correction factor for changing the
resolution back to 1x1 (because of un-summed columns)
19-aug-92 JRL+HSH V3.0 Numerous changes to fix/improve algorithm.
Much more robust for SAA data.
Brightness is now most probable signal at x0,y0.
1-sep-92 JRL V3.1 Brightness calculation taken from mean of
histogram
Liyun Wang, GSFC/ARC, October 7, 1994
Incorporated into the CDS library
Made it to return a flag (!err=-1) if it fails to yield good result
VERSION:
Version 1, October 7, 1994
[Previous]
[Next]
Name: find_pixel_intersects
Purpose: Finds pixel element numbers in image intersected by a line
Project: HESSI
Calling Sequence:
xy = find_pixel_intersects (xedge, yedge, xaxis, yaxis, image_size, ylog=ylog, $
dist=dist, xvals=xvals, yvals=yvals
Method:
Divide the line into twice as many pixels as there are on the diagonal (to make sure at least
one point falls in any pixel the line passes through) and calculate the x, y coords at each length
along the line. Calculate the edges of the pixels xpix, ypix, and use find_ix to find the
element number of the image that each x,y falls in. Then return all the unique x,y element pairs.
Input arguments:
xedge, yedge - 2-element arrays of x and y coordinates where start and end of line crosses edges of
image shown (can be zoomed in) in data coordinates
xaxis - edges of x axis bins of full image (non-zoomed) in data coordinates
yaxis - edges of y axis bins of full image (non-zoomed) in data coordinates
image_size - 2-element array of number of pixels in x and y direction (if zoomed in, this
is the zoomed-in size of the image)
Input Keywords:
ylog - If set, y axis is log scale
Output Optional keywords:
xvals, yvals - x,y data coordinates of the center of each image element returned by the function
dist - distance along the line to each xvals,yvals pair
Written: Kim Tolbert, 18-Mar-2002
Modifications:
29-Mar-2005, Kim: Deleted x0_full,y0_full,dpixel_size input arguments. Instead pass in
xaxis,yaxis. This allows for the possibility of uneven bins (as in spectrograms). Also
added ylog keyword (also for spectrograms)
22-Apr-2005, Kim. Corrected if ylog -> if keyword_set(ylog)
9-May-2005, Kim. Corrected bug - was getting but not using unique pairs (xinter,yinter)
CALLS:
CALLED BY
PROFILES2
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_PROC
Category : Utility, help
Purpose : Find routine in SSW tree
Explanation : Used in WWW search engine
Syntax : IDL> find_proc,proc
Inputs : PROC = procedure name (e.g. xdoc, or *xdoc, or xdoc*)
Opt. Inputs : None
Outputs : STDOUT listing of found procedures
Opt. Outputs: None
Keywords : FILE = output file for listing (otherwise goes to screen)
RESET = force reading of SSW databases
COUNT = number of hits
CLEAN = name of temporary files to delete
CALLS: ***
ANYTIM2TAI, APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CACHE_DATA
CHKLOG [1], CHKLOG [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], ESPAWN, EXIST
PR_SYNTAX, RM_FILE, STRIP_WILD, TRIM2, break_file [4], file_info2 [1]
file_info2 [2], rd_tfile [1], rd_tfile [2]
History : Version 1, 2-Oct-1998, D.M. Zarro. Written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_VALUE()
Purpose : Finds where an array is equal to a value.
Category : Class4, Numerical
Explanation : This procedure finds the index of the point closest to the
specified value, and then performs a bilinear interpolation.
Syntax : Result = FIND_VALUE( Y, VALUE )
Result = FIND_VALUE( X, Y, VALUE )
Examples : X = 0.1*FINDGEN(100) + 2
Y = X^2
PRINT, FIND_VALUE(X, Y, 10)
Inputs : Y = The array to search for VALUE within. Must be
monotonically increasing or decreasing.
VALUE = The value to search for.
Opt. Inputs : X = An array of positions for the Y data values. If not
passed, then the indices (0,1,2,...) are used instead.
Outputs : The result of the function is the interpolated position.
Opt. Outputs: None.
Keywords : None.
Calls : None.
Common : None.
Restrictions: None.
Side effects: None.
Prev. Hist. : Taken from the routine FIND in the SERTS library.
History : Version 1, 21-Aug-1996, William Thompson, GSFC
Contact : WTHOMPSON
[Previous]
[Next]
Project : HESSI
Name : FIND_WIND_DIR()
Purpose : Finds all directories under a specified directory under windows.
Explanation : This routines finds all the directories in a directory tree
when the root of the tree is specified. This provides the same
functionality as having a directory with a plus in front of it
in the environment variable IDL_PATH.
Use : Result = FIND_WITH_DIR( PATH )
PATHS = FIND_WITH_DIR('+mypath')
Inputs : PATH = The path specification for the top directory in the
tree. Optionally this may begin with the '+'
character but the action is the same.
Opt. Inputs : None
Outputs : The result of the function is a list of directories starting
from the top directory passed and working downward from there.
This will be a string array with one directory per
array element.
Opt. Outputs: None.
Keywords : SPAWN - use win_spawn command.
Calls : ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], WIN_SPAWN, concat_dir [4]
Common : None.
Restrictions: PATH must point to a directory that actually exists.
Side effects: None.
Category : Utilities, Operating_system.
Prev. Hist. : None.
Written : Richard.Schwartz@gsfc.nasa.gov 27-May-1998.
Modified : Version 1, Richard.Schwartz@gsfc.nasa.gov 27-May-1998.
Version 2, Richard.Schwartz,
Improved the speed by extracting last position characters
using byte arrays.
Version : Version 1, 17 May 1998
Version 2, 17 Aug 1998
[Previous]
[Next]
NAME:
FIND_WITH_DEF()
PURPOSE:
Searches for files with a default path and extension.
EXPLANATION:
Finds files using default paths and extensions, similar to using the
DEFAULT keyword with the OPEN statement in VMS. Using this routine
together with environment variables allows an OS-independent approach
to finding files.
CALLING SEQUENCE:
Result = FIND_WITH_DEF( FILENAME, PATHS [, EXTENSIONS ] )
INPUTS:
FILENAME = Name of file to be searched for. It may either be a
complete filename, or the path or extension could be left
off, in which case the routine will attempt to find the
file using the default paths and extensions.
PATHS = One or more default paths to use in the search in case
FILENAME does not contain a path itself. The individual
paths are separated by commas, although in UNIX, colons
can also be used. In other words, PATHS has the same
format as !PATH, except that commas can be used as a
separator regardless of operating system. The current
directory is always searched first, unless the keyword
NOCURRENT is set.
A leading $ can be used in any path to signal that what
follows is an environmental variable, but the $ is not
necessary. (In VMS the $ can either be part of the path,
or can signal logical names for compatibility with Unix.)
Environmental variables can themselves contain multiple
paths.
OPTIONAL INPUTS:
EXTENSIONS = One or more extensions to append to end of filename if the
filename does not contain one (e.g. ".dat"). The period
is optional. Multiple extensions can be separated by
commas or colons.
OUTPUTS:
The result of the function is the name of the file if successful, or
the null string if unsuccessful.
OPTIONAL INPUT KEYWORDS:
NOCURRENT = If set, then the current directory is not searched.
RESET = The FIND_WITH_DEF routine supports paths which are
preceeded with the plus sign to signal that all
subdirectories should also be searched. Often this is
used with logical names. It can be rather slow to search
through these subdirectories. The /RESET keyword can be
used to redefine an environment variable so that
subsequent calls don't need to look for the
subdirectories.
To use /RESET, the PATHS parameter must contain the name
of a *single* environment variable. For example
setenv,'FITS_DATA=+/datadisk/fits'
file = find_with_def('test.fits','FITS_DATA',/reset)
CALLS: ***
BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], STR_SEP
CALLED BY:
APPLY_CDS_ADEF, BARYVEL, CAT_DURATION, CDSHEADFITS, CDSLOGO, CDS_COMPRESS
CDS_ENG_N1_AN, CDS_ENG_N4_AN, CDS_FILES, CDS_SLIT6_BURNIN, CHECK_ANOMALY
CHECK_INTEG, CMP_ALL_PRO, CMP_LIBS, DBCOMPRESS, DBCREATE [1], DBCREATE [2]
DBCREATE [3], DBHELP [1], DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3]
DBPRINT [1], DBPRINT [2], DBPRINT [3], DB_TITLES [1], DB_TITLES [2], DB_TITLES [3]
DISPLAY_CDS_BURNIN, EIS_CHECK_DATABASE [1], EIS_CHECK_DATABASE [2]
EIS_GET_HDR [1], EIS_GET_HDR [2], FIND_ALL_DIR [1], FIND_ALL_DIR [2]
FIND_ALL_DIR [3], FIND_DATFILE, FIND_FILE_DUR, FIND_ZDBASE, FIX_CATALOG
FLUSH_CATALOG, GET_DETAIL, GET_EXPER, GET_NIMCP, GET_OBS_DATE, GET_PLAN
GET_SC_POINT, GET_UTC, GET_WIDTH_CORR, GET_ZDBASE, GT_CDS_QL, GT_SOLAR_XY
IMPORT_PLAN, IMPORT_STUDY, ITOOL_GET_TIME, JPLEPHTEST, JSMOVIE, JSMOVIE2
LIST_DETAIL, LIST_EXPER, LIST_PLAN, LOCAL_DIFF, LOCK_DATABASE, MK_CDS_DBASE
MK_CDS_FITS, MK_CDS_GIF, MK_HELP_STC, MK_RASTER, MK_STUDY, MK_SYNOPTIC, MOD_EXPER
NIS_AVG_SPECT_DEMO, NIS_CALIB, OPEN_KAP, OPEN_MSP_FILE, PICKFITS, PLANET_COORDS
PRG_DETAIL, PRG_PLAN, PRIV_ZDBASE, READCDSFITS, READSUM2CDS, READ_NIMCP_CAL
SUBMIT_CAP, SUBMIT_IAP, SUM_GET_LINELIST, TILT_NIS1_DEMO, TILT_NIS2_DEMO
TP_RASDUR, TP_READ_HELP, UPDATE_KAP, VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_CALIB
VDS_READ_FLAT, VDS_ROTATE, WFPC2_READ, WIDG_HELP, XCAT, XCDS_COSMIC, XDIFF, XSPECT
db_read_linelist_all [1], db_read_linelist_all [2]
db_read_linelist_entry [1], db_read_linelist_entry [2]
db_read_raster_all [1], db_read_raster_all [2], db_read_raster_entry [1]
db_read_raster_entry [2], db_read_study_all [1], db_read_study_all [2]
db_save_linelist_entry_create [1], db_save_linelist_entry_create [2]
db_save_linelist_entry_update [1], db_save_linelist_entry_update [2]
db_save_raster_entry_create [1], db_save_raster_entry_create [2]
db_save_raster_entry_update [1], db_save_raster_entry_update [2]
db_save_study_entry_create [1], db_save_study_entry_create [2]
db_save_study_entry_create [3], db_save_study_entry_create [4]
db_save_study_entry_update [1], db_save_study_entry_update [2]
eis_delete_timeline_entry [1], eis_delete_timeline_entry [2]
eis_get_timeline_entries [1], eis_get_timeline_entries [2]
eis_import_study_gui, eis_linelist_gui [1], eis_linelist_gui [2]
eis_open_db [1], eis_open_db [2], eis_raster_gui [1], eis_raster_gui [2]
eis_save_imported_linelist, eis_save_imported_raster, eis_study_gui [1]
eis_study_gui [2], eis_update_timeline_entry [1]
eis_update_timeline_entry [2], eis_update_timeline_science_entry [1]
eis_update_timeline_science_entry [2]
eis_write_science_component_database_table [1]
eis_write_science_component_database_table [2]
EXAMPLE:
FILENAME = ''
READ, 'File to open: ', FILENAME
FILE = FIND_WITH_DEF( FILENAME, 'SERTS_DATA', '.fix' )
IF FILE NE '' THEN ...
PROCEDURE CALLS:
BREAK_PATH(), FIND_ALL_DIR()
REVISION HISTORY:
Version 1, William Thompson, GSFC, 3 May 1993.
Removed trailing / and : characters.
Fixed bugs
Allow for commas within values of logical names.
Added keyword NOCURRENT.
Changed to call BREAK_PATH
Version 2, William Thompson, GSFC, 3 November 1994
Made EXTENSIONS optional.
Version 3, William Thompson, GSFC, 30 April 1996
Call FIND_ALL_DIR to resolve any plus signs.
Version 4, S.V. Haugan, UiO, 5 June 1996
Using OPENR,..,ERROR=ERROR to avoid an IDL 3.6
internal nesting error.
Version 5, R.A. Schwartz, GSFC, 11 July 1996
Use SPEC_DIR to interpret PATH under VMS
Version 6, William Thompson, GSFC, 5 August 1996
Took out call to SPEC_DIR (i.e., reverted to version 4). The
use of SPEC_DIR was required to support logical names defined
via SETLOG,/CONFINE. However, it conflicted with the ability
to use logical names with multiple values. Removing the
/CONFINE made it unnecessary to call SPEC_DIR in this routine.
Version 7, William Thompson, GSFC, 6 August 1996
Added keyword RESET
Converted to IDL V5.0 W. Landsman October 1997
Use STRTRIM instead of TRIM, W. Landsman November 1998
Use STRSPLIT instead of STR_SEP(), V5.3 or later W.L. July 2002
[Previous]
[Next]
NAME:
FIND_WITH_DEF()
PURPOSE:
Searches for files with a default path and extension.
EXPLANATION:
Finds files using default paths and extensions, Using this routine
together with environment variables allows an OS-independent approach
to finding files.
CALLING SEQUENCE:
Result = FIND_WITH_DEF( FILENAME, PATHS [, EXTENSIONS ] )
INPUTS:
FILENAME = Name of file to be searched for. It may either be a
complete filename, or the path or extension could be left
off, in which case the routine will attempt to find the
file using the default paths and extensions.
PATHS = One or more default paths to use in the search in case
FILENAME does not contain a path itself. The individual
paths are separated by commas, although in UNIX, colons
can also be used. In other words, PATHS has the same
format as !PATH, except that commas can be used as a
separator regardless of operating system. The current
directory is always searched first, unless the keyword
NOCURRENT is set.
A leading $ can be used in any path to signal that what
follows is an environmental variable, but the $ is not
necessary. Environmental variables can themselves contain
multiple paths.
OPTIONAL INPUTS:
EXTENSIONS = Scalar string giving one or more extensions to append to
end of filename if the filename does not contain one (e.g.
".dat"). The period is optional. Multiple extensions can
be separated by commas or colons.
OUTPUTS:
The result of the function is the name of the file if successful, or
the null string if unsuccessful.
OPTIONAL INPUT KEYWORDS:
NOCURRENT = If set, then the current directory is not searched.
RESET = The FIND_WITH_DEF routine supports paths which are
preceeded with the plus sign to signal that all
subdirectories should also be searched. Often this is
used with logical names. It can be rather slow to search
through these subdirectories. The /RESET keyword can be
used to redefine an environment variable so that
subsequent calls don't need to look for the
subdirectories.
To use /RESET, the PATHS parameter must contain the name
of a *single* environment variable. For example
setenv,'FITS_DATA=+/datadisk/fits'
file = find_with_def('test.fits','FITS_DATA',/reset)
CALLS: ***
BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3], STR_SEP
CALLED BY:
APPLY_CDS_ADEF, BARYVEL, CAT_DURATION, CDSHEADFITS, CDSLOGO, CDS_COMPRESS
CDS_ENG_N1_AN, CDS_ENG_N4_AN, CDS_FILES, CDS_SLIT6_BURNIN, CHECK_ANOMALY
CHECK_INTEG, CMP_ALL_PRO, CMP_LIBS, DBCOMPRESS, DBCREATE [1], DBCREATE [2]
DBCREATE [3], DBHELP [1], DBHELP [2], DBHELP [3], DBOPEN [1], DBOPEN [2], DBOPEN [3]
DBPRINT [1], DBPRINT [2], DBPRINT [3], DB_TITLES [1], DB_TITLES [2], DB_TITLES [3]
DISPLAY_CDS_BURNIN, EIS_CHECK_DATABASE [1], EIS_CHECK_DATABASE [2]
EIS_GET_HDR [1], EIS_GET_HDR [2], FIND_ALL_DIR [1], FIND_ALL_DIR [2]
FIND_ALL_DIR [3], FIND_DATFILE, FIND_FILE_DUR, FIND_ZDBASE, FIX_CATALOG
FLUSH_CATALOG, GET_DETAIL, GET_EXPER, GET_NIMCP, GET_OBS_DATE, GET_PLAN
GET_SC_POINT, GET_UTC, GET_WIDTH_CORR, GET_ZDBASE, GT_CDS_QL, GT_SOLAR_XY
IMPORT_PLAN, IMPORT_STUDY, ITOOL_GET_TIME, JPLEPHTEST, JSMOVIE, JSMOVIE2
LIST_DETAIL, LIST_EXPER, LIST_PLAN, LOCAL_DIFF, LOCK_DATABASE, MK_CDS_DBASE
MK_CDS_FITS, MK_CDS_GIF, MK_HELP_STC, MK_RASTER, MK_STUDY, MK_SYNOPTIC, MOD_EXPER
NIS_AVG_SPECT_DEMO, NIS_CALIB, OPEN_KAP, OPEN_MSP_FILE, PICKFITS, PLANET_COORDS
PRG_DETAIL, PRG_PLAN, PRIV_ZDBASE, READCDSFITS, READSUM2CDS, READ_NIMCP_CAL
SUBMIT_CAP, SUBMIT_IAP, SUM_GET_LINELIST, TILT_NIS1_DEMO, TILT_NIS2_DEMO
TP_RASDUR, TP_READ_HELP, UPDATE_KAP, VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_CALIB
VDS_READ_FLAT, VDS_ROTATE, WFPC2_READ, WIDG_HELP, XCAT, XCDS_COSMIC, XDIFF, XSPECT
db_read_linelist_all [1], db_read_linelist_all [2]
db_read_linelist_entry [1], db_read_linelist_entry [2]
db_read_raster_all [1], db_read_raster_all [2], db_read_raster_entry [1]
db_read_raster_entry [2], db_read_study_all [1], db_read_study_all [2]
db_save_linelist_entry_create [1], db_save_linelist_entry_create [2]
db_save_linelist_entry_update [1], db_save_linelist_entry_update [2]
db_save_raster_entry_create [1], db_save_raster_entry_create [2]
db_save_raster_entry_update [1], db_save_raster_entry_update [2]
db_save_study_entry_create [1], db_save_study_entry_create [2]
db_save_study_entry_create [3], db_save_study_entry_create [4]
db_save_study_entry_update [1], db_save_study_entry_update [2]
eis_delete_timeline_entry [1], eis_delete_timeline_entry [2]
eis_get_timeline_entries [1], eis_get_timeline_entries [2]
eis_import_study_gui, eis_linelist_gui [1], eis_linelist_gui [2]
eis_open_db [1], eis_open_db [2], eis_raster_gui [1], eis_raster_gui [2]
eis_save_imported_linelist, eis_save_imported_raster, eis_study_gui [1]
eis_study_gui [2], eis_update_timeline_entry [1]
eis_update_timeline_entry [2], eis_update_timeline_science_entry [1]
eis_update_timeline_science_entry [2]
eis_write_science_component_database_table [1]
eis_write_science_component_database_table [2]
EXAMPLE:
FILENAME = ''
READ, 'File to open: ', FILENAME
FILE = FIND_WITH_DEF( FILENAME, 'SERTS_DATA', '.fix' )
IF FILE NE '' THEN ...
PROCEDURE CALLS:
BREAK_PATH(), FIND_ALL_DIR(), STR_SEP()
REVISION HISTORY:
Version 1, William Thompson, GSFC, 3 May 1993.
Removed trailing / and : characters.
Fixed bugs
Allow for commas within values of logical names.
Added keyword NOCURRENT.
Changed to call BREAK_PATH
Version 2, William Thompson, GSFC, 3 November 1994
Made EXTENSIONS optional.
Version 3, William Thompson, GSFC, 30 April 1996
Call FIND_ALL_DIR to resolve any plus signs.
Version 4, S.V. Haugan, UiO, 5 June 1996
Using OPENR,..,ERROR=ERROR to avoid an IDL 3.6
internal nesting error.
Version 5, R.A. Schwartz, GSFC, 11 July 1996
Use SPEC_DIR to interpret PATH under VMS
Version 6, William Thompson, GSFC, 5 August 1996
Took out call to SPEC_DIR (i.e., reverted to version 4). The
use of SPEC_DIR was required to support logical names defined
via SETLOG,/CONFINE. However, it conflicted with the ability
to use logical names with multiple values. Removing the
/CONFINE made it unnecessary to call SPEC_DIR in this routine.
Version 7, William Thompson, GSFC, 6 August 1996
Added keyword RESET
Converted to IDL V5.0 W. Landsman October 1997
Use STRTRIM instead of TRIM, W. Landsman November 1998
Use STRSPLIT instead of STR_SEP W. Landsman July 2002
[Previous]
[Next]
Project : SOHO - CDS
Name : FIND_ZDBASE
Purpose : set ZDBASE to appropriate CDS/USER/SOHO Database location
Category : Planning
Explanation : Searches personal and official DB locations
Syntax : IDL> find_zdbase,type,status=status
CALLED BY:
MK_CDS_PLAN, MK_STUDY, RD_CDS_POINT, XCAT, XSTUDY
Examples :
Inputs : None
Opt. Inputs : None
Outputs : TYPE = 'User', 'CDS', 'SOHO', or 'Unknown'
Opt. Outputs: None
Keywords : STATUS = 1 if DB found, 0 if unsuccessfull
/CAT = set to look for catalog DB
/DEF = set to look for study definitions DB [default]
/DAI = set to look for plan DB
/RES = set to look for resources (e.g. campaign, etc)
/OFF_FIRST = search official before personal DB
FILE = full path name to DB file
ERR = any error string
NORETRY = don't retry by cycling thru different DB's
VERBOSE = echo messages
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], EXP_ZDBASE, FIND_WITH_DEF [1]
FIND_WITH_DEF [2], FIND_WITH_DEF [3], FIX_ZDBASE, GET_ENVIRON, TRIM, WHERE_VECTOR
WHICH_ZDBASE
Common : None
Restrictions: None
Side effects: Environment/logical ZDBASE set to first found DB location
History : Version 1, 7-September-1996, D M Zarro. Written
Version 2, 11-Mar-1997, William Thompson, GSFC
Fixed problem under VMS when logical name ZDBASE has
multiple values.
Version 3, 23-April-1998, Zarro (SAC/GSFC), added /VERBOSE
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
NAME:
FINDFILE_LIST
PURPOSE:
This procedure takes a list of files and path (!path format) and
returns the directory or library of the first occurrence for each
element.
CATEGORY:
GEN, UTIL, SYSTEM
CALLING SEQUENCE:
FINDFILE_LIST, Files, Path, Locs
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], BSORT [1], BSORT [2], BSORT [3]
BSORT [4], GET_LIB, GET_MOD, break_file [4], file_list [1], file_list [2]
INPUTS:
Files- List of procedures including .pro extension
Path - Path in !path format
OPTIONAL INPUTS:
none
OUTPUTS:
Locs - The path for each file.
OPTIONAL OUTPUTS:
none
KEYWORDS:
EXTENSION - optional extension, e.g. '.dat' to search for
CASE_IGNORE- For non-vms, ignore case (VMS default)
NOCURRENT - If set, then don't search the current directory.
CALLED BY:
LOCAL_DIFFS
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
For each directory in turn the filenames are extracted and compared to
the list. As each file is located the list to find gets smaller. The
search is terminated when the file list or directory list is exhausted.
MODIFICATION HISTORY:
Richard Schwartz, 6 Sept 1996
Version 2, richard.schwartz@gsfc.nasa.gov, 30-dec-1997.
[Previous]
[Next]
NAME:
FINDPRO
PURPOSE:
Find all locations of a procedure in the IDL !PATH
EXPLANATION:
FINDPRO searces for the procedure name (as a .pro or a .sav file) in all
IDL libraries or directories given in the !PATH system variable. This
differs from the intrinsic FILE_WHICH() function which only finds the
first occurence of the procedure name.
CALLING SEQUENCE:
FINDPRO, [ Proc_Name, /NoPrint, DirList = , ProList = ]
OPTIONAL INPUT:
Proc_Name - Character string giving the name of the IDL procedure or
function. Do not include the ".pro" extension. If Proc_Name is
omitted, the program will prompt for PROC_NAME. "*" wildcards
are permitted.
CALLS: ***
FDECOMP [1], FDECOMP [2], FDECOMP [3], PATH_SEP, ZPARCHECK [1], ZPARCHECK [2]
ZPARCHECK [3]
OPTIONAL KEYWORD INPUT:
/NoPrint - if set, then the file's path is not printed on the screen and
absolutely no error messages are printed on the screen. If not
set, then - since the MESSAGE routine is used - error messages
will be printed but the printing of informational messages
depends on the value of the !Quiet variable.
OPTIONAL KEYWORD OUTPUTS:
DirList - The directories in which the file is located are returned in
the keyword as a string array.
If the procedure is an intrinsic IDL procedure, then the
value of DirList = ['INTRINSIC'].
If the procedure is not found, the value of DirList = [''].
ProList - The list (full pathnames) of procedures found. Useful if you
are looking for the name of a procedure using wildcards.
The order of the names in DirList and ProList is identical to the order
in which the procedure name appears in the !PATH
PROCEDURE:
The system variable !PATH is parsed using EXPAND_PATH into individual
directories. FILE_SEARCH() is used to search the directories for
the procedure name. If not found in !PATH, then the name is compared
with the list of intrinsic IDL procedures given by the ROUTINE_INFO()
function.
EXAMPLE:
(1) Find the procedure CURVEFIT. Assume for this example that the user
also has a copy of the curvefit.pro procedure in her home directory
on a Unix machine.
IDL> findpro, 'curvefit', DIRLIST=DirList
Procedure curvefit.pro found in directory /home/user/.
Procedure curvefit.pro found in directory /home/idl/lib/userlib
IDL> help, DirList
DIRLIST STRING = Array(2)
IDL> help, DirList[0], DirList[1]
<Expression> STRING = '/home/user'
<Expression> STRING = '/home/idl/lib/userlib'
(2) Find all procedures in one's !path containing the characters "zoom"
IDL> findpro,'*zoom*'
RESTRICTIONS:
User will be unable to find a path for a native IDL function
or procedure, or for a FORTRAN or C routine added with CALL_EXTERNAL.
Remember that Unix is case sensitive, and most procedures will be in
lower case.
PROCEDURES USED:
ZPARCHECK, FDECOMP
REVISION HISTORY:
Based on code extracted from the GETPRO procedure, J. Parker 1994
Use the intrinsic EXPAND_PATH function W. Landsman Nov. 1994
Use ROUTINE_NAMES() to check for intrinsic procs W. Landsman Jul 95
Added Macintosh, WINDOWS compatibility W. Landsman Sep. 95
Removed spurious first element in PROLIST W. Landsman March 1997
Don't include duplicate directories in !PATH WL May 1997
Use ROUTINE_INFO instead of undocumented ROUTINE_NAMES W.L. October 1998
Also check for save sets W. Landsman October 1999
Force lower case check for VMS W. Landsman January 2000
Only return .pro or .sav files in PROLIST W. Landsman January 2002
Force lower case check for .pro and .sav D. Swain September 2002
Use FILE_SEARCH() if V5.5 or later W. Landsman June 2006
Assume since V55, remove VMS support W. Landsman Sep. 2006
[Previous]
[Next]
Project : SOHO - CDS
Name : FINDVAL
Purpose : Linearly interpolates X,Y arrays for (xval,yval)
Category : Interpolation
Explanation :
Uses linear interpolation to obtain xval or yval with respect to
input X,Y arrays. This function differs from INTERPOL
in that if finds multi-valued cases.
Syntax : IDL> yval=findval(x,y,xval) or xval=findval(y,x,yval)
CALLED BY:
GUESS_FIT_PAR
Examples :
Inputs : X and Y, floating arrays, e.g. wavelength & flux
Opt. Inputs : None
Outputs : XVAL or YVAL are floating point arrays.
The size of these arrays (usually 1) = no of interpolated points
Opt. Outputs: None
Keywords : None
Common : None
Restrictions: None
Side effects: None
History : Version 1, 17-May-1986, D M Zarro. Written
(my very first real IDL program)
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : SOHO - CDS
Name : FIT2GIF
Purpose : convert FITS file to a GIF image file
Explanation : Reads a FITS file, byte scales it, and
then writes it to a GIF file.
Use : FITS2GIF,INFILE
Inputs : INFILE = fits file name
Opt. Inputs : None.
Outputs : None.
Opt. Outputs: HEADER = fits file header
Keywords : OFILE = output GIF file name [def = INFILE with .GIF extension]
TITLE = title for image
COLOR = color table to load [def= 0 , B/W]
RED, GREEN, BLUE = optional color vectors to override COLOR
FRAC = fraction by which to increase image
size in Y-direction to fit title [def = 15%]
XPOS, YPOS = normalized coordinates for title [def=.1,.9]
ROTATE = value for rotate (see ROTATE function)
FLIP = flip image to to bottom
REVERSE = flip image left to right
PREVIEW = preview image before writing
SIG = select significant range of image
Calls : ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FITS2GIF
FXREAD [1], FXREAD [2], LOADCT, SELECT_WINDOWS, SIGRANGE [1], SIGRANGE [2]
SSW_WRITE_GIF, TEST_OPEN, break_file [4], delvarx [5]
Common : None.
Restrictions: None.
Side effects: None.
Category : Plotting.
Prev. Hist. : None.
Written : Dominic Zarro (ARC)
Modified : Version 2, William Thompson, GSFC, 8 April 1998
Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
Version 3, 13-Aug-2003, William Thompson
Use SSW_WRITE_GIF instead of WRITE_GIF
Version : Version 3, 13-Aug-2003
[Previous]
[Next]
Name:
FIT_BACKGRND
Call:
Background_rate=FIT_BACKGND( t_d, rate, erate, order, trange1, trange2, sigma=sigma, $
selected=selected, ltime=ltime)
PURPOSE:
This function fits the count rate, RATE, to a polynomial of order, ORDER, over
the background intervals specified by the limits in TRANGE1 and TRANGE2.
Return the value of the fit over the time range, T_D.
Calls: ***
AVG [1], AVG [2], CHECKVAR [1], EXIST, FCHECK, F_DIV, POLY, POLYFITW, checkvar [2]
Inputs:
t_d - time array, n or (2 x n) where n is the number of time bins.
if t_d is dimensioned 2xn, then the first column is the
start times and the second column is the end times.
if t_d is dimensioned n, then intervals are uniform and
t_d is the center of each interval. t_d is monotonic.
rate - count rate vector, n elements.
erate - uncertainties on rate
ltime - livetime of each interval in rate, used for weighting
selected - indices of selected points in t_d and rate to use in fit
or
trange1 - 2 points on the range covered by t_d. Should be prior
to the event (flare).
trange2 - 2 points after the event along t_d.
order - polynomial to fit over the ranges specified by
trange1 and trange2
If it is
Keyword SIGMA is the average standard deviation in the fit
Default ORDER =1
Uses POLY and POLY_FIT
CALLED BY:
GOES__DEFINE, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2], spex_bk__define
History:
RAS, 92/1/27
17-oct-93, modified to take time arrays with start and stop edges
21-apr-94, fixed bug in use of order (degree of fit)
also allows order 0, straight average
30-aug-95, fixed sigma calculation
23-aug-96, fixed basic sigma calculation
09-sep-2004, Kim. Fixed sigma again - previously er^2*lt, now (er*lt)^2
09-Aug-2005, Kim. Changed keyword_set(selected) to exist(selected)
11-Jan-2006, Kim. Fixed bug in computing xedges (changed + to - for last point)
[Previous]
[Next]
NAME:
fit_circle
PURPOSE:
Fit a circle to vector of points.
CALLING SEQUENCE:
Result_vector = fit_circle(x,y,a,radius_fix=radius_fix,tolerance=tolerance)
INPUTS:
x = Vector of x values
y = Vector of y values
RETURNED:
Result_vector = [x1,y1,r1] result of coordinates (x1,y1) and radius (r1).
OPTIONAL INPUTS:
a = Vector of [x0,y0,r0] = First guesses for the circle (x0,y0,radius)
If a is not supplied, x0 and y0 are the averages and and r0 is
taken to be the average distance of each (x,y) point to (x0,y0).
OPTIONAL INPUT KEYWORDS:
radius_fix = If set, will not vary the radius in the fit.
tolerance = If present and > 0, fit_circle will recursively call itself
until abs(r1-r0)/r0 < tolerance.
For example, setting tolerance = 0.01 will cause the
calculation to continue until the solution for the radius
does not vary between iterations by more than 1%.
If radius_fix is set, tolerance will have no effect.
limit_iter = Set the upper limit to the number of times to iterate.
(e.g., limit_iter=10 will limit the number of iterations
to 10 or less.)
OPTIONAL OUTPUT KEYWORDS:
num_iter = Number of iterations
CALLS: ***
POLY_FIT
CALLED BY:
CLICKLIMB, FIND_LIMB, FIND_LIMB2, FIND_LIMB_GEN, SHOW_REGNS, fit_limb, get_xyrad
MODIFICATION HISTORY:
17 Oct 1991, J. R. Lemen, Written (based on routine in HSH's find_limb)
26 Feb 1992, J. R. Lemen, Added tolerance keyword
24-jan-94, JRL, Added limit_iter keyword
19-oct-94, T. Metcalf and K. Shibasaki, Improved initial guess. Works
with partial circles now.
[Previous]
[Next]
Project : SOHO - CDS
Name : FIT_GAUSS
Purpose : Fits a gaussian plus a quadratic to data points
Explanation : Fit Y=F(X) where:
F(X) = A0*EXP(-Z^2/2) + A3 + A4*X + A5*X^2
and Z=(X-A1)/A2
A0 = height of exp, A1 = center of exp, A2 = Gaussian width,
A3 = constant term, A4 = linear term, A5 = quadratic term.
Estimate the parameters A0,A1,A2,A3 and then call LSTSQR.
If the (max-avg) of Y is larger than (avg-min) then it is
assumed the line is an emission line, otherwise it is assumed
there is an absorbtion line. The estimated center is the max
or min element. The height is (max-avg) or (avg-min)
respectively. The width is foun by searching out from the
extrem until a point is found < the 1/e value.
Use : YFIT = FIT_GAUSS( X, Y [, A [, ASIG [, CHISQR ]]] )
Inputs : X = independent variable, must be a vector.
Y = dependent variable, must have the same number of points
as X.
Opt. Inputs : None.
Outputs : YFIT = fitted function.
Opt. Outputs: A = Coefficients -- a six element vector as described above.
ASIG = Estimated errors in A.
Keywords :
ACCURACY = Accuracy to cut off at. Defaults to 1E-5.
MAX_ITER = Maximum number of reiterations. Defaults to 20.
POISSON = If set, then a Poisson error distribution is assumed, and
the weights are set accordingly to 1/Y.
ERROR = Array of errors. The weights are set accordingly to
1/ERROR^2. Overrides POISSON.
WEIGHT = Array of weights to use in fitting. Overrides POISSON and
ERROR.
LAMBDA = Initial value of LAMBDA. Defaults to 1E-2.
NOPRINT = If set, then no printout is generated.
CHISQR = Returned value of chi-squared. Only relevant if ERROR
passed explicitly.
N_ITER = Number of iterations used.
CMATRIX = Correlation matrix.
Calls : ***
LSTSQR, POLY_FIT
Common : None.
Restrictions: The peak or minimum of the gaussian must be the largest or
respectively the smallest point in the Y vector.
Side effects: None.
Category : Utilities, Curve_Fitting
Prev. Hist. :
DMS, RSI, Dec, 1983.
Modified to use LSTSQR, William Thompson, Feb. 1990.
William Thompson, June 1991, modified to use keywords.
Written : David M. Stern, RSI, December 1983
Modified : Version 1, William Thompson, GSFC, 9 January 1995
Incorporated into CDS library
Version : Version 1, 9 January 1995
[Previous]
[Next]
Project : SOHO - CDS
Name : FIT_SPEC
Purpose : fit spectra
Category : Analysis
Explanation :
Syntax : IDL> fit_spec,x,y
CALLED BY:
BCS, FCS, WBSC_SPC_EV [1], WBSC_SPC_EV [2]
Examples :
Inputs : y = data to fit
x = independent array
Opt. Inputs : None
Outputs : fx,fz = fitted results array
a = fitted parameters
e = error in a
Opt. Outputs: None
Keywords : fit_funct = string name of fit_function to fit
limited to 'GAUSS','FBLUE','VOIGT', and 'DVOIGT'
fixp = parameter indicies to fix (e.g. [0,1] to fix first and second)
flabels = string array of fit characteristics
damp = damping width (A) for Voigt fit
disp = dispersion (dw/dx)
weights = weights for fitting
include = range of additional region to include in fit (e.g. background)
err = 1 (fail) / 0 (success)
fxrange = range within which to restrict fit
chi2 = reduced chi squared
/wave = flags 'x' array as wavelength units (A)
/flux = flags 'y' array as flux units (photons s-1 cm-2 A-1)
/last = use latest 'a' values as input to new iteration
/instrumental = use instrumental weighting
CALLS: ***
DVOIGT_FIT, FBLUE_FIT, GAUSS_FIT, REVERSE, UNIQ [1], UNIQ [2], UNIQ [3], VOIGT_FIT
Common : None.
Restrictions: Limited to Gaussians and Voigt functions.
Side effects: None.
History : Version 1, 17-July-1996, D M Zarro. Written
Version 2, 13-Sept-1999, Zarro (SM&A/GSFC), added BGAUSS
20-Sept-1999, Zarro (SM&A/GSFC), added /INSTRUMENTAL
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
NAME:
FITEXY
PURPOSE:
Best straight-line fit to data with errors in both coordinates
EXPLANATION:
Linear Least-squares approximation in one-dimension (y = a + b*x),
when both x and y data have errors
CALLING EXAMPLE:
FITEXY, x, y, A, B, X_SIG= , Y_SIG= , [sigma_A_B, chi_sq, q, TOL=]
INPUTS:
x = array of values for independent variable.
y = array of data values assumed to be linearly dependent on x.
REQUIRED INPUT KEYWORDS:
X_SIGMA = scalar or array specifying the standard deviation of x data.
Y_SIGMA = scalar or array specifying the standard deviation of y data.
OPTIONAL INPUT KEYWORD:
TOLERANCE = desired accuracy of minimum & zero location, default=1.e-3.
OUTPUTS:
A_intercept = constant parameter result of linear fit,
B_slope = slope parameter, so that:
( A_intercept + B_slope * x ) approximates the y data.
OPTIONAL OUTPUT:
sigma_A_B = two element array giving standard deviation of
A_intercept and B_slope parameters, respectively.
The standard deviations are not meaningful if (i) the
fit is poor (see parameter q), or (ii) b is so large that
the data are consistent with a vertical (infinite b) line.
If the data are consistent with *all* values of b, then
sigma_A_B = [1e33,e33]
chi_sq = resulting minimum Chi-Square of Linear fit, scalar
q - chi-sq probability, scalar (0-1) giving the probability that
a correct model would give a value equal or larger than the
observed chi squared. A small value of q indicates a poor
fit, perhaps because the errors are underestimated. As
discussed by Tremaine et al. (2002, ApJ, 574, 740) an
underestimate of the errors (e.g. due to an intrinsic dispersion)
can lead to a bias in the derived slope, and it may be worth
enlarging the error bars to get a reduced chi_sq ~ 1
CALLS: ***
CHISQR_PDF, CHISQ_FITEXY, MINF_BRACKET, MINF_PARABOLIC, MOMENT, ZBRENT [1]
ZBRENT [2]
COMMON:
common fitexy, communicates the data for computation of chi-square.
PROCEDURE CALLS:
CHISQ_FITEXY() ;Included in this file
MINF_BRACKET, MINF_PARABOLIC, ZBRENT ;In IDL Astronomy Library
MOMENT(), CHISQR_PDF() ;In standard IDL distribution
PROCEDURE:
From "Numerical Recipes" column by Press and Teukolsky:
in "Computer in Physics", May, 1992 Vol.6 No.3
Also see the 2nd edition of the book "Numerical Recipes" by Press et al.
In order to avoid problems with data sets where X and Y are of very
different order of magnitude the data are normalized before the fitting
process is started. The following normalization is used:
xx = (x - xm) / xs and sigx = x_sigma / xs
where xm = MEAN(x) and xs = STDDEV(x)
yy = (y - ym) / ys and sigy = y_sigma / ys
where ym = MEAN(y) and ys = STDDEV(y)
MODIFICATION HISTORY:
Written, Frank Varosi NASA/GSFC September 1992.
Now returns q rather than 1-q W. Landsman December 1992
Use CHISQR_PDF, MOMENT instead of STDEV,CHI_SQR1 W. Landsman April 1998
Fixed typo for initial guess of slope, this error was nearly
always insignificant W. Landsman March 2000
Normalize X,Y before calculation (from F. Holland) W. Landsman Nov 2006
[Previous]
[Next]
Project : SOHO-CDS
Name : FITS2MAP
Purpose : Make an image map from a FITS file
Category : imaging
Syntax : fits2map,file,map
Inputs : FILE = FITS file name (or FITS data + HEADER)
Outputs : MAP = map structure
Keywords : SUB = [x1,x2,y1,y2] = indicies of subarray to extract
SOHO = designate as SOHO-viewed
OUTSIZE = image dimensions of map
HEADER = FITS header (output of last file read)
OLD_WAY = use old read method
OBJECT = return list of map objects
APPEND = append map objects to existing list
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3]
DELVARX [4], EXIST, HAVE_TAG, INDEX2MAP, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
MERGE_STRUCT, MRDFITS [1], MRDFITS [2], PR_SYNTAX, ROT_FITS_HEAD, delvarx [5]
fitshead2struct
CALLED BY:
COALIGN_FITS, OVSA2MAP, PLOT_CDS_POINT [1], PLOT_CDS_POINT [2]
History : Written 22 January 1998, D. Zarro, SAC/GSFC
Modified, 22 April 2000, Zarro (SM&A/GSFC)
Modified, 1 April 2005, Zarro (L-3Com/GSFC)
- accounted for 180 degree roll
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FITS2MAP
Purpose : Make an image map from a FITS file
Category : imaging
Syntax : fits2map,file,map
Inputs : FILE = FITS file name (or FITS data + HEADER)
Outputs : MAP = map structure
Keywords : SUB = [x1,x2,y1,y2] = indicies of subarray to extract
SOHO = designate as SOHO-viewed
OUTSIZE = image dimensions of map
HEADER = FITS header (output of last file read)
OLD_WAY = use old read method
OBJECT = return list of map objects
APPEND = append map objects to existing list
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3]
DELVARX [4], EXIST, HAVE_TAG, INDEX2MAP, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
MERGE_STRUCT, MRDFITS [1], MRDFITS [2], PR_SYNTAX, ROT_FITS_HEAD, delvarx [5]
fitshead2struct
CALLED BY:
COALIGN_FITS, OVSA2MAP, PLOT_CDS_POINT [1], PLOT_CDS_POINT [2]
History : Written 22 January 1998, D. Zarro, SAC/GSFC
Modified, 22 April 2000, Zarro (SM&A/GSFC)
Modified, 1 April 2005, Zarro (L-3Com/GSFC)
- accounted for 180 degree roll
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Name: fits2rm
Category: HESSI, UTIL
Purpose: Read a response matrix from a FITS file. Optionally read EBOUNDS
extension information.
Calling sequence:
fits2rm, 'file.fits', RM=rm, EBINS=ph_edges, DETBINS=ct_edges
Inputs:
file - name of FITS file to read from.
Output keywords:
RM - response matrix, dimensioned n_detector_channels x n_input_energy_bins
EBINS - energy boundaries for input energy bins
DETBINS - energy boundaries for detector channels
PRIMARY_HEADER - first header from FITS file.
EXT_HEADER - header from SPECRESP extension.
EBOUNDS_HEADER - header from EBOUNDS extension.
ERR_MSG = error message. Null if no error occurred.
ERR_CODE - 0/1 if [ no error / an error ] occurred during execution.
Calls: ***
CHECKVAR [1], EXIST, FITS_OPEN, FXPAR [1], FXPAR [2], MRDFITS [1], MRDFITS [2]
N_DIMENSIONS, STR2ARR [1], STR2ARR [2], TRIM, VALID_NUM [1], VALID_NUM [2]
VALID_NUM [3], checkvar [2], required_tags
CALLED BY:
hessi_fits2drm [1], hessi_fits2drm [2], hessi_fits2drm [3]
spex_hessi_fits2drm, spex_xsm_fits2drm
Modification History:
9-aug-2002, Paul Bilodeau - added support for 3-d arrays.
19-Feb-2004, Kim Tolbert - added check that file is an rm file by looking for type*matrix
20-Jul-2004, Kim - call fits_info and mrdfits with /silent
11-Oct-2005, Kim - use fits_open instead of fits_info. fits_info can't handle long headers -
doesn't read the whole header, so if a keyword is near bottom of header, can't find it.
[Previous]
[Next]
Name: fits2spectrum
Category: HESSI, UTIL, FITS
Purpose: Read spectral rate data from a FITS file, including the ENEBAND
extension, if any.
Calling sequence:
Inputs:
file - FITS file to read.
Extnumber - extension number to find Rate or Flux
Outputs:
Input keywords:
EXTNAME - keyword passed to rd_fits_ext. Trapped.
The next three keywords control which extension(s) are read. If
none of these are set, then all three of the primary, rate, and
eneband data extensions are read.
READ_PRIMARY - Set to read primary header.
READ_RATE - Set to read rate extension data.
READ_ENEBAND - set to read eneband extension data.
EXTNO - extension number to read. Trapped.
SETNO - number of extension with given extension type to read in
file. Set this to 1 if you want the second rate extension
and its corresponding eneband extension.
SILENT - Set this to suppress printing of error messages.
Output keywords:
PRIMARY_HEADER - primary FITS header
EXT_HEADER - header for the RATE extension, with any necessary
keywords.
EXT_DATA - data from the RATE / Flux extension.
EXT_STATUS - status from mrdfits call to read rate extension.
ENEBAND_HEADER - header from the ENEBAND extension, if any.
ENEBAND_DATA - data from the ENEBAND extension, if any.
ENEBAND_STATUS - status from mrdfits call to read eneband extension.
ERR_MSG - error message. Null if no error occurred.
ERR_CODE - 0/1 if [ no error / an error ] occurred during execution.
Calls: ***
FITS_INFO [1], FITS_INFO [2], HEADFITS [1], HEADFITS [2], HEADFITS [3]
MRDFITS [1], MRDFITS [2], SSW_PICKFILE, rd_fits_ext
CALLED BY:
HSI_RD_FITS_SPECTRUM, hsi_spectrum_fitsread, read_hessi_4_ospex
read_hessi_4_spex [1], read_hessi_4_spex [2]
Modification History:
9-aug-2002, Paul BIlodeau - rewrote to use rd_fits_ext, headfits,
and ssw_pickfile. Added SILENT kewyord.
19-Feb-2004, Kim Tolbert - added check that file is a rate file by looking for type*rate
[Previous]
[Next]
Project : Solar-B
Name : FITS2TIFF
Purpose : convert FITS file to TIFF file
Explanation : Reads a FITS file, byte scales it, and
then writes it to TIFF file
Use : FITS2TIFF,INFILE,OUTFILE
Inputs : IFILE = input FITS file name
OFILE = output TIFF file name
[def = same as IFILE with .tiff extension]
OUTSIZE = rescale to size [dim1,dim2]
COLORS = load color table
LOG = log scale image
NOCLOBBER = do not clobber existing files
Written : 2-May-2006, Zarro (L-3Com/GSFC)
Contact : dzarro@solar.stanford.edu
CALLS:
[Previous]
[Next]
Name: fits2time
Purpose: convert fits header times to Yohkoh convention
Input Parameters:
header - fits header or fits file name array
Keyword Parameters:
soho - switch, if set, fits header is SOHO time convention
kp - switch, if set, fits uses KittPeak time convention
CALLS: ***
FILE_EXIST [2], FXPAR [1], FXPAR [2], MESAGE, RFITS2 [1], RFITS2 [2], anytim2ex [1]
anytim2ex [2], ex2fid [1], ex2fid [2], file_exist [1], file_exist [3], fmt_tim [1]
fmt_tim [2], is_member [1], is_member [2]
CALLED BY:
ALIGN1BIGGRAM
History:
25-oct-1994 (SLF) Proto written
8-Feb-1995 (SLF) update KP option#2
25-sep-1995 (SLF) MSO-like option
[Previous]
[Next]
Project : HESSI
Name : FITS__DEFINE
Purpose : Define a FITS map object
Category : imaging maps objects
Syntax : This procedure is invoked when a new FITS object is
created via:
IDL> new=obj_new('fits')
CALLS: ***
DPRINT, EXIST, FIND_COMPRESSED, FITS::CLEANUP, FITS::INDEX2FITS, FITS::INIT
FITS::MREADFITS, FITS::READ, FITS::READFITS, HAVE_PROC, IS_BLANK, IS_COMPRESSED
MERGE_STRUCT, MRDFITS [1], MRDFITS [2], MRD_HEAD, OS_FAMILY, SINCE_VERSION [1]
SINCE_VERSION [2], TRIM, fitshead2struct, is_number [1], is_number [2], is_struct
mreadfits
History : Written 19 May 1998, D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
FITS_ADD_CHECKSUM
PURPOSE:
Add or update the CHECKSUM and DATASUM keywords in a FITS header
EXPLANATION:
Follows the 23 May 2002 version of the FITS checksum proposal at
http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
CALLING SEQUENCE:
FITS_ADD_CHECKSUM, Hdr, [ Data, /No_TIMESTAMP, /FROM_IEEE ]
INPUT-OUTPUT:
Hdr - FITS header (string array), it will be updated with new
(or modfied) CHECKSUM and DATASUM keywords
OPTIONAL INPUT:
Data - data array associated with the FITS header. If not supplied, or
set to a scalar, then the program checks whether there is a
DATASUM keyword already in the FITS header containing the 32bit
checksum for the data. if there is no such keyword then ther
assumed to be no data array
associated with the FITS header.
OPTIONAL INPUT KEYWORDS:
/FROM_IEEE - If this keyword is set, then the input is assumed to be in
big endian format (e.g. an untranslated FITS array). This
keyword only has an effect on little endian machines (e.g.
a Linux box).
/No_TIMESTAMP - If set, then a time stamp is not included in the comment
field of the CHECKSUM and DATASUM keywords. Unless the
/No_TIMESTAMP keyword is set, repeated calls to FITS_ADD_CHECKSUM
with the same header and data will yield different values of
CHECKSUM (as the date stamp always changes). However, use of the
date stamp is recommended in the checksum proposal.
PROCEDURES USED:
CHECKSUM32, FITS_ASCII_ENCODE(), GET_DATE, SXADDPAR, SXPAR()
REVISION HISTORY:
W. Landsman SSAI December 2002
CALLS:
CALLED BY
MODFITS, WRITEFITS [1], WRITEFITS [2]
[Previous]
[Next]
NAME:
FITS_ASCII_ENCODE()
PURPOSE:
Encode an unsigned longword as an ASCII string to insert in a FITS header
EXPLANATION:
Follows the 23 May 2002 version of the FITS checksum proposal at
http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
CALLING SEQUENCE:
result = FITS_ASCII_ENCODE( sum32)
INPUTS:
sum32 - 32bit *unsigned longword* (e.g. as returned by CHECKSUM32)
RESULT:
A 16 character scalar string suitable for the CHECKSUM keyword
CALLED BY:
FITS_ADD_CHECKSUM, FITS_TEST_CHECKSUM [1], FITS_TEST_CHECKSUM [2]
EXAMPLE:
A FITS header/data unit has a checksum of 868229149. Encode the
complement of this value (3426738146) into an ASCII string
IDL> print,FITS_ASCII_ENCODE(3426738146U)
===> "hcHjjc9ghcEghc9g"
METHOD:
The 32bit value is interpreted as a sequence of 4 unsigned 8 bit
integers, and divided by 4. Add an offset of 48b (ASCII '0').
Remove non-alphanumeric ASCII characters (byte values 58-64 and 91-96)
by simultaneously incrementing and decrementing the values in pairs.
Cyclicly shift the string one place to the right.
REVISION HISTORY:
Written W. Landsman SSAI December 2002
[Previous]
[Next]
NAME:
FITS_CD_FIX
PURPOSE:
Update obsolete representations of the CD matrix in a FITS header
EXPLANATION:
According the paper, "Representations of Celestial Coordinates in FITS"
by Calabretta & Greisen (2002, A&A, 395, 1077, available at
http://www.aoc.nrao.edu/~egreisen/ )the rotation of an image from
standard coordinates is represented by a coordinate description (CD)
matrix. The standard representation of the CD matrix are PCn_m
keywords, but CDn_m keywords (which include the scale factors) are
also allowed. However, earliers drafts of the standard allowed the
keywords forms CD00n00m and PC00n00m. This procedure will convert
FITS CD matrix keywords containing zeros into the standard forms
CDn_m and PCn_m containing only underscores.
CALLING SEQUENCE:
FITS_CD_FIX, Hdr
INPUT-OUTPUT:
HDR - FITS header, 80 x N string array. If the header does not
contain 'CD00n00m' or 'PC00n00m' keywords then it is left
unmodified. Otherwise, the keywords containing integers are
replaced with those containing underscores.
OPTIONAL KEYWORD INPUT
/REVERSE - this keyword does nothing, but is kept for compatiblity with
earlier versions.
PROCEDURES USED:
SXADDPAR, SXDELPAR, SXPAR()
REVISION HISTORY:
Written W. Landsman Feb 1990
Major rewrite Feb 1994
Converted to IDL V5.0 W. Landsman September 1997
Use double precision formatting of CD matrix W. Landsman April 2000
Major rewrite to convert only to forms recognized by the Greisen
& Calabretta standard W. Landsman July 2003
CALLS:
[Previous]
[Next]
NAME:
FITS_CLOSE
*PURPOSE:
Close a FITS data file
*CATEGORY:
INPUT/OUTPUT
*CALLING SEQUENCE:
FITS_CLOSE,fcb
*INPUTS:
FCB: FITS control block returned by FITS_OPEN.
*KEYWORD PARAMETERS:
/NO_ABORT: Set to return to calling program instead of a RETALL
when an I/O error is encountered. If set, the routine will
return a non-null string (containing the error message) in the
keyword MESSAGE. If /NO_ABORT not set, then FITS_CLOSE will
print the message and issue a RETALL
MESSAGE = value: Output error message
*EXAMPLES:
Open a FITS file, read some data, and close it with FITS_CLOSE
FITS_OPEN,'infile',fcb
FITS_READ,fcb,data
FITS_READ,fcb,moredata
FITS_CLOSE,fcb
*HISTORY:
Written by: D. Lindler August, 1995
Converted to IDL V5.0 W. Landsman September 1997
Do nothing if fcb an invalid structure D. Schlegel/W. Landsman Oct. 2000
Return Message='' for to signal normal operation W. Landsman Nov. 2000
CALLED BY
FITS_HELP, FITS_READ, FITS_WRITE, FTAB_DELROW, FTAB_EXT, FTAB_HELP, FTAB_PRINT
MODFITS, RDFITS_STRUCT, WFPC2_READ, get_fits_extno
[Previous]
[Next]
PROJECT:
SOHO - CDS/SUMER
NAME:
FITS_DATATYPE()
PURPOSE:
Return datatype of FITS data for the given BITPIX value
CATEGORY:
Utility
SYNTAX:
Result = fits_datatype(bitpix)
INPUTS:
BITPIX - Integer, value of keyword BITPIX in FITS header
OPTIONAL INPUTS:
FLAG - Integer flag for output format described below
(consistent with the one used in DATATYPE); default to 0
OUTPUTS:
RESULT - Either a string or integer of the data type specified
by BITPIX. Depending on the value of FLAG, the result
will be one of the values from the following table:
FLAG = 0 FLAG = 1 FLAG = 2 FLAG = 3
UND Undefined 0 UND
BYT Byte 1 BYT
INT Integer 2 INT
LON Long 3 LON
FLO Float 4 FLT
DOU Double 5 DBL
For invalid value of BITPIX, datatype is assumed undefined.
OPTIONAL OUTPUTS:
None.
KEYWORDS:
ERROR - Named variable containing error message. If no error
occurs, the null string is returned.
CALLED BY:
ITOOL_MODIFY_FH, ITOOL_WRITE_FITS
COMMON:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
HISTORY:
Version 1, August 14, 1997, Liyun Wang, NASA/GSFC. Written
CONTACT:
Liyun Wang, NASA/GSFC (Liyun.Wang.1@gsfc.nasa.gov)
[Previous]
[Next]
NAME:
fits_disp_month
PURPOSE:
To display a single image per day for a single month
CALLING SEQUENCE:
fits_disp_month, files, -50, 50
fits_disp_month, file_list('/data14/mdi_summary/daily/maglc', 'smdi_maglc_fd_199611*')
METHOD:
The date of the first image defines which month is to be displayed
"DATEOBS" fits keyword must be in the header.
If smin/smax are not passed, then the first image defines the
image scaling min and max
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], RFITS [1], RFITS [2], RFITS [3], SXPAR [1]
SXPAR [2], SXPAR [3], anytim2ex [1], anytim2ex [2], anytim2ints [1]
anytim2ints [2], ex2dow [1], ex2dow [2], fmt_tim [1], fmt_tim [2], gt_day [1]
gt_day [2], tv2 [1], tv2 [2], zbuff2file [1], zbuff2file [2]
CALLED BY:
do_disp_month
HISTORY:
Written 27-Nov-96 by M.Morrison (taking SXT disp_month.pro)
19-May-97 (MDM) - Added writing boarder lines (because of MDI HR)
20-May-97 (MDM) - Added output of HTML map file (mappre and mapfil options)
30-May-97 (MDM) - Modified to work with EIT FITS files (no header
tag "DATEOBS") so got DATE-OBS and TIME-OBS
- Added img_scale option
16-Jun-97 (MDM) - Corrected error if image for first of the month
is missing.
[Previous]
[Next]
NAME:
FITS_HELP
PURPOSE:
To print a summary of the primary data units and extensions in a
FITS file.
;
CALLING SEQUENCE:
FITS_HELP,filename_or_fcb
INPUTS:
FILENAME_OR_FCB - name of the fits file or the FITS Control Block (FCB)
returned by FITS_OPEN. For versions since V5.3, the
file name is allowed to be gzip compressed (with a .gz
extension)
OUTPUTS:
a summary of the fits file is printed.
CALLS: ***
FITS_CLOSE, FITS_OPEN
EXAMPLES:
FITS_HELP,'myfile.fits'
FITS_OPEN,'anotherfile.fits',fcb
FITS_HELP,fcb
PROCEDURES USED:
FITS_OPEN, FITS_CLOSE
HISTORY:
Written by: D. Lindler August, 1995
Converted to IDL V5.0 W. Landsman September 1997
Don't truncate EXTNAME values at 10 chars W. Landsman Feb. 2005
[Previous]
[Next]
NAME:
FITS_INFO
PURPOSE:
Provide information about the contents of a FITS file
EXPLANATION:
Information includes number of header records and size of data array.
Applies to primary header and all extensions. Information can be
printed at the terminal and/or stored in a common block
This routine is mostly obsolete, and better results can be usually be
performed with FITS_HELP (for display) or FITS_OPEN (to read FITS
information into a structure)
CALLING SEQUENCE:
FITS_INFO, Filename, [ /SILENT , TEXTOUT = , N_ext = ]
INPUT:
Filename - Scalar string giving the name of the FITS file(s)
Can include wildcards such as '*.fits'. In IDL V5.5 one can
use the regular expressions allowed by the FILE_SEARCH()
function. One can also search gzip compressed
FITS files.
OPTIONAL INPUT KEYWORDS:
/SILENT - If set, then the display of the file description on the
terminal will be suppressed
TEXTOUT - specifies output device.
textout=1 TERMINAL using /more option
textout=2 TERMINAL without /more option
textout=3 <program>.prt
textout=4 laser.tmp
textout=5 user must open file, see TEXTOPEN
textout=7 append to existing <program.prt> file
textout = filename (default extension of .prt)
If TEXTOUT is not supplied, then !TEXTOUT is used
OPTIONAL OUTPUT KEYWORD:
N_ext - Returns an integer scalar giving the number of extensions in
the FITS file
COMMON BLOCKS
DESCRIPTOR = File descriptor string of the form N_hdrrec Naxis IDL_type
Naxis1 Naxis2 ... Naxisn [N_hdrrec table_type Naxis
IDL_type Naxis1 ... Naxisn] (repeated for each extension)
For example, the following descriptor
167 2 4 3839 4 55 BINTABLE 2 1 89 5
indicates that the primary header containing 167 lines, and
the primary (2D) floating point image (IDL type 4)
is of size 3839 x 4. The first extension header contains
55 lines, and the byte (IDL type 1) table array is of size
89 x 5.
The DESCRIPTOR is *only* computed if /SILENT is set.
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], MRD_SKIP [1], MRD_SKIP [2], STRN [1]
STRN [2], STRN [3], SXPAR [1], SXPAR [2], SXPAR [3], TEXTCLOSE [1], TEXTCLOSE [2]
TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3]
CALLED BY:
ATV, GET_FITS_INSTR, SUMER_FITS, fits2spectrum, slog_headinfo, spex_hessi_fits2drm
xsm_fits2spectrum
EXAMPLE:
Display info about all FITS files of the form '*.fit' in the current
directory
IDL> fits_info, '*.fit'
Any time a *.fit file is found which is *not* in FITS format, an error
message is displayed at the terminal and the program continues
PROCEDURES USED:
GETTOK(), MRD_SKIP, STRN(), SXPAR(), TEXTOPEN, TEXTCLOSE
SYSTEM VARIABLES:
The non-standard system variables !TEXTOUT and !TEXTUNIT will be
created by FITS_INFO if they are not previously defined.
DEFSYSV,'!TEXTOUT',1
DEFSYSV,'!TEXTUNIT',0
See TEXTOPEN.PRO for more info
MODIFICATION HISTORY:
Written, K. Venkatakrishna, Hughes STX, May 1992
Added N_ext keyword, and table_name info, G. Reichert
Work on *very* large FITS files October 92
More checks to recognize corrupted FITS files February, 1993
Proper check for END keyword December 1994
Correctly size variable length binary tables WBL December 1994
EXTNAME keyword can be anywhere in extension header WBL January 1998
Correctly skip past extensions with no data WBL April 1998
Converted to IDL V5.0, W. Landsman, April 1998
No need for !TEXTOUT if /SILENT D.Finkbeiner February 2002
Define !TEXTOUT if needed. R. Sterner, 2002 Aug 27
Work on gzip compressed files for V5.3 or later W. Landsman 2003 Jan
Improve speed by only reading first 36 lines of header
Count headers with more than 32767 lines W. Landsman Feb. 2003
Assume since V5.3 (OPENR,/COMPRESS) W. Landsman Feb 2004
EXTNAME keyword can be anywhere in extension header again
WBL/S. Bansal Dec 2004
[Previous]
[Next]
NAME:
FITS_INFO
PURPOSE:
Provide information about the contents of a FITS file
EXPLANATION:
Information includes number of header records and size of data array.
Applies to primary header and all extensions. Information can be
printed at the terminal and/or stored in a common block
This routine is mostly obsolete, and better results can be usually be
performed with FITS_HELP (for display) or FITS_OPEN (to read FITS
information into a structure)
CALLING SEQUENCE:
FITS_INFO, Filename, [ /SILENT , TEXTOUT = , N_ext = ]
INPUT:
Filename - Scalar string giving the name of the FITS file(s)
Can include wildcards such as '*.fits', or regular expressions
allowed by the FILE_SEARCH() function. One can also search
gzip compressed FITS files.
OPTIONAL INPUT KEYWORDS:
/SILENT - If set, then the display of the file description on the
terminal will be suppressed
TEXTOUT - specifies output device.
textout=1 TERMINAL using /more option
textout=2 TERMINAL without /more option
textout=3 <program>.prt
textout=4 laser.tmp
textout=5 user must open file, see TEXTOPEN
textout=7 append to existing <program.prt> file
textout = filename (default extension of .prt)
If TEXTOUT is not supplied, then !TEXTOUT is used
OPTIONAL OUTPUT KEYWORD:
N_ext - Returns an integer scalar giving the number of extensions in
the FITS file
COMMON BLOCKS
DESCRIPTOR = File descriptor string of the form N_hdrrec Naxis IDL_type
Naxis1 Naxis2 ... Naxisn [N_hdrrec table_type Naxis
IDL_type Naxis1 ... Naxisn] (repeated for each extension)
For example, the following descriptor
167 2 4 3839 4 55 BINTABLE 2 1 89 5
indicates that the primary header containing 167 lines, and
the primary (2D) floating point image (IDL type 4)
is of size 3839 x 4. The first extension header contains
55 lines, and the byte (IDL type 1) table array is of size
89 x 5.
The DESCRIPTOR is *only* computed if /SILENT is set.
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], MRD_SKIP [1], MRD_SKIP [2], STRN [1]
STRN [2], STRN [3], SXPAR [1], SXPAR [2], SXPAR [3], TEXTCLOSE [1], TEXTCLOSE [2]
TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3]
CALLED BY:
ATV, GET_FITS_INSTR, SUMER_FITS, fits2spectrum, slog_headinfo, spex_hessi_fits2drm
xsm_fits2spectrum
EXAMPLE:
Display info about all FITS files of the form '*.fit' in the current
directory
IDL> fits_info, '*.fit'
Any time a *.fit file is found which is *not* in FITS format, an error
message is displayed at the terminal and the program continues
PROCEDURES USED:
GETTOK(), MRD_SKIP, STRN(), SXPAR(), TEXTOPEN, TEXTCLOSE
SYSTEM VARIABLES:
The non-standard system variables !TEXTOUT and !TEXTUNIT will be
created by FITS_INFO if they are not previously defined.
DEFSYSV,'!TEXTOUT',1
DEFSYSV,'!TEXTUNIT',0
See TEXTOPEN.PRO for more info
MODIFICATION HISTORY:
Written, K. Venkatakrishna, Hughes STX, May 1992
Added N_ext keyword, and table_name info, G. Reichert
Work on *very* large FITS files October 92
More checks to recognize corrupted FITS files February, 1993
Proper check for END keyword December 1994
Correctly size variable length binary tables WBL December 1994
EXTNAME keyword can be anywhere in extension header WBL January 1998
Correctly skip past extensions with no data WBL April 1998
Converted to IDL V5.0, W. Landsman, April 1998
No need for !TEXTOUT if /SILENT D.Finkbeiner February 2002
Define !TEXTOUT if needed. R. Sterner, 2002 Aug 27
Work on gzip compressed files for V5.3 or later W. Landsman 2003 Jan
Improve speed by only reading first 36 lines of header
Count headers with more than 32767 lines W. Landsman Feb. 2003
Assume since V5.3 (OPENR,/COMPRESS) W. Landsman Feb 2004
EXTNAME keyword can be anywhere in extension header again
WBL/S. Bansal Dec 2004
Read more than 200 extensions WBL March 2005
Work for FITS files with SIMPLE=F WBL July 2005
Assume since V5.4, fstat.compress available WBL April 2006
[Previous]
[Next]
Interprets a FITS header and returns a structure with the
tagnames matching the FITS keywords and tag values
equal to the keyword values.
PRO fits_interp, header, result, $
inname=inname, instruc=instruc, ishort=ishort, fshort=fshort, $
DASH2UNDERSCORE=dash2underscore
INPUT PARAMETERS:
header = FITS header, string array.
OUTPUT PARAMETERS:
result = structure with values.
OPTIONAL INPUT KEYWORDS:
inname = name of structure to be created, string. Ignored
if /INSTRUC is passed. Default, generate a name
based on the current date and time UT.
instruc = structure to use for interpreting header.
Default, create a structure based on the header
and the values it contains.
ishort - If set, use Integer type rather than Long.
Ignored if INSTRUC is provided.
fshort - If set, use Float type rather than Double.
Ignored if INSTRUC is provided
(See Restrictions)
DASH2UNDERSCORE - If set, replace all instances of '-' with '_'
instead of the default '_D$' (Unnecessary if INSTRUC is provide)
USAGE:
The header string array for a given FITS file can be read
either with
image = READFITS( 'FITS.filename', header )
or
header = HEADFITS( 'FITS.filename' ).
The initial call to FITS_INTERP will define the
structure with datatypes based on the values in the
header. It is good practice to use the /INNAME
keyword to avoid structure definition conflicts.
Subsequent calls to FITS_INTERP for the
same kind of image files should use the INSTRUC keyword
to enforce compatibility of the output structures.
It is not possible to redefine the contents of a structure
with a given name.
CALLS: ***
CREATE_STRUCT [1], CREATE_STRUCT [2], GETTOK [1], GETTOK [2], GETTOK [3]
GETTOK [4], REPCHR [1], REPCHR [2], REPCHR [3], STRNUMBER [1], STRNUMBER [2]
STRNUMBER [3], STRNUMBER [4], STR_SEP, TAG_EXIST [1], TAG_EXIST [2], id_esc
str_replace [1], str_replace [2]
CALLED BY:
READ_NRH, mreadfits
RESTRICTIONS:
All byte, integer, and long values are interpreted as long;
all float, double and E format values are interpreted as real*8.
These conventions insure that if the range of values in the
current header is small, there is still room for later, large
data values. The keywords ISHORT and FSHORT can be set
to save storage if the data value ranges are KNOWN to be small.
Remember, you cannot redefine the structure with a different
choice for ISHORT or FSHORT.
Blank fields may be interpreted with incorrect data types.
Multiple Comment and History lines in the header are gathered into
single .COMMENT and .HISTORY tags as string arrays.
HISTORY:
Written September 30, 1994 Barry LaBonte
Bug fix for structure name October 6, 1994 BJL
Separate comment and history tags October 10, 1994 BJL
Fix structure name case, order October 14, 1994 BJL
Better logic to identify value field October 25, 1994 BJL
Verify the END line in header March 3, 1995 BJL
4-April-1996 (S.L.Freeland) - fixed (kluged?) problem with COMMENT
11-April-1997 (S.L.Freeland) - same with HISTORY problem
13-april-1997 (Craig DeForest) - protection if no comments
5-August-1997 (Craig DeForest) - Fixed bug that prevented
finding multiple {comment|header} lines with a structure
template. Now you find up to the number of strings that
are allocated in the structure template.
21-August-1997 (S.L.Freeland) - implement Barry LaBonte suggestion
(systime instead of ut_time)
20-June-1998 (Zarro, SAC/GSFC) - changed REPCHR call to STR_REPLACE
25-Jan-1999 (Craig DeForest) - Diked out use of the vascii array;
replaced it with ID_ESC call.
18-Jan-2006 (A. Vourlidas, W.T.Thompson) - expanded typecode list to
include UINT (SECCHI images)
20-Jul-2006 (N.Rich) - Add DASH2UNDERSCORE keyword
18-Sep-2006 (N.Rich) - Fix(?) DASH2UNDERSCORE; initialize HEADER and
COMMENT in result because was getting incorrect values in line 313
[Previous]
[Next]
NAME:
FITS_OPEN
PURPOSE:
Opens a FITS (Flexible Image Transport System) data file.
EXPLANATION:
FITS_OPEN was modified in Sep 2006 to open with /SWAP_IF_LITTLE_ENDIAN
It must be used with post-Sep 2006 versions of FITS_READ, FITS_WRITE
and MODFITS.
*CATEGORY:
INPUT/OUTPUT
*CALLING SEQUENCE:
FITS_OPEN, filename, fcb
*INPUTS:
filename : name of the FITS file to open, scalar string
FITS_OPEN can also open gzip compressed (.gz) file *for
reading only*, although there is a performance penalty
*OUTPUTS:
fcb : (FITS Control Block) a IDL structure containing information
concerning the file. It is an input to FITS_READ, FITS_WRITE
and FITS_CLOSE
INPUT KEYWORD PARAMETERS:
/APPEND: Set to append to an existing file.
/HPRINT - print headers with routine HPRINT as they are read.
(useful for debugging a strange file)
/NO_ABORT: Set to return to calling program instead of a RETALL
when an I/O error is encountered. If set, the routine will
return a non-null string (containing the error message) in the
keyword MESSAGE. (For backward compatibility, the obsolete
system variable !ERR is also set to -1 in case of an error.)
If /NO_ABORT not set, then FITS_OPEN will print the message and
issue a RETALL
/UPDATE Set this keyword to open an existing file for update
/WRITE: Set this keyword to open a new file for writing.
OUTPUT KEYWORD PARAMETERS:
MESSAGE = value: Output error message. If the FITS file was opened
successfully, then message = ''.
*NOTES:
The output FCB should be passed to the other FITS routines (FITS_OPEN,
FITS_READ, FITS_HELP, and FITS_WRITE). It has the following structure
when FITS_OPEN is called without /WRITE or /APPEND keywords set.
FCB.FILENAME - name of the input file
.UNIT - unit number the file is opened to
.NEXTEND - number of extensions in the file.
.XTENSION - string array giving the extension type for each
extension.
.EXTNAME - string array giving the extension name for each
extension. (null string if not defined the extension)
.EXTVER - vector of extension version numbers (0 if not
defined)
.EXTLEVEL - vector of extension levels (0 if not defined)
.GCOUNT - vector with the number of groups in each extension.
.PCOUNT - vector with parameter count for each group
.BITPIX - BITPIX for each extension with values
8 byte data
16 short word integers
32 long word integers
-32 IEEE floating point
-64 IEEE double precision floating point
.NAXIS - number of axes for each extension. (0 for null data
units)
.AXIS - 2-D array where axis(*,N) gives the size of each axes
for extension N
.START_HEADER - vector giving the starting byte in the file
where each extension header begins
.START_DATA - vector giving the starting byte in the file
where the data for each extension begins
.HMAIN - keyword parameters (less standard required FITS
keywords) for the primary data unit.
.OPEN_FOR_WRITE - flag (0= open for read, 1=open for write,
2=open for update)
.LAST_EXTENSION - last extension number read.
.RANDOM_GROUPS - 1 if the PDU is random groups format,
0 otherwise
.NBYTES - total number of (uncompressed) bytes in the FITS file
When FITS open is called with the /WRITE or /APPEND option, FCB
contains:
FCB.FILENAME - name of the input file
.UNIT - unit number the file is opened to
.NEXTEND - number of extensions in the file.
.OPEN_FOR_WRITE - flag (1=open for write, 2=open for append
3=open for update)
*EXAMPLES:
Open a FITS file for reading:
FITS_OPEN,'myfile.fits',fcb
Open a new FITS file for output:
FITS_OPEN,'newfile.fits',fcb,/write
PROCEDURES USED:
HPRINT, SXDELPAR, SXPAR()
*HISTORY:
Written by: D. Lindler August, 1995
July, 1996 NICMOS Modified to allow open for overwrite
to allow primary header to be modified
DJL Oct. 15, 1996 corrected to properly extend AXIS when more
than 100 extensions present
Converted to IDL V5.0 W. Landsman September 1997
Use Message = '' rather than !ERR =1 as preferred signal of normal
operation W. Landsman November 2000
Lindler, Dec, 2001, Modified to use 64 bit words for storing byte
positions within the file to allow support for very large
files
Work with gzip compressed files W. Landsman January 2003
Fix gzip compress for V5.4 and earlier W.Landsman/M.Fitzgerald Dec 2003
Assume since V5.3 (STRSPLIT, OPENR,/COMPRESS) W. Landsman Feb 2004
Treat FTZ extension as gzip compressed W. Landsman Sep 2004
Assume since V5.4 fstat.compress available W. Landsman Apr 2006
FCB.Filename now expands any wildcards W. Landsman July 2006
Make ndata 64bit for very large files B. Garwood/W. Landsman Sep 2006
Open with /SWAP_IF_LITTLE_ENDIAN, remove obsolete keywords to OPEN
W. Landsman Sep 2006
CALLS:
CALLED BY
FITS_HELP, FITS_READ, FITS_WRITE, FTAB_DELROW, FTAB_EXT, FTAB_HELP, FTAB_PRINT
MODFITS, RDFITS_STRUCT, WFPC2_READ, find_fits_ext, fits2rm, get_fits_extno
[Previous]
[Next]
NAME:
FITS_READ
PURPOSE:
To read a FITS file.
EXPLANATION:
***NOTE** This version of FITS_READ must be used with a post Sep 2006
version of FITS_OPEN.
CALLING SEQUENCE:
FITS_READ, filename_or_fcb, data [,header, group_par]
INPUTS:
FILENAME_OR_FCB - this parameter can be the FITS Control Block (FCB)
returned by FITS_OPEN or the file name of the FITS file. If
a file name is supplied, FITS_READ will open the file with
FITS_OPEN and close the file with FITS_CLOSE before exiting.
When multiple extensions are to be read from the file, it is
more efficient for the user to call FITS_OPEN and leave the
file open until all extensions are read.
OUTPUTS:
DATA - data array. If /NOSCALE is specified, BSCALE and BZERO
(if present in the header) will not be used to scale the data.
If Keywords FIRST and LAST are used to read a portion of the
data or the heap portion of an extension, no scaling is done
and data is returned as a 1-D vector. The user can use the IDL
function REFORM to convert the data to the correct dimensions
if desired. If /DATA_ONLY is specified, no scaling is done.
HEADER - FITS Header. If an extension is read, and the /NO_PDU keyword
parameter is not supplied, the primary data unit header
and the extension header will be combined. The header will have
the form:
<required keywords for the extension: XTENSION, BITPIX,
NAXIS, ...>
BEGIN MAIN HEADER --------------------------------
<PDU header keyword and history less required keywords:
SIMPLE, BITPIX, NAXIS, ...>
BEGIN EXTENSION HEADER ---------------------------
<extension header less required keywords that were
placed at the beginning of the header.
END
The structure of the header is such that if a keyword is
duplicated in both the PDU and extension headers, routine
SXPAR will print a warning and return the extension value of
the keyword. SXADDPAR and SXADDHIST will add new keywords and
history to the extension portion of the header unless the
parameter /PDU is supplied in the calling sequence.
GROUP_PAR - Group parameter block for FITS random groups format files
or the heap area for variable length binary tables.
Any scale factors in the header (PSCALn and PZEROn) are not
applied to the group parameters.
INPUT KEYWORD PARAMETERS:
/NOSCALE: Set to return the FITS data without applying the scale
factors BZERO and BSCALE.
/HEADER_ONLY: set to read the header only.
/DATA_ONLY: set to read the data only. If set, if any scale factors
are present (BSCALE or BZERO), they will not be applied.
/NO_PDU: Set to not add the primary data unit header keywords to the
output header.
/NO_ABORT: Set to return to calling program instead of a RETALL
when an I/O error is encountered. If set, the routine will
return a non-null string (containing the error message) in the
keyword MESSAGE. (For backward compatibility, the obsolete
system variable !ERR is also set to -1 in case of an error.)
If /NO_ABORT not set, then FITS_READ will print the message and
issue a RETALL
/NO_UNSIGNED - By default, if the header indicates an unsigned integer
(BITPIX = 16, BZERO=2^15, BSCALE=1) then FITS_READ will output
an IDL unsigned integer data type (UINT). But if /NO_UNSIGNED
is set, then the data is converted to type LONG.
EXTEN_NO - extension number to read. If not set, the next extension
in the file is read. Set to 0 to read the primary data unit.
XTENSION - string name of the xtension to read
EXTNAME - string name of the extname to read
EXTVER - integer version number to read
EXTLEVEL - integer extension level to read
FIRST - set this keyword to only read a portion of the data. It gives
the first word of the data to read
LAST - set this keyword to only read a portion of the data. It gives
the last word number of the data to read
GROUP - group number to read for GCOUNT>1. (Default=0, the first group)
OUTPUT KEYWORD PARAMETERS:
ENUM - Output extension number that was read.
MESSAGE = value: Output error message
NOTES:
Determination or which extension to read.
case 1: EXTEN_NO specified. EXTEN_NO will give the number of the
extension to read. The primary data unit is refered
to as extension 0. If EXTEN_NO is specified, XTENSION,
EXTNAME, EXTVER, and EXTLEVEL parameters are ignored.
case 2: if EXTEN_NO is not specified, the first extension
with the specified XTENSION, EXTNAME, EXTVER, and
EXTLEVEL will be read. If any of the 4 parameters
are not specified, they will not be used in the search.
Setting EXTLEVEL=0, EXTVER=0, EXTNAME='', or
XTENSION='' is the same as not supplying them.
case 3: if none of the keyword parameters, EXTEN_NO, XTENSION,
EXTNAME, EXTVER, or EXTLEVEL are supplied. FITS_READ
will read the next extension in the file. If the
primary data unit (PDU), extension 0, is null, the
first call to FITS_READ will read the first extension
of the file.
The only way to read a null PDU is to use EXTEN_NO = 0.
If FIRST and LAST are specified, the data is returned without applying
any scale factors (BSCALE and BZERO) and the data is returned in a
1-D vector. This will allow you to read any portion of a multiple
dimension data set. Once returned, the IDL function REFORM can be
used to place the correct dimensions on the data.
IMPLICIT IMAGES: FITS_READ will construct an implicit image
for cases where NAXIS=0 and the NPIX1, NPIX2, and PIXVALUE
keywords are present. The output image will be:
image = replicate(PIXVALUE,NPIX1,NPIX2)
CALLS: ***
FITS_CLOSE, FITS_OPEN, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXDELPAR [1]
SXDELPAR [2], SXDELPAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
ATV, FTAB_DELROW, FTAB_EXT, FTAB_HELP, FTAB_PRINT, MODFITS, RDFITS_STRUCT, WFPC2_READ
EXAMPLES:
Read the primary data unit of a FITS file, if it is null read the
first extension:
FITS_READ, 'myfile.fits', data, header
Read the first two extensions of a FITS file and the extension with
EXTNAME = 'FLUX' and EXTVER = 4
FITS_OPEN, 'myfile.fits', fcb
FITS_READ, fcb,data1, header2, exten_no = 1
FITS_READ, fcb,data1, header2, exten_no = 2
FITS_READ, fcb,data3, header3, extname='flux', extver=4
FITS_CLOSE, fcb
Read the sixth image in a data cube for the fourth extension.
FITS_OPEN, 'myfile.fits', fcb
image_number = 6
ns = fcb.axis(0,4)
nl = fcb.axis(1,4)
i1 = (ns*nl)*(image_number-1)
i2 = i2 + ns*nl-1
FITS_READ,fcb,image,header,first=i1,last=i2
image = reform(image,ns,nl,/overwrite)
FITS_CLOSE
PROCEDURES USED:
FITS_CLOSE, FITS_OPEN
SXADDPAR, SXDELPAR, SXPAR()
WARNINGS:
In Sep 2006, FITS_OPEN was modified to open FITS files using the
/SWAP_IF_LITTLE_ENDIAN keyword to OPEN, so that subsequent routines
(FITS_READ, FITS_WRITE) did not require any byte swapping. An error
may result if an pre-Sep 2006 version of FITS_OPEN is used with a
post Sep 2006 version of FITS_READ, FITS_WRITE or MODFITS.
HISTORY:
Written by: D. Lindler, August 1995
Converted to IDL V5.0 W. Landsman September 1997
Avoid use of !ERR W. Landsman August 1999
Read unsigned datatypes, added /no_unsigned W. Landsman December 1999
Don't call FITS_CLOSE unless fcb is defined W. Landsman January 2000
Set BZERO = 0 for unsigned integer data W. Landsman January 2000
Only call IEEE_TO_HOST if needed W. Landsman February 2000
Ensure EXTEND keyword in primary header W. Landsman April 2001
Don't erase ERROR message when closing file W. Landsman April 2002
Assume at least V5.1 remove NANValue keyword W. Landsman November 2002
Work with compress files (read file size from fcb),
requires updated (Jan 2003) version of FITS_OPEN W. Landsman Jan 2003
Do not modify BSCALE/BZERO for unsigned integers W. Landsman April 2006
Asuume FITS_OPEN has opened the file with /SWAP_IF_LITTLE_ENDIAN
W. Landsman September 2006
Fix problem with /DATA_ONLY keyword M.Buie/W.Landsman October 2006
[Previous]
[Next]
NAME:
FITS_TEST_CHECKSUM()
PURPOSE:
Verify the values of the CHECKSUM and DATASUM keywords in a FITS header
EXPLANATION:
Follows the 23 May 2002 version of the FITS checksum proposal at
http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
CALLING SEQUENCE:
result = FITS_TEST_CHECKSUM(HDR, [ DATA, ERRMSG=, /FROM_IEEE ])
INPUTS:
HDR - FITS header (vector string)
OPTIONAL DATA:
DATA - data array associated with the FITS header. If not supplied, or
set to a scalar, then there is assumed to be no data array
associated with the FITS header.
RESULT:
An integer -1, 0 or 1 indicating the following conditions:
1 - CHECKSUM (and DATASUM) keywords are present with correct values
0 - CHECKSUM keyword is not present
-1 - CHECKSUM or DATASUM keyword does not have the correct value
indicating possible data corruption.
OPTIONAL INPUT KEYWORD:
/FROM_IEEE - If this keyword is set, then the input is assumed to be in
big endian format (e.g. an untranslated FITS array). This
keyword only has an effect on little endian machines (e.g.
a Linux box).
OPTIONAL OUTPUT KEYWORD:
ERRMSG - will contain a scalar string giving the error condition. If
RESULT = 1 then ERRMSG will be an empty string. If this
output keyword is not supplied, then the error message will be
printed at the terminal.
NOTES:
The header and data must be *exactly* as originally written in the FITS
file. By default, some FITS readers may alter keyword values (e.g.
BSCALE) or append information (e.g. HISTORY or an inherited primary
header) and this will alter the checksum value.
PROCEDURES USED:
CHECKSUM32, FITS_ASCII_ENCODE(), SXPAR()
CALLS: ***
CHECKSUM32, FITS_ASCII_ENCODE, SXPAR [1], SXPAR [2], SXPAR [3]
EXAMPLE:
Verify the CHECKSUM keywords in the primary header/data unit of a FITS
file 'test.fits'
FITS_READ,'test.fits',data,hdr,/no_PDU,/NoSCALE
print,FITS_TEST_CHECKSUM(hdr,data)
Note the use of the /No_PDU and /NoSCALE keywords to avoid any alteration
of the FITS header
REVISION HISTORY:
W. Landsman SSAI December 2002
Return quietly if CHECKSUM keywords not found W. Landsman May 2003
[Previous]
[Next]
NAME:
FITS_TEST_CHECKSUM()
PURPOSE:
Verify the values of the CHECKSUM and DATASUM keywords in a FITS header
EXPLANATION:
Follows the 23 May 2002 version of the FITS checksum proposal at
http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
CALLING SEQUENCE:
result = FITS_TEST_CHECKSUM(HDR, [ DATA, ERRMSG=, /FROM_IEEE ])
INPUTS:
HDR - FITS header (vector string)
OPTIONAL DATA:
DATA - data array associated with the FITS header. If not supplied, or
set to a scalar, then there is assumed to be no data array
associated with the FITS header.
RESULT:
An integer -1, 0 or 1 indicating the following conditions:
1 - CHECKSUM (and DATASUM) keywords are present with correct values
0 - CHECKSUM keyword is not present
-1 - CHECKSUM or DATASUM keyword does not have the correct value
indicating possible data corruption.
OPTIONAL INPUT KEYWORD:
/FROM_IEEE - If this keyword is set, then the input is assumed to be in
big endian format (e.g. an untranslated FITS array). This
keyword only has an effect on little endian machines (e.g.
a Linux box).
OPTIONAL OUTPUT KEYWORD:
ERRMSG - will contain a scalar string giving the error condition. If
RESULT = 1 then ERRMSG will be an empty string. If this
output keyword is not supplied, then the error message will be
printed at the terminal.
NOTES:
The header and data must be *exactly* as originally written in the FITS
file. By default, some FITS readers may alter keyword values (e.g.
BSCALE) or append information (e.g. HISTORY or an inherited primary
header) and this will alter the checksum value.
PROCEDURES USED:
CHECKSUM32, FITS_ASCII_ENCODE(), SXPAR()
CALLS: ***
CHECKSUM32, FITS_ASCII_ENCODE, SXPAR [1], SXPAR [2], SXPAR [3]
EXAMPLE:
Verify the CHECKSUM keywords in the primary header/data unit of a FITS
file 'test.fits'
FITS_READ,'test.fits',data,hdr,/no_PDU,/NoSCALE
print,FITS_TEST_CHECKSUM(hdr,data)
Note the use of the /No_PDU and /NoSCALE keywords to avoid any alteration
of the FITS header
REVISION HISTORY:
W. Landsman SSAI December 2002
Return quietly if CHECKSUM keywords not found W. Landsman May 2003
Add /NOSAVE to CHECKSUM32 calls when possible W. Landsman Sep 2004
[Previous]
[Next]
NAME:
FITS_WRITE
PURPOSE:
To write a FITS primary data unit or extension.
EXPLANATION:
***NOTE** This version of FITS_READ must be used with a post Sep 2006
version of FITS_OPEN.
CALLING SEQUENCE:
FITS_WRITE, filename_or_fcb, data, [header_in]
INPUTS:
FILENAME_OR_FCB: name of the output data file or the FITS control
block returned by FITS_OPEN (called with the /WRITE or
/APPEND) parameters.
OPTIONAL INPUTS:
DATA: data array to write. If not supplied or set to a scalar, a
null image is written.
HEADER_IN: FITS header keyword. If not supplied, a minimal basic
header will be created. Required FITS keywords, SIMPLE,
BITPIX, XTENSION, NAXIS, ... are added by FITS_WRITE and
do not need to be supplied with the header. If supplied,
their values will be updated as necessary to reflect DATA.
INPUT KEYWORD PARAMETERS:
XTENSION: type of extension to write (Default="IMAGE"). If not
supplied, it will be taken from HEADER_IN. If not in either
place, the default is "IMAGE". This parameter is ignored
when writing the primary data unit. Note that binary and
and ASCII table extensions already have a properly formatted
header (e.g. with TTYPE* keywords) and byte array data.
EXTNAME: EXTNAME for the extension. If not supplied, it will be taken
from HEADER_IN. If not supplied and not in HEADER_IN, no
EXTNAME will be written into the output extension.
EXTVER: EXTVER for the extension. If not supplied, it will be taken
from HEADER_IN. If not supplied and not in HEADER_IN, no
EXTVER will be written into the output extension.
EXTLEVEL: EXTLEVEL for the extension. If not supplied, it will be taken
from HEADER_IN. If not supplied and not in HEADER_IN, no
EXTLEVEL will be written into the output extension.
/NO_ABORT: Set to return to calling program instead of a RETALL
when an I/O error is encountered. If set, the routine will
return a non-null string (containing the error message) in the
keyword MESSAGE. If /NO_ABORT not set, then FITS_WRITE will
print the message and issue a RETALL
/NO_DATA: Set if you only want FITS_WRITE to write a header. The
header supplied will be written without modification and
the user is expected to write the data using WRITEU to unit
FCB.UNIT. When FITS_WRITE is called with /NO_DATA, the user is
responsible for the validity of the header, and must write
the correct amount and format of the data. When FITS_WRITE
is used in this fashion, it will pad the data from a previously
written extension to 2880 blocks before writting the header.
OUTPUT KEYWORD PARAMETERS:
MESSAGE: value of the error message for use with /NO_ABORT
HEADER: actual output header written to the FITS file.
NOTES:
If the first call to FITS_WRITE is an extension, FITS_WRITE will
automatically write a null image as the primary data unit.
Keywords and history in the input header will be properly separated
into the primary data unit and extension portions when constructing
the output header (See FITS_READ for information on the internal
Header format which separates the extension and PDU header portions).
CALLS: ***
FITS_CLOSE, FITS_OPEN, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXDELPAR [1]
SXDELPAR [2], SXDELPAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FTAB_DELROW
EXAMPLES:
Write an IDL variable to a FITS file with the minimal required header.
FITS_WRITE,'newfile.fits',ARRAY
Write the same array as an image extension, with a null Primary data
unit.
FITS_WRITE,'newfile.fits',ARRAY,xtension='IMAGE'
Write 4 additional image extensions to the same file.
FITS_OPEN,'newfile.fits',fcb
FITS_WRITE,fcb,data1,extname='FLUX',extver=1
FITS_WRITE,fcb,err1,extname'ERR',extver=1
FITS_WRITE,fcb,data2,extname='FLUX',extver=2
FITS_WRITE,fcb,err2,extname='ERR',extver=2
FITS_CLOSE,FCB
PROCEDURES USED:
FITS_OPEN, SXADDPAR, SXDELPAR, SXPAR()
HISTORY:
Written by: D. Lindler August, 1995
Work for variable length extensions W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
PCOUNT and GCOUNT added for IMAGE extensions J. Graham October 1999
Write unsigned data types W. Landsman December 1999
Pad data area with zeros not blanks W. McCann/W. Landsman October 2000
Return Message='' to signal normal operation W. Landsman Nov. 2000
Ensure that required extension table keywords are in proper order
W.V. Dixon/W. Landsman March 2001
Assume since V5.1, remove NaNValue keyword W. Landsman Nov. 2002
Removed obsolete !ERR system variable W. Landsman Feb 2004
Check that byte array supplied with table extension W. Landsman Mar 2004
Make number of bytes 64bit to avoid possible overflow W.L Apr 2006
Asuume FITS_OPEN has opened the file with /SWAP_IF_LITTLE_ENDIAN
W. Landsman September 2006
[Previous]
[Next]
NAME:
FITSDIR
PURPOSE:
Display selected FITS keywords from the headers of FITS files.
EXPLANATION:
The values of either user-specified or default FITS keywords are
displayed in either the primary header and/or the first extension header.
Unless the /NOSIZE keyword is set, the data size is also displayed.
The default keywords are as follows (with keywords in 2nd row used if
those in the first row not found, and the 3rd row if neither the keywords
in the first or second rows found:)
DATE-OBS TELESCOP OBJECT EXPTIME
TDATEOBS TELNAME TARGNAME INTEG ;First Alternative
DATE OBSERVAT EXPOSURE ;Second Alternative
INSTRUME EXPTIM ;Third Alternative
FITSDIR will also recognize gzip compressed files (must have a .gz
or FTZ extension).
CALLING SEQUENCE:
FITSDIR , [ directory, TEXTOUT =, EXTEN=, KEYWORDS=, /NOSIZE, /NoTELESCOPE
ALT1_KEYWORDS= ,ALT2_KEYWORDS = ,ALT3_KEYWORDS =
OPTIONAL INPUT PARAMETERS:
DIRECTORY - Scalar string giving file name, disk or directory to be
searched. Wildcard file names are allowed. Examples of
valid names include 'iraf/*.fits' (Unix), d:\myfiles\f*.fits',
(Windows) or 'Macintosh HD:Files:*c0f.fits' (Macintosh).
OPTIONAL KEYWORD INPUT PARAMETER
KEYWORDS - FITS keywords to display, as either a vector of strings or as
a comma delimited scalar string, e.g.'testname,dewar,filter'
If not supplied, then the default keywords are 'DATE-OBS',
'TELESCOP','OBJECT','EXPTIME'
ALT1_KEYWORDS - A list (either a vector of strings or a comma delimited
strings of alternative keywords to use if the default
KEYWORDS cannot be found. By default, 'TDATEOBS', is the
alternative to DATE-OBS, 'TELNAME' for 'TELESCOP','TARGNAME'
for 'OBJECT', and 'INTEG' for EXPTIME
ALT2_KEYWORDS - A list (either a vector of strings or a comma delimited
strings of alternative keywords to use if neither KEYWORDS
nor ALT1_KEYWORDS can be found.
ALT3_KEYWORDS - A list (either a vector of strings or a comma delimited
strings of alternative keywords to use if neither KEYWORDS
nor ALT1_KEYWORDS nor ALT2_KEYWORDS can be found.
/NOSIZE - if set then information about the image size is not displayed
TEXTOUT - Controls output device as described in TEXTOPEN procedure
textout=1 TERMINAL using /more option
textout=2 TERMINAL without /more option
textout=3 <program>.prt
textout=4 laser.tmp
textout=5 user must open file
textout=7 Append to existing <program>.prt file
textout = filename (default extension of .prt)
EXTEN - Specifies an extension number (/EXTEN works for first extension)
which is checked for the desired keywords.
/NOTELESCOPE - If set, then if the default keywords are used, then the
TELESCOPE (or TELNAME, OBSERVAT, INSTRUME) keywords are omitted
to give more room for display other keywords. The /NOTELESCOP
keyword has no effect if the default keywords are not used.
OUTPUT PARAMETERS:
None.
CALLS: ***
FDECOMP [1], FDECOMP [2], FDECOMP [3], FXMOVE [1], FXMOVE [2], GETTOK [1]
GETTOK [2], GETTOK [3], GETTOK [4], MRD_HREAD [1], MRD_HREAD [2], REMCHAR [1]
REMCHAR [2], REMCHAR [3], SPEC_DIR [1], SPEC_DIR [2], SPEC_DIR [3], TEXTCLOSE [1]
TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3], strsplit
EXAMPLES:
(1) Print info on all'*.fits' files in the current directory using default
keywords. Include information from the extension header
IDL> fitsdir,/exten
(2) Write a driver program to display selected keywords in HST/ACS drizzled
(*drz) images
pro acsdir
keywords = 'date-obs,targname,detector,filter1,filter2,exptime'
fitsdir,'*drz.fits',key=keywords,/exten
return & end
(3) Write info on all *.fits files in the Unix directory /usr2/smith, to a
file 'smith.txt' using the default keywords, but don't display the value
of the TELESCOPE keyword
IDL> fitsdir ,'/usr2/smith/*.fits',t='smith.txt', /NoTel
PROCEDURE:
FILE_SEARCH() is used to find the specified FITS files. The
header of each file is read, and the selected keywords are extracted.
The formatting is adjusted so that no value is truncated on display.
SYSTEM VARIABLES:
TEXTOPEN (called by FITSDIR) will automatically define the following
non-standard system variables if they are not previously defined:
DEFSYSV,'!TEXTOUT',1
DEFSYSV,'!TEXTUNIT',0
PROCEDURES USED:
FDECOMP, FXMOVE, MRD_HREAD, REMCHAR
TEXTOPEN, TEXTCLOSE
MODIFICATION HISTORY:
Written, W. Landsman, HSTX February, 1993
Search alternate keyword names W.Landsman October 1998
Avoid integer truncation for NAXISi >32767 W. Landsman July 2000
Don't leave open unit W. Landsman July 2000
Added EXTEN keyword, work with compressed files, additional alternate
keywords W. Landsman December 2000
Don't assume floating pt. exposure time W. Landsman September 2001
Major rewrite, KEYWORD & ALT*_KEYWORDS keywords, no truncation,
/NOSIZE keyword W. Landsman, SSAI August 2002
Assume V5.3 or later W. Landsman November 2002
Fix case where no keywords supplied W. Landsman January 2003
NAXIS* values must be integers W. Landsman SSAI June 2003
Trim spaces off of input KEYWORD values W. Landsman March 2004
Treat .FTZ extension as gzip compressed W. Landsman September 2004
Assume since V5.5, file_search() available W. Landsman Aug 2006
[Previous]
[Next]
Name: fitshead2struct
Purpose: convert FITS header->struct, optionally add useful standard TAGS
Input Parameters:
head - FITs header array (ex: output from <headfits>)
template - use this template structure (after first call, for example)
Keyword Parameters:
ncomment - set maximum number of COMMENT records expected
nhistory - set maxinum number of HISTORY records expected
(default for ncomment and nhistory is acutal# X padding)
add_standard - if switch, add some standard tags, including
TIME, DAY, MJD fields (if not present)
if add_struct is a STRUCTURE, add these fields
wcs - If set, add WCS structure
Also takes any keywords accepted by FITSHEAD2WCS.
Calling Sequence:
struct=fitshead2struct(header)
struct=fitshead2struct(header, /add_standard) ; include SSW standards
CALLED BY:
DO_EIT_MAP, DO_EIT_SCALING, EIT__DEFINE, FF_SUMMARY, FITS2MAP [1], FITS2MAP [2]
FITSFILE__DEFINE [2], FITSHEAD2WCS, FITS__DEFINE, HFITS__DEFINE, ITOOL_RD_FITS
ITOOL_TRACE_SCALE, MAKE_BKGD, OPEN_ANACUBE, Radio Spectrogram FITS File reader
Radiospectrogram FITS File reader [1]
Radiospectrogram FITS File reader [2], SXIG12_PREP, SXIG12_READ [1]
SXIG12_READ [2], SXIG12_READ_ONE [1], SXIG12_READ_ONE [2], WCS2FITSHEAD
WCS_FIND_SYSTEM, datify, fitsgen, hsi_image_fitsread, lasco_time2file, mdialign
mreadfits, mreadfits_urls, read_soon, sxi_arcs2pix, sxi_hel2arcs, sxi_parv2pix
sxi_pix2arcs, sxi_pix2hel, update_history, zcheck_hdr, zstructify
History:
24-feb-1997 - S.L.Freeland - based upon some other SSW routines...
(inspired by fits_interp.pro by Barry Labonte)
27-feb-1997 - improve ADD_STANDARD logic (use <sswfits_struct> tags)
increased protection against malformed headers
9-apr-1997 - Allow user specified structure for ADD_STANDARD
19-Jan-1998 - Added id_esc to the tagname conversion -- CED
14-Jun-1998 - Added check for error-causing non-numeric structure fields (Zarro, SAC/GSFC)
2-Mar-1999 - Use 'id_unesc' in fxpar calls
19-mar-1999 - per DMZ, assure predefined tags expand to fit input
10-Dec-1999 - S.L.Freeland, per Barry Labonte - fixed logic bug
which would 'miss' keywords 1 character in length
09-May-2003, William Thompson - Use ssw_strsplit instead of strsplit
10-Jul-2003, William Thompson - Treat CROTA1/CROTA2 correctly
Use DATE-OBS/TIME-OBS as substitute for DATE_OBS
3-Nov-2003, Zarro (L-3/GSFC) - fixed string to integer conversion errors
14-Apr-2006, William Thompson, GSFC, Added /WCS keyword
Motivation:
use by mreadfits if no structure template is passed
(to permit vectorized FITS file header operations)
Routines Called:
fxpar, fxaddpar, make_str, data_chk, ssw_strsplit, str_replace,
strjustify, fmt_tag, uniq, rem_elem, prstr, id_esc, fitshead2wcs
CALLS: ***
ADD_TAG [1], ADD_TAG [2], ANYTIM2UTC [1], ANYTIM2UTC [2], ARR2STR [1], Arr2Str [2]
BOOST_TAG, DATATYPE [1], DATATYPE [2], DATATYPE [3], FITSHEAD2WCS, FMT_TAG [1]
FMT_TAG [2], FXADDPAR [1], FXADDPAR [2], FXKVALUE, FXPAR [1], FXPAR [2], IS_STRING
MAKE_STR [1], MAKE_STR [2], TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2]
UNIQ [3], data_chk [1], data_chk [2], id_esc, id_unesc, is_number [1], is_number [2]
prstr [1], prstr [2], rem_elem [1], rem_elem [2], ssw_strsplit, sswfits_struct [1]
sswfits_struct [2], str_replace [1], str_replace [2], strarrcompress, strjustify
strspecial [1], strspecial [2], tag_index [1], tag_index [2]
Restrictions:
NEED TO RESOLVE DATE-OBS/DATE_OBS mapping
(scheduled for 28-feb-1997) (Done, CED 19-Jan-1998)
[Previous]
[Next]
Project : STEREO
Name : FITSHEAD2WCS()
Purpose : Extract WCS data from FITS header
Category : FITS, Coordinates, WCS
Explanation : This procedure examines the FITS header (or index structure),
and extracts the embedded World Coordinate System information.
Syntax : WCS = FITSHEAD2WCS( HEADER )
CALLED BY:
INDEX2MAP, WCS_FIND_PIXEL_LIST, fitshead2struct, mreadfits
Examples : FXREAD, FILENAME, DATA, HEADER
WCS = FITSHEAD2WCS( HEADER )
Inputs : HEADER = Either a FITS header, or an index structure from
FITSHEAD2STRUCT.
Opt. Inputs : None.
Outputs : WCS = Structure containing World Coordinate System
information, including the following tags:
COORD_TYPE= The type of coordinate system, which is one of
the following:
Helioprojective-Cartesian (default if angular)
Heliocentric-Cartesian (if not angular)
Helioprojective-Radial
Stonyhurst-Heliographic
Carrington-Heliographic
Celestial-Equatorial
Celestial-Galactic
Celestial-Ecliptic
Celestial-Helioecliptic
Celestial-Supergalactic
WCSNAME = The WCSNAME keyword from the FITS header. If
not found, then will be the same as COORD_TYPE.
VARIATION = Either 'PC', 'CD', or 'CROTA'
COMPLIANT = True if all required WCS keywords found.
Having COMPLIANT=0 doesn't mean that the
returned WCS structure is wrong, but it does
mean that some of the information was inferred,
rather than read directly.
PROJECTION= The coordinate projection. Default is 'TAN'
for angular coordinates, blank otherwise.
NAXIS = The array dimensions.
IX = IDL index for the longitude (X) dimension.
Note that the IDL index is 1 less than the FITS
index. For example, if the header had the
keyword "CTYPE1='HPLN-TAN'", then IX=0.
IY = IDL index for the latitude (Y) dimension.
The default is IX=0, IY=1.
CRPIX = Reference pixels. Note that these are in FITS
notation, which is 1 higher than IDL notation.
The reference pixel may also be fractional,
e.g. 10.5, and may be outside the array bounds.
CRVAL = Reference values.
CTYPE = Axis type, e.g. 'HPLN-TAN'
CNAME = Character string describing axis, free form.
CUNIT = Axis units, e.g. 'arcsec'
SIMPLE = True if the WCS can be described as simple.
See wcs_simple.pro for details.
The presence of the following keywords depends on whether
the header uses the PC, CD, or CROTA variation.
CDELT = Axis scale. May be omitted if VARIATION='CD'.
PC = Transformation matrix (CD or CROTA).
CD = Alternate transformation matrix (CD only).
ROLL_ANGLE= Coordinate rotation angle. Always present for
CROTA cases. May also be present if PC or CD
matrix can be decomposed into a rotation angle.
The following keywords may be present, depending on the
FITS header.
PROJ_NAMES = Names of additional keywords associated with
the projection, e.g. LONPOLE, PV2_1. The
SYSTEM character, if any, is stripped off.
PROJ_VALUES = Array of values associated with PROJ_NAMES.
The structure may also contain the following
substructures for TIME and POSITION information.
TIME = Substructure of time values. See
wcs_find_time.pro for more information.
POSITION = Substructure of position values. See
wcs_find_position.pro for more information.
Opt. Outputs: None.
Keywords : SYSTEM = Selects which alternate coordinate system should be
used. See wcs_find_system.pro for more information.
MINIMAL = If set, then only a minimal WCS is generated, to save
processing time. Used by INDEX2MAP.
COLUMN = Binary table column name or number.
FILENAME= Used with headers containing the -TAB projection, so
that the lookup tables can be read.
LUNFXB = The logical unit number returned by FXBOPEN,
pointing to the binary table that the header
refers to. Usage of this keyword allows
implementation of the "Greenbank Convention",
where keywords can be replaced with columns of
the same name. It's also needed for tables
containing "iVn_Xa" or "iPVn_Xa" columns, and for
tables containing pixel lists.
ROWFXB = Used in conjunction with LUNFXB, to give the
row number in the table. Default is 1.
PIXEL_LIST = If set, then look for pixel list information in
the binary table. Used in conjunction with
LUNFXB, but does not require ROWFXB.
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 = ''
WCS = FITSHEAD2WCS( HEADER, ERRMSG=ERRMSG, ...)
IF ERRMSG NE '' THEN ...
The following keywords are passed to WCS_DECOMP_ANGLE.
PRECISION = Precision to be used when determining if the angle
can be successfully derived, and if there are any
significant cross terms involving non-spatial
dimensions. The default is 1E-4, i.e. the results
should be correct to about 4 significant figures.
NOXTERMS = If set, then success is dependent on not having any
cross terms involving non-spatial dimensions.
Calls : ***
BOOST_ARRAY [1], BOOST_ARRAY [2], BOOST_ARRAY [3], DATATYPE [1], DATATYPE [2]
DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FXBFIND [1]
FXBFIND [2], FXBHEADER [1], FXBHEADER [2], FXBISOPEN [1], FXBISOPEN [2]
FXBREAD [1], FXBREAD [2], FXBREAD [3], FXBTDIM [1], FXBTDIM [2], FXBTFORM [1]
FXBTFORM [2], GET_FITS_PAR, IS_STRING, NTRIM, TAG_EXIST [1], TAG_EXIST [2]
VALID_NUM [1], VALID_NUM [2], VALID_NUM [3], WCS_DECOMP_ANGLE, WCS_FIND_KEYWORD
WCS_FIND_PIXEL_LIST, WCS_FIND_POSITION, WCS_FIND_SPECTRUM, WCS_FIND_SYSTEM
WCS_FIND_TABLE, WCS_FIND_TIME, WCS_SIMPLE, delvarx [5], fitshead2struct
struct2fitshead
Common : None.
Restrictions: Currently only supports one FITS header at a time. Binary
tables are not yet supported.
Notes : The PC and CD matrices are ordered by row and column. The
following examples show how they are applied.
IJ = [I,J] ;IDL Pixel coordinates
XY = CDELT * (PC # (IJ + 1 - CRPIX)) + CRVAL
or
XY = (CD # (IJ + 1 - CRPIX)) + CRVAL
Note that the +1 in the equations above takes care of the
one-pixel offset between the IDL and FITS pixel notations.
With spherical map projections, CRVAL is applied as part of the
projection, rather than added in as above.
Side effects: If the FITS file doesn't contain CTYPE keywords, then either
HPLN-TAN/HPLT-TAN (angles) or SOLX/SOLY (distances) are assumed
for the first two axes.
Prev. Hist. : None.
History : Version 1, 22-Apr-2005, William Thompson, GSFC
Version 2, 25-Apr-2005, William Thompson, GSFC
Handle case where header doesn't have NAXIS.
Version 3, 26-Apr-2005, William Thompson, GSFC
Add keyword ERRMSG -- use when no NAXIS
Roll angle doesn't need to be present if zero
Version 4, 03-Jun-2005, William Thompson, GSFC
Improved logic of what assumptions to make
Version 5, 08-Jun-2005, William Thompson, GSFC
Add call to WCS_FIND_SPECTRUM
Add CNAME, Add PS keywords
Version 6, 14-Jun-2005, William Thompson, GSFC
Add support for the lookup table projection
Version 7, 23-Jun-2005, William Thompson, GSFC
Add support for binary tables
Fixed bug with calculation of PC from CROTA
Version 8, 06-Feb-2006, William Thompson, GSFC
Fixed bug reading PC,CD matrices for alternate systems
Version 9, 1-Mar-2006, William Thompson, GSFC
Exit gracefully if no axes found.
Version 9, 15-Mar-2006, William Thompson, GSFC
Fix some common units strings errors
Version 10, 12-Mar-2006, William Thompson, GSFC
Added keyword PIXEL_LIST
Contact : WTHOMPSON
[Previous]
[Next]
NAME:
FITSRGB_to_TIFF
PURPOSE:
Combine separate red, green, and blue FITS images into TIFF format
EXPLANATION:
The output TIFF (class R) file can have colors interleaved either
by pixel or image. The colour mix is also adjustable.
CALLING SEQUENCE:
FITSRGB_to_TIFF, path, rgb_files, tiff_name [,/BY_PIXEL, /PREVIEW,
RED= , GREEN =, BLUE =]
INPUTS:
path = file system directory path to the RGB files required.
rgb_files = string array with three components - the red FITS file
filename, the blue FITS file filename and the green FITS
file filename
OUTPUTS:
tiff_name = string containing name of tiff file to be produced
OPTIONAL OUTPUT:
Header = String array containing the header from the FITS file.
OPTIONAL INPUT KEYWORDS:
BY_PIXEL = This causes TIFF file RGB to be interleaved by pixel
rather than the default of by image.
PREVIEW = Allows a 24 bit image to be displayed on the screen
to check the colour mix.
RED = Real number containing the fractional mix of red
GREEN = Real number containing the fractional mix of green
BLUE = Real number containing the fractional mix of blue
EXAMPLE:
Read three FITS files, 'red.fits', 'blue.fits' and 'green.fits' from
the directory '/data/images/space' and output a TIFF file named
'colour.tiff'
IDL> FITSRGB_to_TIFF, '/data/images/space', ['red.fits', $
'blue.fits', 'green.fits'], 'colour.tiff'
Read three FITS files, 'red.fits', 'blue.fits' and 'green.fits' from
the current directory and output a TIFF file named '/images/out.tiff'
In this case, the red image is twice as strong as the green and the
blue is a third more intense. A preview on screen is also wanted.
IDL> FITSRGB_to_TIFF, '.', ['red.fits', $
'blue.fits', 'green.fits'], '/images/out.tiff', $
/PREVIEW, RED=0.5, GREEN=1.0, BLUE=0.666
CALLS: ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], READFITS [1], READFITS [2]
READFITS [3], concat_dir [4]
RESTRICTIONS:
(1) Limited to the ability of the routine READFITS
NOTES:
None
PROCEDURES USED:
Functions: READFITS, CONCAT_DIR
Procedures: WRITE_TIFF
MODIFICATION HISTORY:
16th January 1995 - Written by Carl Shaw, Queen's University Belfast
27 Jan 1995 - W. Landsman, Add CONCAT_DIR for VMS, Windows compatibility
Converted to IDL V5.0 W. Landsman September 1997
Use WRITE_TIFF instead of obsolete TIFF_WRITE W. Landsman December 1998
Cosmetic changes W. Landsman February 2000
[Previous]
[Next]
Project : SOHO - CDS
Name :
FITSTAPE()
Purpose :
Function to perform FITS tape I/O.
Explanation :
Function to perform FITS tape I/O. Called by FITSREAD.
FOR VMS IDL ONLY!
Use :
status=fitstape(command,unit,bitpix,data)
Inputs :
command - string command from the following choices
'init' - initialization (must be first call to fitstape)
'read' - get next 2880 byte data buffer
'eof' - check for end of tape file
'write'- write 2880 byte data buffer
'woef' - empty buffer and write end-of-file
unit - tape unit number
bitpix - bits/per data element (used to control byte swapping)
(required for 'read' and 'write')
(for 'init' command this parameter gives
the blocking factor, number of 2880 byte
records per tape record. if not supplied 1 is
assumed)
data - 2880 byte data array if 'write' command
Opt. Inputs :
None.
Outputs :
data - 2880 byte data array if 'read' command
status is returned as the function value
with the following meanings.
'init' = 1
'read' = !err returned by taprd
'write' = 1
'eof' = 1 if at end of file
0 if not at end of file
'weof' = 1
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
SKIPF [1], SKIPF [2], TAPRD [1], TAPRD [2], TAPWRT [1], TAPWRT [2], WEOF [1], WEOF [2]
CALLED BY:
FXTAPEREAD, FXTAPEWRITE, FXTPIO_READ, FXTPIO_WRITE
Common :
QFITSTAPE
Restrictions:
None.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
Version 1 D. Lindler Nov 1986
Converted to IDL Version 2. M. Greason, STX, June 1990.
Recognize BITPIX = -32 and BITPIX = -64 W. Landsman April 1992
Written :
Don Lindler, GSFC/HRS November 1986.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name : FITTER
Purpose : Least-squares fit of linear function
Explanation : Fits a linear function to a series of data points via a
least-squares technique.
Use : FITTER, X, Y, FDER, PARAM [, PERR ]
Inputs : X = Positions.
Y = Data values.
ERR = Errors in Y.
FDER = Array of partial derivatives of fitted function.
This array will have the dimensions: FDER(
N_ELEMENTS(X) , N_ELEMENTS(PARAM) )
Opt. Inputs : None.
Outputs : PARAM = Returned parameters of fit.
Opt. Outputs: PERR = Errors in PARAM.
Keywords : POISSON = If set, then a Poisson error distribution is assumed,
and the weights are set accordingly to 1/Y.
ERROR = Array of errors. The weights are set accordingly to
1/ERROR^2. Overrides POISSON.
WEIGHT = Array of weights to use in fitting. Overrides
POISSON and ERROR.
YZERO = Amount to subtract from Y (only for use with
REGRESS).
CHISQR = Returned value of chi-squared. Only relevant if
ERROR passed explicitly.
CMATRIX = Correlation matrix.
Calls : ***
TRIM
CALLED BY:
REGRESS_FIT
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities, Curve_Fitting
Prev. Hist. : William Thompson, June 1991, modified to use keywords.
Written : William Thompson, GSFC, June 1991
Modified : Version 1, William Thompson, GSFC, 9 January 1995
Incorporated in CDS library
Version : Version 1, 9 January 1995
[Previous]
[Next]
Project : SOHO-CDS
Name : FIX_DATE
Purpose : Fix date that uses digit month into one with a string month
Category : utility
Syntax : fdate=fix_date(date)
Inputs : DATE = string date to fix (e.g. '10/02/98')
Outputs : FDATE = fixed date (e.g. '10-feb-98')
Keywords : EUROPEAN = interpret middle entry as month
CALLS: ***
ARR2STR [1], Arr2Str [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_MONTH
STR2ARR [1], STR2ARR [2], TRIM2, is_number [1], is_number [2], str_replace [1]
str_replace [2]
History : Written 26 August 1998, D. Zarro, SAC/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HINODE/EIS
Name : FIX_DIR_NAME
Purpose : Fix directory name
CALLS: ***
CHKLOG [1], CHKLOG [2], IS_BLANK
CALLED BY:
SHOW_SYNOP__DEFINE
Example :
IDL> f='/Users/zarro/.decompressed/..'
IDL> print,fix_dir_name(f)
/Users/zarro
Inputs : DIR = directory name to fix
Outputs : OUT = fixed directory name
Keywords : ERR = string error message
Version : Written 4-Dec-2006, Zarro (ADNET/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HESSI
Name : FIX_EXTRA
Purpose : When using keyword inheritance, the tag name in _extra may be abbreviated
relative to the full name. For example, using /log when one really
means /log_scale may cause setting /log_scale to fail if one is
really looking for the full name /log_scale.
CALLS: ***
IS_BLANK, IS_STRING, REP_TAG_NAME, is_struct
CALLED BY:
HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
HSI_SPECTROGRAM_DECIM_TABLE, MAP__DEFINE, PLOT_MAP_DEFINE
SPECTROGRAM CLASS DEFINITION, hsi_spectrogramACCBIN [2]
hsi_spectrogram__define [1], hsi_spectrogram__define [2]
hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
hsi_spectrogram__livetime [1]
Example : IDL> help,/st,extra
GRID INT 1
LIMB INT 1
LOG INT 1
IDL> help,/st,template
LOG_SCALE BYTE 0
GRID_SPACING FLOAT 0.00000
LIMB_PLOT BYTE 0
IDL> help,fix_extra(extra,template),/st
LOG_SCALE INT 1
GRID_SPACING INT 1
LIMB_PLOT INT 1
Category : string structure utility
Inputs : EXTRA = structure produced by _extra
TEMPLATE = structure of actual full keyword names or list
of tag names
Outputs : Same as EXTRA, but abbreviated names are expanded to match template
Keywords : None
History : 23-Nov-2002, Zarro (EER/GSFC)
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : Solar-B/EIS
Name : fix_path
Purpose : Fix IDL path names by expanding environment
variables and removing extraneous delimiters.
Category : utility string
Syntax : IDL> new=fix_path(path)
Inputs : PATH = IDL path name
Outputs : NEW = fixed path name
Keywords : ERR = error string
CALLS: ***
CHKLOG [1], CHKLOG [2], GET_DELIM, GET_PATH_DELIM, IS_BLANK, IS_STRING, LOCAL_NAME
STR2ARR [1], STR2ARR [2], STR_TRAIL, str_replace [1], str_replace [2]
History : 30-May-2006, Zarro (L-3Com/GSFC) - written
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Name: fix_slash
Purpose: return string with slashes corrected for OS
Input Parameters:
source - source string
Category :
Utilities, Strings
CALLS: ***
GET_DELIM, str_replace [1], str_replace [2]
CALLED BY:
HESSI_DATA_PATHS [1], HSI_LOC_FILE, hessi_var, hessi_version
History: Kim Tolbert, 26-Jul-2001
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FIX_STRLEN()
PURPOSE:
Make a string have a fixed length by appending spaces.
EXPLANATION:
CALLING SEQUENCE:
Result = fix_strlen(str, length=length)
INPUTS:
STR - String to be padded
LENGTH - Desired length of resulting str
OPTIONAL INPUTS:
None.
OUTPUTS:
None.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
PREFIX - Padding spaces in front of the given string if set
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3]
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written January 25, 1995, Liyun Wang, NASA/GSFC
MODIFICATION HISTORY:
Version 1, created, Liyun Wang, NASA/GSFC, January 25, 1995
VERSION:
Version 1, January 25, 1995
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FIX_STRLEN_ARR()
PURPOSE:
Make a string have a fixed length by appending spaces.
EXPLANATION:
CALLING SEQUENCE:
Result = fix_strlen_arr(str, length)
INPUTS:
STR - String to be padded (may be an array of strings)
LENGTH - Desired length of resulting str (must be scalar)
OPTIONAL INPUTS:
None.
OUTPUTS:
None.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
PREFIX - Padding spaces in front of the given string if set
CENTER - If set, center text, pad with spaces before and after
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3]
CALLED BY:
hsi_format_flare
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written January 25, 1995, Liyun Wang, NASA/GSFC
MODIFICATION HISTORY:
Version 1, created, Liyun Wang, NASA/GSFC, January 25, 1995
Kim Tolbert, 11/26/2000 - Modified fix_strlen to handle input
string arrays and renamed to fix_strlen_arr.
Kim Tolbert, 27-Jan-2002, Added center keyword
[Previous]
[Next]
Project : SOHO - CDS
Name : FIX_ZDBASE()
Purpose : To control the value of env. var. ZDBASE.
Explanation : The environment variable ZDBASE controls access to the
databases. The user may have access to either a private
set of data bases or the 'official' CDS set. This function
allows the uset to set the ZDBASE variable to be the
equivalent of either ZDBASE_CDS or ZDBASE_USER depending
on the database access required. These latter two variables
must be defined before this routine is called. The original
definition of ZDBASE is stored in common and can be restored to
that variable by use of the /ORIGINAL keyword.
Use : IDL> status = fix_zdbase(/user, errmsg=errmsg)
first time used so record the current value of ZDBASE and set
its current value to be that of ZDBASE_USER
IDL> status = fix_zdbase(/cds, errmsg=errmsg)
if not the first time used then just set current ZDBASE
definition to that of ZDBASE_CDS
IDL> status = fix_zdbase(/orig, errmsg=errmsg)
all finished, so restore ZDBASE to its original value.
Note that this routine is more likely to be used within other
procedures rather than at a user level as in the above
example.
IDL> status = fix_zdbase(/resolve, errmsg=errmsg)
Resolve the current definition of ZDBASE, to expand any plus
signs in the path. This speeds up software using the ZDBASE
environment variable. If this is the first time that
FIX_ZDBASE() is called, then the expanded version will be
stored as the original.
Inputs : None (see keywords).
Opt. Inputs : None
Outputs : Function returns 1 for success, 0 for error.
(Values in common may change, and see ERRMSG keyword)
Opt. Outputs: None
Keywords : The following keywords are used to select the appropriate
database.
USER - switch ZDBASE to value of ZDBASE_USER
CDS - switch ZDBASE to value of ZDBASE_CDS
SOHO - switch ZDBASE to value of ZDBASE_SOHO
EIS - switch ZDBASE to value of ZDBASE_EIS
ORIGINAL - restore original value of ZDBASE
RESOLVE - optimize the current value of ZDBASE
Additional keywords.
ERRMSG - if defined on entry any error messages
will be returned in it.
INIT - initialise common block
Calls : ***
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FIND_ALL_DIR [1]
FIND_ALL_DIR [2], FIND_ALL_DIR [3], GET_ENVIRON, delvarx [5]
CALLED BY:
CDS_FILES, EIS_CAT [1], EIS_CAT [2], EIS_CHECK_DATABASE [1]
EIS_CHECK_DATABASE [2], EIS_DBASE, FIND_ZDBASE, MK_CDS_PLAN, MK_PLAN_FORM
MK_RASTER, MK_SOHO_SETUP, MK_SOHO_TARGET, MK_STUDY, SET_CDS_SDB, UPDATE_IAP
UPDATE_KAP, XCAT, XSTUDY, db_read_linelist_all [1], db_read_linelist_all [2]
db_read_raster_all [1], db_read_raster_all [2], db_read_study_all [1]
db_read_study_all [2], db_save_linelist_entry_create [1]
db_save_linelist_entry_create [2], db_save_raster_entry_create [1]
db_save_raster_entry_create [2], db_save_study_entry_create [1]
db_save_study_entry_create [2], db_save_study_entry_create [3]
db_save_study_entry_create [4], eis_db_save_gui [1], eis_db_save_gui [2]
eis_linelist_gui [1], eis_linelist_gui [2], eis_mk_plan_gui [1]
eis_mk_plan_gui [2], eis_raster_gui [1], eis_raster_gui [2]
eis_save_imported_linelist, eis_save_imported_raster, eis_study_gui [1]
eis_study_gui [2], eis_write_timeline_database_tables [1]
eis_write_timeline_database_tables [2]
Common : zdbase_def
Restrictions: Uses common block variable to signal whether original value
of ZDBASE has been saved or not. Be careful of the common
block's memory.
Side effects: Environment variable ZDBASE is changed.
Category : Util, database
Prev. Hist. : None
Written : C D Pike, RAL, 17-Jan-95
Modified : Improve error handling. CDP, 6-Mar-95
Allow '+' format option in env var specification. CDP,15-May-95
Version 4, William Thompson, GSFC, 16 May 1995
Added keyword /PLUS_REQUIRED to FIND_ALL_DIR call.
Allows more than one tree in input.
Added variable ZDB_USED to common block
Version 4.1, SVHH, UiO, 22-Sep-1995
Altered EXECUTE command in order to avoid
problem with commands longer than 256 characters.
Version 5, William Thompson, GSFC, 15 January 1996
Added SOHO keyword. Simplified structure.
Version 6, William Thompson, GSFC, 6 August 1996
Call DEF_DIRLIST instead of SETENV
Version 7, William Thompson, GSFC, 7 August 1996
Call get_environ instead of getenv.
Version 8, Dominic Zarro, 15 June 2001
Added INIT keyword to initialize common
Version 9, William Thompson, GSFC, 14-Jan-2001
Added keyword RESOLVE
Version 10, William Thompson, GSFC, 16-Sep-2005
Added keyword EIS
Allow /USER, /CDS, /SOHO, and /EIS keywords to be
combined. Databases are searched in that order.
Version : Version 10
[Previous]
[Next]
Project : SOHO - CDS
Name :
FLAG_LONG_NAMES
Purpose :
Flags procedure names that would appear the same under DOS
Explanation :
Flags sets of IDL procedure names which have the same first eight
characters. These would appear to be the same file on DOS machines.
The names of each set of .PRO files with the same first eight
characters are printed to the screen.
Use :
CD, directory ;(go to desired directory)
FLAG_LONG_NAMES
Inputs :
None.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
FDECOMP [1], FDECOMP [2], FDECOMP [3]
Common :
None.
Restrictions:
None.
Side effects:
None.
Category :
Utilities, Operating_system.
Prev. Hist. :
William Thompson, January 1993.
Written :
William Thompson, GSFC, January 1993.
Modified :
Version 1, William Thompson, GSFC, 9 July 1993.
Incorporated into CDS library.
Version :
Version 1, 9 July 1993.
[Previous]
[Next]
Project : SOHO - CDS
Name : FLAG_MISSING
Purpose : Flags pixels in images as missing
Explanation : Sets pixels in an image to a value representing missing
pixels. This flag value is either a specific number, given by
the MISSING keyword, or an IEEE Not-a-Number (NaN) value.
Use : FLAG_MISSING, ARRAY, INDEX [, MISSING=MISSING]
Inputs : ARRAY = Array to flag missing pixels within
INDEX = Positions of missing pixels
Opt. Inputs : None.
Outputs : The ARRAY variable is modified
Opt. Outputs: None.
Keywords : MISSING = Value flagging missing pixels.
Calls : ***
DATATYPE [1], DATATYPE [2], DATATYPE [3]
CALLED BY:
ASMOOTH, AVERAGE, INTERP2
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities
Prev. Hist. : None.
Written : William Thompson, GSFC, 12-May-2005
Modified : Version 1, William Thompson, GSFC, 12-May-2005
Version : Version 1, 12-May-2005
[Previous]
[Next]
Name: flare_hist
Purpose: return flare class (daily) frequencies for desired time range
Input Paramters:
time0,time1 - time range to consider (def=1980 -> today)
Output Paramters:
function returns structure vector, 1 element per day in range:
{time:0l,day:0,nb:0,nc:0,nm:0,nx:0,ntot:0,fmax:'',fmaxt:''}
CALLS: ***
GET_GEV, STR2ARR [1], STR2ARR [2], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1]
anytim [2], anytim [3], anytim [4], anytim [5], decode_gev, last_nelem, reltime [1]
reltime [2]
History:
20-sep-2005 - S.L.Freeland
[Previous]
[Next]
Project : SOHO - CDS
Name : FLASH_MSG
Purpose : Flashes an information message in a text widget.
Explanation : Write a text message to the specified widget, and alternates
it with setting it blank in order to simulate a flashing
message.
Use : IDL> flash_msg, widget_id, text [, other_keywords]
Inputs : widget_id - the id of the text widget
text - the message to be flashed
Opt. Inputs : None.
Outputs : None.
Opt. Outputs: None.
Keywords : NUM -- Number of flashing times; default is 4 times.
NOBEEP -- Set this keyword to suppress the beep
RATE -- Flashing rate in seconds; default: 0.25 sec.
APPEND -- Appends to widget text rather than overwriting
Calls : ***
Bell
CALLED BY:
EIS_IMAGE_TOOL [1], EIS_IMAGE_TOOL [2], EIS_IMAGE_TOOL_EVENT [1]
EIS_IMAGE_TOOL_EVENT [2], EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2]
EIS_LOAD_IMAGE [1], EIS_LOAD_IMAGE [2], IMAGE_TOOL, IMAGE_TOOL_EVENT
ITOOL_DISP_ROT, ITOOL_LIMBFITTER, ITOOL_LOAD_IMAGE, ITOOL_PICKFILE, ITOOL_PTOOL
MAKE_AUTO_FIT, MAKE_MANUAL_FIT, MK_LIMBFIT_BS, MK_POINT_BASE, MK_RASTER
TP_DISP_IEF, TP_DISP_LLIST, TP_DISP_RAST, TP_EDIT_TABLE, TP_RECALC_DEW
TP_REDISPLAY, UPDATE_FITLIMB, XGET_SYNOPTIC, plotman, plotman_zoom
Restrictions: Widget must be already set up.
Side effects: Can be annoying if called frequently with beeping!
Category : Utilities, Help
Prev. Hist. : None
Written : C D Pike, RAL, 2-Jul-1993
Modified : Liyun Wang, GSFC/ARC, August 25, 1994
Added optional keyword NUM to control number of flashing
times and NOBEEP to suppress the beep.
Add append keyword, CDP, 14-Oct-94
Fix working of /append mode, CDP, 19-Oct-94
Limit rewrite of old text in /append mode to 20 lines.
CDP, 9-Jan-95
Version : Version 5, 9-Jan-95
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FLASH_PLOTS
PURPOSE:
Make a flashing plot of a polygon
EXPLANATION:
CALLING SEQUENCE:
FLASH_PLOTS, xx, yy [,num=num] [,rate=rate]
INPUTS:
XX -- X coordinates of points to be connected.
YY -- Y coordinates of points to be connected.
OPTIONAL INPUTS:
None.
OUTPUTS:
None.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
NUM -- Number of flashing times; default is 4 times.
RATE -- Flashing rate in seconds; default: 0.25 sec.
COLOR -- Index of color to be used; default: !d.table_size-1
PSYSTEM -- Coordinate system used for plotting. Valid values are:
0 -- device coodinate system (default)
1 -- data coordinate system
2 -- normal coordinate system
CALLS:
None.
CALLED BY:
EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2], ITOOL_PTOOL, MK_POINT_BASE
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written November 2, 1994, by Liyun Wang, NASA/GSFC
MODIFICATION HISTORY:
Version 2, William Thompson, GSFC, 8 April 1998
Changed !D.N_COLORS to !D.TABLE_SIZE for 24-bit displays
VERSION:
Version 2, 8 April 1998
[Previous]
[Next]
NAME:
FLEGENDRE
PURPOSE:
Compute the first M terms in a Legendre polynomial expansion.
EXPLANATION:
Meant to be used as a supplied function to SVDFIT.
This procedure became partially obsolete in IDL V5.0 with the
introduction of the /LEGENDRE keyword to SVDFIT and the associated
SVDLEG function. However, note that, unlike SVDLEG, FLEGENDRE works
on vector values of X.
CALLING SEQUENCE:
result = FLEGENDRE( X, M)
INPUTS:
X - the value of the independent variable, scalar or vector
M - number of term of the Legendre expansion to compute, integer scalar
OUTPUTS:
result - (N,M) array, where N is the number of elements in X and M
is the order. Contains the value of each Legendre term for
each value of X
EXAMPLE:
(1) If x = 2.88 and M = 3 then
IDL> print, flegendre(x,3) ==> [1.00, 2.88, 11.9416]
This result can be checked by explicitly computing the first 3 Legendre
terms, 1.0, x, 0.5*( 3*x^2 -1)
(2) Find the coefficients to an M term Legendre polynomial that gives
the best least-squares fit to a dataset (x,y)
IDL> coeff = SVDFIT( x,y,M,func='flegendre')
The coefficients can then be supplied to the function POLYLEG to
compute the best YFIT values for any X.
METHOD:
The recurrence relation for the Legendre polynomials is used to compute
each term. Compare with the function FLEG in "Numerical Recipes"
by Press et al. (1992), p. 674
REVISION HISTORY:
Written Wayne Landsman Hughes STX April 1995
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Project : SOHO-CDS
Name : FLIP_MAP
Purpose : Flip map to correct for 180 degree roll
Category : imaging
Syntax : fmap=flip_map(map)
Inputs : MAP = image map structure
Outputs : FMAP = flipped map
Keywords : None
CALLS: ***
COMP_FITS_CEN, COMP_FITS_CRPIX, EXIST, GET_MAP_PROP, PR_SYNTAX, VALID_MAP
History : Written 7 April 2005 - Zarro (L-3Com/GSFC)
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
ROUTINE:
FLOOR
PURPOSE:
Return the closest integer less than or equal to its argument.
CALLING SEQUENCE:
Result = FLOOR(X)
This is fixup for IDL versions prior to V3.1
WRITTEN:
29-Nov-95, R. Kano
[Previous]
[Next]
NAME:
FLUX2MAG
PURPOSE:
Convert from flux (ergs/s/cm^2/A) to magnitudes.
EXPLANATION:
Use MAG2FLUX() for the opposite direction.
CALLING SEQUENCE:
mag = flux2mag( flux, [ zero_pt, ABwave= ] )
INPUTS:
flux - scalar or vector flux vector, in erg cm-2 s-1 A-1
OPTIONAL INPUT:
zero_pt - scalar giving the zero point level of the magnitude.
If not supplied then zero_pt = 21.1 (Code et al 1976)
Ignored if the ABwave keyword is supplied
OPTIONAL KEYWORD INPUT:
ABwave - wavelength scalar or vector in Angstroms. If supplied, then
FLUX2MAG() returns Oke AB magnitudes (Oke & Gunn 1983, ApJ, 266,
713).
OUTPUT:
mag - magnitude vector. If the ABwave keyword is set then mag
is given by the expression
ABMAG = -2.5*alog10(f) - 5*alog10(ABwave) - 2.406
Otherwise, mag is given by the expression
mag = -2.5*alog10(flux) - zero_pt
EXAMPLE:
Suppose one is given wavelength and flux vectors, w (in Angstroms) and
f (in erg cm-2 s-1 A-1). Plot the spectrum in AB magnitudes
IDL> plot, w, flux2mag(f,ABwave = w), /nozero
REVISION HISTORY:
Written J. Hill STX Co. 1988
Converted to IDL V5.0 W. Landsman September 1997
Added ABwave keyword W. Landsman September 1998
[Previous]
[Next]
NAME:
FM_UNRED
PURPOSE:
Deredden a flux vector using the Fitzpatrick (1999) parameterization
EXPLANATION:
The R-dependent Galactic extinction curve is that of Fitzpatrick & Massa
(Fitzpatrick, 1999, PASP, 111, 63; astro-ph/9809387 ).
Parameterization is valid from the IR to the far-UV (3.5 microns to 0.1
microns). UV extinction curve is extrapolated down to 912 Angstroms.
CALLING SEQUENCE:
FM_UNRED, wave, flux, ebv, [ funred, R_V = , /LMC2, /AVGLMC, ExtCurve=
gamma =, x0=, c1=, c2=, c3=, c4= ]
INPUT:
WAVE - wavelength vector (Angstroms)
FLUX - calibrated flux vector, same number of elements as WAVE
If only 3 parameters are supplied, then this vector will
updated on output to contain the dereddened flux.
EBV - color excess E(B-V), scalar. If a negative EBV is supplied,
then fluxes will be reddened rather than dereddened.
OUTPUT:
FUNRED - unreddened flux vector, same units and number of elements
as FLUX
OPTIONAL INPUT KEYWORDS
R_V - scalar specifying the ratio of total to selective extinction
R(V) = A(V) / E(B - V). If not specified, then R = 3.1
Extreme values of R(V) range from 2.3 to 5.3
/AVGLMC - if set, then the default fit parameters c1,c2,c3,c4,gamma,x0
are set to the average values determined for reddening in the
general Large Magellanic Cloud (LMC) field by Misselt et al.
(1999, ApJ, 515, 128)
/LMC2 - if set, then the fit parameters are set to the values determined
for the LMC2 field (including 30 Dor) by Misselt et al.
Note that neither /AVGLMC or /LMC2 will alter the default value
of R_V which is poorly known for the LMC.
The following five input keyword parameters allow the user to customize
the adopted extinction curve. For example, see Clayton et al. (2003,
ApJ, 588, 871) for examples of these parameters in different interstellar
environments.
x0 - Centroid of 2200 A bump in microns (default = 4.596)
gamma - Width of 2200 A bump in microns (default =0.99)
c3 - Strength of the 2200 A bump (default = 3.23)
c4 - FUV curvature (default = 0.41)
c2 - Slope of the linear UV extinction component
(default = -0.824 + 4.717/R)
c1 - Intercept of the linear UV extinction component
(default = 2.030 - 3.007*c2
OPTIONAL OUTPUT KEYWORD:
ExtCurve - Returns the E(wave-V)/E(B-V) extinction curve, interpolated
onto the input wavelength vector
CALLS: ***
CSPLINE, POLY
EXAMPLE:
Determine how a flat spectrum (in wavelength) between 1200 A and 3200 A
is altered by a reddening of E(B-V) = 0.1. Assume an "average"
reddening for the diffuse interstellar medium (R(V) = 3.1)
IDL> w = 1200 + findgen(40)*50 ;Create a wavelength vector
IDL> f = w*0 + 1 ;Create a "flat" flux vector
IDL> fm_unred, w, f, -0.1, fnew ;Redden (negative E(B-V)) flux vector
IDL> plot,w,fnew
NOTES:
(1) The following comparisons between the FM curve and that of Cardelli,
Clayton, & Mathis (1989), (see ccm_unred.pro):
(a) - In the UV, the FM and CCM curves are similar for R < 4.0, but
diverge for larger R
(b) - In the optical region, the FM more closely matches the
monochromatic extinction, especially near the R band.
(2) Many sightlines with peculiar ultraviolet interstellar extinction
can be represented with the FM curve, if the proper value of
R(V) is supplied.
(3) Use the 4 parameter calling sequence if you wish to save the
original flux vector.
PROCEDURE CALLS:
CSPLINE(), POLY()
REVISION HISTORY:
Written W. Landsman Raytheon STX October, 1998
Based on FMRCurve by E. Fitzpatrick (Villanova)
Added /LMC2 and /AVGLMC keywords, W. Landsman August 2000
Added ExtCurve keyword, J. Wm. Parker August 2000
Assume since V5.4 use COMPLEMENT to WHERE W. Landsman April 2006
[Previous]
[Next]
Project : SOHO - CDS
Name : FMEDIAN
Purpose : Median filtering w/rectangular neighbourhood & MISSING
Explanation : Performs median filtering. Differs from MEDIAN in that the
median filter extends smoothly to the edge of the array, and
in that different widths can be set for the X and Y
directions.
Use : Result = FMEDIAN(ARRAY [, NW1 [, NW2 ]])
Inputs : ARRAY : Array to filter.
Opt. Inputs : NW1 : Width of the median filter in the first (X)
direction. Default is 3.
NW2 : Width of the median filter in the second (Y) direction.
Default is NW1. Ignored if ARRAY has only one dimension.
Outputs : Returns an array with the same size and type as the
input array.
Opt. Outputs: None.
Keywords : MISSING : Value signifying missing data. Missing pixels will
not be included when calculating the median of the
neighbourhood. If no valid pixels are found in the
neighbourhood of a pixel, the corresponding median
value will be set to MISSING.
Env. Vars. : SSW_EXTERNAL_F = Points to a sharable object file containing
associated Fortran software callable by
CALL_EXTERNAL. If this environment variable
exists, then the routine uses CALL_EXTERNAL to
calculate the checksum. Otherwise the checksum
is calculated within IDL, which is slower.
For backwards compatibility, the software will
also look for the environment variable
CDS_EXTERNAL if it doesn't find SSW_EXTERNAL_F
SSW_EXTERNAL_PREFACE = On some operating systems, such as older
versions of SunOS, this needs to be set to the
underscore character "_". Otherwise, it doesn't
need to be defined.
Calls : ***
FMEDIAN_SLOW
CALLED BY:
CDS_FILL_MISSING, CLEAN_EXPOSURE, CLEAN_SPIKE, NEW_SPIKE, xdisp_fits
Common : None.
Restrictions: ARRAY must be either one or two dimensional. Will call
FMEDIAN_SLOW if $SSW_EXTERNAL_F library is not found, causing a
severe slow-down of the routine (factor of 3 - 100, depending
on the size of the filter).
Side effects: Loads call_external library pointed to by $SSW_EXTERNAL_F. If
this library cannot be found, an IDL version called
FMEDIAN_SLOW is used instead.
Category : Utilities, Arrays
Prev. Hist. : SERTS routine.
Written : William Thompson, August 1991.
Modified : Version 2, S.V.H.Haugan, UiO, 9 October 1996
Added MISSING keyword, added a few parameter range
checks. Added calll to FMEDIAN_SLOW when no
SSW_EXTERNAL_F library is available. Supplying
workspace to the fortran routine. Fortran routine
using a quicksort-based median finder to keep ahead
of IDL's fast median routine.
Version 3, William Thompson, GSFC, 16 July 1998
Look for SSW_EXTERNAL evar before CDS_EXTERNAL
Check for SSW_EXTERNAL_PREFACE instead of !version.os
Version : Version 3, 16 July 1998
[Previous]
[Next]
Project : SOHO - CDS
Name : FMEDIAN_SLOW
Purpose : FMEDIAN routine without CALL_EXTERNAL
Explanation : See fmedian.pro/built-in median routine.
Use : RESULT = FMEDIAN(ARRAY, [, NW1 [, NW2]])
Inputs : See fmedian.pro
Opt. Inputs : See fmedian.pro
Outputs : See fmedian.pro
Opt. Outputs: See fmedian.pro
Keywords : See fmedian.pro
Calls : None.
CALLED BY:
FMEDIAN
Common : None.
Restrictions: ARRAY must be either one or two dimensional. No parameters are
checked, since this routine is supposed to be called only from
within FMEDIAN().
Side effects: None.
Category : Utilities, Arrays
Prev. Hist. : Fortran version was a SERTS routine.
Written : William Thompson, August 1991 (Call_external version)
Modified : Version 1, S.V.H.Haugan, UiO, 9 October 1996
Added MISSING keyword, added non-call_external code.
Version : 1, 9 October 1996
[Previous]
[Next]
Name: fmt_doc
Purpose: format output buffer containing documentation header info
Input Parameters:
doc_str - document structures, as returned by get_doc.pro
scaler or array of structures
Optional Keyword Paramters:
lf - if set, 1 blank line inserted between routine documentation
Output Parameters:
function returns string array of formatted doc_str contents
for scaler input, each doc_str field is included (page format)
for array input, a summary list format (Name Purpose) is produced
Calling Sequence: outarr=fmt_doc(doc_str)
Category: gen, util, swmaint, documentation, class3
CALLS: ***
STR2ARR [1], STR2ARR [2]
CALLED BY:
doc_summ [1], doc_summ [2], get_doc [1], get_doc [2], get_doc [3]
History: slf, 20-Jul-1992
slf, 30-Mar-1994 (add brief, keyindent)
[Previous]
[Next]
NAME:
FMT_TAG
PURPOSE:
Converts a data structure (as represented by the IDL SIZE
its to string representation for dynamic structure building
CALLING SEQUENCE:
user_value = FMT_TAG( SIZE (data_structure))
INPUTS:
DSIZE - size vector for desired data structure
RETURN VALUE:
Character string representing data structure
CALLED BY:
Multi_draw [1], Multi_draw [2], RD_GEN [1], RD_GEN [2], build_str [1]
build_str [2], diskbench, extract_val, fitshead2struct, get1hk_info [1]
get1hk_info [2], get_elemabun [1], get_elemabun [2], save_data [1], sparse [1]
sparse [2], sparse [3], str_merge [1], str_merge [2], str_subset, struct2ms [1]
struct2ms [2], sxt2file, sxt_uniq [1], tr_decode_head [1], tr_decode_head [2]
trace_dph2struct [1], url_decode
EXAMPLES:
if user variable X was created by: FINDGEN(2,3,4,5), then
then FMT_TAG(SIZE(X)) returns string 'FLTARR(2, 3, 4, 5)'
FILE I/O:
NONE
COMMON BLOCKS;
NONE
RESTRICTIONS:
Structures not yet implemented
MODIFICATION HISTORY:
Version 1 - SLF, 3/5/91
29-Jul-97 (MDM) - Changed the i6 format statement to i8
because it was ending up with "******"
5-Nov-99 - Added new IDL 5.1 types, A. Csillaghy
csillag@ssl.berkeley.edu
15-Nov-2002, Paul Bilodeau - added support for unsigned and
64-bit integer types.
[Previous]
[Next]
NAME:
fmt_tim
PURPOSE:
Given a time (or array of times) return the formatted
date/time string.
CALLING SEQUENCE:
print, fmt_tim(roadmap)
print, fmt_tim(index(i).gen)
tim = fmt_tim(index, day_str, time_str)
INPUT:
tim_in - Can be a structure with the .TIME and .DAY
fields
(OR)
The "standard" 7 element external representation
of time (HH,MM,SS,MSEC,DD,MM,YY)
OPTIONAL INPUT:
msec - If present, also print the millisec in the formatted
output.
nolead0 - If present, do not include a leading "0" on the hour string
for hours less than 10. (ie: return 9:00:00 instead of 09:00:00)
fits - If present, then use the FITS slash format of the type DD/MM/YY
OUTPUT:
Returns the whole date/time string formatted in the
form like: 12-OCT-91 23:25:10
OPTIONAL OUTPUT:
day_str - just the date part of the string
time_str- just the time part of the string
CALLS: ***
gt_day [1], gt_day [2], gt_time [1], gt_time [2]
CALLED BY:
ALIGN1BIGGRAM, ALIGN_AR, ANAL_BCS_PHA, ANAL_STIMS, Alt_tim_sel, BCS_24HR_PLOT [1]
BCS_24HR_PLOT [3], BCS_BROWSE24, BCS_CAT, BCS_CONT [1], BCS_CONT [2]
BCS_CREATE_CAT, BCS_MULTI [1], BCS_MULTI [2], BCS_SPMOVIE [1], BCS_SPMOVIE [2]
BOXLC_DISPLAY, BSC_RASTER, BSC_TIM2DSET, CARR2EX, CHECK_SFC_PNT, CIV_SUBTRACT
DISPLOI_MON5K, DO_TEEM, DR, DSN_DMP_FINDER, FAXABLE_SFD, FE25_BSC_TEMP, FIND_CAL [1]
FIND_CAL [2], FIND_SEU, FMT_TIMER [1], FMT_TIMER [2], FOV_COORDS, GET_SUN [1]
GET_SUN [2], GET_TRANGE, GOES_TEK [1], GO_FIND_LIM2, GRID_CURSOR, GT_BSC_TIME
HXA2HEL, HXA_SXT, HXTPIXON, HXT_AUTOIMG, HXT_QLOOK, HXT_TEEM, JITTER_HTML
LASTSFD_DIFF, LATEST_SFDS_GIF, LAY1GKM, LIST_BDA, MANY_DAYS, MDI_SUMMARY_SUB1
MEMCHK_TIMES, MK_HXI_MAP, MK_ORB_WEEK, NAR2COORD, NEAR_CONJ, OBS_EVENT, OBS_PLOT
ORBIT_DN, ORB_EXTRAP, OVER_THE_LIMB, PFI_CENT, PLOTBSD v306 IDL2, PLOT_BSC_AS2
PREFLARE_SEARCH, PROM_ON_DISK, PROTRACTOR, QUICKATT [1], QUICKATT [2], RD_AR
RD_PLAN_AREA, READ_TRACE_FOV, SDC_VERIFY, SELECT_24HR, SFD_PHOT, SFD_TEK, SPLINE_LC
SUMM_CALS, SXT2POS, SXT_EXPOSURE_MAP, SXT_HYST, SXT_QLOOK, SXT_TEEM1 [1]
SXT_TEEM1 [2], SXT_TEEM1 [3], SYNOP_3_ROTS, Sxt_goes_teem, TERM_REVIEW
TERM_REVIEW_GIF, TRACE_LIST_INDEX, TRACE_SSWHERE [1], VIEW_SFM
VIEW_TRACE_MOSAIC, WBSC_LTC_EV [1], WBSC_LTC_EV [2], WBS_DB, WBS_DB2, WOBS_PLOT
XMOVIE_SFM, YOHKOH_EVENTS, YOHKOH_TERM_PREDICT, ada2str, adjust_times
ads_into_att, ads_into_pnt, align1img [1], align1img [2], auto_toban, azimuth_avg
bcs_clock_fix, bcs_trange, box_sxthxt_fsp, bsc_spec_plot [1], bsc_spec_plot [2]
cal_bsc, cam_run_sum, cancel_dsn_fil, ccd_hdr_info, ccd_sunc [1], ccd_sunc [2]
cfl_summary [1], cfl_summary [2], check_sci5k_trunc, chk_pointing
choose_interval, cnvt [2], cont2time [1], cont2time [2], contacts [1]
contacts [2], copy_visible, daily_forecast [2], disp_bda, disp_hda
disp_sci160k [1], disp_sci160k [2], disp_sci5k, disp_synop, disp_therm_rs232
disp_wda, divyup, do_tr_reformat, dsn_show, edac_summary, eitoversxt, ffi_prep
fidrange [1], fidrange [2], file_info2 [1], file_info2 [2], fit_bsc, fit_bsc_as
fit_bsc_plot, fits2time [1], fits2time [2], fits2time [3], fits_disp_month [1]
fits_disp_month [2], fl_goesplot [1], fl_goesplot [2], fl_goesplot [3]
fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], fl_sxtobsnar [1]
fl_sxtobsnar [2], fmt_rasm, fort2hxi [1], fort2hxi [2], ftp_copy_new
gbo_obs_coord, get_active_reg, get_ar, get_bsc_anno, get_dc_image [2]
get_dc_image [3], get_dn_rate [1], get_dn_rate [2], get_hxt_pos, get_info [1]
get_info [2], get_info [3], get_info [4], get_ksc_holiday, get_leak_image [1]
get_leak_image [2], get_leak_image [3], get_mk3 [1], get_mk3 [2], get_orb_epoch
get_selsis, get_seq_tab, get_sfc_info, get_sscinfo [1], get_suncenter2, get_sunset
get_utevent [1], get_utevent [2], go_get_sirius, go_hxt_hk_temps
go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_nvs5, goes_gaps, goes_log
goes_plot [1], goes_plot [2], goes_plot [3], goes_plot [4], goes_plot [5]
goes_summary, goes_teem, goes_widget, goesem_eqn [1], goest_eqn [1], grs32_fsp
grsl_fsp, gtab_summary, gtt_info, gtt_orbit, hkplot_info, html_form_addtime [1]
html_form_addtime [2], html_form_addtime [3], hxi_interp, hxs_fsp, hxsgrs_fsp
hxt_fsp, hxt_fsp1, hxt_multimg, hxt_sources, hxt_utplot, hxtbox_fsp, image2movie
image_summary, in_fov, input_time [1], input_time [2], ip_que_dmpver, iperr_sea
jitter_gif_xyimg, jst, killold [1], killold [2], last_lc, lastgbo, lastsfd [1]
lastsfd [2], lcur_plotr [1], lcur_plotr [2], leak_sub [1], leak_sub [2]
leak_sub [3], list_mo_log [1], list_mo_log [2], list_nrt_times, list_tfi
make_32 [2], mdi_imagetool, mk_att [1], mk_att [2], mk_bsa_interv [1]
mk_bsa_interv [2], mk_coal_movie, mk_desat, mk_desat_wl, mk_evn [1], mk_evn [2]
mk_fem [1], mk_fem [2], mk_fem_file [1], mk_fem_file [2], mk_formt_html [1]
mk_formt_html [2], mk_formt_html [3], mk_gif_mag_index, mk_gsn_obs_s1
mk_hst_summary, mk_mdi_iap, mk_op_file, mk_orbit [1], mk_orbit [2], mk_orbit_files
mk_pnt, mk_sdl, mk_sdm, mk_sdp, mk_sfc [1], mk_sfc [2], mk_sfd [1], mk_sfd [2]
mk_sfd [3], mk_sfd [4], mk_sfs, mk_sft [1], mk_sft [2], mk_sfw, mk_sl [1], mk_sl [2]
mk_sot, mk_sumer_dbase_ff, mk_sun_mosaic, mk_sxc, mk_sxl, mk_timarr [1]
mk_timarr [2], mk_trace_i1, mk_week_file [1], mk_week_file [2], mo_check
mon_health [1], mon_health [2], mon_sci5k, monthly_summary, mplot_nar
msok_poi_copy [1], msok_poi_copy [2], mwlt_select, new_disp_sci5k [1]
new_disp_sci5k [2], new_edac_summary, new_mon_health [1], new_mon_health [2]
norh_get_info [1], norh_get_info [2], obs_summary, old_raster, op_get_special
op_saa_med [1], op_saa_med [2], op_term_score, op_term_sum, op_terminator [1]
op_terminator [2], op_times, oplot_nts, pfi_dominant, pfi_loc, plot_ar_pfi
plot_door_open, plot_expos_hist, plot_fov [1], plot_gsn, plot_hxa
plot_img_cadence, plot_loi_mmad, plot_loi_summary [1], plot_loi_summary [2]
plot_nar [1], plot_nar [2], plot_ref, plot_shutter_perf, plot_ssw_fov
plot_therm_rs232a, plot_therm_rs232c, plot_trav [1], plot_trav [2]
plot_trav [3], plotbft [1], plotbth v30 IDL2, plots_bda, plots_wda, pr_dark_time
pr_evn [2], pr_fdss_grndtrk, pr_fdss_orbevt, pr_fdss_viewpd, pr_fem, pr_gbe, pr_gev
pr_gsn [1], pr_gsn [2], pr_his_index [1], pr_his_index [2], pr_his_index [3]
pr_maxmin_hk, pr_mdihk_trans [1], pr_mdihk_trans [2], pr_nar, pr_nel, pr_orbit_sum
pr_pnt_hist, pr_seq_frame_info, pr_status [1], pr_status [2], pr_sxt_term
pr_sxtobs, pr_therm_rs232, pr_tim2week [1], pr_tim2week [2], pr_uniq_hk
pr_visible, quick_hkplot [1], quick_hkplot [2], quick_plottrav, radial_avg
rd_fdss, rd_raw_station_plan, rd_sci5k, rd_station_plan, rd_sxtgoes
rd_therm_rs232, rd_week_file [1], rd_week_file [2], rd_week_file [3]
rd_week_file [4], rd_xda_same, rdtbl, read_msok_jpg, redo_disploi, redo_mon_sci5k
ref_day_plot, reltime [1], reltime [2], reslot, rest_low8_cube [1]
rest_low8_cube [2], rt_nkr, run_dsnfil, scat_avg, sda2fits, sector_avg, sel_fileinfo
sel_leak_image [1], sel_leak_image [3], sel_leak_image [4], seq_frame_info
seq_run_sum [1], seq_run_sum [2], sft2sfc, show_obs2, show_obs3, show_obs4
sleazy_rot, sol_rot [2], soon_catstat, soup_info, ssw_check_contrib, ssw_track_fov
sumer_ffdb, sun_today [1], sun_today [2], sun_today [3], sxl2radiance, sxt2eit
sxt_align, sxt_deleak [1], sxt_deleak [2], sxt_eff_area, sxt_fits_info
sxt_flux [1], sxt_flux [2], sxt_flux [3], sxt_interp [1], sxt_interp [2]
sxt_mornint, sxt_mwave, sxt_obs_coord [1], sxt_obs_coord [2], sxt_plan
sxt_prep [1], sxt_prep [2], sxt_prep [3], sxtbox_fsp, sxthxt_fsp, sxtth_hxt
table_dump, telem_sum, term_times, tfr_summary, tfr_summary2, tim2dbase
tim2match [1], tim2match [2], tim2match [3], tim2orbit [1], tim2orbit [2]
timegrid, timeline, topsdb [1], topsdb [2], tprofiles, tr_inventory_telem
tr_rd_index, tr_rd_inventory, tr_reformat, trace_sswhere [2], trace_sswhere [3]
trace_sswhere [4], ut_time [1], ut_time [2], utcursor [1], utcursor [2]
valid_pass2, valid_pass3, valid_pass4 [1], valid_pass4 [2], web_seq, weekid [2]
wr_opasc [1], wr_opasc [2], wrt1orbit [1], wrt1orbit [2], wrt_fits_bin_exten [2]
wrt_sci160k_img, xanal_emi, xdate [1], xdate [2], xdisp_sci5k, xdisp_trace2
xdisp_trace3, xhkplot, xsearch_obs, xset_chain [1], xset_chain [2]
xsxt_prep_event, xy_lwa, ydb_exist [2], ydb_install [1], ydb_install [2]
yo_height, yopos [1], yopos [2], yoyo_man2
HISTORY:
written Fall '91 by M.Morrison
13-Nov-91 (MDM) - Added capability to pass the index
and have the ".gen" nested structure accessed
13-Nov-91 (MDM) - Removed the "guts" and put them inside
"gt_time" and "gt_day"
15-Nov-91 (MDM) - Added "msec" and "nolead0" options
4-Aug-95 (MDM) - Added /FITS keyword
[Previous]
[Next]
NAME:
FMT_TIMER
PURPOSE:
print formatted times of an index file
CALLING SEQUENCE:
fmt_timer,index
fmt_timer,index,tmin,tmax,imin=imin,imax=imax,tspan=tspan
fmt_timer,index,/noprint
Keyword Parameters:
/noprint, /quiet - dont print, just return t0/t1
/no_sort - just strip first and last elements (assume sorted)
(more efficient for large input vectors)
(default for very large input unless /force_sort set)
/force_sort - override default switch to /no_sort if very large
input vectors (which are transparently inefficient)
OPTIONAL OUTPUTS
TMIN - formatted time of minimum time of index records
TMAX - formatted time of maximum time of index records
IMIN - index of the input structure INDEX corresponding to TMIN
IMAX - index of the input structure INDEX corresponding to TMAX
TSPAN - time span in sec of index records
CALLS: ***
fmt_tim [1], fmt_tim [2]
CALLED BY:
CHECK_FOR_30S, FIRST_LIGHT [1], FIRST_LIGHT [2], GOES2DPE, MK_ORB_WEEK, NEAR_CONJ
NEUPERT_PLOT, PATROL_ORDER, QUICKDARK [2], QUICKLIMB [1], QUICKLIMB [2], QUICK_DPE
SFD_PHOT, SPARTAN_PLANNER, SXT_ECLIPSE, SXT_HYST, TERM_REVIEW, TERM_REVIEW_GIF
TEST_ATT, TRACE_SSWHERE [1], WL_CUBE_II, emi_plot [1], fix_decon_pits
fl_goesplot [1], fl_goesplot [2], fl_goesplot [3], get_bcs, goes_widget, gtt_orbit
image2movie, ip_que_dmpver, kluge_att, lapalma_cat, mdi_cat, multi_hda2hxi
pfi_dominant, pfi_loc, plot_fov [1], sacpeak_image, ssw_fov_context, sxt2mpeg
time_window, tr_lut_conv, trace_last_movie [1], trace_last_movie [3]
trace_movie_context, trace_special_movie [1], trace_special_movie [2]
trace_special_movie [3], trace_special_movie2, trace_sswhere [2]
trace_sswhere [3], trace_sswhere [4], wrt_fits_bin_exten [2], xanal_emi
HISTORY:
Hugh Hudson, Dec. 18, 1992
HSH, outputs added May 18, 1993
HSH, changed output and added /noprint keyword Aug 26, 1993
GLS, modified code to handle cases where index records are not time
sorted, and added IMIN, IMAX output keywords
SLF, use anytim.pro (allow all SSW/YOhkoh/SOHO times)
SLF, add /QUIET, /NO_SORT, /FORCE_SORT
SLF, 19-aug-1998 - made sort the default
[Previous]
[Next]
Project : SOHO - CDS
Name : FMT_VECT()
Purpose : Formats a vector (any length) into a parenthesized string.
Explanation : This function returns the given vector in parenthesized
coordinates as in the form (X,Y). No limit on the number
of dimensions. Also note that the vector does not need to
be numbers. It may also be a string vector. e.g. ['X','Y']
Use : IDL> tmp = VECT( vctr, [ form, FORMAT = , DELIM = ] )
Inputs : VCTR The vector to be displayed e.g. [56,44]
Opt. Inputs : FORM This may be used instead of the keyword FORMAT
Outputs : tmp A returned string of the parenthesized vector
Opt. Outputs:
Keywords : FORMAT Allows the specification of a format for the
elements. e.g.: VECT([2,3],format='(f7.1)')
gives '(2.0,3.0)'
DELIM Specifies the delimeter. The default is ',' but
other useful examples might be ', ' or ':'
Calls : ***
NUM2STR
CALLED BY:
BP_SEEK_POS, CHIANTI_NE, CHIANTI_TE, CROSS_CORR2, EZFIT, GT_FPOINT, MK_HEAD_CAT
MK_RASTER, MK_SYNOPTIC, MONO_SPEC, PERIODOGRAM, PLOT_DELTAT, PLOT_EXPINT
PLOT_RASTER, POLY_SPEC, SHOW_AXES, SHOW_DATAWIN, SHOW_PLAN, SHOW_RASTER
TP_DISPLAY_VP, TP_DISP_LLIST, TP_GET_DESC, UPDATE_RAS_DUR, UPDATE_STUDY_DUR
WHAT_USES
Restrictions:
Side effects:
Category :
Prev. Hist. : Original VECT, 29-Aug-91 by E. Deutsch
Written : E Deutsch
Modified : CDS version by C D Pike, RAL, 13-May-93
Add /no_parentheses keyword. CDP, 15-Nov-95
Version : Version 2, 15-Nov-1995
[Previous]
[Next]
Name:
font_size
Purpose:
Determine character width and height in pixels for a given
value of CHARSIZE
Calling sequence:
xpix = font_size(charsize, ypix)
xpix = font_size(charsize, ypix ,wxs=wxs, wys=wys)
Inputs:
charsize = Value of plotting keyword CHARSIZE to be tested
Outputs:
xpix = Size of character in pixels in x direction)
ypix = Size of character in pixels in y direction)
Optional Input Keywords:
wxs = Size of the pixmap window (default is 64)
wys = Size of the pixmap window (default is 64)
Method:
Open a window and then read back the results
CALLS: ***
SUMCOL [1], SUMCOL [2], SUMROW [1], SUMROW [2], SUMROW [3], WDEF [1], WDEF [2]
CALLED BY:
cal_fig_mich, fig_summary, img_summary [1], img_summary [2], mplot_nar
plot_ar_pfi, plot_fov [2], plot_nar [1], plot_nar [2]
Side effects:
A PIXMAP window will be created temporarily and then destroyed
Modification History:
9-apr-93 - GLS based on TEXT_SIZE.PRO by JRL
11-Jul-96 (MDM) - Corrected to preserve the device setting when
it was called.
[Previous]
[Next]
Name: force_evt
Purpose: make new event structure for input into event routine
Input Parameters:
parent_evt - parent event of caller
ids = list of widget ids to search for widget_value=value
Keyword Parameters:
type - string describing type of output structure
(widget_button, widget_slider, ...)
History - slf 5-June-1992
CALLS:
CALLED BY
xspr [1], xspr [2], xstepper_event
[Previous]
[Next]
Project : SOHO - CDS
Name : FORM_CHISQR
Purpose : Forms function to be minimized
Explanation : Called from fitting routines to form the function to be
minimized (normally chi-squared).
Use : Result = FORM_CHISQR(Z)
Inputs : Z = Array containing the difference between the fitted
and measured values, divided by the error (sigma).
Opt. Inputs : None.
Outputs : The result of the function is the sum of the error estimates,
normally the squares of Z.
Opt. Outputs: None.
Keywords : ABSOLUTE = If set, then the sum of the absolute differences is
minimized instead of the sum of the squares. This
is equivalent to assuming a double-sided exponential
distribution.
LORENTZ = If set, then a Lorentz distribution is used instead
of a normal distribution. Overrides ABSOLUTE.
Calls : None.
CALLED BY:
AMOEBA_C
Common : None.
Restrictions: None.
Side effects: The statistical interpretation of the value of this function is
unclear if either ABSOLUTE or LORENTZ is set.
Category : Utilities, Curve_Fitting
Prev. Hist. : William Thompson, December, 1992.
Written : William Thompson, GSFC, December 1992
Modified : Version 1, William Thompson, GSFC, 9 January 1995
Incorporated into CDS library
Version : Version 1, 9 January 1995
[Previous]
[Next]
Project : SOHO - CDS
Name :
FORM_FILENAME()
Purpose :
Adds default paths and extensions to filenames.
Explanation :
This procedure tests whether or not a given filename already has an
extension on it. If not, then a default extension is appended.
Optionally, the same can be done with a default path. This is similar
to using the DEFAULT keyword with the OPEN statement in VMS.
Using this routine together with environment variables for the optional
directory path allows an OS-independent approach to forming filenames.
Use :
result = FORM_FILENAME( FILENAME, EXTENSION )
OPENW, UNIT, FORM_FILENAME( FILENAME, '.fits' ), ...
Inputs :
FILENAME = Name of file to test.
EXTENSION = Default filename extension. Ignored if FILENAME already
contains an extension.
Opt. Inputs :
None.
Outputs :
Result of function is the name of the file complete with (optional)
directory and extension.
Opt. Outputs:
None.
Keywords :
DIRECTORY = Default directory path. Ignored if FILENAME already
contains directory information.
Calls : ***
STR_SEP
CALLED BY:
CDS_THUMBNAIL, FS_ARCHIVE_RW, GE_WINDOW [1], GFITS_W, HESSI_SHUTTERS
HSI_PACKET2FITS, PCL [1], PCL [2], PS [1], PS [2], QLARCHIVE, QMS [1], QMS [2]
SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1], SPEX_PROC [2], TVPRINT
WRITE_CALFITS, WRITE_DD, X2JPEG, XCDS_SNAPSHOT
Common :
None.
Restrictions:
None.
Side effects:
None.
Category :
Utilites, Operating System.
Prev. Hist. :
William Thompson, October 1991.
Written :
William Thompson, GSFC, October 1991.
Modified :
Version 1, William Thompson, GSFC, 7 May 1993.
Incorporated into CDS library.
Changed to be compatible with CONCAT_DIR by M. Morrison.
Made more OS-independent. Relaxed punctuation requirements.
Fixed small bug with blank extensions.
Added IDL for Windows compatibility.
Version 2, William Thompson, GSFC, 29 August 1995
Modified to use OS_FAMILY
Version :
Version 2, 29 August 1995
[Previous]
[Next]
Project : SOHO - CDS
Name : FORM_HISTO
Purpose : Forms a histogram from the variable ARRAY.
Category : Class4, Graphics
Explanation : Forms a histogram from the variable ARRAY. Decides what the
coarseness of the histogram should be. Called from PLOT_HISTO.
ARRAY is scaled into a temporary variable to run from zero and
some reasonable number, depending on the number of elements of
ARRAY. This number is the coarseness of the histogram,
i.e. the number of histogram bins. The more elements in ARRAY,
the larger this number will be. However, it will not exceed
100. The HISTOGRAM function is then used on this temporary
variable.
If the optional parameter DELTA is passed, then FORM_HISTO uses
this value to determine the spacing of the histogram bins,
rather than calculating it's own bin spacing as described
above.
Syntax : FORM_HISTO, ARRAY, STEPS, HISTO
CALLED BY:
PLOT_HISTO
Examples : See PLOT_HISTO
Inputs : ARRAY = Array to form histogram from.
Opt. Inputs : None.
Outputs : STEPS = Values at which histogram is taken. Each value
represents histogram between STEP(I) and STEP(I+1).
HISTO = Histogram values.
Opt. Outputs: None.
Keywords : DELTA = Distance between histogram steps. If not passed,
then the routine chooses a suitable value.
MISSING = Value flagging missing pixels. Missing pixels can
also be flagged as Not-A-Number.
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 = ''
FORM_HISTO, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
TRIM, WHERE_NOT_MISSING
Common : None.
Restrictions: None.
Side effects: None.
Prev. Hist. :
William Thompson Applied Research Corporation
September, 1987 8201 Corporate Drive
Landover, MD 20785
William Thompson, May 1992, made DELTA a keyword parameter.
William Thompson, 25 May 1993, changed to call HISTOGRAM with a long
array to make compatible with OpenVMS/ALPHA
History : Version 1, 22-Jan-1996, William Thompson, GSFC.
Incorporated into CDS library.
Version 2, 11-Oct-2002, William Thompson, GSFC
Corrected bug when the number of steps is large.
Version 3, 19-Jun-2006, William Thompson, GSFC
Added keywords MISSING, ERRMSG. Call to WHERE_NOT_MISSING.
Contact : WTHOMPSON
[Previous]
[Next]
Project : SOHO - CDS
Name : FORM_HISTO_2D
Purpose : Forms a histogram from the variable ARRAYX.
Category : Class4, Graphics
Explanation : Forms a 2D histogram from the paired variables ARRAYX and
ARRAYY. Decides what the coarseness of the histogram should
be in each dimension.
The arrays are scaled into temporary variables to run from zero
and some reasonable number, depending on the number of elements
of each array. This number is the coarseness of the histogram,
i.e. the number of histogram bins. The more elements in the
arrays , the larger this number will be. However, it will not
exceed 100. The HISTOGRAM function is then used on a suitable
combination of these temporary variables.
If the optional parameter DELTA is passed, then FORM_HISTO uses
this value to determine the spacing of the histogram bins,
rather than calculating it's own bin spacing as described
above.
Syntax : FORM_HISTO_2D, ARRAYX, ARRAYY, STEPSX, STEPSY, HISTO
Examples : X = RANDOMN(SEED,10000)
Y = RANDOMN(SEED,10000)
FORM_HISTO_2D, X, Y, SX, SY, HISTO, ORIGIN=ORIGIN, SCALE=SCALE
PLOT_IMAGE, HISTO, ORIGIN=ORIGIN, SCALE=SCALE
Inputs : ARRAYX = X array to form histogram from.
ARRAYY = Y array to form histogram from.
Opt. Inputs : None.
Outputs : STEPSX = Values along X axis at which histogram is taken.
Each value represents histogram between STEP(I) and
STEP(I+1).
STEPSY = Same for Y axis.
HISTO = Histogram values.
Opt. Outputs: None.
Keywords : DELTA = Distance between histogram steps. Can be a
two-element vector for separate X and Y values. If
not passed, then the routine chooses suitable values.
CENTER = If set, then the STEPSX and STEPSY arrays refer to
the center of the pixels, rather than the beginning.
This allows one to use commands such as
CONTOUR, HISTO, STEPSX, STEPSY
and match the output from PLOT_IMAGE.
MISSING = Value flagging missing pixels. Missing pixels can
also be flagged as Not-A-Number.
ORIGIN = Returns the origin of the histogram, for use in
PLOT_IMAGE.
SCALE = Returns the scale of the histogram, for use in
PLOT_IMAGE.
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 = ''
FORM_HISTO_2D, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
TRIM, WHERE_NOT_MISSING
Common : None.
Restrictions: None.
Side effects: None.
Prev. Hist. : Based on FORM_HISTO
History : Version 1, 12-Oct-2006, William Thompson, GSFC
Version 2, 12-Jan-2007, William Thompson, GSFC
Corrected bug with occasional array size mismatch
Contact : WTHOMPSON
[Previous]
[Next]
Project : SOHO - CDS
Name :
FORM_INT()
Purpose :
Scales an intensity image for use with split color tables.
Explanation :
Takes an intensity image, and scales it into a byte array suitable for
use with the combined intensity/velocity color table created by
COMBINE_VEL.
Alternatively, two intensity images can be displayed with different
color tables merged via COMBINE_VEL, if the /LOWER switch is used for
one of them.
This function scales an array into the upper (or lower) half of the
color table. If passed, only values of IMAGE within the range IMIN to
IMAX will be used to set the scaling. Missing pixels (MISSING) are
scaled to zero.
Use :
B = FORM_INT(IMAGE)
The following example shows how to put a 256 by 256 intensity image I
next to its corresponding velocity image V. Standard color table #3 is
used for the intensity image.
LOADCT,3 ;Select color table for intensity
COMBINE_VEL ;Combine with velocity color table
TV,FORM_INT(I),0,128 ;Display intensity image on left
TV,FORM_VEL(V,/COMBINED),256,128 ;And velocity on right
The following example shows how to put one 256 by 256 intensity image I1
using color table #3 next to another image of the same size I2 using
color table #5.
LOADCT,3 ;Select first color table
COMBINE_COLORS,/LOWER ;Save lower color table
LOADCT,5 ;Select second color table
COMBINE_COLORS ;Combine the color tables
TV,FORM_INT(I1,/LOWER),0,128 ;Display first image on left
TV,FORM_INT(I2),128 ;And second image on right
Inputs :
IMAGE = Intensity image to be scaled.
Opt. Inputs :
None.
Outputs :
This function returns the scaled image.
Opt. Outputs:
None.
Keywords :
MIN = Lower limit placed on intensity image when selecting scale.
MAX = Upper limit placed on intensity image when selecting scale.
TOP = The maximum value of the scaled image array, as used by
BYTSCL. The default is !D.TABLE_SIZE-1.
BOTTOM = The minimum value of the scaled image array, as used by
BYTSCL. The default is 0.
MISSING = Value flagging missing pixels.
LOWER = If set, then the image is placed in the lower part of the
color table, rather than the upper.
Calls : ***
BYTSCLI, GET_IM_KEYWORD, GOOD_PIXELS, TAG_EXIST [1], TAG_EXIST [2], WHERE_MISSING
CALLED BY:
BSCALE
Common :
None.
Restrictions:
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Dec. 1990. Created from FORM_VEL.
W.T.T., Nov. 1991. Changed IMIN and IMAX to keywords MIN and MAX.
Added support for flag variables VMIN and VMAX.
W.T.T., Feb. 1992. Added LOWER keyword.
William Thompson, August 1992, renamed BADPIXEL to MISSING.
Written :
William Thompson, GSFC, December 1990.
Modified :
Version 1, William Thompson, GSFC, 13 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 22 October 1993.
Modified to call BYTSCLI instead of BYTSCL.
Version 3, William Thompson, GSFC, 8 December 1997
Added keyword TOP. Pay attention to !IMAGE.TOP
Version 4, William Thompson, GSFC, 29 April 2005
Use WHERE_MISSING, GOOD_PIXELS to treat NaN values
Version 5, William Thompson, GSFC, 3-Jan-2006
Added keyword BOTTOM, removed call to EXECUTE
Version :
Version 5, 3-Jan-2006
[Previous]
[Next]
Project : SOHO - CDS
Name : FORM_SIGMAS
Purpose : Forms denominator in function to be minimized.
Explanation : Called from fitting routines to form the denominator in the
argument of the function to be minimized (normally
chi-squared).
Use : FORM_SIGMAS, Y, SIG [, /POISSON ] [, ERROR=ERR ]
Inputs : Y = Data values. Must always be present, but only used
if the POISSON switch is set.
Opt. Inputs : None.
Outputs : SIG = Array of sigmas to be used in evaluating the
function to be minimized.
Opt. Outputs: SIG_SET = A logical switch signalling that a non-trivial SIG
array was returned.
Keywords : POISSON = If set, then a Poisson error distribution is
assumed, and the sigmas are set accordingly to 1/Y.
ERROR = Array of errors. The sigmas are set accordingly to
ABS(ERROR). Overrides POISSON.
Calls : ***
TRIM
CALLED BY:
AMOEBA_C
Common : None
Restrictions: If passed, ERROR must have the same number of elements as Y.
Alternately, ERROR can be passed as a scalar value, and all the
values of SIG returned will be the same.
Side effects: If nothing but Y is passed, then SIG is returned as an array of
ones.
Category : Utilities, Curve_Fitting
Prev. Hist. : William Thompson, December, 1992.
Written : William Thompson, GSFC, December 1992
Modified : Version 1, William Thompson, GSFC, 9 January 1995
Incorporated into CDS library
Version : Version 1, 9 January 1995
[Previous]
[Next]
Project : SOHO - CDS
Name :
FORM_VEL()
Purpose :
Scales a velocity image for display.
Explanation :
Takes a velocity image, and scales it into a byte array suitable for
use with the velocity color table created by LOAD_VEL.
This function scales an array into the range 1 to MAXCOLOR (either
!D.N_COLORS-1 or (!D.N_COLORS - 1)/2, depending on the value of
combined), with values of zero scaling to (MAXCOLOR+1)/2. If passed,
only values of IMAGE within the range MIN to MAX will be used to set
the scaling. Missing pixels (MISSING) are scaled to zero. When used
with LOAD_VEL, positive velocities will be shown in blue, negative
velocities in red (or visa-versa), velocities at or near zero will be
shown in grey, and missing pixels will be black.
Use :
Result = FORM_VEL(IMAGE)
The following example shows how to put a 256 by 256 intensity image I
next to its corresponding velocity image V. Standard color table #3 is
used for the intensity image.
LOADCT,3 ;Select color table for intensity
COMBINE_VEL ;Combine with velocity color table
TV,FORM_INT(I),0,128 ;Display intensity image on left
TV,FORM_VEL(V,/COMBINED),256,128 ;And velocity on right
Inputs :
IMAGE = Velocity image to be scaled.
Opt. Inputs :
None.
Outputs :
This function returns the scaled image.
Opt. Outputs:
None.
Keywords :
MIN = Lower limit placed on velocity image when selecting scale.
MAX = Upper limit placed on velocity image when selecting scale.
If neither MIN or MAX are passed, then the scaling is
derived from the image. If both MIN and MAX are passed,
then the scale is set by the least restrictive of the two
values.
TOP = The maximum value of the scaled image array, as used by
BYTSCL. The default is !D.TABLE_SIZE-1.
BOTTOM = The minimum value of the scaled image array, as used by
BYTSCL. The default is 0.
MISSING = Value flagging missing pixels.
COMBINED = If passed, then velocities are scaled into the bottom half
of the color table, so that intensities can be displayed
using the top half of the color table.
Calls : ***
GET_IM_KEYWORD, GOOD_PIXELS, IM_KEYWORD_SET, TAG_EXIST [1], TAG_EXIST [2]
WHERE_MISSING
CALLED BY:
BSCALE
Common :
None.
Restrictions:
In general, the SERTS image display routines use several non-standard
system variables. These system variables are defined in the procedure
IMAGELIB. It is suggested that the command IMAGELIB be placed in the
user's IDL_STARTUP file.
Some routines also require the SERTS graphics devices software,
generally found in a parallel directory at the site where this software
was obtained. Those routines have their own special system variables.
Side effects:
None.
Category :
Utilities, Image_display.
Prev. Hist. :
W.T.T., Oct. 1987.
W.T.T., Nov. 1990. Modified for version 2 of IDL.
W.T.T., Dec. 1990. Added COMBINED keyword.
W.T.T., Jan. 1991. Changed FLAG to keyword BADPIXEL.
W.T.T., Nov. 1991. Changed VMIN and VMAX to keywords MIN and MAX.
Added support for flag variables VMIN, VMAX and
COMBINED.
W.T.T., Jun. 1992. Changed so that topmost color reserved for
overplotting with white lines.
William Thompson, August 1992, renamed BADPIXEL to MISSING.
Written :
William Thompson, GSFC, October 1987.
Modified :
Version 1, William Thompson, GSFC, 13 May 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 8 December 1997
Added keyword TOP. Pay attention to !IMAGE.TOP
Version 3, William Thompson, GSFC, 29 April 2005
Use WHERE_MISSING, GOOD_PIXELS to treat NaN values
Version 4, William Thompson, GSFC, 3-Jan-2006
Added keyword BOTTOM
Version :
Version 4, 3-Jan-2006
[Previous]
[Next]
Project : HESSI
Name : FORMAT_INTERVALS
Purpose : Function to format intervals as ASCII strings
Category : Utility
Explanation : Output is an array of strings.
If intervals are numbers, strings look like:
'2.2 to 3.7', '4.1 to 5.6', with the numbers formatted
as specified by format keyword
If intervals are times, strings look like:
'12-Nov-2000 02:40:00.000 to 02:40:00.000' with the times formatted
as specified by user. Default format is /vms.
Syntax : IDL> result = format_intervals (int, ut=ut, format=format, $
left_just=left_just, _extra=_extra)
Inputs : int - 2xn array of interval start/end values
Opt. Input Keywords :
ut - if set, treat interval values as time
format - string containing format specification for values in interval
(ignored if ut is set)
left_just - if set, then left justify strings
prefix - if set, then insert 'Interval n' in front of interval
maxint - maximum number of intervals to format. If number of intervals
is > maxint, then show first intervals up to maxint, then '...', then last interval.
_extra - any additional keywords to pass to anytim for ut intervals
Outputs : Returns array of strings with formatted intervals. If int is not a 2xn array
returns the string 'None'.
Opt. Output Keywords: None
CALLED BY:
GOES__DEFINE, HESSI MULTI IMAGE CLASS DEFINITION [2], SPECPLOT__DEFINE
SPEX_DRM__DEFINE, SPEX_FITINT__DEFINE, SPEX_FIT__DEFINE, SPEX__DEFINE
hsi_format_flare, hsi_image_raw__define, hsi_imagefile_2_plotman, hsi_ui_img
hsi_ui_ql, hsi_ui_spec, spex_bk__define, spex_bkint__define, spex_bksub__define
spex_data__define
Examples:
IDL> int = [[2,3],[5,6],[7,8]]
IDL> print,format_intervals(int, format='(f5.1)')
2.0 to 3.0
5.0 to 6.0
7.0 to 8.0
IDL> int = [[2,3],[12,18],[70,80]] + anytim('2001/9/1 12:00')
IDL> print,format_intervals(int, /ut, /yohkoh)
01-Sep-01 12:00:02.000 to 12:00:03.000
01-Sep-01 12:00:12.000 to 12:00:18.000
01-Sep-01 12:01:10.000 to 12:01:20.000
CALLS: ***
FSTRING, N_DIMENSIONS, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
Common : None
Restrictions: Input range must be [2xn]
Side effects: None
History : 25-Aug-2001, Kim Tolbert
Modifications:
19-Jun-2002, Kim. Use fstring instead of string to handle arrays > 1024.
14-OCt-2002, Kim. Added maxint keyword
Contact : kim.tolbert@gsfc.nasa.gov
[Previous]
[Next]
NAME:
FORPRINT
PURPOSE:
Print a set of vectors by looping over each index value.
EXPLANATION:
If W and F are equal length vectors, then the statement
IDL> forprint, w, f
is equivalent to
IDL> for i = 0L, N_elements(w)-1 do print,w[i],f[i]
CALLING SEQUENCE:
forprint, v1,[ v2, v3, v4,....v18, FORMAT = , TEXTOUT = ,STARTLINE =,
SUBSET=, NUMLINE =, /SILENT, COMMENT= ]
INPUTS:
V1,V2,...V18 - Arbitary IDL vectors. If the vectors are not of
equal length then the number of rows printed will be equal
to the length of the smallest vector. Up to 18 vectors
can be supplied.
OPTIONAL KEYWORD INPUTS:
TEXTOUT - Controls print output device, defaults to !TEXTOUT
textout=1 TERMINAL using /more option if available
textout=2 TERMINAL without /more option
textout=3 file 'forprint.prt'
textout=4 file 'laser.tmp'
textout=5 user must open file
textout = filename (default extension of .prt)
textout=7 Append to <program>.prt file if it exists
COMMENT - String to write as the first line of output file if
TEXTOUT > 2. By default, FORPRINT will write a time stamp
on the first line. Use /NOCOMMENT if you don't want FORPRINT
to write anything in the output file.
FORMAT - Scalar format string as in the PRINT procedure. The use
of outer parenthesis is optional. Ex. - format="(F10.3,I7)"
This program will automatically remove a leading "$" from
incoming format statements. Ex. - "$(I4)" would become "(I4)".
If omitted, then IDL default formats are used.
/NOCOMMENT - Set this keyword if you don't want any comment line
line written as the first line in a harcopy output file.
/SILENT - Normally, with a hardcopy output (TEXTOUT > 2), FORPRINT will
print an informational message. If the SILENT keyword
is set and non-zero, then this message is suppressed.
SUBSET - Index vector specifying elements to print. No error checking
is done to make sure the indicies are valid. The statement
IDL> forprint,x,y,z,subset=s
is equivalent to
IDL> for i=0,n-1 do print, x[s[i]], y[s[i]], z[s[i]]
STARTLINE - Integer scalar specifying the first line in the arrays
to print. Default is STARTLINE = 1, i.e. start at the
beginning of the arrays. (If a SUBSET keyword is supplied
then STARTLINE refers to first element in the subscript vector.)
/STDOUT - If set, the force standard output unit (=-1) if not writing
to a file. This allows the FORPINT output to be captured
in a journal file. Only needed for non-GUI terminals
OUTPUTS:
None
SYSTEM VARIABLES:
If keyword TEXTOUT is not used, the default is the nonstandard
keyword !TEXTOUT. If you want to use FORPRINT to write more than
once to the same file, or use a different file name then set
TEXTOUT=5, and open and close then file yourself (see documentation
of TEXTOPEN for more info).
One way to add the non-standard system variables !TEXTOUT and !TEXTUNIT
is to use the procedure ASTROLIB
CALLS: ***
TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2]
TEXTOPEN [3]
EXAMPLE:
Suppose W,F, and E are the wavelength, flux, and epsilon vectors for
a spectrum. Print these values to a file 'output.dat' in a nice
format.
IDL> fmt = '(F10.3,1PE12.2,I7)'
IDL> forprint, F = fmt, w, f, e, TEXT = 'output.dat'
PROCEDURES CALLED:
TEXTOPEN, TEXTCLOSE
REVISION HISTORY:
Written W. Landsman April, 1989
Keywords textout and format added, J. Isensee, July, 1990
Made use of parenthesis in FORMAT optional W. Landsman May 1992
Added STARTLINE keyword W. Landsman November 1992
Set up so can handle 18 input vectors. J. Isensee, HSTX Corp. July 1993
Handle string value of TEXTOUT W. Landsman, HSTX September 1993
Added NUMLINE keyword W. Landsman, HSTX February 1996
Added SILENT keyword W. Landsman, RSTX, April 1998
Much faster printing to a file W. Landsman, RITSS, August, 2001
Use SIZE(/TNAME) instead of DATATYPE() W. Landsman SSAI October 2001
Fix skipping of first line bug introduced Aug 2001 W. Landsman Nov2001
Added /NOCOMMENT keyword, the SILENT keyword now controls only
the display of informational messages. W. Landsman June 2002
Skip PRINTF if IDL in demo mode W. Landsman October 2004
Assume since V5.4 use BREAK instead of GOTO W. Landsman April 2006
Add SUBSET keyword, warning if different size vectors passed.
P.Broos,W.Landsman. Aug 2006
Change keyword_set() to N_elements W. Landsman Oct 2006
Added /STDOUT keyword W. Landsman Oct 2006
[Previous]
[Next]
NAME:
FREBIN
PURPOSE:
Shrink or expand the size of an array an arbitary amount using interpolation
EXPLANATION:
FREBIN is an alternative to CONGRID or REBIN. Like CONGRID it
allows expansion or contraction by an arbitary amount. ( REBIN requires
integral factors of the original image size.) Like REBIN it conserves
flux by ensuring that each input pixel is equally represented in the output
array.
CALLING SEQUENCE:
result = FREBIN( image, nsout, nlout, [ /TOTAL] )
INPUTS:
image - input image, 1-d or 2-d numeric array
nsout - number of samples in the output image, numeric scalar
OPTIONAL INPUT:
nlout - number of lines in the output image, numeric scalar
If not supplied, then set equal to 1
OPTIONAL KEYWORD INPUTS:
/total - if set, the output pixels will be the sum of pixels within
the appropriate box of the input image. Otherwise they will
be the average. Use of the /TOTAL keyword conserves surface flux.
OUTPUTS:
The resized image is returned as the function result. If the input
image is of type DOUBLE or FLOAT then the resized image is of the same
type. If the input image is BYTE, INTEGER or LONG then the output
image is usually of type FLOAT. The one exception is expansion by
integral amount (pixel duplication), when the output image is the same
type as the input image.
CALLED BY:
HREBIN, OPLOTERROR, PLOTERROR, WFPC2_READ
EXAMPLE:
Suppose one has an 800 x 800 image array, im, that must be expanded to
a size 850 x 900 while conserving surface flux:
IDL> im1 = frebin(im,850,900,/total)
im1 will be a 850 x 900 array, and total(im1) = total(im)
NOTES:
If the input image sizes are a multiple of the output image sizes
then FREBIN is equivalent to the IDL REBIN function for compression,
and simple pixel duplication on expansion.
If the number of output pixels are not integers, the output image
size will be truncated to an integer. The platescale, however, will
reflect the non-integer number of pixels. For example, if you want to
bin a 100 x 100 integer image such that each output pixel is 3.1
input pixels in each direction use:
n = 100/3.1 ; 32.2581
image_out = frebin(image,n,n)
The output image will be 32 x 32 and a small portion at the trailing
edges of the input image will be ignored.
PROCEDURE CALLS:
None.
HISTORY:
Adapted from May 1998 STIS version, written D. Lindler, ACC
Added /NOZERO, use INTERPOLATE instead of CONGRID, June 98 W. Landsman
Fixed for nsout non-integral but a multiple of image size Aug 98 D.Lindler
DJL, Oct 20, 1998, Modified to work for floating point image sizes when
expanding the image.
Improve speed by addressing arrays in memory order W.Landsman Dec/Jan 2001
[Previous]
[Next]
Project : SOHO - CDS
Name : FREE_POINTER()
Purpose : to free a pointer variable
Category : Help
Explanation : removes a pointer variable.
Syntax : IDL> free_pointer(pointer)
Inputs : POINTER = pointer variable
Opt. Inputs : None
Outputs : None
Opt. Outputs: None
Keywords : None
CALLS: ***
EXIST, VALID_POINTER, XKILL
CALLED BY:
CACHE_DATA, CDS_STACK, COPY_VAR, FREESCAN, GET_CDS_STUDY, GET_SID, IMAGE_TOOL
IMAGE_TOOL_EVENT, ITOOL_LOAD_IMAGE, MK_PLAN_CUSTOM, MK_SOHO_CUSTOM, NEWSCAN
SCANPATH, SID__DEFINE, XANSWER, XCALENDAR, XCAMP, XCAT, XCHOICE, XCLONE_PLAN, XGET_UTC
XIAP, XINPUT, XLIST, XPROGRAM, XPROGRAM_ADD, XPS_SETUP, XREPORT, XREPORT_EDIT, XSEL_ITEM
XSEL_LIST [1], XSEL_LIST [2], XSET_COLOR, XSET_VALUE, XTEXT, XZOOM_PLAN
ethz_XCHOICE, pcal
Common : None
Restrictions: POINTER becomes invalid
Side effects: None
History : Version 1, 1-Sep-1995, D.M. Zarro. Written
Version 2, 17-Jul-1997, D.M. Zarro. Modified
-- Updated to version 5 pointers
Contact : DZARRO@SOLAR.STANFORD.EDU
[Previous]
[Next]
Project : HESSI
Name : FREE_VAR
Purpose : free variable memory (pointer, objects, structures)
Category : utility objects
Syntax : IDL> free_var,var
Inputs : VAR = any type of IDL variable (scalar or array)
Keywords : DELETE = set to delvarx variable
EXCLUDE = string array of tag names to not free
NO_DEALLOCATE = clear pointer variables, but don't deallocate
memory
CALLS: ***
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], IS_STRING, PTR_EMPTY
delvarx [5]
CALLED BY:
CLONE__DEFINE, FRAMEWORK ABSTRACT CLASS DEFINITION, FREE_VAR__DEFINE, HESSI
HESSI_DATA, OLIST__DEFINE, READER__DEFINE, SHOW_SYNOP__DEFINE
STRUCTURE MANAGER CLASS, hsi_clean_options, hsi_show_flags [2]
hsi_ui_flarecat, hsi_ui_img, hsi_ui_lc, hsi_ui_spec, plotman
spex_hessi_image__define, spex_image__define
History : Written 28 May 2000, D. Zarro, EIT/GSFC
Mod 20-Aug-2000, Kim Tolbert, added exclude keyword
Mod 28-Jun-2001, Andre Csillaghy, remodeled for
efficiency and worked on a problem with the structure option
Mod 12-Dec-2002, Zarro (EER/GSFC) - added check for
blank exclude & changed 'is_member' call to 'where'
22-Apr-2004, Zarro (L-3Com/GSFC) - added /NO_DEALLOCATE
22-Feb-2006, Zarro (L-3Com/GSFC) - replaced PTR_FREE by
HEAP_FREE
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HESSI
Name : FREE_VAR__DEFINE
Purpose : Define a FREE_VAR class
Category : objects
Explanation : FREE_VAR class contains a single method for
recursively freeing memory from an object
Usage: : IDL> add_method,'free_var',object
IDL> object->free_var
or from within a method:
add_method,'free_var',self
self->free_var
Keywords: EXCLUDE - string array of properties or tag names to
not destroy
CALLS: ***
FREE_VAR, FREE_VAR::FREE_VAR, IS_BLANK, OBJ_PROPS
History : Written 10 August 2000, Tolbert (GSFC), Zarro (EIT/GSFC)
Modifications:
20-Aug-2000, Kim Tolbert, added exclude keyword
04-Feb-2003, Kim, somehow check in for loop for exclude disappeared. Put it back
05-Feb-2003, Zarro (EER/GSFC) - checked for blank exclude
22-Apr-2004, Zarro (L-3Com/GSFC) - added _EXTRA
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
FSC_COLOR
PURPOSE:
The purpose of this function is to obtain drawing colors
by name and in a device-decomposition independent way. The
color names and values may be read in as a file, or 88
color names and values are supplied from the program. These
were obtained from the file rgb.txt, found on most X-Window
distributions. Representative colors were chose from across
the color spectrum. To see a list of colors available, type:
Print, FSC_Color(/Names), Format='(6A15)'.
AUTHOR:
FANNING SOFTWARE CONSULTING:
David Fanning, Ph.D.
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
CATEGORY:
Graphics, Color Specification.
CALLING SEQUENCE:
color = FSC_COLOR(theColor, theColorIndex)
NORMAL CALLING SEQUENCE FOR DEVICE-INDEPENDENT COLOR:
axisColor = FSC_COLOR("Green", !D.Table_Size-2)
backColor = FSC_COLOR("Charcoal", !D.Table_Size-3)
dataColor = FSC_COLOR("Yellow", !D.Table_Size-4)
Plot, Findgen(11), Color=axisColor, Background=backColor, /NoData
OPlot, Findgen(11), Color=dataColor
OPTIONAL INPUT PARAMETERS:
theColor: A string with the "name" of the color. To see a list
of the color names available set the NAMES keyword. This may
also be a vector of color names. Colors available are these:
Almond Antique White Aquamarine Beige Bisque Black
Blue Blue Violet Brown Burlywood Charcoal Chartreuse
Chocolate Coral Cornsilk Cyan Dark Goldenrod Dark Gray
Dark Green Dark Khaki Dark Orchid Dark Salmon Deep Pink Dodger Blue
Firebrick Forest Green Gold Goldenrod Gray Green
Green Yellow Honeydew Hot Pink Indian Red Ivory Khaki
Lavender Lawn Green Light Coral Light Cyan Light Gray Light Salmon
Light Yellow Lime Green Linen Magenta Maroon Medium Gray
Medium Orchid Moccasin Navy Olive Olive Drab Orange
Orange Red Orchid Pale Goldenrod Pale Green Papaya Peru
Pink Plum Powder Blue Purple Red Rose
Rosy Brown Royal Blue Saddle Brown Salmon Sandy Brown Sea Green
Seashell Sienna Sky Blue Slate Gray Snow Spring Green
Steel Blue Tan Thistle Tomato Turquoise Violet
Violet Red Wheat White Yellow
Also, these system color names are available in IDL 5.6 and higher: Frame, Text, Active,
Shadow, Highlight, Edge, Selected, Face.
The color WHITE is used if this parameter is absent or a color name is mis-spelled. To see a list
of the color names available in the program, type this:
Print, FSC_COLOR(/Names), Format='(6A15)'
theColorIndex: The color table index (or vector of indices the same length
as the color name vector) where the specified color is loaded. The color table
index parameter should always be used if you wish to obtain a color value in a
color-decomposition-independent way in your code. See the NORMAL CALLING
SEQUENCE for details. If theColor is a vector, and theColorIndex is a scalar,
then the colors will be loaded starting at theColorIndex.
RETURN VALUE:
The value that is returned by FSC_COLOR depends upon the keywords
used to call it and on the version of IDL you are using. In general,
the return value will be either a color index number where the specified
color is loaded by the program, or a 24-bit color value that can be
decomposed into the specified color on true-color systems. (Or a vector
of such numbers.)
If you are running IDL 5.2 or higher, the program will determine which
return value to use, based on the color decomposition state at the time
the program is called. If you are running a version of IDL before IDL 5.2,
then the program will return the color index number. This behavior can
be overruled in all versions of IDL by setting the DECOMPOSED keyword.
If this keyword is 0, the program always returns a color index number. If
the keyword is 1, the program always returns a 24-bit color value.
If the TRIPLE keyword is set, the program always returns the color triple,
no matter what the current decomposition state or the value of the DECOMPOSED
keyword. Normally, the color triple is returned as a 1 by 3 column vector.
This is appropriate for loading into a color index with TVLCT:
IDL> TVLCT, FSC_Color('Yellow', /Triple), !P.Color
But sometimes (e.g, in object graphics applications) you want the color
returned as a row vector. In this case, you should set the ROW keyword
as well as the TRIPLE keyword:
viewobj= Obj_New('IDLgrView', Color=FSC_Color('charcoal', /Triple, /Row))
If the ALLCOLORS keyword is used, then instead of a single value, modified
as described above, then all the color values are returned in an array. In
other words, the return value will be either an NCOLORS-element vector of color
table index numbers, an NCOLORS-element vector of 24-bit color values, or
an NCOLORS-by-3 array of color triples.
If the NAMES keyword is set, the program returns a vector of
color names known to the program.
INPUT KEYWORD PARAMETERS:
ALLCOLORS: Set this keyword to return indices, or 24-bit values, or color
triples, for all the known colors, instead of for a single color.
DECOMPOSED: Set this keyword to 0 or 1 to force the return value to be
a color table index or a 24-bit color value, respectively.
FILENAME: The string name of an ASCII file that can be opened to read in
color values and color names. There should be one color per row
in the file. Please be sure there are no blank lines in the file.
The format of each row should be:
redValue greenValue blueValue colorName
Color values should be between 0 and 255. Any kind of white-space
separation (blank characters, commas, or tabs) are allowed. The color
name should be a string, but it should NOT be in quotes. A typical
entry into the file would look like this:
255 255 0 Yellow
NAMES: If this keyword is set, the return value of the function is
a ncolors-element string array containing the names of the colors.
These names would be appropriate, for example, in building
a list widget with the names of the colors. If the NAMES
keyword is set, the COLOR and INDEX parameters are ignored.
listID = Widget_List(baseID, Value=GetColor(/Names), YSize=16)
ROW: If this keyword is set, the return value of the function when the TRIPLE
keyword is set is returned as a row vector, rather than as the default
column vector. This is required, for example, when you are trying to
use the return value to set the color for object graphics objects. This
keyword is completely ignored, except when used in combination with the
TRIPLE keyword.
SELECTCOLOR: Set this keyword if you would like to select the color name with
the PICKCOLORNAME program. Selecting this keyword automaticallys sets
the INDEX positional parameter. If this keyword is used, any keywords
appropriate for PICKCOLORNAME can also be used. If this keyword is used,
the first positional parameter can be either a color name or the color
table index number. The program will figure out what you want.
TRIPLE: Setting this keyword will force the return value of the function to
*always* be a color triple, regardless of color decomposition state or
visual depth of the machine. The value will be a three-element column
vector unless the ROW keyword is also set.
In addition, any keyword parameter appropriate for PICKCOLORNAME can be used.
These include BOTTOM, COLUMNS, GROUP_LEADER, INDEX, and TITLE.
OUTPUT KEYWORD PARAMETERS:
CANCEL: This keyword is always set to 0, unless that SELECTCOLOR keyword is used.
Then it will correspond to the value of the CANCEL output keyword in PICKCOLORNAME.
COLORSTRUCTURE: This output keyword (if set to a named variable) will return a
structure in which the fields will be the known color names (without spaces)
and the values of the fields will be either color table index numbers or
24-bit color values. If you have specified a vector of color names, then
this will be a structure containing just those color names as fields.
NCOLORS: The number of colors recognized by the program. It will be 88 by default.
CALLS: ***
FSC_COLOR_COLOR24, FSC_COLOR_COUNT_ROWS, FSC_COLOR_ERROR_MESSAGE
PICKCOLORNAME, STR_SEP
CALLED BY:
PICKCOLOR, PROGRESSBAR__DEFINE
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
ADDITIONAL PROGRAMS REQUIRED:
PICKCOLORNAME: This file can be found in the Coyote Library:
http://www.dfanning.com/programs/pickcolorname.pro
EXAMPLE:
To get drawing colors in a device-decomposed independent way:
axisColor = FSC_COLOR("Green", !D.Table_Size-2)
backColor = FSC_COLOR("Charcoal", !D.Table_Size-3)
dataColor = FSC_COLOR("Yellow", !D.Table_Size-4)
Plot, Findgen(11), Color=axisColor, Background=backColor, /NoData
OPlot, Findgen(11), Color=dataColor
To set the viewport color in object graphics:
theView = Obj_New('IDLgrView', Color=FSC_Color('Charcoal', /Triple))
To change the viewport color later:
theView->SetProperty, Color=FSC_Color('Antique White', /Triple)
To load the drawing colors "red", "green", and "yellow" at indices 100-102, type this:
IDL> TVLCT, FSC_Color(["red", "green", and "yellow"], /Triple), 100
MODIFICATION HISTORY:
Written by: David W. Fanning, 19 October 2000. Based on previous
GetColor program.
Fixed a problem with loading colors with TVLCT on a PRINTER device. 13 Mar 2001. DWF.
Added the ROW keyword. 30 March 2001. DWF.
Added the PICKCOLORNAME code to the file, since I keep forgetting to
give it to people. 15 August 2001. DWF.
Added ability to specify color names and indices as vectors. 5 Nov 2002. DWF.
Fixed a problem with the TRIPLE keyword when specifying a vector of color names. 14 Feb 2003. DWF.
Fixed a small problem with the starting index when specifying ALLCOLORS. 24 March 2003. DWF.
Added system color names. 23 Jan 2004. DWF
[Previous]
[Next]
NAME:
FSELECT
PURPOSE:
Read operator selected flare numbers from the terminal and store
the flare numbers into an array to be used in other procedures.
CATEGORY:
HXRBS
CALLING SEQUENCE:
FSELECT, Flarr, Counts
INPUTS:
none.
OUTPUTS:
Flarr: Array of flare numbers selected by the operator.
Counts: Number of flares numbers stored in Flarr.
KEYWORDS:
WHAT: This string will be part of the message to the user.
CALLED BY:
FLARES, FLDISPLAY, FLIST, FSPLOT, HFLARE, HXRBS, QLDISPLAY
Example: PRINT, 'Enter ',what,'single numbers and/or
ranges separated by commas'
INSTRING: Character string with user's list of flare numbers.
If this keyword is supplied, the user is not prompted
for input.
ERROR: 0/1 means no error/error in string. Only used when
INSTRING keyword supplied, because otherwise, prompts
user for corrected string.
OPER_STRING: Character string with user's input. The procedure
will return the user's input string if it cannot
interpret user's input string.
OC_OPTIONS: 0/1 means don't print/print additional operator
data entry options in the operator communications
part of the procedure.
PROCEDURE:
Read a line of operator selected flare numbers from the terminal.
Determine the positions of the non-numeric characters in the line.
Use these characters to determine if single numbers or ranges of
numbers should be stored in FLARR. When the end of the line is
reached and if it ends with a semicolon, read another line.
MODIFICATION HISTORY:
Written 07/11/88 by S. Kennard.
Mod. 07/92 by Erika Lin. (1) to return specific string that the
operator has inputed if procedure cannot interpret operator's
input string (keyword: OPER_STRING); and (2) to indicate
whether or not to print additional operator data entry
options in operator communication part of the procedure
(keyword: OC_OPTIONS).
Mod. 04/96 by EAC. Enlarge FLARR to 10000, allows bigger search
parameters
Mod. 05/14/96 by RCJ. Added documentation.
[Previous]
[Next]
Name: fstats
Purpose: vector version of fstat
Input Paramters:
low (optional) - first lun to check - default is free_lun low limit
high (optional) - last lun to check - default is free_lun high limit
name - only return records with mathcing file names
(returns -1 if file not open on any unit)
Optional Keyword Parameters:
all - if set, use entire lun range (starting at lun=1)
name - if set, only record with specified file name (if exists)
Output: function returns vector of fstat structures
Calling Sequence:
fstat=fstats( [low, high, /all, name=name])
CALLED BY:
mtcmd [1], mtcmd [2]
History: (SLF) 2-jun-93
(SLF) 30-jun-94 Implement name function
[Previous]
[Next]
NAME:
FSTRING
PURPOSE:
Wrapper around STRING function to fix pre-V5.4 1024 formatting size limit
EXPLANATION:
Prior to V5.4, the intrinsic STRING() function had a size limit of 1024
elements. FSTRING() works around this by breaking a larger array into 1024 element
element chunks.
CALLING SEQUENCE:
new = fstring(old, [ format, FORMAT = )
INPUTS:
OLD = string or number to format, scalar, vector or array
OPTIONAL STRING:
FORMAT = scalar string giving format to pass to the STRING() function
See restrictions on possible formats below.
CALLED BY:
FORMAT_INTERVALS, TRACE_SSWHERE [1], XCAMP, XCAT, anytim2weekinfo, dark_sub [1]
dark_sub [2], dark_sub [3], get_infox, hsi_energy_list, hsi_format_flare
mdi_time2file, plot_fov [1], timeline, tr_decode_head [1], tr_decode_head [2]
trace_index2macrofov, trace_sswhere [2], trace_sswhere [3], trace_sswhere [4]
trace_uniq_movies, web_seq, xdisp_trace2
OPTIONAL KEYWORD INPUT:
FORMAT = Format string can alternatively be called as keyword
OUTPUT:
FSTRING will return a string with the same dimensions
RESTRICTIONS:
Because FSTRING breaks up the formatting into 1024 element chunks, problems
can arise if the number of formatting elements does not evenly divide
into 1024. For example, if format = '(i6,f6.2,e12.6)', (i.e. three
formatting elements) then both the 1023rd and 1024th element will be
formatted as I6.
EXAMPLE:
Create a string array of 10000 uniform random numbers formatted as F6.2
IDL> a = fstring( randomu(seed,10000), '(f6.2)')
REVISION HISTORY:
Written W. Landsman (based on program by D. Zarro) February 2000
Check if VERSION is V5.4 or later W. Landsman January 2002
[Previous]
[Next]
PROJECT:
SOHO - SUMER
NAME:
FSUMER_DETAIL()
PURPOSE:
Create a fake sumer detail structure
EXPLANATION:
CALLING SEQUENCE:
Result = FSUMER_DETAIL(n_pointings)
INPUTS:
None.
OPTIONAL INPUTS:
N_POINTINGS - Number of pointings areas, default to 1
OUTPUTS:
Result -- A fake detail structure for SUMER containing the following
tags:
STRUCT_TYPE - The character string 'SUMER-DETAIL'
PROG_ID - Program ID, linking one or more studies together
STUDY_ID - Number defining the study
STUDYVAR - The number 0 (for compatibility with CDS software).
SCI_OBJ - Science objective from the daily science meeting
SCI_SPEC - Specific science objective from meeting
CMP_NO - Campaign number
OBJECT - Code for object planned to be observed
OBJ_ID - Object identification
DATE_OBS - Date/time of beginning of observation, in TAI format
DATE_END - Date/time of end of observation, in TAI format
TIME_TAGGED - True (1) if the start of the study is to be a
time-tagged event. Otherwise, the study will begin
immediately after the previous study.
N_POINTINGS - Number of pointing areas associated with the study.
POINTINGS - A array describing the area for each study to be
used during the study. If there are no pointings
associated with the array, then this tag will have a
dummyvalue instead.
The pointing descriptions themselves are structures, of
type "sumer_plan_pnt", with the following tags:
XCEN - Center pointing of the study part in the X direction.
YCEN - Same in the Y direction.
WIDTH - Width to use for the study.
HEIGHT - Height to use for the study.
ZONE_ID - 1-byte integer, the zone ID for the pointing.
ZONE - String, the zone description, e.g. "Off Limb"
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
None.
CALLS:
None.
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written February 13, 1995, Liyun Wang, NASA/GSFC
MODIFICATION HISTORY:
Version 1, Liyun Wang, NASA/GSFC, February 13, 1995
VERSION:
Version 1, February 13, 1995
[Previous]
[Next]
NAME:
FTAB_DELROW
PURPOSE:
Delete rows of data from a FITS ASCII or binary table extension
CALLING SEQUENCE:
ftab_delrow, filename, rows, EXTEN_NO =, NEWFILE = ]
INPUTS-OUPUTS
filename - scalar string giving name of the FITS file containing an
ASCII or binary table extension.
rows - scalar or vector, specifying the row numbers to delete
First row has index 0. If a vector, it will be sorted and
duplicates will be removed
OPTIONAL KEYWORD INPUTS:
EXTEN_NO - scalar integer specifying which extension number to process
Default is to process the first extension
NEWFILE - scalar string specifying the name of the new output FITS file
FTAB_DELROW will prompt for this parameter if not supplied
EXAMPLE:
Compress the first extension of a FITS file 'test.fits' to include
only non-negative values in the 'FLUX' column
ftab_ext,'test.fits','flux',flux ;Obtain original flux vector
bad = where(flux lt 0) ;Find negative fluxes
ftab_delrow,'test.fits',bad,new='test1.fits' ;Delete specified rows
CALLS: ***
FITS_CLOSE, FITS_OPEN, FITS_READ, FITS_WRITE, FTDELROW, TBDELROW
RESTRICTIONS:
Does not work for variable length binary tables
PROCEDURES USED:
FITS_CLOSE, FITS_OPEN, FITS_READ, FITS_WRITE, FTDELROW, TBDELROW
REVISION HISTORY:
Written W. Landsman STX Co. August, 1997
Converted to IDL V5.0 W. Landsman September 1997
Use COPY_LUN if V5.6 or later W. Landsman February 2003
[Previous]
[Next]
NAME:
FTAB_EXT
PURPOSE:
Routine to extract columns from a FITS (binary or ASCII) table.
CALLING SEQUENCE:
FTAB_EXT, name_or_fcb, columns, v1, [v2,..,v9, ROWS=, EXTEN_NO= ]
INPUTS:
name_or_fcb - either a scalar string giving the name of a FITS file
containing a (binary or ASCII) table, or an IDL structure
containing as file control block (FCB) returned by FITS_OPEN
If FTAB_EXT is to be called repeatedly on the same file, then
it is quicker to first open the file with FITS_OPEN, and then
pass the FCB structure to FTAB_EXT
columns - table columns to extract. Can be either
(1) String with names separated by commas
(2) Scalar or vector of column numbers
OUTPUTS:
v1,...,v9 - values for the columns. Up to 9 columns can be extracted
OPTIONAL INPUT KEYWORDS:
ROWS - scalar or vector giving row number(s) to extract
Row numbers start at 0. If not supplied or set to
-1 then values for all rows are returned
EXTEN_NO - Extension number to process. If not set, then data is
extracted from the first extension in the file (EXTEN_NO=1)
CALLS: ***
FITS_CLOSE, FITS_OPEN, FITS_READ, FTGET, FTINFO, TBGET, TBINFO, strsplit
EXAMPLES:
Read wavelength and flux vectors from the first extension of a
FITS file, 'spec.fit'. Using FTAB_HELP,'spec.fit' we find that this
information is in columns named 'WAVELENGTH' and 'FLUX' (in columns 1
and 2). To read the data
IDL> ftab_ext,'spec.fit','wavelength,flux',w,f
or
IDL> ftab_ext,'spec.fit',[1,2],w,f
PROCEDURES CALLED:
FITS_READ, FITS_CLOSE, FTINFO, FTGET(), TBINFO, TBGET()
HISTORY:
version 1 W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
Improve speed processing binary tables W. Landsman March 2000
Use new FTINFO calling sequence W. Landsman May 2000
Don't call fits_close if fcb supplied W. Landsman May 2001
Use STRSPLIT to parse column string W. Landsman July 2002
Cleanup pointers in TBINFO structure W. Landsman November 2003
Avoid EXECUTE() if V6.1 or later W. Landsamn December 2006
[Previous]
[Next]
NAME:
FTAB_HELP
PURPOSE:
Describe the columns of a FITS binary or ASCII table extension(s).
CALLING SEQUENCE:
FTAB_HELP, filename, [ EXTEN_No = , TEXTOUT= ]
or
FTAB_HELP, fcb, [EXTEN_No=, TEXTOUT= ]
INPUTS:
filename - scalar string giving name of the FITS file.
fcb - FITS control block returned by a previous call to FITS_OPEN
OPTIONAL KEYWORD INPUTS:
EXTEN_NO - integer scalar or vector specifying which FITS extensions
to display. Default is to display all FITS extension.
TEXTOUT - scalar number (0-7) or string (file name) determining
output device (see TEXTOPEN). Default is TEXTOUT=1, output
to the user's terminal
CALLS: ***
FITS_CLOSE, FITS_OPEN, FITS_READ, FTHELP, SXPAR [1], SXPAR [2], SXPAR [3], TBHELP
TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2]
TEXTOPEN [3]
EXAMPLE:
Describe the columns in the second and fourth extensions of a FITS
file spec.fits and write the results to a file 'spec24.lis'
IDL> ftab_help,'spec.fits',exten=[2,4],t='spec24.lis'
SYSTEM VARIABLES:
Uses the non-standard system variables !TEXTOUT and !TEXTUNIT
which must be defined (e.g. with ASTROLIB) before compilation
NOTES:
The behavior of FTAB_HELP was changed in August 2005 to display
all extensions by default, rather than just the first extension
PROCEDURES USED:
FITS_READ, FITS_CLOSE, FITS_OPEN, FTHELP, TBHELP, TEXTOPEN, TEXTCLOSE
HISTORY:
version 1 W. Landsman August 1997
Corrected documentation W. Landsman September 1997
Don't call fits_close if fcb supplied W. Landsman May 2001
Default now is to display all extensions, EXTEN keyword can now
be a vector W. Landsman Aug 2005
[Previous]
[Next]
NAME:
FTAB_PRINT
PURPOSE:
Print the contents of a FITS (binary or ASCII) table extension.
EXPLANATION:
User can specify which rows or columns to print
CALLING SEQUENCE:
FTAB_PRINT, filename, columns, rows, [ TEXTOUT=, FMT=, EXTEN_NO=]
INPUTS:
filename - scalar string giving name of a FITS file containing a
binary or ASCII table
columns - string giving column names, or vector giving
column numbers (beginning with 1). If string
supplied then column names should be separated by comma's.
rows - (optional) vector of row numbers to print (beginning with 0).
If not supplied or set to scalar, -1, then all rows
are printed.
CALLS: ***
FITS_CLOSE, FITS_OPEN, FITS_READ, FTPRINT, TBPRINT
OPTIONAL KEYWORD INPUT:
EXTEN_NO - Extension number to read. If not set, then the first
extension is printed (EXTEN_NO=1)
TEXTOUT - scalar number (0-7) or string (file name) determining
output device (see TEXTOPEN). Default is TEXTOUT=1, output
to the user's terminal
FMT = Format string for print display (binary tables only). If not
supplied, then any formats in the TDISP keyword fields will be
used, otherwise IDL default formats. For ASCII tables, the
format used is always as stored in the FITS table.
EXAMPLE:
Print all rows of the first 5 columns of the first extension of the
file 'wfpc.fits'
IDL> ftab_print,'wfpc.fits',indgen(5)+1
SYSTEM VARIABLES:
Uses the non-standard system variables !TEXTOUT and !TEXTUNIT
which must be defined (e.g. with ASTROLIB) prior to compilation.
PROCEDURES USED:
FITS_OPEN, FITS_READ, FTPRINT, TBPRINT
HISTORY:
version 1 W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FTADDCOL
PURPOSE:
Routine to add a field to a FITS ASCII table
CALLING SEQUENCE:
ftaddcol, h, tab, name, idltype, [ tform, tunit, tscal, tzero, tnull ]
INPUTS:
h - FITS table header. It will be updated as appropriate
tab - FITS table array. Number of columns will be increased if
neccessary.
name - field name, scalar string
idltype - idl data type (as returned by SIZE function) for field,
For string data (type=7) use minus the string length.
OPTIONAL INPUTS:
tform - format specification 'qww.dd' where q = A, I, E, or D
tunit - string giving physical units for the column.
tscal - scale factor
tzero - zero point for field
tnull - null value for field
Use '' as the value of tform,tunit,tscal,tzero,tnull if you want
the default or no specification of them in the table header.
OUTPUTS:
h,tab - updated to allow new column of data
PROCEDURES USED:
FTINFO, FTSIZE, GETTOK(), SXADDPAR
CALLS: ***
FTINFO, FTSIZE, GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], SXADDPAR [1]
SXADDPAR [2], SXADDPAR [3]
CALLED BY:
FTPUT, T_APER, T_FIND, T_GETPSF, T_GROUP, T_NSTAR
HISTORY:
version 1 D. Lindler July, 1987
Converted to IDL V5.0 W. Landsman September 1997
Updated call to new FTINFO W. Landsman April 2000
[Previous]
[Next]
NAME:
FTCREATE
PURPOSE:
Create a new (blank) FITS ASCII table and header with specified size.
CALLING SEQUENCE:
ftcreate, maxcols, maxrows, h, tab
INPUTS:
maxcols - number of character columns allocated, integer scalar
maxrows - maximum number of rows allocated, integer scalar
OUTPUTS:
h - minimal FITS Table extension header, string array
OPTIONAL OUTPUT:
tab - empty table, byte array
CALLS: ***
SXADDPAR [1], SXADDPAR [2], SXADDPAR [3]
CALLED BY:
T_FIND
HISTORY:
version 1 D. Lindler July. 87
Converted to IDL V5.0 W. Landsman September 1997
Make table creation optional, allow 1 row table, add comments to
required FITS keywords W. Landsman October 2001
[Previous]
[Next]
NAME:
FTDELCOL
PURPOSE:
Delete a column of data from a FITS table
CALLING SEQUENCE:
ftdelcol, h, tab, name
INPUTS-OUPUTS
h,tab - FITS table header and data array. H and TAB will
be updated with the specified column deleted
INPUTS:
name - Either (1) a string giving the name of the column to delete
or (2) a scalar giving the column number to delete
CALLS: ***
FTINFO, FTSIZE, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3]
EXAMPLE:
Suppose it has been determined that the F7.2 format used for a field
FLUX in a FITS table is insufficient. The old column must first be
deleted before a new column can be written with a new format.
flux = FTGET(h,tab,'FLUX') ;Save the existing values
FTDELCOL,h,tab,'FLUX' ;Delete the existing column
FTADDCOL,h,tab,'FLUX',8,'F9.2' ;Create a new column with larger format
FTPUT,h,tab,'FLUX',0,flux ;Put back the original values
REVISION HISTORY:
Written W. Landsman STX Co. August, 1988
Adapted for IDL Version 2, J. Isensee, July, 1990
Converted to IDL V5.0 W. Landsman September 1997
Updated call to new FTINFO W. Landsman May 2000
[Previous]
[Next]
NAME:
FTDELROW
PURPOSE:
Delete a row of data from a FITS table
CALLING SEQUENCE:
ftdelrow, h, tab, rows
INPUTS-OUPUTS
h,tab - FITS table header and data array. H and TAB will
be updated on output with the specified row(s) deleted.
rows - scalar or vector, specifying the row numbers to delete
This vector will be sorted and duplicates removed by FTDELROW
CALLS: ***
REM_DUP [1], REM_DUP [2], REM_DUP [3], SXADDPAR [1], SXADDPAR [2], SXADDPAR [3]
SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FTAB_DELROW
EXAMPLE:
Compress a table to include only non-negative flux values
flux = FTGET(h,tab,'FLUX') ;Obtain original flux vector
bad = where(flux lt 0) ;Find negative fluxes
FTDELROW,h,tab,bad ;Delete rows with negative fluxes
PROCEDURE:
Specified rows are deleted from the data array, TAB. The NAXIS2
keyword in the header is updated.
PROCEDURES USED:
sxaddpar
REVISION HISTORY:
Written W. Landsman STX Co. August, 1988
Checked for IDL Version 2, J. Isensee, July, 1990
Converted to IDL V5.0 W. Landsman September 1997
Assume since V5.4, use BREAK instead of GOTO W. Landsman April 2006
[Previous]
[Next]
NAME:
FTGET
PURPOSE:
Function to return value(s) from specified column in a FITS ASCII table
CALLING SEQUENCE
values = FTGET( h, tab, field, [ rows, nulls ] )
or
values = FTGET( ft_str, tab, field. [rows, nulls]
INPUTS:
h - FITS ASCII extension header (e.g. as returned by FITS_READ)
or
ft_str - FITS table structure extracted from FITS header by FTINFO
Use of the IDL structure will improve processing speed
tab - FITS ASCII table array (e.g. as returned by FITS_READ)
field - field name or number
OPTIONAL INPUTS:
rows - scalar or vector giving row number(s)
Row numbers start at 0. If not supplied or set to
-1 then values for all rows are returned
OUTPUTS:
the values for the row are returned as the function value.
Null values are set to 0 or blanks for strings.
OPTIONAL OUTPUT:
nulls - null value flag of same length as the returned data.
It is set to 1 at null value positions and 0 elsewhere.
If supplied then the optional input, rows, must also
be supplied.
CALLS: ***
FTINFO
CALLED BY:
FTAB_EXT, FTSORT, ST_DISKREAD, ST_DISK_DATA, ST_DISK_GEIS, ST_DISK_TABLE, T_APER
T_GETPSF, T_GROUP, T_NSTAR, T_SUBSTAR, WFPC2_READ
EXAMPLE:
Read the columns labeled 'WAVELENGTH' and 'FLUX' from the second
(ASCII table) extension of a FITS file 'spectra.fit'
IDL> fits_read,'spectra.fit',tab,htab,exten=2 ;Read 2nd extension
IDL> w = ftget( htab, tab,'wavelength') ;Wavelength vector
IDL> f = ftget( htab, tab,'flux') ;Flux vector
Slightly more efficient would be to first call FTINFO
IDL> ftinfo, htab, ft_str ;Extract structure
IDL> w = ftget(ft_str, tab,'wavelength') ;Wavelength vector
IDL> f = ftget(ft_str, tab,'flux') ;Flux vector
NOTES:
(1) Use the higher-level procedure FTAB_EXT to extract vectors
directly from the FITS file.
(2) Use FTAB_HELP or FTHELP to determine the columns in a particular
ASCII table.
HISTORY:
coded by D. Lindler July, 1987
Always check for null values W. Landsman August 1990
More informative error message W. Landsman Feb. 1996
Converted to IDL V5.0 W. Landsman September 1997
Allow structure rather than FITS header W. Landsman May 2000
No case sensitivity in TTYPE name W. Landsman February 2002
[Previous]
[Next]
NAME:
FTHELP
PURPOSE:
Routine to print a description of a FITS ASCII table extension
CALLING SEQUENCE:
FTHELP, H, [ TEXTOUT = ]
INPUTS:
H - FITS header for ASCII table extension, string array
OPTIONAL INPUT KEYWORD
TEXTOUT - scalar number (0-7) or string (file name) determining
output device (see TEXTOPEN). Default is TEXTOUT=1, output
to the user's terminal
NOTES:
FTHELP checks that the keyword XTENSION equals 'TABLE' in the FITS
header.
SYSTEM VARIABLES:
Uses the non-standard system variables !TEXTOUT and !TEXTUNIT
which must be defined (e.g. with ASTROLIB) prior to compilation.
PROCEDURES USED:
REMCHAR, SXPAR(), TEXTOPEN, TEXTCLOSE, ZPARCHECK
CALLS: ***
REMCHAR [1], REMCHAR [2], REMCHAR [3], SXPAR [1], SXPAR [2], SXPAR [3]
TEXTCLOSE [1], TEXTCLOSE [2], TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2]
TEXTOPEN [3], ZPARCHECK [1], ZPARCHECK [2], ZPARCHECK [3]
CALLED BY:
FTAB_HELP
HISTORY:
version 1 W. Landsman Jan. 1988
Add TEXTOUT option, cleaner format W. Landsman September 1991
TTYPE value can be longer than 8 chars, W. Landsman August 1995
Remove calls to !ERR, some vectorization W. Landsman February 2000
Slightly more compact display W. Landsman August 2005
[Previous]
[Next]
NAME:
FTHMOD
PURPOSE:
Procedure to modify header information for a specified field
in a FITS table.
CALLING SEQUENCE:
fthmod, h, field, parameter, value
INPUT:
h - FITS header for the table
field - field name or number
parameter - string name of the parameter to modify. Choices
include:
(eg. '***'), TFORM - format specification for the field
TNULL - null value (string) for field, TSCAL - scale factor
TTYPE - field name, TUNIT - physical units for field (eg. 'ANGSTROMS')
TZERO - zero offset
User should be aware that the validity of the change is
not checked. Unless you really know what you are doing
or another user specified parameter.
standards documentation for valid values.
this routine should only be used to change field names, units
value - new value for the parameter. Refer to the FITS table
CALLS: ***
FTINFO, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3]
EXAMPLE:
Change the units for a field name "FLUX" to "Janskys" in a FITS table
header,h
IDL> FTHMOD, h, 'FLUX', 'TUNIT','Janskys'
METHOD:
The header keyword <parameter><field number> is modified
with the new value.
HISTORY:
version 1, D. Lindler July 1987
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite to use new FTINFO call W. Landsman May 2000
[Previous]
[Next]
NAME:
FTINFO
PURPOSE:
Return an informational structure from a FITS ASCII table header.
CALLING SEQUENCE:
ftinfo,h,ft_str, [Count = ]
INPUTS:
h - FITS ASCII table header, string array
OUTPUTS:
ft_str - IDL structure with extracted info from the FITS ASCII table
header. Tags include
.tbcol - starting column position in bytes
.width - width of the field in bytes
.idltype - idltype of field.
7 - string, 4- real*4, 3-integer, 5-real*8
.tunit - string unit numbers
.tscal - scale factor
.tzero - zero point for field
.tnull - null value for the field
.tform - format for the field
.ttype - field name
OPTIONAL OUTPUT KEYWORD:
Count - Integer scalar giving number of fields in the table
PROCEDURES USED:
GETTOK(), SXPAR()
NOTES:
This procedure underwent a major revision in May 2000, and **THE
NEW CALLING SEQUENCE IS INCOMPATIBLE WITH THE OLD ONE **
CALLS: ***
SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FTAB_EXT, FTADDCOL, FTDELCOL, FTGET, FTHMOD, FTPRINT, FTPUT, FTSORT, ST_DISKREAD
ST_DISK_DATA, ST_DISK_GEIS, ST_DISK_TABLE, T_APER, T_GETPSF, T_GROUP, T_NSTAR
T_SUBSTAR, WFPC2_READ
HISTORY:
D. Lindler July, 1987
Converted to IDL V5.0 W. Landsman September 1997
Major rewrite, return structure W. Landsman April 2000
[Previous]
[Next]
NAME:
FTKEEPROW
PURPOSE:
Subscripts (and reorders) a FITS table. A companion piece to FTDELROW.
CALLING SEQUENCE:
ftkeeprow, h, tab, subs
INPUT PARAMETERS:
h = FITS table header array
tab = FITS table data array
subs = subscript array of FITS table rows. Works like any other IDL
subscript array (0 based, of course).
OUTPUT PARAMETERS:
h and tab are modified
CALLS: ***
SXADDHIST [1], SXADDHIST [2], SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXPAR [1]
SXPAR [2], SXPAR [3]
MODIFICATION HISTORY:
Written by R. S. Hill, ST Sys. Corp., 2 May 1991.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Project : HESSI
Name : FTOTAL
Purpose : Wrapper for IDL's TOTAL function that is less restrictive
Category : Utility
Explanation : IDL's TOTAL function crashes if the dimension you want to sum over
has only one element, or if the dimension isn't there. In the first case,
FTOTAL returns the array with the single dimension removed. In the second
case, FTOTAL returns the array unchanged. Otherwise, FTOTAL acts just
like TOTAL.
Syntax : IDL> result = ftotal (array, dimension)
Inputs : array - array to be summed
Opt. Inputs : dimension - dimension over which to sum (starting at 1)
Outputs : Returns sum of elements in array, or sum over dimension if dimension is specified
Keywords : Any keywords that total takes
CALLS: ***
EXIST, REMOVE [1], REMOVE [2]
CALLED BY:
SPEX_GEN__DEFINE
Common : None
Restrictions: None
Side effects: None
History : 25-Aug-2001, Kim Tolbert
Contact : kim.tolbert@gsfc.nasa.gov
[Previous]
[Next]
Project : HESSI
Name : FTP__DEFINE
Purpose : Define an FTP client object
Category : System
Explanation : Object wrapper around FTP
Syntax : This procedure is invoked when a new FTP object is
created via:
IDL> new=obj_new('ftp')
Default settings are:
user='anonymous' ;-- anonymous ftp
pass='user@hostname'
ldir=cwd ;-- copy to current directory
rdir='.' ;-- copy from top login directory
CALLS: ***
APPEND_ARR, ARR2STR [1], Arr2Str [2], CHKLOG [1], CHKLOG [2], CHMOD, CLOSE_LUN, DPRINT
ESPAWN, EXIST, FILE_BREAK, FTP::ASCII, FTP::BINARY, FTP::CD, FTP::CDUP, FTP::CLEANUP
FTP::CLOBBER, FTP::DIR, FTP::FGET, FTP::INIT, FTP::INSERT, FTP::LAUNCH_CMD, FTP::LCD
FTP::LIST_CMD, FTP::LOC_FILE, FTP::LOGIN, FTP::LOGIN_CMD, FTP::LS, FTP::MGET
FTP::OPEN, FTP::PASS, FTP::PING, FTP::PORT, FTP::PWD, FTP::SETPROP, FTP::SHOW
FTP::USER, FTP::VALID, FTP::VERBOSE, GET_DELIM, GET_TEMP_DIR, GET_USER_ID, IS_BLANK
IS_DIR, IS_STRING, LOCAL_NAME, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
MK_TEMP_FILE, OBJ_STRUCT, OS_FAMILY, PTR_ALLOC, RD_ASCII [1], RD_ASCII [2]
STR2ARR [1], STR2ARR [2], STR_TRAIL, TRIM, WRITE_DIR, XKILL, XTEXT, curdir [1]
curdir [2], get_uniq, is_alive [1], is_alive [2], is_number [1], is_number [2]
read_ftp, str_replace [1], str_replace [2]
Examples : ftp=obj_new('ftp')
ftp->open,host ;-- connect to hostname
ftp->ls ;-- list remote directory
ftp->pass,password ;-- set password
ftp->user,user_name ;-- set username
ftp->cd,dir_name ;-- set remote directory
ftp->lcd,dir_name ;-- set local directory
ftp->mget,file_name ;-- get file_name
ftp->pwd ;-- print working directory
ftp->show ;-- show current settings
ftp->put,file_name ;-- put filename [not implemented]
ftp->setprop,rfile=rfile ;-- set remote filename to copy
ftp->setprop,lfile=lfile ;-- set local name of copied file
ftp->clobber,1 [0] ;-- set to clobber existing file
ftp->getprop(/rdir,/ldir,/rfile) ;-- get remote dirs, local dirs,
;remote file
Inputs : 'ftp' = object classname
Outputs : Object with above methods
History : Written 15 Nov 1999, D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FTP_BBSO
Purpose : FTP BBSO H-alpha files for a given date
Category : planning
Explanation : FTP's BBSO Full-Disk H-alpha JPEG files
and renames them to SOHO convention
Syntax : ftp_bbso,date,files=files
Examples :
Inputs : DATE = start date to retrieve
Opt. Inputs : EDATE = end date to retrieve
Outputs : None
Opt. Outputs: None
Keywords :
FILES = found and renamed filenames
OUT_DIR = output directory for file [def = current]
ERR = error string
COUNT = no of files copied
BACK= # of days backward to look [def=0]
MONTH = copy whole month
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2]
BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATE_CODE
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DPRINT, ESPAWN, EXIST, GET_UTC
IS_DIR, SMART_FTP, WRITE_DIR, break_file [4], concat_dir [4], curdir [1], curdir [2]
delvarx [5]
Common : None
Restrictions: Unix only
Side effects: None
History : Written 14 May 1998 D. Zarro, SAC/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
ftp_copy
PURPOSE:
To build an FTP command and execute it from IDL (Default=PUT)
CALLING SEQUENCE:
ftp_copy, files, node [,user,passwd,direct,/anon, /get]
ftp_copy, node, subdir='remote_sub', /anon, /list, dirlist=dirlist
Calling Examples:
ftp_copy, node, 'pub/yohkoh', /list, dirlist=dirlist, /anon
(return directory listing <dirlist> from <node>, anonymous ftp)
ftp_copy, files, node, 'pub/yohkoh', /get, /anon
(get <files> from <node> in subdirectory pub/yohkoh, anonmous ftp)
INPUT:
files - The file names to be copied. For /GET they are the
file names on the remote system
node - The node name or number
user - The user name (will use 'ftp' if /anon is set)
passwd - The password (will use USER@LOCAL if /anon is set)
OPTIONAL INPUT:
dir - The remote directory
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], FILE_EXIST [2], break_file [4], concat_dir [4], file_append [1]
file_append [2], file_exist [1], file_exist [3], get_host [1], get_host [2]
get_logenv [1], get_logenv [2], get_user [1], get_user [2], is_alive [1]
is_alive [2], rd_tfile [1], rd_tfile [2]
CALLED BY:
NET_DIR_DIFF, daily_forecast [2], ftp_copy2sites, ftp_copy_new, get_mk3 [1]
get_mk3 [2], get_selsis, ksc_commands, msok_copy_jpg, msok_poi_copy [1]
msok_poi_copy [2], nobeyama_update, selsis_copy [1], selsis_copy [2]
selsisi_copy, timeline, topsdb [1], topsdb [2], web_seq
OPTIONAL KEYWORD INPUT:
get - If set, do a "get" instead of a "put"
outfil - The file name can be changed by passing the output file
name. The default is to make it the same as the input.
This cannot be used with the OUTDIR option.
outdir - The local directory (generally used with a "get"
ftp_log - The name of the log file that the FTP results should be
written to
logappend - If set, then append the message to the "ftp_log" file
noftp - If set, generate ftp script but dont spawn it
ftp_file - Name of ftp script file (default is $HOME/ftp_copy.ftp)
anonymous - If set, use anon ftp protocal for user and password
(in this case, third parameter is used for DIR if present)
ascii/binary - if set, specifies transfer mode (default is binary)
list - switch, if set, do directory listing (return via DIRLIST keyword)
expect_sizes - vector of expected sizes for files
(if set, status(i)=file_exist(i) AND ((file_size(i) eq expect_sizes(i))
rev_time_dir - if set, causes the 'dir *' request (for file listing) from
ftp node to be 'dir -t'. Useful if directory is very large, and
want most recent files: less chance of losing tail of dir
listing.
OPTIONAL KEYWORD OUTPUTS:
dirlist - (OUTPUT) - return remoted directory listing if /LIST is set
status - (OUTPUT) - boolean success vector, 1 element per file
(currently, only for /get)
ftp_results - Any messages that the FTP commands produce (errors, ...)
qnode - 0 if ping fails, 1 if ping is successful.
METHOD:
Binary is the default method of transfer (use /ascii to override)
DEFAULT is PUT (historical; GET is used much more frequently...)
HISTORY:
Written 11-Oct-93 by M.Morrison
19-Oct-93 (MDM) - Added FTP_RESULTS keyword. Changed things slightly
3-May-94 (SLF) - Major RE-write, add ANONYMOUS, FTP_FILE & NOFTP
keywords and function,use file_append, file_delete
5-May-94 (SLF) - dont LCD for /gets, Add STATUS output keyword
10-May-94 (SLF) - add ASCII and BINARY keywords and function
1-Mar-95 (SLF) - add LIST keyword and function
15-apr-95 (SLF) - fixed bug with LIST option
10-may-95 (SLF) - add ping check (default) and NOPING keyword
avoid hung ftp jobs
2-aug-95 (SLF) - dont clobber input, change def. scriptdir(HOME), documentation
29-jan-96 (JRL) - Fixed status and added qnode keyword
13-may-97 (SLF) - Add EXPECT_SIZES keyword and function
(protection against ftp connection dropouts, partially transmitted files)
14-may-98 (PGS) - added rev_time_dir. Tail of directory listing of long
on ftp node was getting lost. This places the most recent files
first, -- ensures I get most recent files even if lose some older
ones.
17-Feb-99 (MDM) - Code from "noping" to "no_ping" to enable that keyword option
[Previous]
[Next]
NAME:
ftp_copy_new
PURPOSE:
Wrapper to call ftp_copy. Does a remote listing on the source
macine before deciding if the ftp is necessary or not.
CALLING SEQUENCE:
ftp_copy_new, files, node, /anon
ftp_copy_new, files, node, subdir='remote_sub', /anon, /list, dirlist=dirlist
ftp_copy_new, files, node, user, passwd
INPUT:
file - The file names to be copied from the remote system.
node - The node name or number
OPTIONAL INPUT:
user - The user name (will use 'ftp' if /anon is set)
passwd - The password (will use USER@LOCAL if /anon is set)
CALLS: ***
COMP_FIL_LIST, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DELVARX [1]
DELVARX [2], DELVARX [3], DELVARX [4], FILE_EXIST [2], concat_dir [4], delvarx [5]
file_append [1], file_append [2], file_exist [1], file_exist [3], fmt_tim [1]
fmt_tim [2], ftp_copy [1], ftp_copy [2], prstr [1], prstr [2], rd_tfile [1]
rd_tfile [2], str2cols [1], str2cols [2], strjustify
OPTIONAL KEYWORD INPUT:
get - Only works with get (default).
outdir - The local directory (where ftp'ed files are written).
ftp_log - The name of the log file that the FTP results are written.
logappend - If set, then append the message to the "ftp_log" file.
noftp - If set, generate ftp script but don't spawn it.
ftp_file - Name of ftp script file (default is $HOME/ftp_copy.ftp)
anonymous - If set, use anon ftp protocol for user and password
(in this case, third parameter is used for DIR if present)
ascii/binary - If set, specifies transfer mode (default is binary).
list - switch, if set, do directory listing (return via DIRLIST keyword)
local_log_file - Name of a local file which has the previous /list results.
This file is read to see if a new ftp copy is necessary.
If not present, will read all files specified in 1st arg.
no_ping - Ignored in ftp_comp_new. Always do a ping.
rev_time_dir - Causes first call to ftp_copy (to obtain directory list)
to be for files ordered from youngest-to-oldest ('dir -t').
OPTIONAL KEYWORD OUTPUTS:
dirname - Name of the remote directory list file.
dirlist - Return remote directory listing if /LIST is set
status - Different from ftp_copy. 0 means no files copied.
If gt 0, is the number of files copied. If -1,
the node could not be accessed.
outfil - This different from the ftp_copy keyword of the same name.
In ftp_copy_new it is a listing of copied files.
ftp_results - Any messages that the FTP commands produce (errors, ...)
qnode - 0 if ping fails, 1 if ping is successful.
check_size - switch, if set, pass sizes->ftp_copy
expect_size - expected file size array (usually derived from
remote directory list, but may be used for debugging
METHOD:
Binary is the default method of transfer (use /ascii to override)
DEFAULT is PUT (historical; GET is used much more frequently...)
Calls comp_fil_list and ftp_copy
HISTORY:
2-Feb-96, J. R. Lemen (LPARL), Written.
28-Feb-96, JRL, Delete local list file before writing new version ==> correct owner.
24-jul-97, S.L.Freeland add /CHECK_SIZE and EXPECT_SIZE keyword/function
14-may-98, P. G. Shirts: added rev_time_dir keyword (to pass to /list call to
ftp_copy)
[Previous]
[Next]
Project : SOHO-CDS
Name : FTP_HEADER
Purpose : standard FTP header to include in FTP access routines
Category : planning
History : Written 14 Jan 1998 D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FTP_KISF
Purpose : FTP Kiepenheuer-Institut H-alpha files for a given date
Category : planning
Explanation : FTP's KIS Full-Disk H-alpha files
Syntax : ftp_kisf,files=files,date
Examples :
Inputs : None
Opt. Inputs : DATE = date to retrieve
Outputs : None
Opt. Outputs: None
Keywords : FILES = found filenames
OUT_DIR = output directory for file [def = current]
ERR = error string
COUNT = no of files copied
BACK= # of days backward to look [def=0]
FITS = look for FITS files
MONTH = copy whole month
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, DATE_CODE, DELVARX [1], DELVARX [2]
DELVARX [3], DELVARX [4], DPRINT, EXIST, GET_UTC, IS_DIR, SMART_FTP, WRITE_DIR
curdir [1], curdir [2], delvarx [5]
Common : None
Restrictions: Unix only
Side effects: None
History : Written 8 June 1998 D. Zarro, SAC/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Name: ftp_list_since
Purpose: return ftp file list newer than or older than NDAYS (or NHOURS)
Input Parameters:
listing - strarr list from ftp 'ls' or 'dir' (or ftp url)
ndays - number of days for compare
Output Parameters:
function returns files more recent (or older) than specified
Calling Examples:
IDL> newf=ftp_list_since(ftplisting,NHOURS=12,UTOFF=-5) ; <=12 hrs. old
IDL> oldf=ftp_list_since(ftplisting,NDAYS=100,/OLDER) ; >=100 days old
Keyword Parameters:
OLDER - if set, files older than {NDAYS or NHOURS} - def=NEWER
NDAYS - desired window in #DAYS
NHOURS - desired window in #HOURS
UTOFF - optionally, dT(ftp server times:UT) ; signed hours from UT
UPAT - optional uniq string pat to consider - default = '-r'
COUNT (output) - number of files returned
FTIMES (output) - times of files returned (server time zone)
CALLS: ***
BOX_MESSAGE, SOCK_LIST, STRTAB2VECT, data_chk [1], data_chk [2], reltime [1]
reltime [2], ssw_deltat, str2cols [1], str2cols [2], where_pattern [1]
where_pattern [2]
Restrictions:
Must supply either NDAYS or NHOURS
use of ftp://<url> instead of listing implies anon ftp -and-
IDL V>=5.4 (via sockets) - NOT YET TESTED...
Note: time zone of the ftp sever is unknown so if you are worried
about granularity on order of NHOURS instead of NDAYS, you may want to
supply UTOFF (or ~equivlently, pad NHOURS accordingly..)
[Previous]
[Next]
Project : HESSI
Name : FTP_MESOLA
Purpose : FTP data from MESOLA site
Category : GBO ancillary
Syntax : ftp_mesol,tstart,files=files
Inputs : TSTART = start date to retrieve [def = current day]
Opt. Inputs : TEND = end date to retrieve [def = end of current day]
Keywords : FILES = files found
OUT_DIR = output directory for file [def = /tmp]
ERR = error string
COUNT = no of files copied
LIST = list only
QUIET = suppress messages
SITE = PIC, NANCAY, MEUDON
TYPE = HALPHA, K1V, K3
EXT = GIF, FITS
History : 14 Dec 1999 D. Zarro (SM&A/GSFC) - written
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FTP_MLSO_IMAGES
Purpose : FTP MLSO MK3 coronameter GIF images
Category : planning
Explanation :
Syntax : ftp_mlso,date,files=files
Examples :
Inputs : DATE = date to retrieve
Opt. Inputs : EDATE = end date to retieve
Outputs : None
Opt. Outputs: None
Keywords : FILES = found and renamed filenames
OUT_DIR = output directory for file [def = current]
ERR = error string
COUNT = no of files copied
BACK= # of days backward to look [def=0]
MONTH = copy whole month
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2]
BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATE_CODE
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DOY2UTC, DPRINT, ESPAWN, EXIST
FTP_MLSO, GET_UTC, IS_DIR, NUM2STR, SMART_FTP, UTC2DOY, WRITE_DIR, break_file [4]
concat_dir [4], curdir [1], curdir [2], delvarx [5]
Common : None
Restrictions: Unix only
Side effects: None
History : Written 18 Dec 1998 D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FTP_MWSO
Purpose : FTP Mt. Wilson Solar Tower images for a given date
Category : planning
Explanation : spawns anonymous FTP
Syntax : ftp_mwso,date,files=files
Inputs : DATE = start date to retrieve
Opt. Inputs : EDATE = end date to retrieve
Keywords :
FILES = found and renamed filenames
OUT_DIR = output directory for files [def = current]
ERR = error string
COUNT = no of files copied
BACK= # of days backward to look [def=0]
MONTH = copy whole month
FITS = copy FITS files instead
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2]
BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATE_CODE
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DPRINT, ESPAWN, EXIST, GET_UTC
IS_DIR, SMART_FTP, STR_FORMAT, TRIM, WRITE_DIR, break_file [4], concat_dir [4]
curdir [1], curdir [2], delvarx [5], is_number [1], is_number [2]
History : Written 7 June 1999, D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : HESSI
Name : FTP_NOBE
Purpose : FTP Nobeyama radio data
Category : planning synoptic
Explanation : FTP's Nobeyama FITS file nearest to input time
and renames it to IAU convention.
Syntax : ftp_bbso,date,files=files
Examples :
Inputs : DATE = start date to retrieve
Opt. Inputs : EDATE = end date to retrieve
Outputs : None
Opt. Outputs: None
Keywords :
FILES = found and renamed filenames
OUT_DIR = output directory for file [def = current]
ERR = error string
COUNT = no of files copied
BACK= # of days backward to look [def=0]
DAY = copy whole day
EVENT = copy EVENT data
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2]
BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATE_CODE
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DPRINT, ESPAWN, EXIST, GET_UTC
IS_DIR, SMART_FTP, WRITE_DIR, break_file [4], concat_dir [4], curdir [1], curdir [2]
delvarx [5]
Restrictions: Unix only
History : Written 14 Oct 1999 D. Zarro, SM&A/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
Project : SOHO-CDS
Name : FTP_SYNOP
Purpose : Driver to ftp synoptic images for a given date
Category : planning
Explanation : calls appropriate FTP function
Syntax : ftp_synop,site,date
Examples :
Inputs : SITE = site name to search
Opt. Inputs : DATE = date to retrieve
Outputs :
Opt. Outputs: None
Keywords : MAIL = send some mail
FITS = copy FITS files (normally GIF)
LINK = link created files to $SYNOP_DATA/site
BACK = # of days back to search
CALLS: ***
ANYTIM2UTC [1], ANYTIM2UTC [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1]
CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], ESPAWN
EXIST, FILE2FID, GET_USER_ID, GET_UTC, IS_DIR, LOC_FILE [1], LOC_FILE [2]
LOC_FILE [3], MK_DIR, PR_SYNTAX, SEND_MAIL, TEST_DIR, TRIM, concat_dir [4], curdir [1]
curdir [2]
Common : None
Restrictions: Unix only
Side effects: None
History : Written 14 May 1998 D. Zarro, SAC/GSFC
Contact : dzarro@solar.stanford.edu
[Previous]
[Next]
NAME:
FTPRINT
PURPOSE:
Procedure to print specified columns and rows of a FITS table
CALLING SEQUENCE:
FTPRINT, h, tab, columns, [ rows, TEXTOUT = ]
INPUTS:
h - Fits header for table, string array
tab - table array
columns - string giving column names, or vector giving
column numbers (beginning with 1). If string
supplied then column names should be separated by comma's.
rows - (optional) vector of row numbers to print. If
not supplied or set to scalar, -1, then all rows
are printed.
OUTPUTS:
None
OPTIONAL INPUT KEYWORDS:
TEXTOUT controls the output device; see the procedure TEXTOPEN
SYSTEM VARIABLES:
Uses nonstandard system variables !TEXTOUT and !TEXTOPEN
These will be defined (using ASTROLIB) if not already present.
Set !TEXTOUT = 3 to direct output to a disk file. The system
variable is overriden by the value of the keyword TEXTOUT
CALLED BY:
FTAB_PRINT
EXAMPLES:
ftprint,h,tab,'STAR ID,RA,DEC' ;print id,ra,dec for all stars
ftprint,h,tab,[2,3,4],indgen(100) ;print columns 2-4 for
;first 100 stars
ftprint,h,tab,text="stars.dat" ;Convert entire FITS table to
;an ASCII file named STARS.DAT
PROCEDURES USED:
FTSIZE, FTINFO, TEXTOPEN, TEXTCLOSE
CALLS: ***
ASTROLIB, FTINFO, FTSIZE, STRN [1], STRN [2], STRN [3], TEXTCLOSE [1], TEXTCLOSE [2]
TEXTCLOSE [3], TEXTOPEN [1], TEXTOPEN [2], TEXTOPEN [3], strsplit
RESTRICTIONS:
(1) Program does not check whether output length exceeds output
device capacity (e.g. 80 or 132).
(2) Column heading may be truncated to fit in space defined by
the FORMAT specified for the column
(3) Program does not check for null values
MINIMUM IDL VERSION:
V5.3 (uses STRSPLIT)
HISTORY:
version 1 D. Lindler Feb. 1987
Accept undefined values of rows, columns W. Landsman August 1997
Converted to IDL V5.0 W. Landsman September 1997
New FTINFO calling sequence W. Landsman May 2000
Parse scalar string with STRSPLIT W. Landsman July 2002
Fix format display of row number W. Landsman March 2003
Fix format display of row number again W. Landsman May 2003
[Previous]
[Next]
NAME:
FTPUT
PURPOSE:
Procedure to add or update a field in an FITS ASCII table
CALLING SEQUENCE:
FTPUT, htab, tab, field, row, values, [ nulls ]
INPUTS:
htab - FITS ASCII table header string array
tab - FITS ASCII table array (e.g. as read by READFITS)
field - string field name or integer field number
row - either a non-negative integer scalar giving starting row to
update, or a non-negative integer vector specifying rows to
update. FTPUT will append a new row to a table if the value
of 'row' exceeds the number of rows in the tab array
values - value(s) to add or update. If row is a vector
then values must contain the same number of elements.
OPTIONAL INPUT:
nulls - null value flag of same length as values.
It should be set to 1 at null value positions
and 0 elsewhere.
OUTPUTS:
htab,tab will be updated as specified.
CALLS: ***
FTADDCOL, FTINFO, FTSIZE, SXADDPAR [1], SXADDPAR [2], SXADDPAR [3]
CALLED BY:
T_APER, T_FIND, T_GETPSF, T_GROUP, T_NSTAR
EXAMPLE:
One has a NAME and RA and Dec vectors for 500 stars with formats A6,
F9.5 and F9.5 respectively. Write this information to an ASCII table
named 'star.fits'.
IDL> FTCREATE,24,500,h,tab ;Create table header and (empty) data
IDL> FTADDCOL,h,tab,'RA',8,'F9.5','DEGREES' ;Explicity define the
IDL> FTADDCOL,h,tab,'DEC',8,'F9.5','DEGREES' ;RA and Dec columns
IDL> FTPUT,h,tab,'RA',0,ra ;Insert RA vector into table
IDL> FTPUT,h,tab,'DEC',0,dec ;Insert DEC vector into table
IDL> FTPUT, h,tab, 'NAME',0,name ;Insert NAME vector with default
IDL> WRITEFITS,'stars.fits',tab,h ;Write to a file
Note that (1) explicit formatting has been supplied for the (numeric)
RA and Dec vectors, but was not needed for the NAME vector, (2) A width
of 24 was supplied in FTCREATE based on the expected formats (6+9+9),
though the FT* will adjust this value as necessary, and (3) WRITEFITS
will create a minimal primary header
NOTES:
(1) If the specified field is not already in the table, then FTPUT will
create a new column for that field using default formatting. However,
FTADDCOL should be called prior to FTPUT for explicit formatting.
PROCEDURES CALLED
FTADDCOL, FTINFO, FTSIZE, SXADDPAR, SXPAR()
HISTORY:
version 1 D. Lindler July, 1987
Allow E format W. Landsman March 1992
Write in F format if E format will overflow April 1994
Update documentation W. Landsman January 1996
Allow 1 element vector W. Landsman March 1996
Adjust string length to maximum of input string array June 1997
Work for more than 32767 elements August 1997
Converted to IDL V5.0 W. Landsman September 1997
Updated call to the new FTINFO W. Landsman May 2000
Fix case where header does not have any columns yet W.Landsman Sep 2002
Assume since V5.2, omit fstring() call W. Landsman April 2006
[Previous]
[Next]
NAME:
FTSIZE
PURPOSE:
Procedure to return the size of a FITS ASCII table.
CALLING SEQUENCE:
ftsize,h,tab,ncols,rows,tfields,ncols_all,nrows_all, [ERRMSG = ]
INPUTS:
h - FITS ASCII table header, string array
tab - FITS table array, 2-d byte array
OUTPUTS:
ncols - number of characters per row in table
nrows - number of rows in table
tfields - number of fields per row
ncols_all - number of characters/row allocated (size of tab)
nrows_all - number of rows allocated
OPTIONAL OUTPUT KEYWORD:
ERRMSG = If this keyword is present, 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.
HISTORY
D. Lindler July, 1987
Fix for 1-row table, W. Landsman HSTX, June 1994
Converted to IDL V5.0 W. Landsman September 1997
Added ERRMSG keyword W. Landsman May 2000
CALLS:
CALLED BY
FTADDCOL, FTDELCOL, FTPRINT, FTPUT, ST_DISKREAD, ST_DISK_DATA, ST_DISK_GEIS
ST_DISK_TABLE
[Previous]
[Next]
NAME:
FTSORT
PURPOSE:
Sort a FITS ASCII table according to a specified field
CALLING SEQUENCE:
FTSORT,h,tab,[field, REVERSE = ] ;Sort original table header and array
or
FTSORT,h,tab,hnew,tabnew,[field, REVERSE =] ;Create new sorted header
INPUTS:
H - FITS header (string array)
TAB - FITS table (byte array) associated with H. If less than 4
parameters are supplied, then H and TAB will be updated to
contain the sorted table
OPTIONAL INPUTS:
FIELD - Field name(s) or number(s) used to sort the entire table.
If FIELD is a vector then the first element is used for the
primary sort, the second element is used for the secondary
sort, and so forth. (A secondary sort only takes effect when
values in the primary sort field are equal.) Character fields
are sorted using the ASCII collating sequence. If omitted,
the user will be prompted for the field name.
OPTIONAL OUTPUTS:
HNEW,TABNEW - Header and table containing the sorted tables
EXAMPLE:
Sort a FITS ASCII table by the 'DECLINATION' field in descending order
Assume that the table header htab, and array, tab, have already been
read (e.g. with READFITS or FITS_READ):
IDL> FTSORT, htab, tab,'DECLINATION',/REVERSE
OPTIONAL INPUT KEYWORD:
REVERSE - If set then the table is sorted in reverse order (maximum
to minimum. If FIELD is a vector, then REVERSE can also be
a vector. For example, REVERSE = [1,0] indicates that the
primary sort should be in descending order, and the secondary
sort should be in ascending order.
EXAMPLE:
CALLS: ***
BSORT [1], BSORT [2], BSORT [3], BSORT [4], FTGET, FTINFO, REVERSE, SXADDHIST [1]
SXADDHIST [2]
SIDE EFFECTS:
A HISTORY record is added to the table header.
REVISION HISTORY:
Written W. Landsman June, 1988
Converted to IDL V5.0 W. Landsman September 1997
New FTINFO calling sequence, added REVERSE keyword, allow secondary sorts
W. Landsman May 2000
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FUNCIR
PURPOSE:
Return function value and its derivatives of the equation of a circle
EXPLANATION:
CALLING SEQUENCE:
FUNCIR, x, a, y, dyda
INPUTS:
X -- A two element vector for position of the point on the circle
A -- A three element vector representing position (x0, y0) and radius
(r0) of the circle center
OPTIONAL INPUTS:
None.
OUTPUTS:
Y -- Function value of the circle equation.
DYDA -- Derivatives of the function
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
None.
CALLS:
None.
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
Misc, user-supplied function
PREVIOUS HISTORY:
Written November 10, 1994, by Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
VERSION:
Version 1, November 10, 1994
[Previous]
[Next]
NAME:
FUNCT_FIT
PURPOSE:
Non-linear least squares fit to a function of an
arbitrary number of parameters.
Function may be any non-linear function where
the partial derivatives are known or can be approximated.
CATEGORY:
Curve Fitting
CALLING SEQUENCE:
YFIT = FUNCT_FIT(X,Y,W,A,SIGMAA,FUNCT=FUNCT)
INPUTS:
X = Row vector of independent variables.
Y = Row vector of dependent variable, same length as x.
A = Vector of nterms length containing the initial estimate
for each parameter. If A is double precision, calculations
are performed in double precision, otherwise in single prec.
OPTIONAL INPUT PARAMETERS:
OUTPUTS:
A = Vector of parameters containing fit.
Function result = YFIT = Vector of calculated
values.
OPTIONAL OUTPUT PARAMETERS:
Sigmaa = Vector of standard deviations for parameters
KEYWORDS:
goodness(out) = goodnesss of fit = 1 - igamma(nfree/2,chisqr/2)
weights(in) = row vector of weights, same length as x and y.
For no weighting
w(i) = 1., instrumental weighting w(i) = 1./y(i), etc.
funct(in) = function to be fit. If not included, then the
current function in the library version of FUNCT will
be used.
stepfac (in) = fractional stepsize for numerical differencing
fixp (in) = logical vector identifying which parameters to
keep fixed (e.g. fixp=[1,2] means keep parameters 1 and 2 fixed)
corr (in) = correlation matrix specifying actual links between parameters
(e.g. corr(3,2)=alpha implies a(3)=alpha*a(2) and a(3) will be
fixed.
con (in) = linear term to be added to correlation matrix
fxrange (in) = range to limit fit
chi2 (out) = chi squared of fit
nfree (out) = no. of free parameters
niter (out) = no. of iterations
extra (out) = extra optional variable in which user can return
miscellaneous information.
ss (in) = indicies to include in fit
status = 1/0 converged/failed
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, GET_IJ, UNIQ [1], UNIQ [2], UNIQ [3]
funct_val
CALLED BY:
BATSE_SPEC_DRM, DVOIGT_FIT, FBLUE_FIT, GAUSS_FIT, MVOIGT_FIT, VOIGT_FIT, fit_bsc
fit_bsc_as
PROCEDURE:
Copied from "CURFIT", least squares fit to a non-linear
function, pages 237-239, Bevington, Data Reduction and Error
Analysis for the Physical Sciences.
MODIFICATION HISTORY:
Written, DMS, RSI, September, 1982.
Modified by DMZ, Applied Research Corp
Modified by DMZ, Aug 1987 to allow parameter fixing
Modified by DMZ, Oct 1987 to allow parameter linking
Converted to version 2 - DMZ (ARC) April, 1992
Added CHISQR, WEIGHTS, and FXRANGE - Zarro (ARC) Oct'93
[Previous]
[Next]
NAME:
funct_val
PURPOSE:
evaluate any function and its partial derivatives
with respect to each parameter
CATEGORY:
utility
CALLING SEQUENCE:
f=funct_val(x,a,pder,funct=funct,extra=extra)
INPUTS:
x=dependent variable array
a=function parameter array
funct=generic function name passed as string
OUTPUTS:
f=computed function
OPTIONAL OUTPUT PARAMETERS:
pder=derivative of function at ith point with respect to jth parameter
(should not be calculated if parameter is not supplied in call)
if stepfac le 0 then pder is computed analytically from function
KEYWORDS:
stepfac (in) = fractional stepsize for numerical differencing
fixp (in) = logical vector identifying which parameters to keep
fixed (e.g. fixp=[1,2] means keep parameters 1 and 2 fixed)
corr (in) = correlation matrix specifying actual links between parameters
(e.g. corr(3,2)=alpha implies a(3)=alpha*a(2) and a(3) will
be fixed during solution)
extra (out) = extra optional variable in which user can return
miscellaneous information.
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3]
CALLED BY:
FUNCT_FIT
RESTRICTIONS:
funct must be passed as string for this proc to work
PROCEDURE:
uses call_function
MODIFICATION HISTORY:
written March '87 by DMZ, Applied Research Corp.
modified Aug '87 by DMZ, to allow fixed parameters
modified Oct '87 by DMZ, to allow linking parameters
modified Jun '88 by DMZ, to allow analytic PDER
converted to version 2 -- DMZ (ARC) April 1992
optimized and cleaned up keyword inputs -- DMZ (ARC) Sept 1993
[Previous]
[Next]
FUNCTION: FUNCTION LIMITS, X
PURPOSE: Scan vector X and return 2 element vector of [min(x),max(x)]
CALLS:
[Previous]
[Next]
NAME:
FX_ROOT2
PURPOSE:
This function computes real and complex roots (zeros) of
a univariate nonlinear function.
CATEGORY:
Nonlinear Equations/Root Finding
CALLING SEQUENCE:
Result = FX_ROOT2(X, Func)
INPUTS:
X : A 3-element initial guess vector of type real or complex.
Real initial guesses may result in real or complex roots.
Complex initial guesses will result in complex roots.
Func: A scalar string specifying the name of a user-supplied IDL
function that defines the univariate nonlinear function.
This function must accept the vector argument X.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
ITMAX: Set this keyword to specify the maximum number of iterations
The default is 100.
STOP: Set this keyword to specify the stopping criterion used to
judge the accuracy of a computed root, r(k).
STOP = 0 implements an absolute error criterion between two
successively-computed roots, |r(k) - r(k+1)|.
STOP = 1 implements a functional error criterion at the
current root, |Func(r(k))|. The default is 0.
TOL: Set this keyword to specify the stopping error tolerance.
If the STOP keyword is set to 0, the algorithm stops when
|x(k) - x(k+1)| < TOL.
If the STOP keyword is set to 1, the algorithm stops when
|Func(x(k))| < TOL. The default is 1.0e-4.
EXAMPLE:
Define an IDL function named FUNC.
function FUNC, x
return, exp(sin(x)^2 + cos(x)^2 - 1) - 1
end
Define a real 3-element initial guess vector.
x = [0.0, -!pi/2, !pi]
Compute a root of the function using double-precision arithmetic.
root = FX_ROOT2(x, 'FUNC', /double)
Check the accuracy of the computed root.
print, exp(sin(root)^2 + cos(root)^2 - 1) - 1
Define a complex 3-element initial guess vector.
x = [complex(-!pi/3, 0), complex(0, !pi), complex(0, -!pi/6)]
Compute a root of the function.
root = FX_ROOT2(x, 'FUNC')
Check the accuracy of the computed root.
print, exp(sin(root)^2 + cos(root)^2 - 1) - 1
PROCEDURE:
FX_ROOT2 implements an optimal Muller's method using complex
arithmetic only when necessary.
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, March 1994
Modified: GGS, RSI, September 1994
Added support for double-precision complex inputs.
Modified: Zarro (L-3Com/GSFC), November 2004, added _extra to pass
keyword values to func. Renamed to FX_ROOT2
[Previous]
[Next]
NAME:
FXADDPAR
Purpose :
Add or modify a parameter in a FITS header array.
Explanation :
This version of FXADDPAR will write string values longer than 68
characters using the FITS continuation convention described at
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r13.html
Use :
FXADDPAR, HEADER, NAME, VALUE, COMMENT
Inputs :
HEADER = String array containing FITS header. The maximum string
length must be equal to 80. If not defined, then FXADDPAR
will create an empty FITS header array.
NAME = Name of parameter. If NAME is already in the header the
value and possibly comment fields are modified. Otherwise a
new record is added to the header. If NAME is equal to
either "COMMENT" or "HISTORY" then the value will be added to
the record without replacement. In this case the comment
parameter is ignored.
VALUE = Value for parameter. The value expression must be of the
correct type, e.g. integer, floating or string.
String values of 'T' or 'F' are considered logical
values. If the value is a string and is "long"
(more than 69 characters), then it may be continued
over more than one line using the OGIP CONTINUE
standard.
Opt. Inputs :
COMMENT = String field. The '/' is added by this routine. Added
starting in position 31. If not supplied, or set equal to ''
(the null string), then any previous comment field in the
header for that keyword is retained (when found).
Outputs :
HEADER = Updated header array.
Opt. Outputs:
None.
Keywords :
BEFORE = Keyword string name. The parameter will be placed before the
location of this keyword. For example, if BEFORE='HISTORY'
then the parameter will be placed before the first history
location. This applies only when adding a new keyword;
keywords already in the header are kept in the same position.
AFTER = Same as BEFORE, but the parameter will be placed after the
location of this keyword. This keyword takes precedence over
BEFORE.
FORMAT = Specifies FORTRAN-like format for parameter, e.g. "F7.3". A
scalar string should be used. For complex numbers the format
should be defined so that it can be applied separately to the
real and imaginary parts.
/NOCONTINUE = By default, FXADDPAR will break strings longer than 68
characters into multiple lines using the continuation
convention. If this keyword is set, then the line will
instead be truncated to 68 characters. This was the default
behaviour of FXADDPAR prior to December 1999.
Calls : ***
DETABIFY [1], DETABIFY [2], DETABIFY [3], FXADDPAR_CONTPAR, FXADDPAR_CONTWARN
FXPAR [1], FXPAR [2], FXPARPOS [1], FXPARPOS [2]
CALLED BY:
ADJUST_HDR_TCR, C2_CALFACTOR, C2_CALIBRATE, C3_CALFACTOR [1], C3_CALIBRATE
C3_MASSIMG, CDS_SIMPLE_FITS, CHECK_FITS [1], CHECK_FITS [2], CHECK_OBESUMERROR
CH_WRITE_FITS, CNVRT2REF, COMB_FULL_EQ, Create FITS
Create a FITS primary Header and Data Unit, EIS_FITS_CALIB [1]
EIS_FITS_CALIB [2], EIS_FITS_COORD [1], EIS_FITS_COORD [2]
EIS_FITS_DATAID [1], EIS_FITS_DATAID [2], EIS_FITS_OBSTIME [1]
EIS_FITS_OBSTIME [2], EIS_MKFITS [1], EIS_MKFITS [2], EIT_PREP
FITS WRITER CLASS, FITS WRITER CLASS FOR ANY RHESSI DATA TYPES
FITS WRITER CLASS FOR RHESSI IMAGES, FITSFILE__DEFINE [3], FIX_CATALOG
FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1], FXBCREATE [2], FXBGROW, FXBHMAKE [1]
FXBHMAKE [2], FXHMAKE [1], FXHMAKE [2], FXHMODIFY [1], FXHMODIFY [2], FXREAD [1]
FXREAD [2], FXTPIO_WRITE, FXWRITE [1], FXWRITE [2], GET_EXP_FACTOR [1]
GET_EXP_FACTOR [2], HESSI Create FITS Binary Table, HSI_PACKET2FITS
INTGCOMP_NRH2, ITOOL_MAKE_FH, MAKE_DAILY_IMAGE, MAKE_FITS_HDR, MAP2FITS
MK_ALL_MIN, MK_DAILY_C1_MED, MK_DAILY_MED, MK_DAILY_MIN, MK_IMG, MK_MONTHLY_MIN
MK_SYNOPTIC, MLO_MASSIMG, MODEL_to_SCORE [2], MRDFITS [1], MRDFITS [2], MWRFITS
NRH_HSI_FITS, NRL2EIT, OFFSET_BIAS, OPEN_CALFITS, PHOTOCAL, READ_EIT_FILE
REDUCE_LEVEL_05, REDUCE_LEVEL_1, REDUCE_RECTIFY, REDUCE_RECTIFY_P1P2
REDUCE_REFCOORD, REDUCE_STATISTICS, REDUCE_STATISTICS2, RTMOVIE, RTMVIPLAY [1]
RTMVIPLAY [2], RTMVIPLAYPNG, Radio Astronomy Group Fits Write
SHRINK_SUMER_FITS, SPECTRA2FITS, SUMER_RASTER_SAVE, SUMER_SERIAL
SUMER_SPECTROGRAM_SAVE, SYNSCAN, UPDATE_HDR_ROLLXY, WCS2FITSHEAD
WCS_FIND_PIXEL_LIST, WRITE_CALFITS, WRITE_LAST_IMG [1], WRITE_LAST_IMG [2]
WRITE_SUMMARIES [1], WRITE_SUMMARIES [2], WRUNMOVIE [2], WRUNMOVIE4, WRUNMOVIEM
WRUNMOVIEM3, WRUNMOVIEM_RT, XCAL [1], XCAL [2], XSM_VALID, add_kw2hdr, data_sum2fits
eis_make_status_fits [2], eis_make_status_fits [3], eit_getlimb
fitshead2struct, hsi_obs_summ_soc__define, hsi_qlook__define
hsi_spectrum__filewrite, hsi_spectrum__fits_headers, hxrs_drm2fits [1]
hxrs_drm2fits [2], hxrs_drm2fits [3], merge_fits_hdrs, mk_atlas, mk_trace_i0
mkhdr_frm, model_to_score [1], mreadfits, msok_poi_copy [1], msok_poi_copy [2]
overwrt_hdr_kw, polariz_display, rm2fits, smei_frm_cvhdr, smei_hdr_make
smei_mkglare, smei_mksidereal, smei_mkstdstar, smei_sky_read, smei_star_remove
smei_zodiac_remove, spartan_pb2fits, spartan_roll2fits [1], spectrum2fits
struct2fitshead, tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2]
write_ovsa_fits, wrt_eneband_ext, wrt_fits_bin_exten [1], wrt_rate_ext
wso_write, xdisp_fits, xdisp_trace [1], xdisp_trace2, xdisp_trace3
Common :
None.
Restrictions:
Warning -- Parameters and names are not checked against valid FITS
parameter names, values and types.
The required FITS keywords SIMPLE (or XTENSION), BITPIX, NAXIS, NAXIS1,
NAXIS2, etc., must be entered in order. The actual values of these
keywords are not checked for legality and consistency, however.
Side effects:
All HISTORY records are inserted in order at the end of the header.
All COMMENT records are also inserted in order at the end of the
header, but before the HISTORY records. The BEFORE and AFTER keywords
can override this.
All records with no keyword (blank) are inserted in order at the end of
the header, but before the COMMENT and HISTORY records. The BEFORE and
AFTER keywords can override this.
All other records are inserted before any of the HISTORY, COMMENT, or
"blank" records. The BEFORE and AFTER keywords can override this.
String values longer than 68 characters will be split into multiple
lines using the OGIP CONTINUE convention, unless the /NOCONTINUE keyword
is set. For a description of the CONTINUE convention see
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r13.htm
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992, from SXADDPAR by D. Lindler and J. Isensee.
Differences include:
* LOCATION parameter replaced with keywords BEFORE and AFTER.
* Support for COMMENT and "blank" FITS keywords.
* Better support for standard FITS formatting of string and
complex values.
* Built-in knowledge of the proper position of required
keywords in FITS (although not necessarily SDAS/Geis) primary
headers, and in TABLE and BINTABLE extension headers.
William Thompson, May 1992, fixed bug when extending length of header,
and new record is COMMENT, HISTORY, or blank.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 5 September 1997
Fixed bug replacing strings that contain "/" character--it
interpreted the following characters as a comment.
Version 3, Craig Markwardt, GSFC, December 1997
Allow long values to extend over multiple lines
Version 4, D. Lindler, March 2000, modified to use capital E instead
of a lower case e for exponential format.
Version 4.1 W. Landsman April 2000, make user-supplied format uppercase
Version 4.2 W. Landsman July 2002, positioning of EXTEND keyword
Version :
Version 4.2, July 2002
[Previous]
[Next]
NAME:
FXADDPAR
Purpose :
Add or modify a parameter in a FITS header array.
Explanation :
This version of FXADDPAR will write string values longer than 68
characters using the FITS continuation convention described at
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r13.html
Use :
FXADDPAR, HEADER, NAME, VALUE, COMMENT
Inputs :
HEADER = String array containing FITS header. The maximum string
length must be equal to 80. If not defined, then FXADDPAR
will create an empty FITS header array.
NAME = Name of parameter. If NAME is already in the header the
value and possibly comment fields are modified. Otherwise a
new record is added to the header. If NAME is equal to
either "COMMENT" or "HISTORY" then the value will be added to
the record without replacement. In this case the comment
parameter is ignored.
VALUE = Value for parameter. The value expression must be of the
correct type, e.g. integer, floating or string.
String values of 'T' or 'F' are considered logical
values. If the value is a string and is "long"
(more than 69 characters), then it may be continued
over more than one line using the OGIP CONTINUE
standard.
Opt. Inputs :
COMMENT = String field. The '/' is added by this routine. Added
starting in position 31. If not supplied, or set equal to ''
(the null string), then any previous comment field in the
header for that keyword is retained (when found).
Outputs :
HEADER = Updated header array.
Opt. Outputs:
None.
Keywords :
BEFORE = Keyword string name. The parameter will be placed before the
location of this keyword. For example, if BEFORE='HISTORY'
then the parameter will be placed before the first history
location. This applies only when adding a new keyword;
keywords already in the header are kept in the same position.
AFTER = Same as BEFORE, but the parameter will be placed after the
location of this keyword. This keyword takes precedence over
BEFORE.
FORMAT = Specifies FORTRAN-like format for parameter, e.g. "F7.3". A
scalar string should be used. For complex numbers the format
should be defined so that it can be applied separately to the
real and imaginary parts.
/NOCONTINUE = By default, FXADDPAR will break strings longer than 68
characters into multiple lines using the continuation
convention. If this keyword is set, then the line will
instead be truncated to 68 characters. This was the default
behaviour of FXADDPAR prior to December 1999.
Calls : ***
DETABIFY [1], DETABIFY [2], DETABIFY [3], FXADDPAR_CONTPAR, FXADDPAR_CONTWARN
FXPAR [1], FXPAR [2], FXPARPOS [1], FXPARPOS [2]
CALLED BY:
ADJUST_HDR_TCR, C2_CALFACTOR, C2_CALIBRATE, C3_CALFACTOR [1], C3_CALIBRATE
C3_MASSIMG, CDS_SIMPLE_FITS, CHECK_FITS [1], CHECK_FITS [2], CHECK_OBESUMERROR
CH_WRITE_FITS, CNVRT2REF, COMB_FULL_EQ, Create FITS
Create a FITS primary Header and Data Unit, EIS_FITS_CALIB [1]
EIS_FITS_CALIB [2], EIS_FITS_COORD [1], EIS_FITS_COORD [2]
EIS_FITS_DATAID [1], EIS_FITS_DATAID [2], EIS_FITS_OBSTIME [1]
EIS_FITS_OBSTIME [2], EIS_MKFITS [1], EIS_MKFITS [2], EIT_PREP
FITS WRITER CLASS, FITS WRITER CLASS FOR ANY RHESSI DATA TYPES
FITS WRITER CLASS FOR RHESSI IMAGES, FITSFILE__DEFINE [3], FIX_CATALOG
FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1], FXBCREATE [2], FXBGROW, FXBHMAKE [1]
FXBHMAKE [2], FXHMAKE [1], FXHMAKE [2], FXHMODIFY [1], FXHMODIFY [2], FXREAD [1]
FXREAD [2], FXTPIO_WRITE, FXWRITE [1], FXWRITE [2], GET_EXP_FACTOR [1]
GET_EXP_FACTOR [2], HESSI Create FITS Binary Table, HSI_PACKET2FITS
INTGCOMP_NRH2, ITOOL_MAKE_FH, MAKE_DAILY_IMAGE, MAKE_FITS_HDR, MAP2FITS
MK_ALL_MIN, MK_DAILY_C1_MED, MK_DAILY_MED, MK_DAILY_MIN, MK_IMG, MK_MONTHLY_MIN
MK_SYNOPTIC, MLO_MASSIMG, MODEL_to_SCORE [2], MRDFITS [1], MRDFITS [2], MWRFITS
NRH_HSI_FITS, NRL2EIT, OFFSET_BIAS, OPEN_CALFITS, PHOTOCAL, READ_EIT_FILE
REDUCE_LEVEL_05, REDUCE_LEVEL_1, REDUCE_RECTIFY, REDUCE_RECTIFY_P1P2
REDUCE_REFCOORD, REDUCE_STATISTICS, REDUCE_STATISTICS2, RTMOVIE, RTMVIPLAY [1]
RTMVIPLAY [2], RTMVIPLAYPNG, Radio Astronomy Group Fits Write
SHRINK_SUMER_FITS, SPECTRA2FITS, SUMER_RASTER_SAVE, SUMER_SERIAL
SUMER_SPECTROGRAM_SAVE, SYNSCAN, UPDATE_HDR_ROLLXY, WCS2FITSHEAD
WCS_FIND_PIXEL_LIST, WRITE_CALFITS, WRITE_LAST_IMG [1], WRITE_LAST_IMG [2]
WRITE_SUMMARIES [1], WRITE_SUMMARIES [2], WRUNMOVIE [2], WRUNMOVIE4, WRUNMOVIEM
WRUNMOVIEM3, WRUNMOVIEM_RT, XCAL [1], XCAL [2], XSM_VALID, add_kw2hdr, data_sum2fits
eis_make_status_fits [2], eis_make_status_fits [3], eit_getlimb
fitshead2struct, hsi_obs_summ_soc__define, hsi_qlook__define
hsi_spectrum__filewrite, hsi_spectrum__fits_headers, hxrs_drm2fits [1]
hxrs_drm2fits [2], hxrs_drm2fits [3], merge_fits_hdrs, mk_atlas, mk_trace_i0
mkhdr_frm, model_to_score [1], mreadfits, msok_poi_copy [1], msok_poi_copy [2]
overwrt_hdr_kw, polariz_display, rm2fits, smei_frm_cvhdr, smei_hdr_make
smei_mkglare, smei_mksidereal, smei_mkstdstar, smei_sky_read, smei_star_remove
smei_zodiac_remove, spartan_pb2fits, spartan_roll2fits [1], spectrum2fits
struct2fitshead, tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2]
write_ovsa_fits, wrt_eneband_ext, wrt_fits_bin_exten [1], wrt_rate_ext
wso_write, xdisp_fits, xdisp_trace [1], xdisp_trace2, xdisp_trace3
Common :
None.
Restrictions:
Warning -- Parameters and names are not checked against valid FITS
parameter names, values and types.
The required FITS keywords SIMPLE (or XTENSION), BITPIX, NAXIS, NAXIS1,
NAXIS2, etc., must be entered in order. The actual values of these
keywords are not checked for legality and consistency, however.
Side effects:
All HISTORY records are inserted in order at the end of the header.
All COMMENT records are also inserted in order at the end of the
header, but before the HISTORY records. The BEFORE and AFTER keywords
can override this.
All records with no keyword (blank) are inserted in order at the end of
the header, but before the COMMENT and HISTORY records. The BEFORE and
AFTER keywords can override this.
All other records are inserted before any of the HISTORY, COMMENT, or
"blank" records. The BEFORE and AFTER keywords can override this.
String values longer than 68 characters will be split into multiple
lines using the OGIP CONTINUE convention, unless the /NOCONTINUE keyword
is set. For a description of the CONTINUE convention see
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r13.htm
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992, from SXADDPAR by D. Lindler and J. Isensee.
Differences include:
* LOCATION parameter replaced with keywords BEFORE and AFTER.
* Support for COMMENT and "blank" FITS keywords.
* Better support for standard FITS formatting of string and
complex values.
* Built-in knowledge of the proper position of required
keywords in FITS (although not necessarily SDAS/Geis) primary
headers, and in TABLE and BINTABLE extension headers.
William Thompson, May 1992, fixed bug when extending length of header,
and new record is COMMENT, HISTORY, or blank.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 5 September 1997
Fixed bug replacing strings that contain "/" character--it
interpreted the following characters as a comment.
Version 3, Craig Markwardt, GSFC, December 1997
Allow long values to extend over multiple lines
Version 4, D. Lindler, March 2000, modified to use capital E instead
of a lower case e for exponential format.
Version 4.1 W. Landsman April 2000, make user-supplied format uppercase
Version 4.2 W. Landsman July 2002, positioning of EXTEND keyword
Version :
Version 4.2, July 2002
[Previous]
[Next]
NAME:
FXBADDCOL
Purpose :
Adds a column to a binary table extension.
Explanation :
Modify a basic FITS binary table extension (BINTABLE) header array to
define a column.
Use :
FXBADDCOL, INDEX, HEADER, ARRAY [, TTYPE [, COMMENT ]]
Inputs :
HEADER = String array containing FITS extension header.
ARRAY = IDL variable used to determine the data size and type
associated with the column. If the column is defined as
containing variable length arrays, then ARRAY must be of the
maximum size to be stored in the column.
Opt. Inputs :
TTYPE = Column label.
COMMENT = Comment for TTYPE
Outputs :
INDEX = Index (1-999) of the created column.
HEADER = The header is modified to reflect the added column.
Opt. Outputs:
None.
Keywords :
VARIABLE= If set, then the column is defined to contain pointers to
variable length arrays in the heap area.
DCOMPLEX= If set, and ARRAY is complex, with the first dimension being
two (real and imaginary parts), then the column is defined as
double-precision complex (type "M"). This keyword is
only needed prior to IDL Version 4.0, when the double
double complex datatype was unavailable in IDL
BIT = If passed, and ARRAY is of type byte, then the column is
defined as containg bit mask arrays (type "X"), with the
value of BIT being equal to the number of mask bits.
LOGICAL = If set, and array is of type byte, then the column is defined
as containing logical arrays (type "L").
NO_TDIM = If set, then the TDIMn keyword is not written out to the
header. No TDIMn keywords are written for columns containing
variable length arrays.
TUNIT = If passed, then corresponding keyword is added to header.
TSCAL = Same.
TZERO = Same.
TNULL = Same.
TDISP = Same.
TDMIN = Same.
TDMAX = Same.
TDESC = Same.
TCUNI = Same.
TROTA = Same.
TRPIX = Same.
TRVAL = Same.
TDELT = Same.
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 = ''
FXBADDCOL, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], HESSI Create FITS Binary Table
HESSI Write lookup table, OPEN_CALFITS, Radio Astronomy Group Fits Write
SPECTRA2FITS, eis_make_status_fits [2], eis_make_status_fits [3]
hsi_data_gap_fxbh, hsi_ephemeris_fxbh, hsi_filedb_fxbh
hsi_flare_list_info_fxbh, hsi_flarelistentry_fxbh, hsi_obs_summ_data_fxbh
hsi_obs_summ_fxbh, hsi_obs_summ_info_fxbh [2], hsi_obs_summ_otp
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hxrs_drm2fits [1], hxrs_drm2fits [2], hxrs_drm2fits [3], mk_trace_i0, rm2fits
smei_hdr_make, tr_wrt_fits, write_ovsa_fits, wrt_ebounds_ext
Common :
None.
Restrictions:
Warning: No checking is done of any of the parameters defining the
values of optional FITS keywords.
FXBHMAKE must first be called to initialize the header.
If ARRAY is of type character, then it must be of the maximum length
expected for this column. If a character string array, then the
largest string in the array is used to determine the maximum length.
The DCOMPLEX keyword is ignored if ARRAY is not double-precision.
ARRAY must also have a first dimension of two representing the real and
imaginary parts.
The BIT and LOGICAL keywords are ignored if ARRAY is not of type byte.
BIT takes precedence over LOGICAL.
Side effects:
If the data array is multidimensional, then a TDIM keyword is added to
the header, unless either NO_TDIM or VARIABLE is set.
No TDIMn keywords are written out for bit arrays (format 'X'), since
the dimensions would refer to bits, not bytes.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
W. Thompson, Feb 1992, changed from function to procedure.
W. Thompson, Feb 1992, modified to support variable length arrays.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 30 December 1994
Added keyword TCUNI.
Version 5, Wayne Landsman, GSFC, 12 Aug 1997
Recognize double complex IDL datatype
Version :
Version 5, 12 Aug 1997
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBADDCOL
PURPOSE :
Adds a column to a binary table extension.
EXPLANATION :
Modify a basic FITS binary table extension (BINTABLE) header array to
define a column.
USE :
FXBADDCOL, INDEX, HEADER, ARRAY [, TTYPE [, COMMENT ]]
INPUTS :
HEADER = String array containing FITS extension header.
ARRAY = IDL variable used to determine the data size and type
associated with the column. If the column is defined as
containing variable length arrays, then ARRAY must be of the
maximum size to be stored in the column.
Opt. Inputs :
TTYPE = Column label.
COMMENT = Comment for TTYPE
Outputs :
INDEX = Index (1-999) of the created column.
HEADER = The header is modified to reflect the added column.
Opt. Outputs:
None.
Keywords :
VARIABLE= If set, then the column is defined to contain pointers to
variable length arrays in the heap area.
DCOMPLEX= If set, and ARRAY is complex, with the first dimension being
two (real and imaginary parts), then the column is defined as
double-precision complex (type "M"). This keyword is
only needed prior to IDL Version 4.0, when the double
double complex datatype was unavailable in IDL
BIT = If passed, and ARRAY is of type byte, then the column is
defined as containg bit mask arrays (type "X"), with the
value of BIT being equal to the number of mask bits.
LOGICAL = If set, and array is of type byte, then the column is defined
as containing logical arrays (type "L").
NO_TDIM = If set, then the TDIMn keyword is not written out to the
header. No TDIMn keywords are written for columns containing
variable length arrays.
TUNIT = If passed, then corresponding keyword is added to header.
TSCAL = Same.
TZERO = Same.
TNULL = Same.
TDISP = Same.
TDMIN = Same.
TDMAX = Same.
TDESC = Same.
TCUNI = Same.
TROTA = Same.
TRPIX = Same.
TRVAL = Same.
TDELT = Same.
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 = ''
FXBADDCOL, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], HESSI Create FITS Binary Table
HESSI Write lookup table, OPEN_CALFITS, Radio Astronomy Group Fits Write
SPECTRA2FITS, eis_make_status_fits [2], eis_make_status_fits [3]
hsi_data_gap_fxbh, hsi_ephemeris_fxbh, hsi_filedb_fxbh
hsi_flare_list_info_fxbh, hsi_flarelistentry_fxbh, hsi_obs_summ_data_fxbh
hsi_obs_summ_fxbh, hsi_obs_summ_info_fxbh [2], hsi_obs_summ_otp
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hxrs_drm2fits [1], hxrs_drm2fits [2], hxrs_drm2fits [3], mk_trace_i0, rm2fits
smei_hdr_make, tr_wrt_fits, write_ovsa_fits, wrt_ebounds_ext
Common :
None.
Restrictions:
Warning: No checking is done of any of the parameters defining the
values of optional FITS keywords.
FXBHMAKE must first be called to initialize the header.
If ARRAY is of type character, then it must be of the maximum length
expected for this column. If a character string array, then the
largest string in the array is used to determine the maximum length.
The DCOMPLEX keyword is ignored if ARRAY is not double-precision.
ARRAY must also have a first dimension of two representing the real and
imaginary parts.
The BIT and LOGICAL keywords are ignored if ARRAY is not of type byte.
BIT takes precedence over LOGICAL.
Side effects:
If the data array is multidimensional, then a TDIM keyword is added to
the header, unless either NO_TDIM or VARIABLE is set.
No TDIMn keywords are written out for bit arrays (format 'X'), since
the dimensions would refer to bits, not bytes.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
W. Thompson, Feb 1992, changed from function to procedure.
W. Thompson, Feb 1992, modified to support variable length arrays.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 30 December 1994
Added keyword TCUNI.
Version 5, Wayne Landsman, GSFC, 12 Aug 1997
Recognize double complex IDL datatype
Version 6, Wayne Landsman, GSFC. C. Yamauchi (ISAS) 23 Feb 2006
Support 64bit integers
Version :
Version 6, 23 Feb 2006
[Previous]
[Next]
NAME:
FXBCLOSE
Purpose :
Close a FITS binary table extension opened for read.
Explanation :
Closes a FITS binary table extension that had been opened for read by
FXBOPEN.
Use :
FXBCLOSE, UNIT
Inputs :
UNIT = Logical unit number of the file.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBCLOSE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls :
None.
CALLED BY:
CDS_IMAGE, CFITSLIST, CHECKCDSFITS, CW_XTD_NRHF, FIND_FILE_DUR, Fits_spectra [1]
Fits_spectra [2], GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2], GET_ORBIT_FITS
GET_SC_ATT [1], GET_SC_ATT [2], GT_EXPTIME [2], GT_MIRRPOS, GT_NUMEXP, GT_NUMWIN
GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL, GT_WNUM
HESSI packet file close, HESSI score file close, ITOOL_RD_FITS, JPLEPHREAD
LEC_NRH1D, LIT_HEADER_NRH1, NRH_FCLOSE, PLOT_DELTAT, RDFILEPOS, RD_IMAGE_FITS
RD_LAS_CAT_FITS, READCALFITS, READCDSFITS, READSUM2CDS, READ_CENTER_POINT [1]
READ_CENTER_POINT [2], READ_COMPRESSED, READ_SC_ATT
Radio Astronomy Group Fits Read, SHRINK_SUMER_FITS, SUMER_FITS, TIME_IND_NRH
WCS_FIND_TABLE, eis_rd_sts_fits [1], eis_read_fits_data [1]
eis_read_fits_data [2], eis_read_fits_data [3], eis_read_fits_header [1]
eis_read_fits_header [2], eis_status_fits_reader1, ft_sumread_fits
gt_exptime [1], hsi_check_qlook_extensions, hsi_data_gap_fxbr
hsi_ephemeris_fxbr, hsi_filedb_fxbr, hsi_flare_list_entry_fxbr
hsi_flare_list_info_fxbr, hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr
hsi_obs_summ_info_fxbr, hsi_obs_summ_inp, hsi_obs_summ_read
hsi_obs_summ_soc__define, hsi_qlook__define, hsi_test_bad_file, mk_query [1]
mk_query [2], mrdfits_spectra, rd_sumer [1], rd_sumer [2], read_cds_im
read_ovsa_fits, smei_hdr_get, where_are [1], where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must have been opened with FXBOPEN.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 3, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBCLOSE
Purpose :
Close a FITS binary table extension opened for read.
Explanation :
Closes a FITS binary table extension that had been opened for read by
FXBOPEN.
Use :
FXBCLOSE, UNIT
Inputs :
UNIT = Logical unit number of the file.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBCLOSE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls :
None.
CALLED BY:
CDS_IMAGE, CFITSLIST, CHECKCDSFITS, CW_XTD_NRHF, FIND_FILE_DUR, Fits_spectra [1]
Fits_spectra [2], GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2], GET_ORBIT_FITS
GET_SC_ATT [1], GET_SC_ATT [2], GT_EXPTIME [2], GT_MIRRPOS, GT_NUMEXP, GT_NUMWIN
GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL, GT_WNUM
HESSI packet file close, HESSI score file close, ITOOL_RD_FITS, JPLEPHREAD
LEC_NRH1D, LIT_HEADER_NRH1, NRH_FCLOSE, PLOT_DELTAT, RDFILEPOS, RD_IMAGE_FITS
RD_LAS_CAT_FITS, READCALFITS, READCDSFITS, READSUM2CDS, READ_CENTER_POINT [1]
READ_CENTER_POINT [2], READ_COMPRESSED, READ_SC_ATT
Radio Astronomy Group Fits Read, SHRINK_SUMER_FITS, SUMER_FITS, TIME_IND_NRH
WCS_FIND_TABLE, eis_rd_sts_fits [1], eis_read_fits_data [1]
eis_read_fits_data [2], eis_read_fits_data [3], eis_read_fits_header [1]
eis_read_fits_header [2], eis_status_fits_reader1, ft_sumread_fits
gt_exptime [1], hsi_check_qlook_extensions, hsi_data_gap_fxbr
hsi_ephemeris_fxbr, hsi_filedb_fxbr, hsi_flare_list_entry_fxbr
hsi_flare_list_info_fxbr, hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr
hsi_obs_summ_info_fxbr, hsi_obs_summ_inp, hsi_obs_summ_read
hsi_obs_summ_soc__define, hsi_qlook__define, hsi_test_bad_file, mk_query [1]
mk_query [2], mrdfits_spectra, rd_sumer [1], rd_sumer [2], read_cds_im
read_ovsa_fits, smei_hdr_get, where_are [1], where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must have been opened with FXBOPEN.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 3, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBCOLNUM()
Purpose :
Returns a binary table column number.
Explanation :
Given a column specified either by number or name, this routine will
return the appropriate column number.
Use :
Result = FXBCOLNUM( UNIT, COL )
Inputs :
UNIT = Logical unit number corresponding to the file containing the
binary table.
COL = Column in the binary table, given either as a character
string containing a column label (TTYPE), or as a numerical
column index starting from column one.
Opt. Inputs :
None.
Outputs :
The result of the function is the number of the column specified, or
zero if no column is found (when passed by name).
Opt. Outputs:
None.
Keywords :
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 = ''
Result = FXBCOLNUM( ERRMSG=ERRMSG, ... )
IF ERRMSG NE '' THEN ...
Calls :
None.
CALLED BY:
FOPEN_NRH2, FXBDIMEN [1], FXBDIMEN [2], LIT_HEADER_NRH1, RD_NRH2I, READCDSCOL
READSUMCOL, READ_CALFITS, WCS_FIND_KEYWORD
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBOPEN.
If COL is passed as a number, rather than as a name, then it must be
consistent with the number of columns in the table.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
None.
Written :
William Thompson, GSFC, 2 July 1993.
Modified :
Version 1, William Thompson, GSFC, 2 July 1993.
Version 2, William Thompson, GSFC, 29 October 1993.
Added error message for not finding column by name.
Version 3, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 4, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBCOLNUM()
Purpose :
Returns a binary table column number.
Explanation :
Given a column specified either by number or name, this routine will
return the appropriate column number.
Use :
Result = FXBCOLNUM( UNIT, COL )
Inputs :
UNIT = Logical unit number corresponding to the file containing the
binary table.
COL = Column in the binary table, given either as a character
string containing a column label (TTYPE), or as a numerical
column index starting from column one.
Opt. Inputs :
None.
Outputs :
The result of the function is the number of the column specified, or
zero if no column is found (when passed by name).
Opt. Outputs:
None.
Keywords :
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 = ''
Result = FXBCOLNUM( ERRMSG=ERRMSG, ... )
IF ERRMSG NE '' THEN ...
Calls :
None.
CALLED BY:
FOPEN_NRH2, FXBDIMEN [1], FXBDIMEN [2], LIT_HEADER_NRH1, RD_NRH2I, READCDSCOL
READSUMCOL, READ_CALFITS, WCS_FIND_KEYWORD
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBOPEN.
If COL is passed as a number, rather than as a name, then it must be
consistent with the number of columns in the table.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
None.
Written :
William Thompson, GSFC, 2 July 1993.
Modified :
Version 1, William Thompson, GSFC, 2 July 1993.
Version 2, William Thompson, GSFC, 29 October 1993.
Added error message for not finding column by name.
Version 3, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 4, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBCREATE
Purpose :
Open a new binary table at the end of a FITS file.
Explanation :
Write a binary table extension header to the end of a disk FITS file,
and leave it open to receive the data.
The FITS file is opened, and the pointer is positioned just after the
last 2880 byte record. Then the binary header is appended. Calls to
FXBWRITE will append the binary data to this file, and then FXBFINISH
will close the file.
Use :
FXBCREATE, UNIT, FILENAME, HEADER
Inputs :
FILENAME = Name of FITS file to be opened.
HEADER = String array containing the FITS binary table extension
header.
Opt. Inputs :
None.
Outputs :
UNIT = Logical unit number of the opened file.
EXTENSION= Extension number of newly created extension.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBCREATE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXBFINDLUN [1], FXBFINDLUN [2], FXBPARSE [1]
FXBPARSE [2], FXFINDEND [1], FXFINDEND [2]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
HESSI Create FITS Binary Table, HESSI Write lookup table, INTGCOMP_NRH2
NRH_HSI_FITS, RH_INIT_HEADER, Radio Astronomy Group Fits Write
SHRINK_SUMER_FITS, SPECTRA2FITS, WRITE_CALFITS, WRITE_FLUXNRH, WRITE_POSINRH
XSM_PREP, eis_make_status_fits [2], eis_make_status_fits [3]
hsi_data_gap_fxbw, hsi_ephemeris_fxbw, hsi_filedb_fxbw
hsi_flare_list_entry_fxbw, hsi_flare_list_info_fxbw, hsi_obs_summ_data_fxbw
hsi_obs_summ_fxbw, hsi_obs_summ_info_fxbw, hsi_obs_summ_otp
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hxrs_drm2fits [1], hxrs_drm2fits [2], hxrs_drm2fits [3], mk_trace_i0, rm2fits
smei_hdr_make, tr_wrt_fits, write_ovsa_fits, wrt_fits_bin_exten [1]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The primary FITS data unit must already be written to a file. The
binary table extension header must already be defined (FXBHMAKE), and
must match the data that will be written to the file.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992, based on WRITEFITS by J. Woffard and W. Landsman.
W. Thompson, Feb 1992, changed from function to procedure.
W. Thompson, Feb 1992, removed all references to temporary files.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 3, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 5, Antony Bird, Southampton, 25 June 1997
Modified to allow very long tables
Version :
Version 5, 25 June 1997
Converted to IDL V5.0 W. Landsman September 1997
Added EXTENSION parameter, C. Markwardt 1999 Jul 15
More efficient zeroing of file, C. Markwardt, 26 Feb 2001
[Previous]
[Next]
NAME:
FXBCREATE
Purpose :
Open a new binary table at the end of a FITS file.
Explanation :
Write a binary table extension header to the end of a disk FITS file,
and leave it open to receive the data.
The FITS file is opened, and the pointer is positioned just after the
last 2880 byte record. Then the binary header is appended. Calls to
FXBWRITE will append the binary data to this file, and then FXBFINISH
will close the file.
Use :
FXBCREATE, UNIT, FILENAME, HEADER
Inputs :
FILENAME = Name of FITS file to be opened.
HEADER = String array containing the FITS binary table extension
header.
Opt. Inputs :
None.
Outputs :
UNIT = Logical unit number of the opened file.
EXTENSION= Extension number of newly created extension.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBCREATE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXBFINDLUN [1], FXBFINDLUN [2], FXBPARSE [1]
FXBPARSE [2], FXFINDEND [1], FXFINDEND [2]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
HESSI Create FITS Binary Table, HESSI Write lookup table, INTGCOMP_NRH2
NRH_HSI_FITS, RH_INIT_HEADER, Radio Astronomy Group Fits Write
SHRINK_SUMER_FITS, SPECTRA2FITS, WRITE_CALFITS, WRITE_FLUXNRH, WRITE_POSINRH
XSM_PREP, eis_make_status_fits [2], eis_make_status_fits [3]
hsi_data_gap_fxbw, hsi_ephemeris_fxbw, hsi_filedb_fxbw
hsi_flare_list_entry_fxbw, hsi_flare_list_info_fxbw, hsi_obs_summ_data_fxbw
hsi_obs_summ_fxbw, hsi_obs_summ_info_fxbw, hsi_obs_summ_otp
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hxrs_drm2fits [1], hxrs_drm2fits [2], hxrs_drm2fits [3], mk_trace_i0, rm2fits
smei_hdr_make, tr_wrt_fits, write_ovsa_fits, wrt_fits_bin_exten [1]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The primary FITS data unit must already be written to a file. The
binary table extension header must already be defined (FXBHMAKE), and
must match the data that will be written to the file.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992, based on WRITEFITS by J. Woffard and W. Landsman.
W. Thompson, Feb 1992, changed from function to procedure.
W. Thompson, Feb 1992, removed all references to temporary files.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 3, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 5, Antony Bird, Southampton, 25 June 1997
Modified to allow very long tables
Version :
Version 5, 25 June 1997
Converted to IDL V5.0 W. Landsman September 1997
Added EXTENSION parameter, C. Markwardt 1999 Jul 15
More efficient zeroing of file, C. Markwardt, 26 Feb 2001
[Previous]
[Next]
NAME:
FXBDIMEN()
PURPOSE:
Returns the dimensions for a column in a FITS binary table.
Explanation : This procedure returns the dimensions associated with a column
in a binary table opened for read with the command FXBOPEN.
Use : Result = FXBDIMEN(UNIT,COL)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
COL = Column in the binary table to read data from, either
as a character string containing a column label
(TTYPE), or as a numerical column index starting from
column one.
Opt. Inputs : None.
Outputs : The result of the function is an array containing the
dimensions for the specified column in the FITS binary table
that UNIT points to.
Opt. Outputs: None.
Keywords : 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 = ''
Result = FXBDIMEN( ERRMSG=ERRMSG, ... )
IF ERRMSG NE '' THEN ...
Calls : ***
FXBCOLNUM [1], FXBCOLNUM [2], FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
CAL_DETREAD, CAL_DETSELECT, CHECKCDSFITS, DETREAD, DETSELECT, JPLEPHREAD, READSUMCOL
SUMDETREAD
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: The dimensions will be returned whether or not the table is
still open or not.
If UNIT does not point to a binary table, then 0 is returned.
If UNIT is an undefined variable, then 0 is returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 4 March 1994.
Modified : Version 1, William Thompson, GSFC, 4 March 1994.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version : Version 3, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBDIMEN()
PURPOSE:
Returns the dimensions for a column in a FITS binary table.
Explanation : This procedure returns the dimensions associated with a column
in a binary table opened for read with the command FXBOPEN.
Use : Result = FXBDIMEN(UNIT,COL)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
COL = Column in the binary table to read data from, either
as a character string containing a column label
(TTYPE), or as a numerical column index starting from
column one.
Opt. Inputs : None.
Outputs : The result of the function is an array containing the
dimensions for the specified column in the FITS binary table
that UNIT points to.
Opt. Outputs: None.
Keywords : 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 = ''
Result = FXBDIMEN( ERRMSG=ERRMSG, ... )
IF ERRMSG NE '' THEN ...
Calls : ***
FXBCOLNUM [1], FXBCOLNUM [2], FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
CAL_DETREAD, CAL_DETSELECT, CHECKCDSFITS, DETREAD, DETSELECT, JPLEPHREAD, READSUMCOL
SUMDETREAD
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: The dimensions will be returned whether or not the table is
still open or not.
If UNIT does not point to a binary table, then 0 is returned.
If UNIT is an undefined variable, then 0 is returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 4 March 1994.
Modified : Version 1, William Thompson, GSFC, 4 March 1994.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version : Version 3, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBFIND
Purpose :
Find column keywords in a FITS binary table header.
Explanation :
Finds the value of a column keyword for all the columns in the binary
table for which it is set. For example,
FXBFIND, UNIT, 'TTYPE', COLUMNS, VALUES, N_FOUND
Would find all instances of the keywords TTYPE1, TTYPE2, etc. The
array COLUMNS would contain the column numbers for which a TTYPEn
keyword was found, and VALUES would contain the values. N_FOUND would
contain the total number of instances found.
Use :
FXBFIND, [UNIT or HEADER], KEYWORD, COLUMNS, VALUES, N_FOUND
[, DEFAULT ]
Inputs :
Either UNIT or HEADER must be passed.
UNIT = Logical unit number of file opened by FXBOPEN.
HEADER = FITS binary table header.
KEYWORD = Prefix to a series of FITS binary table column keywords. The
keywords to be searched for are formed by combining this
prefix with the numbers 1 through the value of TFIELDS in the
header.
Opt. Inputs :
DEFAULT = Default value to use for any column keywords that aren't
found. If passed, then COLUMNS and VALUES will contain
entries for every column. Otherwise, COLUMNS and VALUES only
contain entries for columns where values were found.
Outputs :
COLUMNS = Array containing the column numbers for which values of the
requested keyword series were found.
VALUES = Array containing the found values.
N_FOUND = Number of values found. The value of this parameter is
unaffected by whether or not DEFAULT is passed.
Opt. Outputs:
None.
Output Keywords :
COMMENTS = Comments associated with each keyword, if any
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2], FXPAR [1], FXPAR [2]
CALLED BY:
AUXREAD, CAL_AUXREAD, CAL_DETSELECT, CDS_IMAGE, CHECKCDSFITS, DETSELECT
FITSHEAD2WCS, FXBHELP [1], FXBHELP [2], FXBPARSE [1], FXBPARSE [2]
Fits_spectra [1], Fits_spectra [2], GET_VDS_BIAS, ITOOL_RD_FITS, RD_IMAGE_FITS
SHRINK_SUMER_FITS, SUMDETSELECT, SUMER_FITS, WCS_FIND_KEYWORD, mk_query [1]
mk_query [2], rd_sumer [1], rd_sumer [2], where_are [1], where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
If UNIT is passed, then the file must have been opened with FXBOPEN.
If HEADER is passed, then it must be a legal FITS binary table header.
The type of DEFAULT must be consistent with the values of the requested
keywords, i.e. both most be either of string or numerical type.
The KEYWORD prefix must not have more than five characters to leave
room for the three digits allowed for the column numbers.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Vectorized implementation improves performance, CM 18 Nov 1999
Added COMMENTS keyword CM Nov 2003
[Previous]
[Next]
NAME:
FXBFIND
Purpose :
Find column keywords in a FITS binary table header.
Explanation :
Finds the value of a column keyword for all the columns in the binary
table for which it is set. For example,
FXBFIND, UNIT, 'TTYPE', COLUMNS, VALUES, N_FOUND
Would find all instances of the keywords TTYPE1, TTYPE2, etc. The
array COLUMNS would contain the column numbers for which a TTYPEn
keyword was found, and VALUES would contain the values. N_FOUND would
contain the total number of instances found.
Use :
FXBFIND, [UNIT or HEADER], KEYWORD, COLUMNS, VALUES, N_FOUND
[, DEFAULT ]
Inputs :
Either UNIT or HEADER must be passed.
UNIT = Logical unit number of file opened by FXBOPEN.
HEADER = FITS binary table header.
KEYWORD = Prefix to a series of FITS binary table column keywords. The
keywords to be searched for are formed by combining this
prefix with the numbers 1 through the value of TFIELDS in the
header.
Opt. Inputs :
DEFAULT = Default value to use for any column keywords that aren't
found. If passed, then COLUMNS and VALUES will contain
entries for every column. Otherwise, COLUMNS and VALUES only
contain entries for columns where values were found.
Outputs :
COLUMNS = Array containing the column numbers for which values of the
requested keyword series were found.
VALUES = Array containing the found values.
N_FOUND = Number of values found. The value of this parameter is
unaffected by whether or not DEFAULT is passed.
Opt. Outputs:
None.
Output Keywords :
COMMENTS = Comments associated with each keyword, if any
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2], FXPAR [1], FXPAR [2]
CALLED BY:
AUXREAD, CAL_AUXREAD, CAL_DETSELECT, CDS_IMAGE, CHECKCDSFITS, DETSELECT
FITSHEAD2WCS, FXBHELP [1], FXBHELP [2], FXBPARSE [1], FXBPARSE [2]
Fits_spectra [1], Fits_spectra [2], GET_VDS_BIAS, ITOOL_RD_FITS, RD_IMAGE_FITS
SHRINK_SUMER_FITS, SUMDETSELECT, SUMER_FITS, WCS_FIND_KEYWORD, mk_query [1]
mk_query [2], rd_sumer [1], rd_sumer [2], where_are [1], where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
If UNIT is passed, then the file must have been opened with FXBOPEN.
If HEADER is passed, then it must be a legal FITS binary table header.
The type of DEFAULT must be consistent with the values of the requested
keywords, i.e. both most be either of string or numerical type.
The KEYWORD prefix must not have more than five characters to leave
room for the three digits allowed for the column numbers.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Vectorized implementation improves performance, CM 18 Nov 1999
Added COMMENTS keyword CM Nov 2003
[Previous]
[Next]
NAME:
FXBFINDLUN()
Purpose :
Find logical unit number UNIT in FXBINTABLE common block.
Explanation :
Finds the proper index to use for getting information about the logical
unit number UNIT in the arrays stored in the FXBINTABLE common block.
Called from FXBCREATE and FXBOPEN.
Use :
Result = FXBFINDLUN( UNIT )
Inputs :
UNIT = Logical unit number.
Opt. Inputs :
None.
Outputs :
The result of the function is an index into the FXBINTABLE common
block.
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
BOOST_ARRAY [1], BOOST_ARRAY [2], BOOST_ARRAY [3]
CALLED BY:
FXBCREATE [1], FXBCREATE [2], FXBDIMEN [1], FXBDIMEN [2], FXBFIND [1], FXBFIND [2]
FXBHEADER [1], FXBHEADER [2], FXBHELP [1], FXBHELP [2], FXBISOPEN [1]
FXBISOPEN [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBSTATE [1], FXBSTATE [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
None.
Side effects:
If UNIT is not found in the common block, then it is added to the
common block.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Added DHEAP variable to fix bug with variable length arrays.
Version 3, Michael Schubnell, University of Michigan, 22 May 1996
Change N_DIMS from short to long integer.
Version :
Version 3, 22 May 1996
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBFINDLUN()
Purpose :
Find logical unit number UNIT in FXBINTABLE common block.
Explanation :
Finds the proper index to use for getting information about the logical
unit number UNIT in the arrays stored in the FXBINTABLE common block.
Called from FXBCREATE and FXBOPEN.
Use :
Result = FXBFINDLUN( UNIT )
Inputs :
UNIT = Logical unit number.
Opt. Inputs :
None.
Outputs :
The result of the function is an index into the FXBINTABLE common
block.
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
BOOST_ARRAY [1], BOOST_ARRAY [2], BOOST_ARRAY [3]
CALLED BY:
FXBCREATE [1], FXBCREATE [2], FXBDIMEN [1], FXBDIMEN [2], FXBFIND [1], FXBFIND [2]
FXBHEADER [1], FXBHEADER [2], FXBHELP [1], FXBHELP [2], FXBISOPEN [1]
FXBISOPEN [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBSTATE [1], FXBSTATE [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
None.
Side effects:
If UNIT is not found in the common block, then it is added to the
common block.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Added DHEAP variable to fix bug with variable length arrays.
Version 3, Michael Schubnell, University of Michigan, 22 May 1996
Change N_DIMS from short to long integer.
Version :
Version 3, 22 May 1996
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBFINISH
Purpose :
Close a FITS binary table extension file opened for write.
Explanation :
Closes a FITS binary table extension file that had been opened for
write by FXBCREATE.
Use :
FXBFINISH, UNIT
Inputs :
UNIT = Logical unit number of the file.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBFINISH, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls :
None.
CALLED BY:
CLOSE_CALFITS, EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
HESSI Write lookup table, HESSI packet file close, HESSI score file close
INTGCOMP_NRH2, NRH_HSI_FITS, RH_CLOSE_HEADER, Radio Astronomy Group Fits Write
SHRINK_SUMER_FITS, SPECTRA2FITS, WRITE_FLUXNRH, WRITE_POSINRH, XSM_PREP
eis_make_status_fits [2], eis_make_status_fits [3], hsi_data_gap_fxbw
hsi_ephemeris_fxbw, hsi_filedb_fxbw, hsi_flare_list_entry_fxbw
hsi_flare_list_info_fxbw, hsi_obs_summ_data_fxbw, hsi_obs_summ_fxbw
hsi_obs_summ_info_fxbw, hsi_obs_summ_otp, hsi_obs_summ_soc__define
hsi_obs_summ_write, hsi_qlook__define, hxrs_drm2fits [1], hxrs_drm2fits [2]
hxrs_drm2fits [3], mk_trace_i0, rm2fits, smei_hdr_make, tr_wrt_fits
write_ovsa_fits, wrt_fits_bin_exten [1]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must have been opened with FXBCREATE, and written with
FXBWRITE.
Side effects:
Any bytes needed to pad the file out to an integral multiple of 2880
bytes are written out to the file. Then, the file is closed.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992.
W. Thompson, Feb 1992, modified to support variable length arrays.
W. Thompson, Feb 1992, removed all references to temporary files.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 3, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 4, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBFINISH
Purpose :
Close a FITS binary table extension file opened for write.
Explanation :
Closes a FITS binary table extension file that had been opened for
write by FXBCREATE.
Use :
FXBFINISH, UNIT
Inputs :
UNIT = Logical unit number of the file.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBFINISH, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls :
None.
CALLED BY:
CLOSE_CALFITS, EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
HESSI Write lookup table, HESSI packet file close, HESSI score file close
INTGCOMP_NRH2, NRH_HSI_FITS, RH_CLOSE_HEADER, Radio Astronomy Group Fits Write
SHRINK_SUMER_FITS, SPECTRA2FITS, WRITE_FLUXNRH, WRITE_POSINRH, XSM_PREP
eis_make_status_fits [2], eis_make_status_fits [3], hsi_data_gap_fxbw
hsi_ephemeris_fxbw, hsi_filedb_fxbw, hsi_flare_list_entry_fxbw
hsi_flare_list_info_fxbw, hsi_obs_summ_data_fxbw, hsi_obs_summ_fxbw
hsi_obs_summ_info_fxbw, hsi_obs_summ_otp, hsi_obs_summ_soc__define
hsi_obs_summ_write, hsi_qlook__define, hxrs_drm2fits [1], hxrs_drm2fits [2]
hxrs_drm2fits [3], mk_trace_i0, rm2fits, smei_hdr_make, tr_wrt_fits
write_ovsa_fits, wrt_fits_bin_exten [1]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must have been opened with FXBCREATE, and written with
FXBWRITE.
Side effects:
Any bytes needed to pad the file out to an integral multiple of 2880
bytes are written out to the file. Then, the file is closed.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992.
W. Thompson, Feb 1992, modified to support variable length arrays.
W. Thompson, Feb 1992, removed all references to temporary files.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 3, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 4, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBGROW
PURPOSE :
Increase the number of rows in a binary table.
EXPLANATION :
Call FXBGROW to increase the size of an already-existing FITS
binary table. The number of rows increases to NROWS; however
the table cannot shrink by this operation. This procedure is
useful when a table with an unknown number of rows must be
created. The caller would then call FXBCREATE to construct a
table of some base size, and follow with calls to FXBGROW to
lengthen the table as needed. The extension being enlarged
need not be the last extension in the file. If subsequent
extensions exist in the file, they will be shifted properly.
CALLING SEQUENCE :
FXBGROW, UNIT, HEADER, NROWS[, ERRMSG= , NOZERO= , BUFFERSIZE= ]
INPUT PARAMETERS :
UNIT = Logical unit number of an already-opened file.
HEADER = String array containing the FITS binary table extension
header. The header is modified in place.
NROWS = New number of rows, always more than the previous
number.
OPTIONAL INPUT KEYWORDS:
NOZERO = when set, FXBGROW will not zero-pad the new data if
it doesn't have to.
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 = ''
FXBGROW, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
BUFFERSIZE = Size in bytes for intermediate data transfers
(default 32768)
Calls : ***
BLKSHIFT [1], BLKSHIFT [2], FXADDPAR [1], FXADDPAR [2], FXHREAD [1], FXHREAD [2]
FXPAR [1], FXPAR [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must be open with write permission.
The binary table extension in question must already by written
to the file (using FXBCREATE).
A table can never shrink via this operation.
SIDE EFFECTS:
The FITS file will grow in size, and heap areas are
preserved by moving them to the end of the file.
The header is modified to reflect the new number of rows.
CATEGORY :
Data Handling, I/O, FITS, Generic.
Initially written, C. Markwardt, GSFC, Nov 1998
Added ability to enlarge arbitrary extensions and tables with
variable sized rows, not just the last extension in a file,
CM, April 2000
Fix bug in the zeroing of the output file, C. Markwardt, April 2005
[Previous]
[Next]
NAME:
FXBHEADER()
PURPOSE:
Returns the header of an open FITS binary table.
Explanation : This procedure returns the FITS extension header of a FITS
binary table opened for read with the command FXBOPEN.
Use : Result = FXBHEADER(UNIT)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is a string array containing the
header for the FITS binary table that UNIT points to.
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
FITS CLASS DEFINITION, FITSHEAD2WCS, LEC_NRH1D, READCDSCOL, READSUMCOL
READ_CALFITS, WCS_FIND_KEYWORD
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: The string array returned always has as many elements as the
largest header read by FXBOPEN. Any extra elements beyond the
true header are blank or null strings.
The header will be returned whether or not the table is still
open or not.
If UNIT does not point to a binary table, then a string array
of nulls is returned.
If UNIT is an undefined variable, then the null string is
returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 1 July 1993.
Modified : Version 1, William Thompson, GSFC, 1 July 1993.
Version : Version 1, 1 July 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBHEADER()
PURPOSE:
Returns the header of an open FITS binary table.
EXPLANATION:
This procedure returns the FITS extension header of a FITS
binary table opened for read with the command FXBOPEN.
Use : Result = FXBHEADER(UNIT)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is a string array containing the
header for the FITS binary table that UNIT points to.
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
FITS CLASS DEFINITION, FITSHEAD2WCS, LEC_NRH1D, READCDSCOL, READSUMCOL
READ_CALFITS, WCS_FIND_KEYWORD
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: The string array returned always has as many elements as the
largest header read by FXBOPEN. Any extra elements beyond the
true header are blank or null strings.
The header will be returned whether or not the table is still
open or not.
If UNIT does not point to a binary table, then a string array
of nulls is returned.
If UNIT is an undefined variable, then the null string is
returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 1 July 1993.
Modified : Version 1, William Thompson, GSFC, 1 July 1993.
Version : Version 1, 1 July 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBHELP
Purpose :
Prints short description of columns in a FITS binary table.
Explanation :
Prints a short description of the columns in a FITS binary table to the
terminal screen.
Use :
FXBHELP, UNIT
Inputs :
UNIT = Logical unit number of file opened by FXBOPEN.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
FXBFIND [1], FXBFIND [2], FXBFINDLUN [1], FXBFINDLUN [2], FXPAR [1], FXPAR [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must have been opened with FXBOPEN.
Side effects:
Certain fields may be truncated in the display.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992, from TBHELP by W. Landsman.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 12 May 1993.
Modified to not write to a logical unit number assigned to the
terminal. This makes it compatible with IDL for Windows.
Version :
Version 2, 12 May 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBHELP
Purpose :
Prints short description of columns in a FITS binary table.
Explanation :
Prints a short description of the columns in a FITS binary table to the
terminal screen.
Use :
FXBHELP, UNIT
Inputs :
UNIT = Logical unit number of file opened by FXBOPEN.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
FXBFIND [1], FXBFIND [2], FXBFINDLUN [1], FXBFINDLUN [2], FXPAR [1], FXPAR [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must have been opened with FXBOPEN.
Side effects:
Certain fields may be truncated in the display.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992, from TBHELP by W. Landsman.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 12 May 1993.
Modified to not write to a logical unit number assigned to the
terminal. This makes it compatible with IDL for Windows.
Version :
Version 2, 12 May 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBHMAKE
Purpose :
Create basic FITS binary table extension (BINTABLE) header.
Explanation :
Creates a basic header array with all the required keywords, but with
none of the table columns defined. This defines a basic structure
which can then be added to or modified by other routines.
Use :
FXBHMAKE, HEADER, NROWS [, EXTNAME [, COMMENT ]]
Inputs :
NROWS = Number of rows in the binary table.
Opt. Inputs :
EXTNAME = If passed, then the EXTNAME record is added with this value.
COMMENT = Comment to go along with EXTNAME.
Outputs :
HEADER = String array containing FITS extension header.
Opt. Outputs:
None.
Keywords :
INITIALIZE = If set, then the header is completely initialized, and any
previous entries are lost.
DATE = If set, then the DATE keyword is added to the header.
EXTVER = Extension version number (integer).
EXTLEVEL = Extension level number (integer).
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 = ''
FXBHMAKE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXHCLEAN [1], FXHCLEAN [2], GET_DATE [1], GET_DATE [2]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], FITS WRITER CLASS, FITSFILE__DEFINE [3]
HESSI Create FITS Binary Table, HESSI Write lookup table, INTGCOMP_NRH2
OPEN_CALFITS, Radio Astronomy Group Fits Write, SPECTRA2FITS, WRITE_FLUXNRH
WRITE_POSINRH, eis_make_status_fits [2], eis_make_status_fits [3]
hsi_data_gap_fxbh, hsi_ephemeris_fxbh, hsi_filedb_fxbh
hsi_flare_list_info_fxbh, hsi_flarelistentry_fxbh, hsi_obs_summ_data_fxbh
hsi_obs_summ_fxbh, hsi_obs_summ_info_fxbh [2], hsi_obs_summ_otp
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hsi_spectrum__filewrite, hsi_spectrum__fits_headers, hxrs_drm2fits [1]
hxrs_drm2fits [2], hxrs_drm2fits [3], mk_rmf_hdr, mk_trace_i0, smei_hdr_make
tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2], write_ovsa_fits
wrt_ebounds_ext, wrt_eneband_ext, wrt_fits_bin_exten [1]
Common :
None.
Restrictions:
Warning: No checking is done of any of the parameters.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
William Thompson, Sep 1992, added EXTVER and EXTLEVEL keywords.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 3, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBHMAKE
Purpose :
Create basic FITS binary table extension (BINTABLE) header.
Explanation :
Creates a basic header array with all the required keywords, but with
none of the table columns defined. This defines a basic structure
which can then be added to or modified by other routines.
Use :
FXBHMAKE, HEADER, NROWS [, EXTNAME [, COMMENT ]]
Inputs :
NROWS = Number of rows in the binary table.
Opt. Inputs :
EXTNAME = If passed, then the EXTNAME record is added with this value.
COMMENT = Comment to go along with EXTNAME.
Outputs :
HEADER = String array containing FITS extension header.
Opt. Outputs:
None.
Keywords :
INITIALIZE = If set, then the header is completely initialized, and any
previous entries are lost.
DATE = If set, then the DATE keyword is added to the header.
EXTVER = Extension version number (integer).
EXTLEVEL = Extension level number (integer).
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 = ''
FXBHMAKE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXHCLEAN [1], FXHCLEAN [2], GET_DATE [1], GET_DATE [2]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], FITS WRITER CLASS, FITSFILE__DEFINE [3]
HESSI Create FITS Binary Table, HESSI Write lookup table, INTGCOMP_NRH2
OPEN_CALFITS, Radio Astronomy Group Fits Write, SPECTRA2FITS, WRITE_FLUXNRH
WRITE_POSINRH, eis_make_status_fits [2], eis_make_status_fits [3]
hsi_data_gap_fxbh, hsi_ephemeris_fxbh, hsi_filedb_fxbh
hsi_flare_list_info_fxbh, hsi_flarelistentry_fxbh, hsi_obs_summ_data_fxbh
hsi_obs_summ_fxbh, hsi_obs_summ_info_fxbh [2], hsi_obs_summ_otp
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hsi_spectrum__filewrite, hsi_spectrum__fits_headers, hxrs_drm2fits [1]
hxrs_drm2fits [2], hxrs_drm2fits [3], mk_rmf_hdr, mk_trace_i0, smei_hdr_make
tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2], write_ovsa_fits
wrt_ebounds_ext, wrt_eneband_ext, wrt_fits_bin_exten [1]
Common :
None.
Restrictions:
Warning: No checking is done of any of the parameters.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
William Thompson, Sep 1992, added EXTVER and EXTLEVEL keywords.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version :
Version 3, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Project : SOHO - CDS
Name :
FXBINTABLE
Purpose :
Common block FXBINTABLE used by "FXB" routines.
Explanation :
This is not an IDL routine as such, but contains the definition of the
common block FXBINTABLE for inclusion into other routines. By defining
the common block in one place, the problem of conflicting definitions
is avoided.
This file is included into routines that need this common block with
the single line (left justified)
@fxbintable
FXBINTABLE contains the following arrays:
LUN = An array of logical unit numbers of currently (or
previously) opened binary table files.
STATE = Array containing the state of the FITS files
associated with the logical unit numbers, where
0=closed, 1=open for read, and 2=open for write.
HEAD = FITS binary table headers.
MHEADER = Array containing the positions of the first data byte
of the header for each file referenced by array LUN.
NHEADER = Array containing the positions of the first data byte
after the header for each file referenced by array
LUN.
NAXIS1 = Values of NAXIS1 from the binary table headers.
NAXIS2 = Values of NAXIS2 from the binary table headers.
TFIELDS = Values of TFIELDS from the binary table headers.
HEAP = The start of the first byte of the heap area
for variable length arrays.
DHEAP = The start of the first byte of the next variable
length array, if writing.
BYTOFF = Byte offset from the beginning of the row for each
column in the binary table headers.
TTYPE = Values of TTYPE for each column in the binary table
headers.
FORMAT = Character code formats of the various columns.
IDLTYPE = IDL type code for each column in the binary table
headers.
N_ELEM = Number of elements for each column in the binary
table headers.
TSCAL = Scale factors for the individual columns.
TZERO = Zero offsets for the individual columns.
MAXVAL = For variable length arrays, contains the maximum
number of elements for each column in the binary
table headers.
N_DIMS = Number of dimensions, and array of dimensions for
each column of type string in the binary table
headers.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Added DHEAP variable to fix bug with variable length arrays.
Version :
Version 2, 21 July 1993.
[Previous]
[Next]
NAME:
FXBINTABLE
Purpose :
Common block FXBINTABLE used by "FXB" routines.
Explanation :
This is not an IDL routine as such, but contains the definition of the
common block FXBINTABLE for inclusion into other routines. By defining
the common block in one place, the problem of conflicting definitions
is avoided.
This file is included into routines that need this common block with
the single line (left justified)
@fxbintable
FXBINTABLE contains the following arrays:
LUN = An array of logical unit numbers of currently (or
previously) opened binary table files.
STATE = Array containing the state of the FITS files
associated with the logical unit numbers, where
0=closed, 1=open for read, and 2=open for write.
HEAD = FITS binary table headers.
MHEADER = Array containing the positions of the first data byte
of the header for each file referenced by array LUN.
NHEADER = Array containing the positions of the first data byte
after the header for each file referenced by array
LUN.
NAXIS1 = Values of NAXIS1 from the binary table headers.
NAXIS2 = Values of NAXIS2 from the binary table headers.
TFIELDS = Values of TFIELDS from the binary table headers.
HEAP = The start of the first byte of the heap area
for variable length arrays.
DHEAP = The start of the first byte of the next variable
length array, if writing.
BYTOFF = Byte offset from the beginning of the row for each
column in the binary table headers.
TTYPE = Values of TTYPE for each column in the binary table
headers.
FORMAT = Character code formats of the various columns.
IDLTYPE = IDL type code for each column in the binary table
headers.
N_ELEM = Number of elements for each column in the binary
table headers.
TSCAL = Scale factors for the individual columns.
TZERO = Zero offsets for the individual columns.
MAXVAL = For variable length arrays, contains the maximum
number of elements for each column in the binary
table headers.
N_DIMS = Number of dimensions, and array of dimensions for
each column of type string in the binary table
headers.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Added DHEAP variable to fix bug with variable length arrays.
Version :
Version 2, 21 July 1993.
[Previous]
[Next]
NAME:
FXBISOPEN()
PURPOSE:
Returns true if UNIT points to an open FITS binary table.
Explanation : This procedure checks to see if the logical unit number given
by the variable UNIT corresponds to a FITS binary table opened
for read with the command FXBOPEN, and which has not yet been
closed with FXBCLOSE.
Use : Result = FXBISOPEN(UNIT)
If FXBISOPEN(UNIT) THEN ...
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is either True (1) or False (0),
depending on whether UNIT points to an open binary table or
not.
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
FITSHEAD2WCS, GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2], GET_ORBIT_FITS
GET_SC_ATT [1], GET_SC_ATT [2], READCDSCOL, READCDSFITS, READSUMCOL, READ_CALFITS
READ_SC_ATT, WCS_FIND_KEYWORD
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: If UNIT is an undefined variable, then False (0) is returned.
If UNIT points to a FITS binary table file that is opened for
write, then False (0) is returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 1 July 1993.
Modified : Version 1, William Thompson, GSFC, 1 July 1993.
Version : Version 1, 1 July 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBISOPEN()
PURPOSE:
Returns true if UNIT points to an open FITS binary table.
Explanation : This procedure checks to see if the logical unit number given
by the variable UNIT corresponds to a FITS binary table opened
for read with the command FXBOPEN, and which has not yet been
closed with FXBCLOSE.
Use : Result = FXBISOPEN(UNIT)
If FXBISOPEN(UNIT) THEN ...
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is either True (1) or False (0),
depending on whether UNIT points to an open binary table or
not.
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
FITSHEAD2WCS, GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2], GET_ORBIT_FITS
GET_SC_ATT [1], GET_SC_ATT [2], READCDSCOL, READCDSFITS, READSUMCOL, READ_CALFITS
READ_SC_ATT, WCS_FIND_KEYWORD
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: If UNIT is an undefined variable, then False (0) is returned.
If UNIT points to a FITS binary table file that is opened for
write, then False (0) is returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 1 July 1993.
Modified : Version 1, William Thompson, GSFC, 1 July 1993.
Version : Version 1, 1 July 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Project : SOHO - CDS
Name : FXBMHEADER()
Purpose : Returns the file header of an open FITS binary table.
Explanation : This procedure returns the FITS primary file header of a FITS
binary table opened for read with the command FXBOPEN.
Use : Result = FXBMHEADER(UNIT)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is a string array containing the
header for the FITS file that UNIT points to.
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXHREAD [1], FXHREAD [2]
CALLED BY:
READSUM2CDS, READSUMCOL
Common : None.
Restrictions: UNIT must point to an open FITS file.
Side effects: If UNIT does not point to a binary table, then a string array
of nulls is returned.
If UNIT is an undefined variable, then the null string is
returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 17 November 1995
Modified : Version 1, William Thompson, GSFC, 17 November 1995
Version : Version 1, 17 November 1995
[Previous]
[Next]
NAME:
FXBOPEN
Purpose :
Open binary table extension in a disk FITS file for reading or updating
Explanation :
Opens a binary table extension in a disk FITS file for reading. The
columns are then read using FXBREAD, and the file is closed when done
with FXBCLOSE.
Use :
FXBOPEN, UNIT, FILENAME, EXTENSION [, HEADER ]
Inputs :
FILENAME = Name of FITS file to be opened. Optional
extension *number* may be specified, in either of
the following formats (using the FTOOLS
convention): FILENAME[EXT] or FILENAME+EXT, where
EXT is 1 or higher. Such an extension
specification takes priority over EXTENSION.
EXTENSION = Either the number of the FITS extension, starting with the
first extension after the primary data unit being one; or a
character string containing the value of EXTNAME to search
for.
Opt. Inputs :
None.
Outputs :
UNIT = Logical unit number of the opened file.
Opt. Outputs:
HEADER = String array containing the FITS binary table extension
header.
Keywords :
NO_TDIM = If set, then any TDIMn keywords found in the header are
ignored.
ACCESS = A scalar string describing access privileges as
one of READ ('R') or UPDATE ('RW').
DEFAULT: 'R'
REOPEN = If set, UNIT must be an already-opened file unit.
FXBOPEN will treat the file as a FITS file.
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 = ''
FXBOPEN, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2], FXBPARSE [1], FXBPARSE [2], FXHREAD [1]
FXHREAD [2], FXPAR [1], FXPAR [2]
CALLED BY:
CDS_IMAGE, CFITSLIST, CHECKCDSFITS, CW_XTD_NRHF, EIS_DATA_READFOREIGN
EIS_DATA__READFITS [1], EIS_DATA__READFITS [2], FIND_FILE_DUR
FITS CLASS DEFINITION, FITS_HDR__READ [3], FOPEN_NRH2, Fits_spectra [1]
Fits_spectra [2], GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2], GET_ORBIT_FITS
GET_SC_ATT [1], GET_SC_ATT [2], GT_EXPTIME [2], GT_MIRRPOS, GT_NUMEXP, GT_NUMWIN
GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL, GT_WNUM, ITOOL_RD_FITS
JPLEPHREAD, LEC_NRH1D, LIT_HEADER_NRH1, Open Packet File, Open Score File
PLOT_DELTAT, RDFILEPOS, RD_IMAGE_FITS, RD_LAS_CAT_FITS, READCALFITS, READCDSFITS
READSUM2CDS, READ_CENTER_POINT [1], READ_CENTER_POINT [2], READ_COMPRESSED
READ_SC_ATT, Radio Astronomy Group Fits Read
Radiospectrogram FITS File reader [1], SHRINK_SUMER_FITS, SUMER_FITS
TIME_IND_NRH, WCS_FIND_TABLE, eis_rd_sts_fits [1], eis_read_fits_data [2]
eis_read_fits_data [3], eis_read_fits_header [1], eis_read_fits_header [2]
eis_status_fits_reader1, ft_sumread_fits, gt_exptime [1]
hsi_check_qlook_extensions, hsi_data_gap_fxbr, hsi_ephemeris_fxbr
hsi_filedb_fxbr, hsi_flare_list_entry_fxbr, hsi_flare_list_info_fxbr
hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr, hsi_obs_summ_info_fxbr
hsi_obs_summ_inp, hsi_obs_summ_otp, hsi_obs_summ_read
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hsi_test_bad_file, mk_query [1], mk_query [2], mrdfits_spectra, rd_sumer [1]
rd_sumer [2], read_cds_im, read_ovsa_fits, smei_hdr_get, where_are [1]
where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must be a valid FITS file.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb 1992, based on READFITS by J. Woffard and W. Landsman.
W. Thompson, Feb 1992, changed from function to procedure.
W. Thompson, June 1992, fixed up error handling.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 27 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 21 June 1994
Extended ERRMSG to call to FXBPARSE
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
Added ACCESS, REOPEN keywords, and FXFILTER package, CM 1999 Feb 03
Added FILENAME[EXT] and FILENAME+EXT extension parsing, CM 1999 Jun 28
Some general tidying, CM 1999 Nov 18
[Previous]
[Next]
NAME:
FXBOPEN
Purpose :
Open binary table extension in a disk FITS file for reading or updating
Explanation :
Opens a binary table extension in a disk FITS file for reading. The
columns are then read using FXBREAD, and the file is closed when done
with FXBCLOSE.
Use :
FXBOPEN, UNIT, FILENAME, EXTENSION [, HEADER ]
Inputs :
FILENAME = Name of FITS file to be opened. Optional
extension *number* may be specified, in either of
the following formats (using the FTOOLS
convention): FILENAME[EXT] or FILENAME+EXT, where
EXT is 1 or higher. Such an extension
specification takes priority over EXTENSION.
EXTENSION = Either the number of the FITS extension, starting with the
first extension after the primary data unit being one; or a
character string containing the value of EXTNAME to search
for.
Opt. Inputs :
None.
Outputs :
UNIT = Logical unit number of the opened file.
Opt. Outputs:
HEADER = String array containing the FITS binary table extension
header.
Keywords :
NO_TDIM = If set, then any TDIMn keywords found in the header are
ignored.
ACCESS = A scalar string describing access privileges as
one of READ ('R') or UPDATE ('RW').
DEFAULT: 'R'
REOPEN = If set, UNIT must be an already-opened file unit.
FXBOPEN will treat the file as a FITS file.
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 = ''
FXBOPEN, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2], FXBPARSE [1], FXBPARSE [2], FXHREAD [1]
FXHREAD [2], FXPAR [1], FXPAR [2]
CALLED BY:
CDS_IMAGE, CFITSLIST, CHECKCDSFITS, CW_XTD_NRHF, EIS_DATA_READFOREIGN
EIS_DATA__READFITS [1], EIS_DATA__READFITS [2], FIND_FILE_DUR
FITS CLASS DEFINITION, FITS_HDR__READ [3], FOPEN_NRH2, Fits_spectra [1]
Fits_spectra [2], GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2], GET_ORBIT_FITS
GET_SC_ATT [1], GET_SC_ATT [2], GT_EXPTIME [2], GT_MIRRPOS, GT_NUMEXP, GT_NUMWIN
GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL, GT_WNUM, ITOOL_RD_FITS
JPLEPHREAD, LEC_NRH1D, LIT_HEADER_NRH1, Open Packet File, Open Score File
PLOT_DELTAT, RDFILEPOS, RD_IMAGE_FITS, RD_LAS_CAT_FITS, READCALFITS, READCDSFITS
READSUM2CDS, READ_CENTER_POINT [1], READ_CENTER_POINT [2], READ_COMPRESSED
READ_SC_ATT, Radio Astronomy Group Fits Read
Radiospectrogram FITS File reader [1], SHRINK_SUMER_FITS, SUMER_FITS
TIME_IND_NRH, WCS_FIND_TABLE, eis_rd_sts_fits [1], eis_read_fits_data [2]
eis_read_fits_data [3], eis_read_fits_header [1], eis_read_fits_header [2]
eis_status_fits_reader1, ft_sumread_fits, gt_exptime [1]
hsi_check_qlook_extensions, hsi_data_gap_fxbr, hsi_ephemeris_fxbr
hsi_filedb_fxbr, hsi_flare_list_entry_fxbr, hsi_flare_list_info_fxbr
hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr, hsi_obs_summ_info_fxbr
hsi_obs_summ_inp, hsi_obs_summ_otp, hsi_obs_summ_read
hsi_obs_summ_soc__define, hsi_obs_summ_write, hsi_qlook__define
hsi_test_bad_file, mk_query [1], mk_query [2], mrdfits_spectra, rd_sumer [1]
rd_sumer [2], read_cds_im, read_ovsa_fits, smei_hdr_get, where_are [1]
where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The file must be a valid FITS file.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb 1992, based on READFITS by J. Woffard and W. Landsman.
W. Thompson, Feb 1992, changed from function to procedure.
W. Thompson, June 1992, fixed up error handling.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 27 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 21 June 1994
Extended ERRMSG to call to FXBPARSE
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, 23 June 1994
Converted to IDL V5.0 W. Landsman September 1997
Added ACCESS, REOPEN keywords, and FXFILTER package, CM 1999 Feb 03
Added FILENAME[EXT] and FILENAME+EXT extension parsing, CM 1999 Jun 28
Some general tidying, CM 1999 Nov 18
[Previous]
[Next]
NAME:
FXBPARSE
Purpose :
Parse the binary table extension header.
Explanation :
Parses the binary table extension header, and store the information
about the format of the binary table in the FXBINTABLE common
block--called from FXBCREATE and FXBOPEN.
Use :
FXBPARSE, ILUN, UNIT, HEADER
Inputs :
ILUN = Index into the arrays in the FXBINTABLE common block.
HEADER = FITS binary table extension header.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
NO_TDIM = If set, then any TDIMn keywords found in the header are
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 = ''
FXBPARSE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXBFIND [1], FXBFIND [2], FXBTDIM [1], FXBTDIM [2], FXBTFORM [1], FXBTFORM [2]
FXPAR [1], FXPAR [2], STORE_ARRAY [1], STORE_ARRAY [2], STORE_ARRAY [3]
CALLED BY:
FXBCREATE [1], FXBCREATE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
None.
Side effects:
Any TDIMn keywords found for bit arrays (format 'X') are ignored, since
the dimensions would refer to bits, not bytes.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
William Thompson, Jan. 1993, modified for renamed FXBTFORM and FXBTDIM.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, Michael Schubnell, University of Michigan, 22 May 1996
Change N_DIMS from short to long integer.
Version 5, W. Landsman, GSFC, 12 Aug 1997
Use double complex datatype, if needed
Version 6, W. Landsman GSFC 30 Aug 1997
Version :
Version 6, 31 Aug 1997
Converted to IDL V5.0 W. Landsman September 1997
Optimized FXPAR; call FXBFIND for speed, CM 1999 Nov 18
Modify DHEAP(ILUN) when opening table now, CM 2000 Feb 22
Default the TZERO/TSCAL tables to double instead of single
precision floating point, CM 2003 Nov 23
[Previous]
[Next]
NAME:
FXBPARSE
Purpose :
Parse the binary table extension header.
Explanation :
Parses the binary table extension header, and store the information
about the format of the binary table in the FXBINTABLE common
block--called from FXBCREATE and FXBOPEN.
Use :
FXBPARSE, ILUN, UNIT, HEADER
Inputs :
ILUN = Index into the arrays in the FXBINTABLE common block.
HEADER = FITS binary table extension header.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
NO_TDIM = If set, then any TDIMn keywords found in the header are
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 = ''
FXBPARSE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXBFIND [1], FXBFIND [2], FXBTDIM [1], FXBTDIM [2], FXBTFORM [1], FXBTFORM [2]
FXPAR [1], FXPAR [2], STORE_ARRAY [1], STORE_ARRAY [2], STORE_ARRAY [3]
CALLED BY:
FXBCREATE [1], FXBCREATE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
None.
Side effects:
Any TDIMn keywords found for bit arrays (format 'X') are ignored, since
the dimensions would refer to bits, not bytes.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
William Thompson, Jan. 1993, modified for renamed FXBTFORM and FXBTDIM.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, Michael Schubnell, University of Michigan, 22 May 1996
Change N_DIMS from short to long integer.
Version 5, W. Landsman, GSFC, 12 Aug 1997
Use double complex datatype, if needed
Version 6, W. Landsman GSFC 30 Aug 1997
Version :
Version 6, 31 Aug 1997
Converted to IDL V5.0 W. Landsman September 1997
Optimized FXPAR; call FXBFIND for speed, CM 1999 Nov 18
Modify DHEAP(ILUN) when opening table now, CM 2000 Feb 22
Default the TZERO/TSCAL tables to double instead of single
precision floating point, CM 2003 Nov 23
[Previous]
[Next]
NAME:
FXBREAD
Purpose :
Read a data array from a disk FITS binary table file.
Explanation :
Each call to FXBREAD will read the data from one column and one row
from the FITS data file, which should already have been opened by
FXBOPEN. One needs to call this routine for every column and every row
in the binary table. FXBCLOSE will then close the FITS data file.
Use :
FXBREAD, UNIT, DATA, COL [, ROW ]
Inputs :
UNIT = Logical unit number corresponding to the file containing the
binary table.
COL = Column in the binary table to read data from, either as a
character string containing a column label (TTYPE), or as a
numerical column index starting from column one.
Opt. Inputs :
ROW = Either row number in the binary table to read data from,
starting from row one, or a two element array containing a
range of row numbers to read. If not passed, then the entire
column is read in.
Row must be passed for variable length arrays.
Outputs :
DATA = IDL data array to be read from the file.
Opt. Outputs:
None.
Keywords :
NOSCALE = If set, then the output data will not be scaled using the
optional TSCAL and TZERO keywords in the FITS header.
Default is to scale.
NOIEEE = If set, then the output data is not byte-swapped to
machine order. NOIEEE implies NOSCALE.
Default is to perform the byte-swap.
VIRTUAL = If set, and COL is passed as a name rather than a number,
then if the program can't find a column with that name, it
will then look for a keyword with that name in the header.
Such a keyword would then act as a "virtual column", with the
same value for every row.
DIMENSIONS = Vector array containing the dimensions to be used to read
in the data. Bypasses any dimensioning information stored in
the header. Ignored for bit arrays. If the data type is
double-precision complex, then an extra dimension of 2 is
prepended to the dimensions passed by the user.
NANVALUE= Value signalling data dropout. All points corresponding to
IEEE NaN (not-a-number) are converted to this number.
Ignored unless DATA is of type float, double-precision or
complex.
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 = ''
FXBREAD, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXPAR [1], FXPAR [2], IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3]
IEEE_TO_HOST [4], WHERENAN [1], WHERENAN [2], WHERENAN [3], WHERENAN [4]
WHERE_NEGZERO [1], WHERE_NEGZERO [2]
CALLED BY:
CW_XTD_NRHF, EIS_DATA_READFOREIGN, EIS_DATA__READFITS [1]
EIS_DATA__READFITS [2], FIND_FILE_DUR, FITSHEAD2WCS, FOPEN_NRH2
Fits_spectra [1], Fits_spectra [2], GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2]
GET_ORBIT_FITS, GET_SC_ATT [1], GET_SC_ATT [2], HESSI Score Read, JPLEPHREAD
LEC_NRH1D, RDFILEPOS, RD_LAS_CAT_FITS, RD_NRH2I, READCDSCOL, READSUMCOL
READ_CALFITS, READ_CENTER_POINT [1], READ_CENTER_POINT [2], READ_COMPRESSED
READ_SC_ATT, Radio Astronomy Group Fits Read
Radiospectrogram FITS File reader [1], SHRINK_SUMER_FITS, SUMER_FITS
TIME_IND_NRH, WCS_FIND_KEYWORD, WCS_FIND_PIXEL_LIST, WCS_FIND_TABLE
eis_rd_sts_fits [1], eis_read_fits_data [1], eis_read_fits_data [2]
eis_read_fits_data [3], ft_sumread_fits, hsi_data_gap_fxbr, hsi_ephemeris_fxbr
hsi_filedb_fxbr, hsi_flare_list_entry_fxbr, hsi_flare_list_info_fxbr
hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr, hsi_obs_summ_info_fxbr
hsi_obs_summ_inp, hsi_obs_summ_read, hsi_obs_summ_soc__define
hsi_qlook__define, mk_query [1], mk_query [2], mrdfits_spectra, rd_sumer [1]
rd_sumer [2], read_ovsa_fits, smei_hdr_get, where_are [1], where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBOPEN.
The data must be consistent with the column definition in the binary
table header.
The row number must be consistent with the number of rows stored in the
binary table header.
The number of elements implied by the dimensions keyword must not
exceed the number of elements stored in the file.
Side effects:
If the DIMENSIONS keyword is used, then the number of data points read
in may be less than the number of points stored in the table.
If there are no elements to read in (the number of elements is zero),
then the program sets !ERR to -1, and DATA is unmodified.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992.
W. Thompson, Feb 1992, modified to support variable length arrays.
W. Thompson, Jun 1992, modified way that row ranges are read in. No
longer works reiteratively.
W. Thompson, Jun 1992, fixed bug where NANVALUE would be modified by
TSCAL and TZERO keywords.
W. Thompson, Jun 1992, fixed bug when reading character strings.
Treats dimensions better when reading multiple
rows.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 30 June 1993.
Added overwrite keyword to REFORM call to speed up.
Version 3, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 4, William Thompson, GSFC, 29 October 1993.
Added error message for not finding column by name.
Version 5, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 6, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 7, William Thompson, GSFC, 29 December 1994
Fixed bug where single element dimensions were lost.
Version 8, William Thompson, GSFC, 20 March 1995
Fixed bug introduced in version 7.
Version 9, Wayne Landsman, GSFC, 3 July 1996
Fixed bug involving use of virtual keyword.
Version 10, William Thompson, GSFC, 31-Jan-1997
Added call to WHERE_NEGZERO.
Version 11, Wayne Landsman, GSFC, 12 Aug, 1997
Use IDL dcomplex datatype if needed
Version 12, Wayne Landmsan, GSFC, 20 Feb, 1998
Remove call to WHERE_NEGZERO (now part of IEEE_TO_HOST)
Version 13, 18 Nov 1999, CM, Add NOIEEE keyword
Version 14, 21 Aug 2000, William Thompson, GSFC
Catch I/O errors
Version :
Version 14, 21 Aug 2000
[Previous]
[Next]
NAME:
FXBREAD
Purpose :
Read a data array from a disk FITS binary table file.
Explanation :
Each call to FXBREAD will read the data from one column and one row
from the FITS data file, which should already have been opened by
FXBOPEN. One needs to call this routine for every column and every row
in the binary table. FXBCLOSE will then close the FITS data file.
Use :
FXBREAD, UNIT, DATA, COL [, ROW ]
Inputs :
UNIT = Logical unit number corresponding to the file containing the
binary table.
COL = Column in the binary table to read data from, either as a
character string containing a column label (TTYPE), or as a
numerical column index starting from column one.
Opt. Inputs :
ROW = Either row number in the binary table to read data from,
starting from row one, or a two element array containing a
range of row numbers to read. If not passed, then the entire
column is read in.
Row must be passed for variable length arrays.
Outputs :
DATA = IDL data array to be read from the file.
Opt. Outputs:
None.
Keywords :
NOSCALE = If set, then the output data will not be scaled using the
optional TSCAL and TZERO keywords in the FITS header.
Default is to scale.
NOIEEE = If set, then the output data is not byte-swapped to
machine order. NOIEEE implies NOSCALE.
Default is to perform the byte-swap.
VIRTUAL = If set, and COL is passed as a name rather than a number,
then if the program can't find a column with that name, it
will then look for a keyword with that name in the header.
Such a keyword would then act as a "virtual column", with the
same value for every row.
DIMENSIONS = Vector array containing the dimensions to be used to read
in the data. Bypasses any dimensioning information stored in
the header. Ignored for bit arrays. If the data type is
double-precision complex, then an extra dimension of 2 is
prepended to the dimensions passed by the user.
NANVALUE= Value signalling data dropout. All points corresponding to
IEEE NaN (not-a-number) are converted to this number.
Ignored unless DATA is of type float, double-precision or
complex.
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 = ''
FXBREAD, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXPAR [1], FXPAR [2], IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3]
IEEE_TO_HOST [4], WHERENAN [1], WHERENAN [2], WHERENAN [3], WHERENAN [4]
WHERE_NEGZERO [1], WHERE_NEGZERO [2]
CALLED BY:
CW_XTD_NRHF, EIS_DATA_READFOREIGN, EIS_DATA__READFITS [1]
EIS_DATA__READFITS [2], FIND_FILE_DUR, FITSHEAD2WCS, FOPEN_NRH2
Fits_spectra [1], Fits_spectra [2], GET_CDS_TEMPS, GET_ORBIT [1], GET_ORBIT [2]
GET_ORBIT_FITS, GET_SC_ATT [1], GET_SC_ATT [2], HESSI Score Read, JPLEPHREAD
LEC_NRH1D, RDFILEPOS, RD_LAS_CAT_FITS, RD_NRH2I, READCDSCOL, READSUMCOL
READ_CALFITS, READ_CENTER_POINT [1], READ_CENTER_POINT [2], READ_COMPRESSED
READ_SC_ATT, Radio Astronomy Group Fits Read
Radiospectrogram FITS File reader [1], SHRINK_SUMER_FITS, SUMER_FITS
TIME_IND_NRH, WCS_FIND_KEYWORD, WCS_FIND_PIXEL_LIST, WCS_FIND_TABLE
eis_rd_sts_fits [1], eis_read_fits_data [1], eis_read_fits_data [2]
eis_read_fits_data [3], ft_sumread_fits, hsi_data_gap_fxbr, hsi_ephemeris_fxbr
hsi_filedb_fxbr, hsi_flare_list_entry_fxbr, hsi_flare_list_info_fxbr
hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr, hsi_obs_summ_info_fxbr
hsi_obs_summ_inp, hsi_obs_summ_read, hsi_obs_summ_soc__define
hsi_qlook__define, mk_query [1], mk_query [2], mrdfits_spectra, rd_sumer [1]
rd_sumer [2], read_ovsa_fits, smei_hdr_get, where_are [1], where_are [2]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBOPEN.
The data must be consistent with the column definition in the binary
table header.
The row number must be consistent with the number of rows stored in the
binary table header.
The number of elements implied by the dimensions keyword must not
exceed the number of elements stored in the file.
Side effects:
If the DIMENSIONS keyword is used, then the number of data points read
in may be less than the number of points stored in the table.
If there are no elements to read in (the number of elements is zero),
then the program sets !ERR to -1, and DATA is unmodified.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992.
W. Thompson, Feb 1992, modified to support variable length arrays.
W. Thompson, Jun 1992, modified way that row ranges are read in. No
longer works reiteratively.
W. Thompson, Jun 1992, fixed bug where NANVALUE would be modified by
TSCAL and TZERO keywords.
W. Thompson, Jun 1992, fixed bug when reading character strings.
Treats dimensions better when reading multiple
rows.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 30 June 1993.
Added overwrite keyword to REFORM call to speed up.
Version 3, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 4, William Thompson, GSFC, 29 October 1993.
Added error message for not finding column by name.
Version 5, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 6, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 7, William Thompson, GSFC, 29 December 1994
Fixed bug where single element dimensions were lost.
Version 8, William Thompson, GSFC, 20 March 1995
Fixed bug introduced in version 7.
Version 9, Wayne Landsman, GSFC, 3 July 1996
Fixed bug involving use of virtual keyword.
Version 10, William Thompson, GSFC, 31-Jan-1997
Added call to WHERE_NEGZERO.
Version 11, Wayne Landsman, GSFC, 12 Aug, 1997
Use IDL dcomplex datatype if needed
Version 12, Wayne Landmsan, GSFC, 20 Feb, 1998
Remove call to WHERE_NEGZERO (now part of IEEE_TO_HOST)
Version 13, 18 Nov 1999, CM, Add NOIEEE keyword
Version 14, 21 Aug 2000, William Thompson, GSFC
Catch I/O errors
Version :
Version 14, 21 Aug 2000
[Previous]
[Next]
NAME:
FXBREADM
PURPOSE:
Read multiple columns/rows from a disk FITS binary table file.
EXPLANATION :
A call to FXBREADM will read data from multiple rows and
multiple columns in a single procedure call. Up to forty-nine
columns may be read in a single pass; the number of rows is
limited essentially by available memory. The file should have
already been opened with FXBOPEN. FXBREADM optimizes reading
multiple columns by first reading a large chunk of data from
the FITS file directly, and then slicing the data into columns
within memory. FXBREADM can read variable-length arrays (see
below).
The number of columns is limited to 49 if data are passed by
positional argument. However, this limitation can be overcome
by having FXBREADM return the data in an array of pointers.
The user should set the PASS_METHOD keyword to 'POINTER', and an
array of pointers to the data will be returned in the POINTERS keyword.
The user is responsible for freeing the pointers; however,
FXBREADM will reuse any pointers passed into the procedure, and
hence any pointed-to data will be destroyed.
FXBREADM can also read variable-length columns from FITS
binary tables. Since such data is not of a fixed size, it is
returned as a structure. The structure has the following
elements:
VARICOL: ;; Flag: variable length column (= 1)
N_ELEMENTS: ;; Total number of elements returned
TYPE: ;; IDL data type code (integer)
N_ROWS: ;; Number of rows read from table (integer)
INDICES: ;; Indices of each row's data (integer array)
DATA: ;; Raw data elements (variable type array)
In order to gain access to the Ith row's data, one should
examine DATA(INDICES(I):INDICES(I+1)-1), which is similar in
construct to the REVERSE_INDICES keyword of the HISTOGRAM
function.
CALLING SEQUENCE:
FXBREADM, UNIT, COL, DATA1, [ DATA2, ... DATA48, ROW=, BUFFERSIZE = ]
/NOIEEE, /NOSCALE, /VIRTUAL, NANVALUE=, PASS_METHOD = POINTERS=,
ERRMSG = , WARNMSG = , STATUS = ]
INPUT PARAMETERS :
UNIT = Logical unit number corresponding to the file containing the
binary table.
COL = An array of columns in the binary table to read data
from, either as character strings containing column
labels (TTYPE), or as numerical column indices
starting from column one.
Outputs :
DATA1, DATA2...DATA48 = A named variable to accept the data values, one
for each column. The columns are stored in order of the
list in COL. If the read operation fails for a
particular column, then the corresponding output Dn
variable is not altered. See the STATUS keyword.
Ignored if PASS_METHOD is 'POINTER'.
OPTIONAL INPUT KEYWORDS:
ROW = Either row number in the binary table to read data from,
starting from row one, or a two element array containing a
range of row numbers to read. If not passed, then the entire
column is read in.
/NOIEEE = If set, then then IEEE floating point data will not
be converted to the host floating point format (and
this by definition implies NOSCALE). The user is
responsible for their own floating point conversion.
/NOSCALE = If set, then the output data will not be scaled using the
optional TSCAL and TZERO keywords in the FITS header.
Default is to scale.
VIRTUAL = If set, and COL is passed as a name rather than a number,
then if the program can't find a column with that name, it
will then look for a keyword with that name in the header.
Such a keyword would then act as a "virtual column", with the
same value for every row.
DIMENSIONS = FXBREADM ignores this keyword. It is here for
compatibility only.
NANVALUE= Value signalling data dropout. All points corresponding to
IEEE NaN (not-a-number) are converted to this number.
Ignored unless DATA is of type float, double-precision or
complex.
PASS_METHOD = A scalar string indicating method of passing
data from FXBREADM. Either 'ARGUMENT' (indicating
pass by positional argument), or 'POINTER' (indicating
passing an array of pointers by the POINTERS
keyword).
Default: 'ARGUMENT'
POINTERS = If PASS_METHOD is 'POINTER' then an array of IDL
pointers is returned in this keyword, one for each
requested column. Any pointers passed into FXBREADM will
have their pointed-to data destroyed. Ultimately the
user is responsible for deallocating pointers.
BUFFERSIZE = Raw data are transferred from the file in chunks
to conserve memory. This is the size in bytes of
each chunk. If a value of zero is given, then all
of the data are transferred in one pass. Default is
32768 (32 kB).
OPTIONAL OUTPUT KEYWORDS:
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 = ''
FXBREAD, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
WARNMSG = Messages which are considered to be non-fatal
"warnings" are returned in this output string.
Note that if some but not all columns are
unreadable, this is considered to be non-fatal.
STATUS = An output array containing the status for each
column read, 1 meaning success and 0 meaning failure.
Calls : ***
FXBREADM_CONV, FXPAR [1], FXPAR [2], IEEE_TO_HOST [1], IEEE_TO_HOST [2]
IEEE_TO_HOST [3], IEEE_TO_HOST [4], WHERENAN [1], WHERENAN [2], WHERENAN [3]
WHERENAN [4]
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBOPEN.
The data must be consistent with the column definition in the binary
table header.
The row number must be consistent with the number of rows stored in the
binary table header.
Generaly speaking, FXBREADM will be faster than iterative
calls to FXBREAD when (a) a large number of columns is to be
read or (b) the size in bytes of each cell is small, so that
the overhead of the FOR loop in FXBREAD becomes significant.
SIDE EFFECTS:
If there are no elements to read in (the number of elements is zero),
then the program sets !ERR to -1, and DATA is unmodified.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
C. Markwardt, based in concept on FXBREAD version 12 from
IDLASTRO, but with significant and
major changes to accomodate the
multiple row/column technique. Mostly
the parameter checking and general data
flow remain.
C. Markwardt, updated to read variable length arrays, and to
pass columns by handle or pointer.
20 Jun 2001
C. Markwardt, try to conserve memory when creating the arrays
13 Oct 2001
Handle case of GE 50 columns, C. Markwardt, 18 Apr 2002
Handle case where TSCAL/TZERO changes type of column,
C. Markwardt, 23 Feb 2003
Fix bug in handling of FOUND and numeric columns,
C. Markwardt 12 May 2003
Removed pre-V5.0 HANDLE options W. Landsman July 2004
[Previous]
[Next]
NAME:
FXBSTATE()
PURPOSE:
Returns the state of a FITS binary table.
Explanation : This procedure returns the state of a FITS binary table that
was either opened for read with the command FXBOPEN, or for
write with the command FXBCREATE.
Use : Result = FXBSTATE(UNIT)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is the state of the FITS binary
table that UNIT points to. This can be one of three values:
0 = Closed
1 = Open for read
2 = Open for write
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
CHECKCDSFITS
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: If UNIT is an undefined variable, then 0 (closed) is returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 1 July 1993.
Modified : Version 1, William Thompson, GSFC, 1 July 1993.
Version : Version 1, 1 July 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBSTATE()
PURPOSE:
Returns the state of a FITS binary table.
Explanation : This procedure returns the state of a FITS binary table that
was either opened for read with the command FXBOPEN, or for
write with the command FXBCREATE.
Use : Result = FXBSTATE(UNIT)
Inputs : UNIT = Logical unit number returned by FXBOPEN routine.
Must be a scalar integer.
Opt. Inputs : None.
Outputs : The result of the function is the state of the FITS binary
table that UNIT points to. This can be one of three values:
0 = Closed
1 = Open for read
2 = Open for write
Opt. Outputs: None.
Keywords : None.
Calls : ***
FXBFINDLUN [1], FXBFINDLUN [2]
CALLED BY:
CHECKCDSFITS
Common : Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions: None.
Side effects: If UNIT is an undefined variable, then 0 (closed) is returned.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : None.
Written : William Thompson, GSFC, 1 July 1993.
Modified : Version 1, William Thompson, GSFC, 1 July 1993.
Version : Version 1, 1 July 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
Project : SOHO - CDS
Name :
FXBTDIM()
Purpose :
Parse TDIM-like kwywords.
Explanation :
Parses the value of a TDIM-like keyword (e.g. TDIMnnn, TDESC, etc.) to
return the separate elements contained within.
Use :
Result = FXBTDIM( TDIM_KEYWORD )
Inputs :
TDIM_KEYWORD = The value of a TDIM-like keyword. Must be a
character string of the form "(value1,value2,...)".
If the parentheses characters are missing, then the
string is simply returned as is, without any further
processing.
Opt. Inputs :
None.
Outputs :
The result of the function is a character string array containing the
values contained within the keyword parameter. If a numerical result
is desired, then simply call, e.g.
Result = FIX( FXBTDIM( TDIM_KEYWORD ))
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
CALLED BY:
CFITSLIST, EIS_DATA_READFOREIGN, EIS_DATA__READFITS [1]
EIS_DATA__READFITS [2], FITSHEAD2WCS, FXBPARSE [1], FXBPARSE [2], GET_VDS_BIAS
IMP_DATAWIN, READCDSCOL, READSUMCOL, READ_CALFITS, SUMER_FITS, SUMER_RASTER_SAVE
SUMER_SPECTROGRAM_SAVE, SUMER_TOOL_PD_EVENT
Common :
None.
Restrictions:
The input parameter must have the proper format. The separate values
must not contain the comma character. TDIM_KEYWORD must not be an
array.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan. 1992.
William Thompson, Jan. 1993, renamed to be compatible with DOS
limitations.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
[Previous]
[Next]
NAME:
FXBTDIM()
Purpose :
Parse TDIM-like kwywords.
Explanation :
Parses the value of a TDIM-like keyword (e.g. TDIMnnn, TDESC, etc.) to
return the separate elements contained within.
Use :
Result = FXBTDIM( TDIM_KEYWORD )
Inputs :
TDIM_KEYWORD = The value of a TDIM-like keyword. Must be a
character string of the form "(value1,value2,...)".
If the parentheses characters are missing, then the
string is simply returned as is, without any further
processing.
Opt. Inputs :
None.
Outputs :
The result of the function is a character string array containing the
values contained within the keyword parameter. If a numerical result
is desired, then simply call, e.g.
Result = FIX( FXBTDIM( TDIM_KEYWORD ))
Opt. Outputs:
None.
Keywords :
None.
Calls : ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
CALLED BY:
CFITSLIST, EIS_DATA_READFOREIGN, EIS_DATA__READFITS [1]
EIS_DATA__READFITS [2], FITSHEAD2WCS, FXBPARSE [1], FXBPARSE [2], GET_VDS_BIAS
IMP_DATAWIN, READCDSCOL, READSUMCOL, READ_CALFITS, SUMER_FITS, SUMER_RASTER_SAVE
SUMER_SPECTROGRAM_SAVE, SUMER_TOOL_PD_EVENT
Common :
None.
Restrictions:
The input parameter must have the proper format. The separate values
must not contain the comma character. TDIM_KEYWORD must not be an
array.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan. 1992.
William Thompson, Jan. 1993, renamed to be compatible with DOS
limitations.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBTFORM
Purpose :
Returns information about FITS binary table columns.
Explanation :
Procedure to return information about the format of the various columns
in a FITS binary table.
Use :
FXBTFORM,HEADER,TBCOL,IDLTYPE,FORMAT,NUMVAL,MAXVAL
Inputs :
HEADER = Fits binary table header.
Opt. Inputs :
None.
Outputs :
TBCOL = Array of starting column positions in bytes.
IDLTYPE = IDL data types of columns.
FORMAT = Character code defining the data types of the columns.
NUMVAL = Number of elements of the data arrays in the columns.
MAXVAL = Maximum number of elements for columns containing variable
length arrays, or zero otherwise.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBTFORM, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXPAR [1], FXPAR [2]
CALLED BY:
CAL_DETSELECT, CHECKCDSFITS, DETSELECT, EIS_DATA_READFOREIGN
EIS_DATA__READFITS [1], EIS_DATA__READFITS [2], FITSFILE__DEFINE [2]
FITSHEAD2WCS, FXBPARSE [1], FXBPARSE [2], SHRINK_SUMER_FITS, SUMDETSELECT
Common :
None.
Restrictions:
None.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb. 1992, from TBINFO by D. Lindler.
W. Thompson, Jan. 1993, renamed to be compatible with DOS limitations.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 9 April 1997
Modified so that variable length arrays can be read, even if
the maximum array size is not in the header.
Version 5 Wayne Landsman, GSFC, August 1997
Recognize double complex array type if since IDL version 4.0
Version :
Version 6
Optimized FXPAR call, CM 1999 Nov 18
[Previous]
[Next]
NAME:
FXBTFORM
PURPOSE :
Returns information about FITS binary table columns.
EXPLANATION :
Procedure to return information about the format of the various columns
in a FITS binary table.
Use :
FXBTFORM,HEADER,TBCOL,IDLTYPE,FORMAT,NUMVAL,MAXVAL
Inputs :
HEADER = Fits binary table header.
Opt. Inputs :
None.
Outputs :
TBCOL = Array of starting column positions in bytes.
IDLTYPE = IDL data types of columns.
FORMAT = Character code defining the data types of the columns.
NUMVAL = Number of elements of the data arrays in the columns.
MAXVAL = Maximum number of elements for columns containing variable
length arrays, or zero otherwise.
Opt. Outputs:
None.
Keywords :
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 = ''
FXBTFORM, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXPAR [1], FXPAR [2]
CALLED BY:
CAL_DETSELECT, CHECKCDSFITS, DETSELECT, EIS_DATA_READFOREIGN
EIS_DATA__READFITS [1], EIS_DATA__READFITS [2], FITSFILE__DEFINE [2]
FITSHEAD2WCS, FXBPARSE [1], FXBPARSE [2], SHRINK_SUMER_FITS, SUMDETSELECT
Common :
None.
Restrictions:
None.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb. 1992, from TBINFO by D. Lindler.
W. Thompson, Jan. 1993, renamed to be compatible with DOS limitations.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 9 April 1997
Modified so that variable length arrays can be read, even if
the maximum array size is not in the header.
Version 5 Wayne Landsman, GSFC, August 1997
Recognize double complex array type if since IDL version 4.0
Version 6
Optimized FXPAR call, CM 1999 Nov 18
Version :
Version 7: Wayne Landsman, GSFC Feb 2006
Added support for 64bit integer K format
[Previous]
[Next]
NAME:
FXBWRITE
Purpose :
Write a binary data array to a disk FITS binary table file.
Explanation :
Each call to FXBWRITE will write to the data file, which should already
have been created and opened by FXBCREATE. One needs to call this
routine for every column and every row in the binary table. FXBFINISH
will then close the file.
Use :
FXBWRITE, UNIT, DATA, COL, ROW
Inputs :
UNIT = Logical unit number corresponding to the file containing the
binary table.
DATA = IDL data array to be written to the file.
COL = Column in the binary table to place data in, starting from
column one.
ROW = Row in the binary table to place data in, starting from row
one.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
BIT = Number of bits in bit mask arrays (type "X"). Only used if
the column is of variable size.
NANVALUE= Value signalling data dropout. All points corresponding to
this value are set to be IEEE NaN (not-a-number). Ignored
unless DATA is of type float, double-precision or complex.
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 = ''
FXBWRITE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3], HOST_TO_IEEE [4]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
HESSI Packet Write, HESSI Write lookup table, INTGCOMP_NRH2, NRH_HSI_FITS
Radio Astronomy Group Fits Write, SHRINK_SUMER_FITS, SPECTRA2FITS
WRITE_CALFITS, WRITE_FLUXNRH, WRITE_POSINRH, XSM_PREP, eis_make_status_fits [2]
eis_make_status_fits [3], hsi_data_gap_fxbw, hsi_ephemeris_fxbw
hsi_filedb_fxbw, hsi_flare_list_entry_fxbw, hsi_flare_list_info_fxbw
hsi_obs_summ_data_fxbw, hsi_obs_summ_fxbw, hsi_obs_summ_info_fxbw
hsi_obs_summ_otp, hsi_obs_summ_soc__define, hsi_obs_summ_write
hsi_qlook__define, hsi_scorewrite, hxrs_drm2fits [1], hxrs_drm2fits [2]
hxrs_drm2fits [3], mk_trace_i0, rm2fits, tr_wrt_fits, write_ovsa_fits
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBCREATE.
The data must be consistent with the column definition in the binary
table header.
The row number must be consistent with the number of rows stored in the
binary table header.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992, based on WRITEFITS by J. Woffard and W. Landsman.
W. Thompson, Feb 1992, modified to support variable length arrays.
W. Thompson, Feb 1992, removed all references to temporary files.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 3, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 5, Wayne Landsman, GSFC, 12 Aug 1997
Recognize IDL double complex data type
Version :
Version 5, 12 August 1997
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBWRITE
Purpose :
Write a binary data array to a disk FITS binary table file.
Explanation :
Each call to FXBWRITE will write to the data file, which should already
have been created and opened by FXBCREATE. One needs to call this
routine for every column and every row in the binary table. FXBFINISH
will then close the file.
Use :
FXBWRITE, UNIT, DATA, COL, ROW
Inputs :
UNIT = Logical unit number corresponding to the file containing the
binary table.
DATA = IDL data array to be written to the file.
COL = Column in the binary table to place data in, starting from
column one.
ROW = Row in the binary table to place data in, starting from row
one.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
BIT = Number of bits in bit mask arrays (type "X"). Only used if
the column is of variable size.
NANVALUE= Value signalling data dropout. All points corresponding to
this value are set to be IEEE NaN (not-a-number). Ignored
unless DATA is of type float, double-precision or complex.
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 = ''
FXBWRITE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3], HOST_TO_IEEE [4]
CALLED BY:
EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
HESSI Packet Write, HESSI Write lookup table, INTGCOMP_NRH2, NRH_HSI_FITS
Radio Astronomy Group Fits Write, SHRINK_SUMER_FITS, SPECTRA2FITS
WRITE_CALFITS, WRITE_FLUXNRH, WRITE_POSINRH, XSM_PREP, eis_make_status_fits [2]
eis_make_status_fits [3], hsi_data_gap_fxbw, hsi_ephemeris_fxbw
hsi_filedb_fxbw, hsi_flare_list_entry_fxbw, hsi_flare_list_info_fxbw
hsi_obs_summ_data_fxbw, hsi_obs_summ_fxbw, hsi_obs_summ_info_fxbw
hsi_obs_summ_otp, hsi_obs_summ_soc__define, hsi_obs_summ_write
hsi_qlook__define, hsi_scorewrite, hxrs_drm2fits [1], hxrs_drm2fits [2]
hxrs_drm2fits [3], mk_trace_i0, rm2fits, tr_wrt_fits, write_ovsa_fits
Common :
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
Restrictions:
The binary table file must have been opened with FXBCREATE.
The data must be consistent with the column definition in the binary
table header.
The row number must be consistent with the number of rows stored in the
binary table header.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992, based on WRITEFITS by J. Woffard and W. Landsman.
W. Thompson, Feb 1992, modified to support variable length arrays.
W. Thompson, Feb 1992, removed all references to temporary files.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 July 1993.
Fixed bug with variable length arrays.
Version 3, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 5, Wayne Landsman, GSFC, 12 Aug 1997
Recognize IDL double complex data type
Version :
Version 5, 12 August 1997
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXBWRITM
PURPOSE:
Write multiple columns/rows to a disk FITS binary table file.
EXPLANATION :
A call to FXBWRITM will write multiple rows and multiple
columns to a binary table in a single procedure call. Up to
fifty columns may be read in a single pass. The file should
have already been opened with FXBOPEN (with write access) or
FXBCREATE. FXBWRITM optimizes writing multiple columns by
first writing a large chunk of data to the FITS file all at
once. FXBWRITM cannot write variable-length arrays; use
FXBWRITE instead.
The number of columns is limited to 50 if data are passed by
positional argument. However, this limitation can be overcome
by passing pointers to FXBWRITM. The user should set the PASS_METHOD
keyword to 'POINTER' as appropriate, and an array of pointers to
the data in the POINTERS keyword. The user is responsible for freeing
the pointers.
CALLING SEQUENCE:
FXBWRITM, UNIT, COL, D0, D1, D2, ..., [ ROW= , PASS_METHOD, NANVALUE=
POINTERS=, BUFFERSIZE= ]
INPUT PARAMETERS:
UNIT = Logical unit number corresponding to the file containing the
binary table.
D0,..D49= An IDL data array to be written to the file, one for
each column. These parameters will be igonred if data
is passed through the POINTERS keyword.
COL = Column in the binary table to place data in. May be either
a list of column numbers where the first column is one, or
a string list of column names.
OPTIONAL INPUT KEYWORDS:
ROW = Either row number in the binary table to write data to,
starting from row one, or a two element array containing a
range of row numbers to write. If not passed, then
the entire column is written.
NANVALUE= Value signalling data dropout. All points corresponding to
this value are set to be IEEE NaN (not-a-number). Ignored
unless DATA is of type float, double-precision or complex.
PASS_METHOD = A scalar string indicating method of passing
data to FXBWRITM. One of 'ARGUMENT' (indicating
pass by positional argument), or'POINTER' (indicating
passing an array of pointers by the POINTERS
keyword).
Default: 'ARGUMENT'
POINTERS = If PASS_METHOD is 'POINTER' then the user must pass
an array of IDL pointers to this keyword, one for
each column. Ultimately the user is responsible for
deallocating pointers.
BUFFERSIZE = Data are transferred in chunks to conserve
memory. This is the size in bytes of each chunk.
If a value of zero is given, then all of the data
are transferred in one pass. Default is 32768 (32
kB).
OPTIONAL OUTPUT KEYWORDS:
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 = ''
FXBWRITE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
WARNMSG = Messages which are considered to be non-fatal
"warnings" are returned in this output string.
STATUS = An output array containing the status for each
read, 1 meaning success and 0 meaning failure.
PROCEDURE CALLS:
HOST_TO_IEEE, PRODUCT()
CALLED BY:
smei_hdr_make
EXAMPLE:
Write a binary table 'sample.fits' giving 43 X,Y positions and a
21 x 21 PSF at each position:
(1) First, create sample values
x = findgen(43) & y = findgen(43)+1 & psf = randomn(seed,21,21,43)
(2) Create primary header, write it to disk, and make extension header
fxhmake,header,/initialize,/extend,/date
fxwrite,'sample.fits',header
fxbhmake,header,43,'TESTEXT','Test binary table extension'
(3) Fill extension header with desired column names
fxbaddcol,1,header,x[0],'X' ;Use first element in each array
fxbaddcol,2,header,y[0],'Y' ;to determine column properties
fxbaddcol,3,header,psf[*,*,0],'PSF'
(4) Write extension header to FITS file
fxbcreate,unit,'sample.fits',header
(5) Use FXBWRITM to write all data to the extension in a single call
fxbwritm,unit,['X','Y','PSF'], x, y, psf
fxbfinish,unit ;Close the file
CALLS: ***
HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3], HOST_TO_IEEE [4], UNIQ [1]
UNIQ [2], UNIQ [3]
COMMON BLOCKS:
Uses common block FXBINTABLE--see "fxbintable.pro" for more
information.
RESTRICTIONS:
The binary table file must have been opened with FXBCREATE or
FXBOPEN (with write access).
The data must be consistent with the column definition in the binary
table header.
The row number must be consistent with the number of rows stored in the
binary table header.
A PASS_METHOD of POINTER does not use the EXECUTE() statement and can be
used with the IDL Virtual Machine. However, the EXECUTE() statement is
used when the PASS_METHOD is by arguments.
CATEGORY:
Data Handling, I/O, FITS, Generic.
PREVIOUS HISTORY:
C. Markwardt, based on FXBWRITE and FXBREADM (ver 1), Jan 1999
WRITTEN:
Craig Markwardt, GSFC, January 1999.
MODIFIED:
Version 1, Craig Markwardt, GSFC 18 January 1999.
Documented this routine, 18 January 1999.
C. Markwardt, added ability to pass by handle or pointer.
Some bug fixes, 20 July 2001
W. Landsman/B.Schulz Allow more than 50 arguments when using pointers
W. Landsman Remove pre-V5.0 HANDLE options July 2004
W. Landsman Remove EXECUTE() call with POINTERS May 2005
[Previous]
[Next]
NAME:
FXFINDEND
Purpose :
Find the end of a FITS file.
Explanation :
This routine finds the end of the last logical record in a FITS file,
which may be different from that of the physical end of the file. Each
FITS header is read in and parsed, and the file pointer is moved to
where the next FITS extension header would be if there is one, or to
the end of the file if not.
Use :
FXFINDEND, UNIT [, EXTENSION]
Inputs :
UNIT = Logical unit number for the opened file.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
EXTENSION = The extension number that a new extension would
have if placed at the end of the file.
Keywords :
None.
Calls : ***
FXHREAD [1], FXHREAD [2], FXPAR [1], FXPAR [2]
CALLED BY:
FXBCREATE [1], FXBCREATE [2]
Common :
None.
Restrictions:
The file must have been opened for block I/O. There must not be any
FITS "special records" at the end of the file.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
Added EXTENSION parameter, CM 1999 Nov 18
[Previous]
[Next]
NAME:
FXFINDEND
Purpose :
Find the end of a FITS file.
Explanation :
This routine finds the end of the last logical record in a FITS file,
which may be different from that of the physical end of the file. Each
FITS header is read in and parsed, and the file pointer is moved to
where the next FITS extension header would be if there is one, or to
the end of the file if not.
Use :
FXFINDEND, UNIT [, EXTENSION]
Inputs :
UNIT = Logical unit number for the opened file.
Opt. Inputs :
None.
Outputs :
None.
Opt. Outputs:
EXTENSION = The extension number that a new extension would
have if placed at the end of the file.
Keywords :
None.
Calls : ***
FXHREAD [1], FXHREAD [2], FXPAR [1], FXPAR [2]
CALLED BY:
FXBCREATE [1], FXBCREATE [2]
Common :
None.
Restrictions:
The file must have been opened for block I/O. There must not be any
FITS "special records" at the end of the file.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Feb. 1992.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
Added EXTENSION parameter, CM 1999 Nov 18
[Previous]
[Next]
NAME:
FXHCLEAN
Purpose :
Removes required keywords from FITS header.
Explanation :
Removes any keywords relevant to array structure from a FITS header,
preparatory to recreating it with the proper values.
Use :
FXHCLEAN, HEADER
Inputs :
HEADER = FITS header to be cleaned.
Opt. Inputs :
None.
Outputs :
HEADER = The cleaned FITS header is returned in place of the input
array.
Opt. Outputs:
None.
Keywords :
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 = ''
FXHCLEAN, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXPAR [1], FXPAR [2], SXDELPAR [1], SXDELPAR [2], SXDELPAR [3]
CALLED BY:
CDS_SIMPLE_FITS, FXBHMAKE [1], FXBHMAKE [2], FXHMAKE [1], FXHMAKE [2]
Common :
None.
Restrictions:
HEADER must be a string array containing a properly formatted FITS
header.
Side effects:
Warning: when cleaning a binary table extension header, not all of the
keywords pertaining to columns in the table may be removed.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 30 December 1994
Added TCUNIn to list of column keywords to be removed.
Version :
Version 4, 30 December 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXHCLEAN
Purpose :
Removes required keywords from FITS header.
Explanation :
Removes any keywords relevant to array structure from a FITS header,
preparatory to recreating it with the proper values.
Use :
FXHCLEAN, HEADER
Inputs :
HEADER = FITS header to be cleaned.
Opt. Inputs :
None.
Outputs :
HEADER = The cleaned FITS header is returned in place of the input
array.
Opt. Outputs:
None.
Keywords :
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 = ''
FXHCLEAN, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXPAR [1], FXPAR [2], SXDELPAR [1], SXDELPAR [2], SXDELPAR [3]
CALLED BY:
CDS_SIMPLE_FITS, FXBHMAKE [1], FXBHMAKE [2], FXHMAKE [1], FXHMAKE [2]
Common :
None.
Restrictions:
HEADER must be a string array containing a properly formatted FITS
header.
Side effects:
Warning: when cleaning a binary table extension header, not all of the
keywords pertaining to columns in the table may be removed.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 30 December 1994
Added TCUNIn to list of column keywords to be removed.
Version :
Version 4, 30 December 1994
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXHMAKE
Purpose :
Create a basic FITS header array.
Explanation :
Creates a basic header array with all the required keywords. This
defines a basic structure which can then be added to or modified by
other routines.
Use :
FXHMAKE, HEADER [, DATA ]
Inputs :
None required.
Opt. Inputs :
DATA = IDL data array to be written to file in the primary data unit
(not in an extension). This is used to determine the values
of the BITPIX and NAXIS, etc. keywords.
If not passed, then BITPIX is set to eight, NAXIS is set to
zero, and no NAXISnnn keywords are included in this
preliminary header.
Outputs :
HEADER = String array containing FITS header.
Opt. Outputs:
None.
Keywords :
INITIALIZE = If set, then the header is completely initialized, and any
previous entries are lost.
EXTEND = If set, then the keyword EXTEND is inserted into the file,
with the value of "T" (true).
DATE = If set, then the DATE keyword is added to the header.
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 = ''
FXHMAKE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXHCLEAN [1], FXHCLEAN [2], GET_DATE [1], GET_DATE [2]
CALLED BY:
CDS_SIMPLE_FITS, Create FITS, Create a FITS primary Header and Data Unit
EIS_MKFITS [1], EIS_MKFITS [2], FITS WRITER CLASS, FITSFILE__DEFINE [3]
HSI_PACKET2FITS, MAP2FITS, MK_IMG, MK_MONTHLY_MIN, MK_SYNOPTIC, NRH_HSI_FITS
OPEN_CALFITS, REDUCE_LEVEL_1, Radio Astronomy Group Fits Write, SPECTRA2FITS
SUMER_RASTER_SAVE, SUMER_SPECTROGRAM_SAVE, WCS2FITSHEAD, WCS_FIND_PIXEL_LIST
eis_make_status_fits [2], eis_make_status_fits [3], hsi_filedb_write
hsi_obs_summ_otp, hsi_obs_summ_soc__define, hsi_obs_summ_write
hsi_qlook__define, hxrs_drm2fits [1], hxrs_drm2fits [2], hxrs_drm2fits [3]
mk_trace_i0, mwritefits, rm2fits, smei_hdr_make, spectrum2fits, struct2fitshead
tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2], write_ovsa_fits
write_trace, wrt_fits_bin_exten [1], xdisp_fits, xdisp_trace [1], xdisp_trace2
xdisp_trace3
Common :
None.
Restrictions:
Groups are not currently supported.
Side effects:
BITPIX, NAXIS, etc. are defined such that complex arrays are stored as
floating point, with an extra first dimension of two elements (real and
imaginary parts).
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992, from FXHMAKE by D. Lindler and M. Greason.
Differences include:
* Use of FITS standard (negative BITPIX) to signal floating
point numbers instead of (SDAS/Geis) DATATYPE keyword.
* Storage of complex numbers as pairs of real numbers.
* Support for EXTEND keyword, and for cases where there is no
primary data array.
* Insertion of DATE record made optional. Only required FITS
keywords are inserted automatically.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, Wayne Landsman, GSFC, 12 August 1997
Recognize double complex data type
Converted to IDL V5.0 W. Landsman September 1997
Version 6, William Thompson, GSFC, 22 September 2004
Recognize unsigned integer types.
Version :
Version 6, 22 September 2004
[Previous]
[Next]
NAME:
FXHMAKE
Purpose :
Create a basic FITS header array.
Explanation :
Creates a basic header array with all the required keywords. This
defines a basic structure which can then be added to or modified by
other routines.
Use :
FXHMAKE, HEADER [, DATA ]
Inputs :
None required.
Opt. Inputs :
DATA = IDL data array to be written to file in the primary data unit
(not in an extension). This is used to determine the values
of the BITPIX and NAXIS, etc. keywords.
If not passed, then BITPIX is set to eight, NAXIS is set to
zero, and no NAXISnnn keywords are included in this
preliminary header.
Outputs :
HEADER = String array containing FITS header.
Opt. Outputs:
None.
Keywords :
INITIALIZE = If set, then the header is completely initialized, and any
previous entries are lost.
EXTEND = If set, then the keyword EXTEND is inserted into the file,
with the value of "T" (true).
DATE = If set, then the DATE keyword is added to the header.
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 = ''
FXHMAKE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXHCLEAN [1], FXHCLEAN [2], GET_DATE [1], GET_DATE [2]
CALLED BY:
CDS_SIMPLE_FITS, Create FITS, Create a FITS primary Header and Data Unit
EIS_MKFITS [1], EIS_MKFITS [2], FITS WRITER CLASS, FITSFILE__DEFINE [3]
HSI_PACKET2FITS, MAP2FITS, MK_IMG, MK_MONTHLY_MIN, MK_SYNOPTIC, NRH_HSI_FITS
OPEN_CALFITS, REDUCE_LEVEL_1, Radio Astronomy Group Fits Write, SPECTRA2FITS
SUMER_RASTER_SAVE, SUMER_SPECTROGRAM_SAVE, WCS2FITSHEAD, WCS_FIND_PIXEL_LIST
eis_make_status_fits [2], eis_make_status_fits [3], hsi_filedb_write
hsi_obs_summ_otp, hsi_obs_summ_soc__define, hsi_obs_summ_write
hsi_qlook__define, hxrs_drm2fits [1], hxrs_drm2fits [2], hxrs_drm2fits [3]
mk_trace_i0, mwritefits, rm2fits, smei_hdr_make, spectrum2fits, struct2fitshead
tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2], write_ovsa_fits
write_trace, wrt_fits_bin_exten [1], xdisp_fits, xdisp_trace [1], xdisp_trace2
xdisp_trace3
Common :
None.
Restrictions:
Groups are not currently supported.
Side effects:
BITPIX, NAXIS, etc. are defined such that complex arrays are stored as
floating point, with an extra first dimension of two elements (real and
imaginary parts).
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992, from FXHMAKE by D. Lindler and M. Greason.
Differences include:
* Use of FITS standard (negative BITPIX) to signal floating
point numbers instead of (SDAS/Geis) DATATYPE keyword.
* Storage of complex numbers as pairs of real numbers.
* Support for EXTEND keyword, and for cases where there is no
primary data array.
* Insertion of DATE record made optional. Only required FITS
keywords are inserted automatically.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 21 June 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, Wayne Landsman, GSFC, 12 August 1997
Recognize double complex data type
Converted to IDL V5.0 W. Landsman September 1997
Version 6, William Thompson, GSFC, 22 September 2004
Recognize unsigned integer types.
Version :
Version 6, 22 September 2004
[Previous]
[Next]
NAME:
FXHMODIFY
PURPOSE :
Modify a FITS header in a file on disk.
Explanation :
Opens a FITS file, and adds or modifies a parameter in the FITS header.
Can be used for either the main header, or for an extension header.
The modification is performed directly on the disk file.
Use :
FXHMODIFY, FILENAME, NAME, VALUE, COMMENT
Inputs :
FILENAME = String containing the name of the file to be read.
NAME = Name of parameter. If NAME is already in the header the
value and possibly comment fields are modified. Otherwise a
new record is added to the header. If NAME is equal to
either "COMMENT" or "HISTORY" then the value will be added to
the record without replacement. In this case the comment
parameter is ignored.
VALUE = Value for parameter. The value expression must be of the
correct type, e.g. integer, floating or string. String
values of 'T' or 'F' are considered logical values.
Opt. Inputs :
COMMENT = String field. The '/' is added by this routine. Added
starting in position 31. If not supplied, or set equal to ''
(the null string), then any previous comment field in the
header for that keyword is retained (when found).
Outputs :
None.
Opt. Outputs:
None.
Keywords :
EXTENSION = Either the number of the FITS extension, starting with the
first extension after the primary data unit being one; or a
character string containing the value of EXTNAME to search
for. If not passed, then the primary FITS header is
modified.
BEFORE = Keyword string name. The parameter will be placed before the
location of this keyword. For example, if BEFORE='HISTORY'
then the parameter will be placed before the first history
location. This applies only when adding a new keyword;
keywords already in the header are kept in the same position.
AFTER = Same as BEFORE, but the parameter will be placed after the
location of this keyword. This keyword takes precedence over
BEFORE.
FORMAT = Specifies FORTRAN-like format for parameter, e.g. "F7.3". A
scalar string should be used. For complex numbers the format
should be defined so that it can be applied separately to the
real and imaginary parts.
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 = ''
FXHMODIFY, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
BLKSHIFT [1], BLKSHIFT [2], FXADDPAR [1], FXADDPAR [2], FXHREAD [1], FXHREAD [2]
FXPAR [1], FXPAR [2]
CALLED BY:
CAL_HDR_UPDATE, COMP_DATE, ITOOL_MODIFY_FH, ITOOL_WRITE_FITS, RH_MOD_HEADER
UPD_NRH2DFITS, WRITE_FLUXNRH, WRITE_POSINRH, XSM_PREP, smei_frm_update
Common :
None.
Restrictions:
This routine can not be used to modify any of the keywords that control
the structure of the FITS file, e.g. BITPIX, NAXIS, PCOUNT, etc. Doing
so could corrupt the readability of the FITS file.
Side effects:
If adding a record to the FITS header would increase the
number of 2880 byte records stored on disk, then the file is
enlarged before modification, unless the NOGROW keyword is passed.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
None.
Written :
William Thompson, GSFC, 3 March 1994.
Modified :
Version 1, William Thompson, GSFC, 3 March 1994.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 3.1 Wayne Landsman GSFC 17 March 2006
Fix problem in BLKSHIFT call if primary header extended
Version :
Version 3.1, 17 March 2006
[Previous]
[Next]
NAME:
FXHMODIFY
PURPOSE :
Modify a FITS header in a file on disk.
Explanation :
Opens a FITS file, and adds or modifies a parameter in the FITS header.
Can be used for either the main header, or for an extension header.
The modification is performed directly on the disk file.
Use :
FXHMODIFY, FILENAME, NAME, VALUE, COMMENT
Inputs :
FILENAME = String containing the name of the file to be read.
NAME = Name of parameter. If NAME is already in the header the
value and possibly comment fields are modified. Otherwise a
new record is added to the header. If NAME is equal to
either "COMMENT" or "HISTORY" then the value will be added to
the record without replacement. In this case the comment
parameter is ignored.
VALUE = Value for parameter. The value expression must be of the
correct type, e.g. integer, floating or string. String
values of 'T' or 'F' are considered logical values.
Opt. Inputs :
COMMENT = String field. The '/' is added by this routine. Added
starting in position 31. If not supplied, or set equal to ''
(the null string), then any previous comment field in the
header for that keyword is retained (when found).
Outputs :
None.
Opt. Outputs:
None.
Keywords :
EXTENSION = Either the number of the FITS extension, starting with the
first extension after the primary data unit being one; or a
character string containing the value of EXTNAME to search
for. If not passed, then the primary FITS header is
modified.
BEFORE = Keyword string name. The parameter will be placed before the
location of this keyword. For example, if BEFORE='HISTORY'
then the parameter will be placed before the first history
location. This applies only when adding a new keyword;
keywords already in the header are kept in the same position.
AFTER = Same as BEFORE, but the parameter will be placed after the
location of this keyword. This keyword takes precedence over
BEFORE.
FORMAT = Specifies FORTRAN-like format for parameter, e.g. "F7.3". A
scalar string should be used. For complex numbers the format
should be defined so that it can be applied separately to the
real and imaginary parts.
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 = ''
FXHMODIFY, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
BLKSHIFT [1], BLKSHIFT [2], FXADDPAR [1], FXADDPAR [2], FXHREAD [1], FXHREAD [2]
FXPAR [1], FXPAR [2]
CALLED BY:
CAL_HDR_UPDATE, COMP_DATE, ITOOL_MODIFY_FH, ITOOL_WRITE_FITS, RH_MOD_HEADER
UPD_NRH2DFITS, WRITE_FLUXNRH, WRITE_POSINRH, XSM_PREP, smei_frm_update
Common :
None.
Restrictions:
This routine can not be used to modify any of the keywords that control
the structure of the FITS file, e.g. BITPIX, NAXIS, PCOUNT, etc. Doing
so could corrupt the readability of the FITS file.
Side effects:
If adding a record to the FITS header would increase the
number of 2880 byte records stored on disk, then the file is
enlarged before modification, unless the NOGROW keyword is passed.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
None.
Written :
William Thompson, GSFC, 3 March 1994.
Modified :
Version 1, William Thompson, GSFC, 3 March 1994.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 3.1 Wayne Landsman GSFC 17 March 2006
Fix problem in BLKSHIFT call if primary header extended
Version :
Version 3.1, 17 March 2006
[Previous]
[Next]
NAME:
FXHREAD
Purpose :
Reads a FITS header from an opened disk file.
Explanation :
Reads a FITS header from an opened disk file.
Use :
FXHREAD, UNIT, HEADER [, STATUS ]
Inputs :
UNIT = Logical unit number.
Opt. Inputs :
Outputs :
HEADER = String array containing the FITS header.
Opt. Outputs:
STATUS = Condition code giving the status of the read. Normally, this
is zero, but is set to !ERR if an error occurs, or if the
first byte of the header is zero (ASCII null).
Keywords :
None.
Calls :
None.
CALLED BY:
CDS_IMAGE, CHECK_INTEG, FIND_DURATION, FIX_CATALOG, FXBGROW, FXBMHEADER, FXBOPEN [1]
FXBOPEN [2], FXBOPEN [3], FXFINDEND [1], FXFINDEND [2], FXHMODIFY [1]
FXHMODIFY [2], FXREAD [1], FXREAD [2], FXTPIO_WRITE, ITOOL_MODIFY_FH
ITOOL_RD_FITS, ITOOL_WRITE_FITS, PR_CAL_HDR, RD_IMAGE_FITS
Radio Astronomy Group Fits Read, SHRINK_SUMER_FITS, VALID_FITS
Common :
None.
Restrictions:
The file must already be positioned at the start of the header. It
must be a proper FITS file.
Side effects:
The file ends by being positioned at the end of the FITS header, unless
an error occurs.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb 1992, from READFITS by J. Woffard and W. Landsman.
W. Thompson, Aug 1992, added test for SIMPLE keyword.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXHREAD
Purpose :
Reads a FITS header from an opened disk file.
Explanation :
Reads a FITS header from an opened disk file.
Use :
FXHREAD, UNIT, HEADER [, STATUS ]
Inputs :
UNIT = Logical unit number.
Opt. Inputs :
Outputs :
HEADER = String array containing the FITS header.
Opt. Outputs:
STATUS = Condition code giving the status of the read. Normally, this
is zero, but is set to !ERR if an error occurs, or if the
first byte of the header is zero (ASCII null).
Keywords :
None.
Calls :
None.
CALLED BY:
CDS_IMAGE, CHECK_INTEG, FIND_DURATION, FIX_CATALOG, FXBGROW, FXBMHEADER, FXBOPEN [1]
FXBOPEN [2], FXBOPEN [3], FXFINDEND [1], FXFINDEND [2], FXHMODIFY [1]
FXHMODIFY [2], FXREAD [1], FXREAD [2], FXTPIO_WRITE, ITOOL_MODIFY_FH
ITOOL_RD_FITS, ITOOL_WRITE_FITS, PR_CAL_HDR, RD_IMAGE_FITS
Radio Astronomy Group Fits Read, SHRINK_SUMER_FITS, VALID_FITS
Common :
None.
Restrictions:
The file must already be positioned at the start of the header. It
must be a proper FITS file.
Side effects:
The file ends by being positioned at the end of the FITS header, unless
an error occurs.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Feb 1992, from READFITS by J. Woffard and W. Landsman.
W. Thompson, Aug 1992, added test for SIMPLE keyword.
Written :
William Thompson, GSFC, February 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
PROJECT:
SOHO - CDS
NAME:
FXKVALUE()
PURPOSE:
Get value from a set of candidate keywords of a FITS header
EXPLANATION:
This function routine calls FXPAR to determine the value of one of a
set of candidate keywords by searching though the given FITS header in
the order of given keyword list. The returned value corresponds to
that of the keyword that is matched first.
CALLING SEQUENCE:
Result = fxkvalue(header, string_vec)
INPUTS:
HEADER - The FITS header returned by FXREAD
STRVEC - A string vector (or scalar) containing all posible keywords
for the concerned parameter
OPTIONAL INPUTS:
None.
OUTPUTS:
Result - Value extracted from the FITS header who's keyword matches
the one in STRVEC first. If no keyword is matched, the
returned result will be a null string, and at the same time
the system variable !err is set to -1.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
None.
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], FXPAR [1], FXPAR [2]
CALLED BY:
GET_OBS_DATE, ITOOL_GET_TIME, ITOOL_SET_CSI, RD_IMAGE_FITS, fitshead2struct
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
System variable !err is set to -1 if no keyword is matched.
CATEGORY:
PREVIOUS HISTORY:
Written February 8, 1995, Liyun Wang, NASA/GSFC
MODIFICATION HISTORY:
Version 1, created, Liyun Wang, NASA/GSFC, February 8, 1995
VERSION:
Version 1, February 8, 1995
[Previous]
[Next]
NAME:
FXMOVE
PURPOSE:
Skip to a specified extension number or name in a FITS file
CALLING SEQUENCE:
STATUS=FXMOVE(UNIT, EXT, /Silent)
STATUS=FXMOVE(UNIT, EXTNAME, /Silent, EXT_NO=, ERRMSG= )
INPUT PARAMETERS:
UNIT = An open unit descriptor for a FITS data stream.
EXTEN = Number of extensions to skip.
or
Scalar string giving extension name (in the EXTNAME keyword)
OPTIONAL INPUT PARAMETER:
/SILENT - If set, then any messages about invalid characters in the
FITS file are suppressed.
OPTIONAL OUTPUT PARAMETER:
ERRMSG = If this keyword is present, 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.
RETURNS:
0 if successful.
-1 if an error is encountered.
CALLS: ***
FXPAR [1], FXPAR [2], MRD_HREAD [1], MRD_HREAD [2], MRD_SKIP [1], MRD_SKIP [2]
SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FITSDIR, FXPOSIT [1], FXPOSIT [2], MRDFITS [1], MRDFITS [2]
COMMON BLOCKS:
None.
SIDE EFFECTS:
Repositions the file pointer.
PROCEDURE:
Each FITS header is read in and parsed, and the file pointer is moved
to where the next FITS extension header until the desired
extension is reached.
PROCEDURE CALLS:
FXPAR(), MRD_HREAD, MRD_SKIP
MODIFICATION HISTORY:
Extracted from FXPOSIT 8-March-2000 by T. McGlynn
Added /SILENT keyword 14-Dec-2000 by W. Landsman
Save time by not reading the full header W. Landsman Feb. 2003
Allow extension name to be specified, added EXT_NO, ERRMSG keywords
W. Landsman December 2006
[Previous]
[Next]
NAME:
FXMOVE
PURPOSE:
Skip to a specified extension number or name in a FITS file
CALLING SEQUENCE:
STATUS=FXMOVE(UNIT, EXT, /Silent)
STATUS=FXMOVE(UNIT, EXTNAME, /Silent, EXT_NO=, ERRMSG= )
INPUT PARAMETERS:
UNIT = An open unit descriptor for a FITS data stream.
EXTEN = Number of extensions to skip.
or
Scalar string giving extension name (in the EXTNAME keyword)
OPTIONAL INPUT PARAMETER:
/SILENT - If set, then any messages about invalid characters in the
FITS file are suppressed.
OPTIONAL OUTPUT PARAMETER:
ERRMSG = If this keyword is present, 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.
RETURNS:
0 if successful.
-1 if an error is encountered.
CALLS: ***
FXPAR [1], FXPAR [2], MRD_HREAD [1], MRD_HREAD [2], MRD_SKIP [1], MRD_SKIP [2]
SXPAR [1], SXPAR [2], SXPAR [3]
CALLED BY:
FITSDIR, FXPOSIT [1], FXPOSIT [2], MRDFITS [1], MRDFITS [2]
COMMON BLOCKS:
None.
SIDE EFFECTS:
Repositions the file pointer.
PROCEDURE:
Each FITS header is read in and parsed, and the file pointer is moved
to where the next FITS extension header until the desired
extension is reached.
PROCEDURE CALLS:
FXPAR(), MRD_HREAD, MRD_SKIP
MODIFICATION HISTORY:
Extracted from FXPOSIT 8-March-2000 by T. McGlynn
Added /SILENT keyword 14-Dec-2000 by W. Landsman
Save time by not reading the full header W. Landsman Feb. 2003
Allow extension name to be specified, added EXT_NO, ERRMSG keywords
W. Landsman December 2006
[Previous]
[Next]
NAME:
FXPAR()
PURPOSE:
Obtain the value of a parameter in a FITS header.
EXPLANATION:
The first 8 chacters of each element of HDR are searched for a match to
NAME. If the keyword is one of those allowed to take multiple values
("HISTORY", "COMMENT", or " " (blank)), then the value is taken
as the next 72 characters. Otherwise, it is assumed that the next
character is "=", and the value (and optional comment) is then parsed
from the last 71 characters. An error occurs if there is no parameter
with the given name.
If the value is too long for one line, it may be continued on to the
the next input card, using the OGIP CONTINUE convention. For more info,
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r13.html
Complex numbers are recognized as two numbers separated by one or more
space characters.
If a numeric value has no decimal point (or E or D) it is returned as
type LONG. If it contains more than 8 numerals, or contains the
character 'D', then it is returned as type DOUBLE. Otherwise it is
returned as type FLOAT. If an integer is too large to be stored as
type LONG, then it is returned as DOUBLE.
CALLING SEQUENCE:
Result = FXPAR( HDR, NAME [, ABORT, COUNT=, COMMENT=, /NOCONTINUE ] )
Result = FXPAR(HEADER,'DATE') ;Finds the value of DATE
Result = FXPAR(HEADER,'NAXIS*') ;Returns array dimensions as
;vector
REQUIRED INPUTS:
HDR = FITS header string array (e.g. as returned by FXREAD). Each
element should have a length of 80 characters
NAME = String name of the parameter to return. If NAME is of the
form 'keyword*' then an array is returned containing values
of keywordN where N is an integer. The value of keywordN
will be placed in RESULT(N-1). The data type of RESULT will
be the type of the first valid match of keywordN
found, unless DATATYPE is given.
OPTIONAL INPUT:
ABORT = String specifying that FXPAR should do a RETALL if a
parameter is not found. ABORT should contain a string to be
printed if the keyword parameter is not found. If not
supplied, FXPAR will return with a negative !err if a keyword
is not found.
DATATYPE = A scalar value, indicating the type of vector
data. All keywords will be cast to this type.
Default: based on first keyword.
CALLED BY:
BK, CAL_DETSELECT, CAL_HDRREAD, CDS_IMAGE, CENTER_NRH2, CFITSLIST, CHANDLE
CHECK_FITS [1], CHECK_FITS [2], CHECK_INTEG, CH_WRITE_FITS, CNVRT2REF
COMB_FULL_EQ, COMP_DATE, CONGRID [1], CW_HEADER, CW_POS, CW_XTD_NRHF, DETSELECT
EIS_GET_HDR_STRUC, EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2], EIT_DAILY
EIT_FXPAR, EIT_PREP, EIT_SUB_UTIL_FILE, FIND_DURATION, FIND_FILE_DUR
FITSFILE__DEFINE [2], FITSHDR2STRUCT, FITS_HDR_LIST, FOPEN_NRH2, FOPEN_STD_GMRT
FOPEN_STD_SOHO, FOPEN_YOHKOH, FUZZY_IMAGE, FXADDPAR [1], FXADDPAR [2]
FXBADDCOL [1], FXBADDCOL [2], FXBFIND [1], FXBFIND [2], FXBGROW, FXBHELP [1]
FXBHELP [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBPARSE [1], FXBPARSE [2]
FXBREAD [1], FXBREAD [2], FXBREAD [3], FXBREADM, FXBTFORM [1], FXBTFORM [2]
FXFINDEND [1], FXFINDEND [2], FXHCLEAN [1], FXHCLEAN [2], FXHMODIFY [1]
FXHMODIFY [2], FXKVALUE, FXMOVE [1], FXMOVE [2], FXREAD [1], FXREAD [2], FXTPIO_READ
FXWRITE [1], FXWRITE [2], Fits_spectra [1], Fits_spectra [2], GENERIC_MOVIE
GET_FITS_INSTR, GET_OBS_DATE, GET_ROLL_OR_XY, GET_SEC_PIXEL, GET_SUN_CENTER [1]
GET_TEL_CONFIG, GET_VDS_BIAS, GFITS_R, GT_EXPTIME [2], GT_HDR, GT_MIRRPOS, GT_NUMEXP
GT_NUMWIN, GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL, GT_WNUM, HDRREAD
HSI_RD_FITS_SPECTRUM, HXFITS, INIT_NRH_CFILE, INTGCOMP_NRH2, ITOOL_GET_SRC
ITOOL_GET_TIME, ITOOL_GET_TYPE, ITOOL_PTOOL, ITOOL_RD_FITS, ITOOL_SET_CSI
JPLEPHREAD, LASCO_FITSHDR2STRUCT, LASCO_READFITS [1], LAYOUT, LIST_HDR_SUM
LIT_HEADER_NRH1, LOAD_EIT_COLOR, MAKE_DAILY_IMAGE, MAKE_FITS_HDR, MISS_BLOCKS
MKDI_C1, MKFILEPOS, MKMOVIE, MKMOVIE0 obsolete version of mkmoviepro
MKMOVIE_kpd, MK_ALL_MIN, MK_DAILY_C1_MED, MK_DAILY_MIN, MK_GIF, MK_HEAD_CAT
MK_IMAGE, MK_IMG, MK_MONTHLY_MIN, MK_ONE_DEB_GIF, MK_RESUME, MK_SUMER_CAT
MLO_FITSHDR2STRUCT, MRDFITS [1], MRDFITS [2], MWRFITS, NRHRCAL, NRHRCALIBRATION
NRHR_LFREQ, NRH_FLUXASCI, NRH_FOPEN, NRH_HSI_FITS, NRH_IDFREQ, NRH_PLOTF, NRH_PLOTI
NRH_SOURCEASCI, NRL2EIT, OCCLTR_CNTR, OPEN_NRH_CFILE, PHOTOCAL, PLOT_DELTAT
PLOT_MAXPOS, PLOT_SOURCES, POLARIZ_CALC, RD_HXRBS_FITS, RD_IMAGE_FITS, READCDSCOL
READCDSFITS, READSUMCOL, READ_CALFITS, READ_CENTER_POINT [1]
READ_CENTER_POINT [2], READ_CONT_FITS, READ_EIT_FILE, READ_HXRS_FITS [1]
READ_HXRS_FITS [2], READ_HXRS_FITS [3], READ_NRH, READ_NRHPOS, READ_TTS_FITS
REDUCE_IMG_HDR, REDUCE_IMG_HDR2, REDUCE_LEVEL_05, REDUCE_LEVEL_1, REDUCE_RECTIFY
REDUCE_RECTIFY_P1P2, REDUCE_REFCOORD, ROT_FITS_HEAD, SCORE_BPROJ, SFITSLIST
SHOW_SYNOPTIC, SHRINK_SUMER_FITS, SPEX_READ_FIT_RESULTS, STDIMGPLOT, STDIMGPLOT2
STD_INT_SCALE, SUMDETSELECT, SUMER_FITS, SUMER_RASTER_SAVE, SUMER_SAT_COR
SUMER_SERIAL, SUMER_SPECTROGRAM_SAVE, SUMER_TOOL, SUMER_TOOL_PD_EVENT, SXT_IMAGE
SYNSCAN, TELESCOPE_POINTING, TIME_IND_NRH, TRACE_MOSAIC_IMAGE, UPD_CDS_POINT
UPD_NRH2DFITS, WCS2FITSHEAD, WCS_HCLEAN, WRITE_DISK_MOVIE [1]
WRITE_DISK_MOVIE [2], WRITE_DISK_MOVIE [3], WRITE_FLUXNRH, WRITE_LAST_IMG [1]
WRITE_LAST_IMG [2], WRITE_POSINRH, WRITE_SUMMARIES [1], WRITE_SUMMARIES [2]
XCOR_CDS, XRASTER [1], XRASTER [2], XSM_VALID, add_kw2hdr, bfits_burst [1]
bfits_burst [2], cmap2gif ftsfile maxdmind ROOTroot CONTROLcontrol, dsp_fov
eis_read_fits_data [1], eit_getlimb, eit_norm_response [1], eitoversxt, fits2rm
fits2time [1], fits2time [2], fits2time [3], fitsgen, fitshead2struct
ft_sumread_fits, get_newsoon, gt_exptime [1], hessi_fits2drm [1]
hessi_fits2drm [2], hessi_fits2drm [3], hsi_break_srm, hsi_data_gap_fxbr
hsi_ephemeris_fxbr, hsi_filedb_fxbr, hsi_flare_list_entry_fxbr
hsi_image_fitsread, hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr
hsi_spectrum_fitsread, htmd_cat, laser8ew, merge_fits_hdrs, mk_atlas
mk_gsn_obs_s1, mk_minim, mk_query [1], mk_query [2], mk_stdim_list
mrdfits_spectra, msok_poi_copy [1], msok_poi_copy [2], overwrt_hdr_kw, polariz
qImage_cw_DrawEphem, rd_sumer [1], rd_sumer [2], read_hessi_4_ospex
read_hessi_4_spex [1], read_hessi_4_spex [2], read_hessi_fits_4_spex [1]
read_hessi_fits_4_spex [2], read_xsm_4_ospex, slog_headinfo, smei_frm_cvhdr
smei_hdr_update, smei_htm_testcase, smei_sky_read, smei_star_remove
smei_star_standard, smei_zodiac_remove, spex_convert_results [1]
spex_hessi_fits2drm, spex_xsm_fits2drm, sxt2eit, viewlist, where_are [1]
where_are [2], wso_read, xsm_fits2spectrum
Example: DATATYPE=0.0D (cast data to double precision)
START = A best-guess starting position of the sought-after
keyword in the header. If specified, then FXPAR
first searches for scalar keywords in the header in
the index range bounded by START-PRECHECK and
START+POSTCHECK. This can speed up keyword searches
in large headers. If the keyword is not found, then
FXPAR searches the entire header.
If not specified then the entire header is searched.
Searches of the form 'keyword*' also search the
entire header and ignore START.
Upon return START is changed to be the position of
the newly found keyword. Thus the best way to
search for a series of keywords is to search for
them in the order they appear in the header like
this:
START = 0L
P1 = FXPAR('P1', START=START)
P2 = FXPAR('P2', START=START)
PRECHECK = If START is specified, then PRECHECK is the number
of keywords preceding START to be searched.
Default: 5
POSTCHECK = If START is specified, then POSTCHECK is the number
of keywords after START to be searched.
Default: 20
OUTPUT:
The returned value of the function is the value(s) associated with the
requested keyword in the header array.
If the parameter is complex, double precision, floating point, long or
string, then the result is of that type. Apostrophes are stripped from
strings. If the parameter is logical, 1 is returned for T, and 0 is
returned for F.
If NAME was of form 'keyword*' then a vector of values are returned.
OPTIONAL INPUT KEYWORDS:
/NOCONTINUE = If set, then continuation lines will not be read, even
if present in the header
OPTIONAL OUTPUT KEYWORD:
COUNT = Optional keyword to return a value equal to the number of
parameters found by FXPAR.
COMMENTS= Array of comments associated with the returned values.
PROCEDURE CALLS:
GETTOK(), VALID_NUM
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], VALID_NUM [1], VALID_NUM [2]
VALID_NUM [3]
SIDE EFFECTS:
The system variable !err is set to -1 if parameter not found, 0 for a
scalar value returned. If a vector is returned it is set to the number
of keyword matches found.
If a keyword occurs more than once in a header, a warning is given,
and the first occurence is used. However, if the keyword is "HISTORY",
"COMMENT", or " " (blank), then multiple values are returned.
NOTES:
The functions SXPAR() and FXPAR() are nearly identical, although
FXPAR() has slightly more sophisticated parsing. There is no
particular reason for having two nearly identical procedures, but
both are too widely used to drop either one.
REVISION HISTORY:
Version 1, William Thompson, GSFC, 12 April 1993.
Adapted from SXPAR
Version 2, William Thompson, GSFC, 14 October 1994
Modified to use VALID_NUM instead of STRNUMBER. Inserted
additional call to VALID_NUM to trap cases where character
strings did not contain quotation marks.
Version 3, William Thompson, GSFC, 22 December 1994
Fixed bug with blank keywords, following suggestion by Wayne
Landsman.
Version 4, Mons Morrison, LMSAL, 9-Jan-98
Made non-trailing ' for string tag just be a warning (not
a fatal error). It was needed because "sxaddpar" had an
error which did not write tags properly for long strings
(over 68 characters)
Version 5, Wayne Landsman GSFC, 29 May 1998
Fixed potential problem with overflow of LONG values
Version 6, Craig Markwardt, GSFC, 28 Jan 1998,
Added CONTINUE parsing
Version 7, Craig Markwardt, GSFC, 18 Nov 1999,
Added START, PRE/POSTCHECK keywords for better
performance
Version 8, Craig Markwardt, GSFC, 08 Oct 2003,
Added DATATYPE keyword to cast vector keywords type
Version 9, Paul Hick, 22 Oct 2003, Corrected bug (NHEADER-1)
[Previous]
[Next]
NAME:
FXPAR()
PURPOSE:
Obtain the value of a parameter in a FITS header.
EXPLANATION:
The first 8 chacters of each element of HDR are searched for a match to
NAME. If the keyword is one of those allowed to take multiple values
("HISTORY", "COMMENT", or " " (blank)), then the value is taken
as the next 72 characters. Otherwise, it is assumed that the next
character is "=", and the value (and optional comment) is then parsed
from the last 71 characters. An error occurs if there is no parameter
with the given name.
If the value is too long for one line, it may be continued on to the
the next input card, using the OGIP CONTINUE convention. For more info,
http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/ofwg_recomm/r13.html
Complex numbers are recognized as two numbers separated by one or more
space characters.
If a numeric value has no decimal point (or E or D) it is returned as
type LONG. If it contains more than 8 numerals, or contains the
character 'D', then it is returned as type DOUBLE. Otherwise it is
returned as type FLOAT. If an integer is too large to be stored as
type LONG, then it is returned as DOUBLE.
CALLING SEQUENCE:
Result = FXPAR( HDR, NAME [, ABORT, COUNT=, COMMENT=, /NOCONTINUE ] )
Result = FXPAR(HEADER,'DATE') ;Finds the value of DATE
Result = FXPAR(HEADER,'NAXIS*') ;Returns array dimensions as
;vector
REQUIRED INPUTS:
HDR = FITS header string array (e.g. as returned by FXREAD). Each
element should have a length of 80 characters
NAME = String name of the parameter to return. If NAME is of the
form 'keyword*' then an array is returned containing values
of keywordN where N is an integer. The value of keywordN
will be placed in RESULT(N-1). The data type of RESULT will
be the type of the first valid match of keywordN
found, unless DATATYPE is given.
OPTIONAL INPUT:
ABORT = String specifying that FXPAR should do a RETALL if a
parameter is not found. ABORT should contain a string to be
printed if the keyword parameter is not found. If not
supplied, FXPAR will return with a negative !err if a keyword
is not found.
DATATYPE = A scalar value, indicating the type of vector
data. All keywords will be cast to this type.
Default: based on first keyword.
CALLED BY:
BK, CAL_DETSELECT, CAL_HDRREAD, CDS_IMAGE, CENTER_NRH2, CFITSLIST, CHANDLE
CHECK_FITS [1], CHECK_FITS [2], CHECK_INTEG, CH_WRITE_FITS, CNVRT2REF
COMB_FULL_EQ, COMP_DATE, CONGRID [1], CW_HEADER, CW_POS, CW_XTD_NRHF, DETSELECT
EIS_GET_HDR_STRUC, EIS_ITOOL_PTOOL [1], EIS_ITOOL_PTOOL [2], EIT_DAILY
EIT_FXPAR, EIT_PREP, EIT_SUB_UTIL_FILE, FIND_DURATION, FIND_FILE_DUR
FITSFILE__DEFINE [2], FITSHDR2STRUCT, FITS_HDR_LIST, FOPEN_NRH2, FOPEN_STD_GMRT
FOPEN_STD_SOHO, FOPEN_YOHKOH, FUZZY_IMAGE, FXADDPAR [1], FXADDPAR [2]
FXBADDCOL [1], FXBADDCOL [2], FXBFIND [1], FXBFIND [2], FXBGROW, FXBHELP [1]
FXBHELP [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBPARSE [1], FXBPARSE [2]
FXBREAD [1], FXBREAD [2], FXBREAD [3], FXBREADM, FXBTFORM [1], FXBTFORM [2]
FXFINDEND [1], FXFINDEND [2], FXHCLEAN [1], FXHCLEAN [2], FXHMODIFY [1]
FXHMODIFY [2], FXKVALUE, FXMOVE [1], FXMOVE [2], FXREAD [1], FXREAD [2], FXTPIO_READ
FXWRITE [1], FXWRITE [2], Fits_spectra [1], Fits_spectra [2], GENERIC_MOVIE
GET_FITS_INSTR, GET_OBS_DATE, GET_ROLL_OR_XY, GET_SEC_PIXEL, GET_SUN_CENTER [1]
GET_TEL_CONFIG, GET_VDS_BIAS, GFITS_R, GT_EXPTIME [2], GT_HDR, GT_MIRRPOS, GT_NUMEXP
GT_NUMWIN, GT_SLITNUM, GT_SLITPOS, GT_START, GT_WINSIZE, GT_WLABEL, GT_WNUM, HDRREAD
HSI_RD_FITS_SPECTRUM, HXFITS, INIT_NRH_CFILE, INTGCOMP_NRH2, ITOOL_GET_SRC
ITOOL_GET_TIME, ITOOL_GET_TYPE, ITOOL_PTOOL, ITOOL_RD_FITS, ITOOL_SET_CSI
JPLEPHREAD, LASCO_FITSHDR2STRUCT, LASCO_READFITS [1], LAYOUT, LIST_HDR_SUM
LIT_HEADER_NRH1, LOAD_EIT_COLOR, MAKE_DAILY_IMAGE, MAKE_FITS_HDR, MISS_BLOCKS
MKDI_C1, MKFILEPOS, MKMOVIE, MKMOVIE0 obsolete version of mkmoviepro
MKMOVIE_kpd, MK_ALL_MIN, MK_DAILY_C1_MED, MK_DAILY_MIN, MK_GIF, MK_HEAD_CAT
MK_IMAGE, MK_IMG, MK_MONTHLY_MIN, MK_ONE_DEB_GIF, MK_RESUME, MK_SUMER_CAT
MLO_FITSHDR2STRUCT, MRDFITS [1], MRDFITS [2], MWRFITS, NRHRCAL, NRHRCALIBRATION
NRHR_LFREQ, NRH_FLUXASCI, NRH_FOPEN, NRH_HSI_FITS, NRH_IDFREQ, NRH_PLOTF, NRH_PLOTI
NRH_SOURCEASCI, NRL2EIT, OCCLTR_CNTR, OPEN_NRH_CFILE, PHOTOCAL, PLOT_DELTAT
PLOT_MAXPOS, PLOT_SOURCES, POLARIZ_CALC, RD_HXRBS_FITS, RD_IMAGE_FITS, READCDSCOL
READCDSFITS, READSUMCOL, READ_CALFITS, READ_CENTER_POINT [1]
READ_CENTER_POINT [2], READ_CONT_FITS, READ_EIT_FILE, READ_HXRS_FITS [1]
READ_HXRS_FITS [2], READ_HXRS_FITS [3], READ_NRH, READ_NRHPOS, READ_TTS_FITS
REDUCE_IMG_HDR, REDUCE_IMG_HDR2, REDUCE_LEVEL_05, REDUCE_LEVEL_1, REDUCE_RECTIFY
REDUCE_RECTIFY_P1P2, REDUCE_REFCOORD, ROT_FITS_HEAD, SCORE_BPROJ, SFITSLIST
SHOW_SYNOPTIC, SHRINK_SUMER_FITS, SPEX_READ_FIT_RESULTS, STDIMGPLOT, STDIMGPLOT2
STD_INT_SCALE, SUMDETSELECT, SUMER_FITS, SUMER_RASTER_SAVE, SUMER_SAT_COR
SUMER_SERIAL, SUMER_SPECTROGRAM_SAVE, SUMER_TOOL, SUMER_TOOL_PD_EVENT, SXT_IMAGE
SYNSCAN, TELESCOPE_POINTING, TIME_IND_NRH, TRACE_MOSAIC_IMAGE, UPD_CDS_POINT
UPD_NRH2DFITS, WCS2FITSHEAD, WCS_HCLEAN, WRITE_DISK_MOVIE [1]
WRITE_DISK_MOVIE [2], WRITE_DISK_MOVIE [3], WRITE_FLUXNRH, WRITE_LAST_IMG [1]
WRITE_LAST_IMG [2], WRITE_POSINRH, WRITE_SUMMARIES [1], WRITE_SUMMARIES [2]
XCOR_CDS, XRASTER [1], XRASTER [2], XSM_VALID, add_kw2hdr, bfits_burst [1]
bfits_burst [2], cmap2gif ftsfile maxdmind ROOTroot CONTROLcontrol, dsp_fov
eis_read_fits_data [1], eit_getlimb, eit_norm_response [1], eitoversxt, fits2rm
fits2time [1], fits2time [2], fits2time [3], fitsgen, fitshead2struct
ft_sumread_fits, get_newsoon, gt_exptime [1], hessi_fits2drm [1]
hessi_fits2drm [2], hessi_fits2drm [3], hsi_break_srm, hsi_data_gap_fxbr
hsi_ephemeris_fxbr, hsi_filedb_fxbr, hsi_flare_list_entry_fxbr
hsi_image_fitsread, hsi_obs_summ_data_fxbr, hsi_obs_summ_fxbr
hsi_spectrum_fitsread, htmd_cat, laser8ew, merge_fits_hdrs, mk_atlas
mk_gsn_obs_s1, mk_minim, mk_query [1], mk_query [2], mk_stdim_list
mrdfits_spectra, msok_poi_copy [1], msok_poi_copy [2], overwrt_hdr_kw, polariz
qImage_cw_DrawEphem, rd_sumer [1], rd_sumer [2], read_hessi_4_ospex
read_hessi_4_spex [1], read_hessi_4_spex [2], read_hessi_fits_4_spex [1]
read_hessi_fits_4_spex [2], read_xsm_4_ospex, slog_headinfo, smei_frm_cvhdr
smei_hdr_update, smei_htm_testcase, smei_sky_read, smei_star_remove
smei_star_standard, smei_zodiac_remove, spex_convert_results [1]
spex_hessi_fits2drm, spex_xsm_fits2drm, sxt2eit, viewlist, where_are [1]
where_are [2], wso_read, xsm_fits2spectrum
Example: DATATYPE=0.0D (cast data to double precision)
START = A best-guess starting position of the sought-after
keyword in the header. If specified, then FXPAR
first searches for scalar keywords in the header in
the index range bounded by START-PRECHECK and
START+POSTCHECK. This can speed up keyword searches
in large headers. If the keyword is not found, then
FXPAR searches the entire header.
If not specified then the entire header is searched.
Searches of the form 'keyword*' also search the
entire header and ignore START.
Upon return START is changed to be the position of
the newly found keyword. Thus the best way to
search for a series of keywords is to search for
them in the order they appear in the header like
this:
START = 0L
P1 = FXPAR('P1', START=START)
P2 = FXPAR('P2', START=START)
PRECHECK = If START is specified, then PRECHECK is the number
of keywords preceding START to be searched.
Default: 5
POSTCHECK = If START is specified, then POSTCHECK is the number
of keywords after START to be searched.
Default: 20
OUTPUT:
The returned value of the function is the value(s) associated with the
requested keyword in the header array.
If the parameter is complex, double precision, floating point, long or
string, then the result is of that type. Apostrophes are stripped from
strings. If the parameter is logical, 1 is returned for T, and 0 is
returned for F.
If NAME was of form 'keyword*' then a vector of values are returned.
OPTIONAL INPUT KEYWORDS:
/NOCONTINUE = If set, then continuation lines will not be read, even
if present in the header
OPTIONAL OUTPUT KEYWORD:
COUNT = Optional keyword to return a value equal to the number of
parameters found by FXPAR.
COMMENTS= Array of comments associated with the returned values.
PROCEDURE CALLS:
GETTOK(), VALID_NUM
CALLS: ***
GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4], VALID_NUM [1], VALID_NUM [2]
VALID_NUM [3]
SIDE EFFECTS:
The system variable !err is set to -1 if parameter not found, 0 for a
scalar value returned. If a vector is returned it is set to the number
of keyword matches found.
If a keyword occurs more than once in a header, a warning is given,
and the first occurence is used. However, if the keyword is "HISTORY",
"COMMENT", or " " (blank), then multiple values are returned.
NOTES:
The functions SXPAR() and FXPAR() are nearly identical, although
FXPAR() has slightly more sophisticated parsing. There is no
particular reason for having two nearly identical procedures, but
both are too widely used to drop either one.
REVISION HISTORY:
Version 1, William Thompson, GSFC, 12 April 1993.
Adapted from SXPAR
Version 2, William Thompson, GSFC, 14 October 1994
Modified to use VALID_NUM instead of STRNUMBER. Inserted
additional call to VALID_NUM to trap cases where character
strings did not contain quotation marks.
Version 3, William Thompson, GSFC, 22 December 1994
Fixed bug with blank keywords, following suggestion by Wayne
Landsman.
Version 4, Mons Morrison, LMSAL, 9-Jan-98
Made non-trailing ' for string tag just be a warning (not
a fatal error). It was needed because "sxaddpar" had an
error which did not write tags properly for long strings
(over 68 characters)
Version 5, Wayne Landsman GSFC, 29 May 1998
Fixed potential problem with overflow of LONG values
Version 6, Craig Markwardt, GSFC, 28 Jan 1998,
Added CONTINUE parsing
Version 7, Craig Markwardt, GSFC, 18 Nov 1999,
Added START, PRE/POSTCHECK keywords for better
performance
Version 8, Craig Markwardt, GSFC, 08 Oct 2003,
Added DATATYPE keyword to cast vector keywords type
Version 9, Paul Hick, 22 Oct 2003, Corrected bug (NHEADER-1)
[Previous]
[Next]
NAME:
FXPARPOS()
Purpose :
Finds position to insert record into FITS header.
Explanation :
Finds the position to insert a record into a FITS header. Called from
FXADDPAR.
Use :
Result = FXPARPOS(KEYWRD, IEND [, BEFORE=BEFORE ] [, AFTER=AFTER ])
Inputs :
KEYWRD = Array of eight-character keywords in header.
IEND = Position of END keyword.
Opt. Inputs :
None.
Outputs :
Result of function is position to insert record.
Opt. Outputs:
None.
Keywords :
BEFORE = Keyword string name. The parameter will be placed before the
location of this keyword. For example, if BEFORE='HISTORY'
then the parameter will be placed before the first history
location. This applies only when adding a new keyword;
keywords already in the header are kept in the same position.
AFTER = Same as BEFORE, but the parameter will be placed after the
location of this keyword. This keyword takes precedence over
BEFORE.
If neither BEFORE or AFTER keywords are passed, then IEND is returned.
Calls :
None.
CALLED BY:
FXADDPAR [1], FXADDPAR [2]
Common :
None.
Restrictions:
KEYWRD and IEND must be consistent with the relevant FITS header.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXPARPOS()
Purpose :
Finds position to insert record into FITS header.
Explanation :
Finds the position to insert a record into a FITS header. Called from
FXADDPAR.
Use :
Result = FXPARPOS(KEYWRD, IEND [, BEFORE=BEFORE ] [, AFTER=AFTER ])
Inputs :
KEYWRD = Array of eight-character keywords in header.
IEND = Position of END keyword.
Opt. Inputs :
None.
Outputs :
Result of function is position to insert record.
Opt. Outputs:
None.
Keywords :
BEFORE = Keyword string name. The parameter will be placed before the
location of this keyword. For example, if BEFORE='HISTORY'
then the parameter will be placed before the first history
location. This applies only when adding a new keyword;
keywords already in the header are kept in the same position.
AFTER = Same as BEFORE, but the parameter will be placed after the
location of this keyword. This keyword takes precedence over
BEFORE.
If neither BEFORE or AFTER keywords are passed, then IEND is returned.
Calls :
None.
CALLED BY:
FXADDPAR [1], FXADDPAR [2]
Common :
None.
Restrictions:
KEYWRD and IEND must be consistent with the relevant FITS header.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
William Thompson, Jan 1992.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version :
Version 1, 12 April 1993.
Converted to IDL V5.0 W. Landsman September 1997
[Previous]
[Next]
NAME:
FXPOSIT
PURPOSE:
Return the unit number of a FITS file positioned at specified extension
EXPLANATION:
The FITS file will be ready to be read at the beginning of the
specified extension. Exither an extension number or extension name
can be specified. Called by headfits.pro, mrdfits.pro, readfits.pro
CALLING SEQUENCE:
unit=FXPOSIT(FILE, EXT_NO_OR_NAME, /READONLY, COMPRESS=program, /SILENT)
INPUT PARAMETERS:
FILE = FITS file name, scalar string
EXT_NO_OR_NAME = Either the extension to be moved to (scalar
nonnegative integer) or the name of the extension to read
(scalar string)
RETURNS:
Unit number of file or -1 if an error is detected.
OPTIONAL INPUT KEYWORD PARAMETER:
/READONLY - If this keyword is set and non-zero, then OPENR rather
than OPENU will be used to open the FITS file.
COMPRESS - If this keyword is set and non-zero, then then treat
the file as compressed. If 1 assume a gzipped file.
and use IDLs internal decompression facility. For Unix
compressed or bzip2 compressed files spawn off a process to
decompress and use its output as the FITS stream. If the
keyword is not 1, then use its value as a string giving the
command needed for decompression.
/SILENT If set, then suppress any messages about invalid characters
in the FITS file.
OPTIONAL OUTPUT KEYWORD:
EXTNUM - Nonnegative integer give the extension number actually read
Useful only if the extension was specified by name.
ERRMSG = If this keyword is present, 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.
CALLS: ***
FXMOVE [1], FXMOVE [2]
CALLED BY:
EIS_GET_HDR [1], EIS_GET_HDR [2], FITSFILE__DEFINE [2], HEADFITS [1]
HEADFITS [2], MRDFITS [1], MRDFITS [2], MRD_HEAD
SIDE EFFECTS:
Opens and returns the descriptor of a file.
PROCEDURE:
Open the appropriate file, or spawn a command and intercept
the output.
Call FXMOVE to get to the appropriate extension.
PROCEDURE CALLS:
FXMOVE()
MODIFICATION HISTORY:
Derived from William Thompson's FXFINDEND routine.
Modified by T.McGlynn, 5-October-1994.
Modified by T.McGlynn, 25-Feb-1995 to handle compressed
files. Pipes cannot be accessed using FXHREAD so
MRD_HREAD was written.
W. Landsman 23-Apr-1997 Force the /bin/sh shell when uncompressing
T. McGlynn 03-June-1999 Use /noshell option to get rid of processes left by spawn.
Use findfile to retain ability to use wildcards
W. Landsman 03-Aug-1999 Use EXPAND_TILDE under Unix to find file
T. McGlynn 04-Apr-2000 Put reading code into FXMOVE,
additional support for compression from D.Palmer.
W. Landsman/D.Zarro 04-Jul-2000 Added test for !VERSION.OS EQ 'Win32' (WinNT)
W. Landsman 12-Dec-2000 Added /SILENT keyword
W. Landsman April 2002 Use FILE_SEARCH for V5.5 or later
W. Landsman Feb 2004 Assume since V5.3 (OPENR,/COMPRESS available)
W. Landsman,W. Thompson, 2-Mar-2004, Add support for BZIP2
W. Landsman Don't leave open file if an error occurs
W. Landsman Sep 2004 Treat FTZ extension as gzip compressed
W. Landsman Feb 2006 Removed leading spaces (prior to V5.5)
W. Landsman Nov 2006 Allow specification of extension name
Added EXTNUM, ERRMSG keywords
[Previous]
[Next]
NAME:
FXPOSIT
PURPOSE:
Return the unit number of a FITS file positioned at specified extension
EXPLANATION:
The FITS file will be ready to be read at the beginning of the
specified extension. Exither an extension number or extension name
can be specified. Called by headfits.pro, mrdfits.pro, readfits.pro
CALLING SEQUENCE:
unit=FXPOSIT(FILE, EXT_NO_OR_NAME, /READONLY, COMPRESS=program, /SILENT)
INPUT PARAMETERS:
FILE = FITS file name, scalar string
EXT_NO_OR_NAME = Either the extension to be moved to (scalar
nonnegative integer) or the name of the extension to read
(scalar string)
RETURNS:
Unit number of file or -1 if an error is detected.
OPTIONAL INPUT KEYWORD PARAMETER:
/READONLY - If this keyword is set and non-zero, then OPENR rather
than OPENU will be used to open the FITS file.
COMPRESS - If this keyword is set and non-zero, then then treat
the file as compressed. If 1 assume a gzipped file.
and use IDLs internal decompression facility. For Unix
compressed or bzip2 compressed files spawn off a process to
decompress and use its output as the FITS stream. If the
keyword is not 1, then use its value as a string giving the
command needed for decompression.
/SILENT If set, then suppress any messages about invalid characters
in the FITS file.
OPTIONAL OUTPUT KEYWORD:
EXTNUM - Nonnegative integer give the extension number actually read
Useful only if the extension was specified by name.
ERRMSG = If this keyword is present, 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.
CALLS: ***
FXMOVE [1], FXMOVE [2]
CALLED BY:
EIS_GET_HDR [1], EIS_GET_HDR [2], FITSFILE__DEFINE [2], HEADFITS [1]
HEADFITS [2], MRDFITS [1], MRDFITS [2], MRD_HEAD
SIDE EFFECTS:
Opens and returns the descriptor of a file.
PROCEDURE:
Open the appropriate file, or spawn a command and intercept
the output.
Call FXMOVE to get to the appropriate extension.
PROCEDURE CALLS:
FXMOVE()
MODIFICATION HISTORY:
Derived from William Thompson's FXFINDEND routine.
Modified by T.McGlynn, 5-October-1994.
Modified by T.McGlynn, 25-Feb-1995 to handle compressed
files. Pipes cannot be accessed using FXHREAD so
MRD_HREAD was written.
W. Landsman 23-Apr-1997 Force the /bin/sh shell when uncompressing
T. McGlynn 03-June-1999 Use /noshell option to get rid of processes left by spawn.
Use findfile to retain ability to use wildcards
W. Landsman 03-Aug-1999 Use EXPAND_TILDE under Unix to find file
T. McGlynn 04-Apr-2000 Put reading code into FXMOVE,
additional support for compression from D.Palmer.
W. Landsman/D.Zarro 04-Jul-2000 Added test for !VERSION.OS EQ 'Win32' (WinNT)
W. Landsman 12-Dec-2000 Added /SILENT keyword
W. Landsman April 2002 Use FILE_SEARCH for V5.5 or later
W. Landsman Feb 2004 Assume since V5.3 (OPENR,/COMPRESS available)
W. Landsman,W. Thompson, 2-Mar-2004, Add support for BZIP2
W. Landsman Don't leave open file if an error occurs
W. Landsman Sep 2004 Treat FTZ extension as gzip compressed
W. Landsman Feb 2006 Removed leading spaces (prior to V5.5)
W. Landsman Nov 2006 Allow specification of extension name
Added EXTNUM, ERRMSG keywords
[Previous]
[Next]
NAME:
FXREAD
Purpose :
Read basic FITS files.
Explanation :
Read an image array from a disk FITS file. Optionally allows the
user to read in only a subarray and/or every Nth pixel.
Use :
FXREAD, FILENAME, DATA [, HEADER [, I1, I2 [, J1, J2 ]] [, STEP]]
Inputs :
FILENAME = String containing the name of the file to be read.
Opt. Inputs :
I1,I2 = Data range to read in the first dimension. If passed, then
HEADER must also be passed. If not passed, or set to -1,-1,
then the entire range is read.
J1,J2 = Data range to read in the second dimension. If passed, then
HEADER and I1,J2 must also be passed. If not passed, or set
to -1,-1, then the entire range is read.
STEP = Step size to use in reading the data. If passed, then
HEADER must also be passed. Default value is 1. Ignored if
less than 1.
Outputs :
DATA = Data array to be read from the file.
Opt. Outputs:
HEADER = String array containing the header for the FITS file.
Keywords :
/COMPRESS - If this keyword is set and non-zero, then then treat
the file as gzip compressed. By default FXREAD assumes
the file is gzip compressed if it ends in ".gz"
NANVALUE = Value signalling data dropout. All points corresponding to
IEEE NaN (not-a-number) are set to this value. Ignored
unless DATA is of type float or double-precision.
EXTENSION = FITS extension. It can be a scalar integer,
indicating the extension number (extension number 0
is the primary HDU). It can also be a scalar string,
indicating the extension name (EXTNAME keyword).
Default: 0 (primary HDU)
PROMPT = If set, then the optional parameters are prompted for at the
keyboard.
AVERAGE = If set, then the array size is reduced by averaging pixels
together rather than by subselecting pixels. Ignored unless
STEP is nontrivial. Note: this is much slower.
YSTEP = If passed, then STEP is the step size in the 1st dimension,
and YSTEP is the step size in the 2nd dimension. Otherwise,
STEP applies to both directions.
NOSCALE = If set, then the output data will not be scaled using the
optional BSCALE and BZERO keywords in the FITS header.
Default is to scale, if and only if BSCALE and BZERO are
present and nontrivial.
NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the
optional HEADER array will not be changed. The default is
to reset these keywords to BSCALE=1, BZERO=0. Ignored if
NOSCALE is set.
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 = ''
FXREAD, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
NODATA = If set, then the array is not read in, but the
primary header is read.
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXHREAD [1], FXHREAD [2], FXPAR [1], FXPAR [2]
GET_DATE [1], GET_DATE [2], IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3]
IEEE_TO_HOST [4], WHERENAN [1], WHERENAN [2], WHERENAN [3], WHERENAN [4]
CALLED BY:
CDS_IMAGE, CDS_SLIT6_BURNIN, DISPLAY_CDS_BURNIN, FIT2GIF, ITOOL_RD_FITS
LOCATE_FFCAL, MK_GIF, MK_IVM_MAP, NIS_AVG_SPECT_DEMO, RD_IMAGE_FITS, READ_EIT_FILE
Radio Astronomy Group Fits Read, VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_CALIB
VDS_READ_FLAT, XCOR_CDS, rd_trace_i0 [2]
Common :
None.
Restrictions:
Groups are not supported.
The optional parameters I1, I2, and STEP only work with one or
two-dimensional arrays. J1 and J2 only work with two-dimensional
arrays.
Use of the AVERAGE keyword is not compatible with arrays with missing
pixels.
Side effects:
If the keywords BSCALE and BZERO are present in the FITS header, and
have non-trivial values, then the returned array DATA is formed by the
equation
DATA = BSCALE*original + BZERO
However, this behavior can overridden by using the /NOSCALE keyword.
If the data is scaled, then the optional HEADER array is changed so
that BSCALE=1 and BZERO=0. This is so that these scaling parameters
are not applied to the data a second time by another routine. Also,
history records are added storing the original values of these
constants. Note that only the returned array is modified--the header
in the FITS file itself is untouched.
If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO
keywords are not changed. It is then the user's responsibility to
ensure that these parameters are not reapplied to the data. In
particular, these keywords should not be present in any header when
writing another FITS file, unless the user wants their values to be
applied when the file is read back in. Otherwise, FITS readers will
read in the wrong values for the data array.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, May 1992, based in part on READFITS by W. Landsman, and
STSUB by M. Greason and K. Venkatakrishna.
W. Thompson, Jun 1992, added code to interpret BSCALE and BZERO
records, and added NOSCALE and NOUPDATE
keywords.
W. Thompson, Aug 1992, changed to call FXHREAD, and to add history
records for BZERO, BSCALE.
Minimium IDL Version:
V5.3 (uses COMPRESS keyword to OPEN)
Written :
William Thompson, GSFC, May 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 17 November 1993.
Corrected bug with AVERAGE keyword on non-IEEE compatible
machines.
Corrected bug with subsampling on VAX machines.
Version 3, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 5, Zarro (SAC/GSFC), 14 Feb 1997
Added I/O error checking
Version 6, 20-May-1998, David Schlegel/W. Thompson
Allow a single pixel to be read in.
Change the signal to read in the entire array to be -1
Version 7 C. Markwardt 22 Sep 2003
If the image is empty (NAXIS EQ 0), or NODATA is set, then
return only the header.
Version 8 W. Landsman 29 June 2004
Added COMPRESS keyword, check for .gz extension
Version 9, William Thompson, 19-Aug-2004
Make sure COMPRESS is treated as a scalar
Version 10, Craig Markwardt, 01 Mar 2004
Add EXTENSION keyword and ability to read different
extensions than the primary one.
[Previous]
[Next]
NAME:
FXREAD
Purpose :
Read basic FITS files.
Explanation :
Read an image array from a disk FITS file. Optionally allows the
user to read in only a subarray and/or every Nth pixel.
Use :
FXREAD, FILENAME, DATA [, HEADER [, I1, I2 [, J1, J2 ]] [, STEP]]
Inputs :
FILENAME = String containing the name of the file to be read.
Opt. Inputs :
I1,I2 = Data range to read in the first dimension. If passed, then
HEADER must also be passed. If not passed, or set to -1,-1,
then the entire range is read.
J1,J2 = Data range to read in the second dimension. If passed, then
HEADER and I1,J2 must also be passed. If not passed, or set
to -1,-1, then the entire range is read.
STEP = Step size to use in reading the data. If passed, then
HEADER must also be passed. Default value is 1. Ignored if
less than 1.
Outputs :
DATA = Data array to be read from the file.
Opt. Outputs:
HEADER = String array containing the header for the FITS file.
Keywords :
/COMPRESS - If this keyword is set and non-zero, then then treat
the file as gzip compressed. By default FXREAD assumes
the file is gzip compressed if it ends in ".gz"
NANVALUE = Value signalling data dropout. All points corresponding to
IEEE NaN (not-a-number) are set to this value. Ignored
unless DATA is of type float or double-precision.
EXTENSION = FITS extension. It can be a scalar integer,
indicating the extension number (extension number 0
is the primary HDU). It can also be a scalar string,
indicating the extension name (EXTNAME keyword).
Default: 0 (primary HDU)
PROMPT = If set, then the optional parameters are prompted for at the
keyboard.
AVERAGE = If set, then the array size is reduced by averaging pixels
together rather than by subselecting pixels. Ignored unless
STEP is nontrivial. Note: this is much slower.
YSTEP = If passed, then STEP is the step size in the 1st dimension,
and YSTEP is the step size in the 2nd dimension. Otherwise,
STEP applies to both directions.
NOSCALE = If set, then the output data will not be scaled using the
optional BSCALE and BZERO keywords in the FITS header.
Default is to scale, if and only if BSCALE and BZERO are
present and nontrivial.
NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the
optional HEADER array will not be changed. The default is
to reset these keywords to BSCALE=1, BZERO=0. Ignored if
NOSCALE is set.
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 = ''
FXREAD, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
NODATA = If set, then the array is not read in, but the
primary header is read.
Calls : ***
FXADDPAR [1], FXADDPAR [2], FXHREAD [1], FXHREAD [2], FXPAR [1], FXPAR [2]
GET_DATE [1], GET_DATE [2], IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3]
IEEE_TO_HOST [4], WHERENAN [1], WHERENAN [2], WHERENAN [3], WHERENAN [4]
CALLED BY:
CDS_IMAGE, CDS_SLIT6_BURNIN, DISPLAY_CDS_BURNIN, FIT2GIF, ITOOL_RD_FITS
LOCATE_FFCAL, MK_GIF, MK_IVM_MAP, NIS_AVG_SPECT_DEMO, RD_IMAGE_FITS, READ_EIT_FILE
Radio Astronomy Group Fits Read, VDS_BURNIN_NEW, VDS_BURNIN_ORIG, VDS_CALIB
VDS_READ_FLAT, XCOR_CDS, rd_trace_i0 [2]
Common :
None.
Restrictions:
Groups are not supported.
The optional parameters I1, I2, and STEP only work with one or
two-dimensional arrays. J1 and J2 only work with two-dimensional
arrays.
Use of the AVERAGE keyword is not compatible with arrays with missing
pixels.
Side effects:
If the keywords BSCALE and BZERO are present in the FITS header, and
have non-trivial values, then the returned array DATA is formed by the
equation
DATA = BSCALE*original + BZERO
However, this behavior can overridden by using the /NOSCALE keyword.
If the data is scaled, then the optional HEADER array is changed so
that BSCALE=1 and BZERO=0. This is so that these scaling parameters
are not applied to the data a second time by another routine. Also,
history records are added storing the original values of these
constants. Note that only the returned array is modified--the header
in the FITS file itself is untouched.
If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO
keywords are not changed. It is then the user's responsibility to
ensure that these parameters are not reapplied to the data. In
particular, these keywords should not be present in any header when
writing another FITS file, unless the user wants their values to be
applied when the file is read back in. Otherwise, FITS readers will
read in the wrong values for the data array.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, May 1992, based in part on READFITS by W. Landsman, and
STSUB by M. Greason and K. Venkatakrishna.
W. Thompson, Jun 1992, added code to interpret BSCALE and BZERO
records, and added NOSCALE and NOUPDATE
keywords.
W. Thompson, Aug 1992, changed to call FXHREAD, and to add history
records for BZERO, BSCALE.
Minimium IDL Version:
V5.3 (uses COMPRESS keyword to OPEN)
Written :
William Thompson, GSFC, May 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 17 November 1993.
Corrected bug with AVERAGE keyword on non-IEEE compatible
machines.
Corrected bug with subsampling on VAX machines.
Version 3, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 4, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 5, Zarro (SAC/GSFC), 14 Feb 1997
Added I/O error checking
Version 6, 20-May-1998, David Schlegel/W. Thompson
Allow a single pixel to be read in.
Change the signal to read in the entire array to be -1
Version 7 C. Markwardt 22 Sep 2003
If the image is empty (NAXIS EQ 0), or NODATA is set, then
return only the header.
Version 8 W. Landsman 29 June 2004
Added COMPRESS keyword, check for .gz extension
Version 9, William Thompson, 19-Aug-2004
Make sure COMPRESS is treated as a scalar
Version 10, Craig Markwardt, 01 Mar 2004
Add EXTENSION keyword and ability to read different
extensions than the primary one.
Version 11, W. Landsamn September 2006
Assume since V5.5, remove VMS support
[Previous]
[Next]
Project : SOHO - CDS
Name : FXTAPEREAD
Purpose : Copy FITS files tape to disk with interactive capabilities.
Explanation : Copy FITS files from tape onto disk. Data is left in FITS
format, and not converted to SDAS. For use on VMS (any
version) and UNIX running IDL Version 3.1 or later (see
Restrictions).
Use : FXTAPEREAD ; Prompt for all parameters.
FXTAPEREAD, UNIT, LIST, KEYWORD, TAPENAME, FNAMES [, XWSTR]
FXTAPEREAD, 1, INDGEN(5)+1, 'IMAGE'
; Read the first 5 files on unit 1. The filenames are
; taken from the IMAGE keyword.
FXTAPEREAD, 1, [2,4], '', '', ['GALAXY', 'STAR']
; Read files 2 and 4 on unit 1. Create files named
; GALAXY and STAR.
FXTAPEREAD, 1, [2,4]
; Read files 2 and 4, and prompt for filenames.
Inputs : None necessary.
Opt. Inputs : Interactive users will normally just type FXTAPEREAD and be
prompted for all parameters. However, the following
parameters can be passed directly to FXTAPEREAD:
UNIT = Tape unit number (scalar: 0-9).
LIST = Vector containing list of file numbers to read.
KEYWORD = Scalar string giving a FITS keyword which will be
extracted from the headers on tape and used for file
names. Set KEYWORD to the null string '', if such a
keyword is not to be used.
TAPENAME= Scalar string giving a name for the tape. Filenames
will be constructed by concatenating TAPENAME with
the file number. TAPENAME is used only if KEYWORD
is passed as the null string ''.
FNAMES = Vector string giving a file name for each file
number given in LIST. FNAMES is used only if both
KEYWORD = '' and TAPENAME = ''. Spaces are trimmed
from names in FNAMES.
XWSTR = A string array that contains informational text
concerning tape reading events. These strings are
printed either to the screen or to the FILENAME
widget (internally called XWIDGET) created by the
XWINTAPE procedure.
Outputs : None.
Opt. Outputs: FNAMES = If KEYWORD or TAPENAME is set to a non-null string,
then the filename created by FXTPIO_READ is stored
in this variable to be returned to the caller.
XWSTR = A string array that contains informational text
concerning tape reading events. These strings are
printed either to the screen or to the FILENAME
widget (internally called XWIDGET) created by the
XWINTAPE procedure. Note that FXTAPEREAD adds
strings to this array and passes them back to the
caller.
Keywords : ERRMSG = If defined and passed, then any error messages will
be returned to the user in this parameter rather
than being handled by the IDL MESSAGE utility. If
no errors are encountered, then a null string is
returned. In order to use this feature, the string
ERRMSG must be defined first, e.g.,
ERRMSG = ''
FXTAPEREAD, 1, INDGEN(5)+1, 'IMAGE', $
ERRMSG=ERRMSG
IF ERRMSG(0) NE '' THEN ...
NOSUFFIX = Normally FXTAPEREAD (via FXTPIO_READ) will
automatically append a ".fits" to the end of a
passed file name. Setting this keyword prevents
that from happening.
SFDU = This keyword tells this routine that the first file
on the tape is an SFDU header file (defined to be
tape file number 1). If this keyword is set, then
the first file on the tape is skipped after the
initial rewind is preformed.
XWIDGET = This keyword tells this routine that an X-window
widget (i.e., XWINTAPE) is driving this program.
If this is the case, any informational messages
generated from this routine will be displayed in the
widget instead of the screen.
Calls : ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], FITSTAPE, FXTPIO_READ, GETFILES
REWIND [1], REWIND [2], SKIPF [1], SKIPF [2]
Common : None.
Restrictions: Supported under VMS and (NOW) under UNIX running IDL Versions
3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are
included in a user library directory.
Side effects: FXTAPEREAD will always rewind the tape before processing.
The FITS file is copied over record by record with no
conversion, until the <end-of-file> marker is reached. No
testing is done of the validity of the FITS file.
Images are NOT converted using BSCALE and BZERO factors in the
header.
For each tape file a FITS disk file will be created with the
name "<name>.FITS" unless /NOSUFFIX has been set..
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : William Thompson, March 1992, from FITSRD by D. Lindler.
William Thompson, May 1992, fixed TPOS bug when reading
multiple files.
William Thompson, Jan. 1993, changed for renamed FXTPIO_READ.
Written : William Thompson, GSFC, March 1992.
Modified : Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, Donald G. Luttermoser, GSFC/ARC, 13 March 1995.
Added ERRMSG keyword. Reformatted and modified the
documentation.
Version 3, Donald G. Luttermoser, GSFC/ARC, 20 March 1995.
Added NOSUFFIX & SFDU keyword.
Version 4, Donald G. Luttermoser, GSFC/ARC, 9 May 1995.
Added the XWIDGET keyword.
Version 5, Donald G. Luttermoser, GSFC/ARC, 13 December 1995.
Fixed the output text when an SFDU header file has
been written to the tape. This SFDU file is now
referred to tape file #1 (instead of #0 as previously
done) and the first FITS file is tape file #2 (instead
of #1).
Version : Version 5, 13 December 1995.
[Previous]
[Next]
Project : SOHO - CDS
Name : FXTAPEWRITE
Purpose : Procedure to copy disk FITS files to tape with interactive
capabilities.
Explanation : Writes the FITS files to tape based upon the parameters
inputted or supplied. If no parameters are supplied, then the
user is asked a series of questions to walk him or her through
copying a number of FITS files from disk to tape.
Use : FXTAPEWRITE ; Prompt for all parameters.
FXTAPEWRITE, UNIT, BLFAC, FNAMES, KEYWORD [, XWSTR]
FXTAPEWRITE, 0, 1, FNAMES
; Writes all FITS files listed in FNAMES to the tape
; associated to UNIT = 0 with 2880 bytes per record.
FXTAPEWRITE, 1, 3, 'CDS', 'FILENAME'
; Writes all FITS files beginning with the name 'CDS'
; to the tape associated to UNIT = 1 with 8640 (2880*3)
; bytes per record and includes the keyword 'FILENAME'
; in the FITS header which contains the disk file name
; of the file being written.
Inputs : None necessary.
Opt. Inputs : Interactive users will normally just type FXTAPEWRITE and be
prompted for all parameters. However, the following
parameters can be passed directly to FXTAPEWRITE:
UNIT = Tape unit number (integer scalar).
BLFAC = Blocking factor (1-10) = # of 2880 byte records per
block.
FNAMES = File names (string array). If in interactive mode,
the file names may either be specified individually,
or a tapename may be specified, and all files in the
form "tapename<number>.FITS" will be written to tape.
KEYWORD = Name of a FITS keyword to put file names into. This
will simplify subsequent reading of the FITS tape,
since individual filenames will not have to be
specified. If you don't want to put the file names
into the FITS header, then just hit <RETURN>
(interactive mode) or do not pass this parameter.
XWSTR = A string array that contains informational text
concerning the tape I/O. These strings are printed
either to the screen or to the FILENAME widget (set
internally to XWIDGET) if the XWINTAPE procedure is
driving this routine.
Outputs : None.
Opt. Outputs: XWSTR = A string array that contains informational text
concerning the tape I/O. These strings are printed
either to the screen or to the FILENAME widget (set
internally to XWIDGET) if the XWINTAPE procedure is
driving this routine. Note that FXTAPEWRITE will
add strings to this array which is then passed back
to the caller.
Keywords : XWIDGET = This keyword tells this FXTAPEWRITE that the XWINTAPE
widget procedure is driving this procedure. If so,
then any informational text is printed to the
FILENAME widget (internally set to XWIDGET) created
by XWINTAPE.
SFDU = If set, then an SFDU header file was placed at the
beginning of the tape.
ERRMSG = If defined and passed, then any error messages will
be returned to the user in this parameter rather
than being handled by the IDL MESSAGE utility. If
no errors are encountered, then a null string is
returned. In order to use this feature, the string
ERRMSG must be defined first, e.g.,
ERRMSG = ''
FXTAPEWRITE, 1, 1, FNAMES, ERRMSG=ERRMSG
IF ERRMSG(0) NE '' THEN ...
Calls : ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], FITSTAPE, FXTPIO_WRITE, GETFILES
Common : None.
Restrictions: Supported under VMS and (NOW) under UNIX running IDL Versions
3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are
included in a user library directory.
Side effects: Tape is not rewound before files are written. Tape should be
positioned with REWIND or SKIPF before calling FXTAPEWRITE.
If you want to append new FITS files to a tape, then call
TINIT (tape init) to position tape between final double EOF.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : William Thompson, March 1992, from FITSWRT by D. Lindler.
William Thompson, May 1992, removed call to TINIT.
William Thompson, Jan. 1993, changed for renamed FXTPIO_WRITE.
Written : William Thompson, GSFC, March 1992.
Modified : Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, Donald G. Luttermoser, GSFC/ARC, 13 March 1995.
Included "passed" input parameters and ERRMSG keyword.
Reformatted and modified the documentation.
Version 3, Donald G. Luttermoser, GSFC/ARC, 9 May 1995.
Added the XWIDGET keyword.
Version 4, Donald G. Luttermoser, GSFC/ARC, 13 December 1995.
Corrected output text such that if an SFDU file was
placed at the beginning of the tape (indicated with
the added keyword /SFDU), the first FITS file written
to the tape is tape file #2 (not #1 as previously done).
Version : Version 4, 13 December 1995.
[Previous]
[Next]
Project : SOHO - CDS
Name : FXTPIO_READ
Purpose : Copies FITS files from tape to disk -- internal routine.
Explanation : Procedure to copy a FITS file from a tape on the specified
tape unit to the disk file <name>.FITS (unless the /NOSUFFIX
keyword has been set). Data is left in FITS format, and not
converted to SDAS. For use on VMS (any version) and UNIX
running IDL Version 3.1 or later (see Restrictions).
The procedure FXTAPEREAD is normally used to read a FITS tape.
FXTPIO_READ is a procedure call internal to FXTAPEREAD.
Use : FXTPIO_READ, UNIT, NAME
FXTPIO_READ, UNIT, NAME, KEYWORD
Inputs : UNIT = Tape unit number (scalar: 0-9).
NAME = File name (without an extension, unless /NOSUFFIX is
set).
Opt. Inputs : KEYWORD = If supplied and not equal to the null string then
the file name will be taken from the value of the
header keyword specified.
Outputs : NAME = Name of file if input keyword parameter is supplied.
Opt. Outputs: None.
Keywords : ERRMSG = If defined and passed, then any error messages will
be returned to the user in this parameter rather
than being handled by the IDL MESSAGE utility. If
no errors are encountered, then a null string is
returned. In order to use this feature, the string
ERRMSG must be defined first, e.g.,
ERRMSG = ''
FXTPIO_READ, 1, NAME, ERRMSG=ERRMSG
IF ERRMSG(0) NE '' THEN ...
NOSUFFIX = Normally FXTPIO_READ will automatically append a
".fits" to the end of a passed file name. Setting
this keyword prevents this from happening.
Calls : ***
FITSTAPE, FXPAR [1], FXPAR [2], REMCHAR [1], REMCHAR [2], REMCHAR [3]
CALLED BY:
FXTAPEREAD
Common : None.
Restrictions: Supported under VMS and (NOW) under UNIX running IDL Versions
3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are
included in a user library directory.
Side effects: The FITS file is copied to a disk file called <name>.FITS
(unless the /NOSUFFIX keyword has been set).
The FITS file is copied over record by record with no
conversion, until the end-of-file marker is reached. No
testing is done of the validity of the FITS file.
Images are NOT converted using BSCALE and BZERO factors in the
header.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : William Thompson, March 1992, from FITSREAD by D. Lindler, M.
Greason, and W. Landsman.
W. Thompson, May 1992, changed open statement to force 2880
byte fixed length records (VMS). The software here
does not depend on this file configuration, but other
FITS readers might.
William Thompson, Jan. 1993, renamed to be compatible with DOS
file naming limitations.
Written : William Thompson, GSFC, March 1992.
Modified : Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, Donald G. Luttermoser, GSFC/ARC, 14 March 1995.
Added ERRMSG and NOSUFFIX keywords.
Version : Version 2, 14 March 1995.
[Previous]
[Next]
Project : SOHO - CDS
Name : FXTPIO_WRITE
Purpose : Copy FITS files from disk to tape -- internal routine.
Explanation : Procedure will copy a disk FITS file to the specified tape
unit, at the current tape position. Used for true disk FITS
files, not SDAS/Geis files. Called by FXTAPEWRITE.
Use : FXTPIO_WRITE, UNIT, FILE
FXTPIO_WRITE, UNIT, FILE, KEYWORD
Inputs : UNIT = IDL tape unit number (scalar: 0-9).
FILE = Disk FITS file name, with extension.
Opt. Inputs : KEYWORD = Keyword to place file name into. If not supplied or
equal to the null string '' then the file name is
not put into the header before writing it to tape.
Outputs : None.
Opt. Outputs: None.
Keywords : ERRMSG = If defined and passed, then any error messages will
be returned to the user in this parameter rather
than being handled by the IDL MESSAGE utility. If
no errors are encountered, then a null string is
returned. In order to use this feature, the string
ERRMSG must be defined first, e.g.,
ERRMSG = ''
FXTPIO_WRITE, 1, FILE, ERRMSG=ERRMSG
IF ERRMSG(0) NE '' THEN ...
Calls : ***
FDECOMP [1], FDECOMP [2], FDECOMP [3], FITSTAPE, FXADDPAR [1], FXADDPAR [2]
FXHREAD [1], FXHREAD [2], REMCHAR [1], REMCHAR [2], REMCHAR [3], SKIPF [1]
SKIPF [2]
CALLED BY:
FXTAPEWRITE
Common : None.
Restrictions: Supported under VMS and (NOW) under UNIX running IDL Versions
3.1 or later when the UNIX versions of TAPRD, TAPWRT, etc. are
included in a user library directory.
Side effects: None.
Category : Data Handling, I/O, FITS, Generic.
Prev. Hist. : William Thompson, March 1992, from FITSWRITE by D. Lindler, W.
Landsman, and M. Greason.
William Thompson, Jan. 1993, renamed to be compatible with DOS
file naming limitations.
Written : William Thompson, GSFC, March 1992.
Modified : Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, Donald G. Luttermoser, GSFC/ARC, 14 March 1995.
Added ERRMSG keyword. Updated documentation concerning
UNIX.
Version 3, Donald G. Luttermoser, GSFC/ARC, 9 May 1995.
Removed the "PRINT, FILE" line from this routine and
placed it in FXTAPEWRITE which drives this procedure.
Version : Version 3, 9 May 1995.
[Previous]
[Next]
NAME:
FXWRITE
Purpose :
Write a disk FITS file.
Explanation :
Creates a disk FITS file and writes a FITS primary header, and
optionally a primary data array.
Use :
FXWRITE, FILENAME, HEADER [, DATA ]
Inputs :
FILENAME = String containing the name of the file to be written.
HEADER = String array containing the header for the FITS file.
Opt. Inputs :
DATA = IDL data array to be written to the file. If not passed,
then it is assumed that extensions will be added to the
file.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
NANVALUE = Value signalling data dropout. All points corresponding to
this value are set to be IEEE NaN (not-a-number). Ignored
unless DATA is of type float, double-precision or complex.
NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the
HEADER array will not be changed. The default is to reset
these keywords to BSCALE=1, BZERO=0.
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 = ''
FXWRITE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
CHECK_FITS [1], CHECK_FITS [2], FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2]
GET_DATE [1], GET_DATE [2], HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3]
HOST_TO_IEEE [4]
CALLED BY:
CDS_SIMPLE_FITS, Create FITS, Create a FITS primary Header and Data Unit
EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
FITS WRITER CLASS, FITSFILE__DEFINE [3], HSI_PACKET2FITS, ITOOL_MODIFY_FH
ITOOL_WRITE_FITS, MAP2FITS, MK_SYNOPTIC, RH_INIT_HEADER
Radio Astronomy Group Fits Write, SHRINK_SUMER_FITS, SPECTRA2FITS
WRITE_CALFITS, XSM_PREP, eis_make_status_fits [2], eis_make_status_fits [3]
eit_getlimb, hsi_filedb_write, hsi_obs_summ_otp, hsi_obs_summ_soc__define
hsi_obs_summ_write, hsi_qlook__define, hxrs_drm2fits [1], hxrs_drm2fits [2]
hxrs_drm2fits [3], mk_trace_i0, polariz_display, rm2fits, smei_hdr_make
spectrum2fits, tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2]
write_ovsa_fits, wrt_fits_bin_exten [1]
Common :
None.
Restrictions:
If DATA is passed, then HEADER must be consistent with it. If no data
array is being written to the file, then HEADER must also be consistent
with that. The routine FXHMAKE can be used to create a FITS header.
If found, then the optional keywords BSCALE and BZERO in the HEADER
array is changed so that BSCALE=1 and BZERO=0. This is so that these
scaling parameters are not applied to the data a second time by another
routine. Also, history records are added storing the original values
of these constants. (Other values of BZERO are used for unsigned
integers.)
If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO
keywords are not changed. The user should then be aware that FITS
readers will apply these numbers to the data, even if the data is
already converted to floating point form.
Groups are not supported.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992, from WRITEFITS by J. Woffard and W. Landsman.
Differences include:
* Made DATA array optional, and HEADER array mandatory.
* Changed order of HEADER and DATA parameters.
* No attempt made to fix HEADER array.
W. Thompson, May 1992, changed open statement to force 2880 byte fixed
length records (VMS). The software here does not
depend on this file configuration, but other
FITS readers might.
W. Thompson, Aug 1992, added code to reset BSCALE and BZERO records,
and added the NOUPDATE keyword.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 12 August 1999
Catch error if unable to open file.
Version 4.1 Wayne Landsman, GSFC, 02 May 2000
Remove !ERR in call to CHECK_FITS, Use ARG_PRESENT()
Version 5, William Thompson, GSFC, 22 September 2004
Recognize unsigned integer types
Version :
Version 5, 22 Sep 2004
[Previous]
[Next]
NAME:
FXWRITE
Purpose :
Write a disk FITS file.
Explanation :
Creates a disk FITS file and writes a FITS primary header, and
optionally a primary data array.
Use :
FXWRITE, FILENAME, HEADER [, DATA ]
Inputs :
FILENAME = String containing the name of the file to be written.
HEADER = String array containing the header for the FITS file.
Opt. Inputs :
DATA = IDL data array to be written to the file. If not passed,
then it is assumed that extensions will be added to the
file.
Outputs :
None.
Opt. Outputs:
None.
Keywords :
NANVALUE = Value signalling data dropout. All points corresponding to
this value are set to be IEEE NaN (not-a-number). Ignored
unless DATA is of type float, double-precision or complex.
NOUPDATE = If set, then the optional BSCALE and BZERO keywords in the
HEADER array will not be changed. The default is to reset
these keywords to BSCALE=1, BZERO=0.
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 = ''
FXWRITE, ERRMSG=ERRMSG, ...
IF ERRMSG NE '' THEN ...
Calls : ***
CHECK_FITS [1], CHECK_FITS [2], FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2]
GET_DATE [1], GET_DATE [2], HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3]
HOST_TO_IEEE [4]
CALLED BY:
CDS_SIMPLE_FITS, Create FITS, Create a FITS primary Header and Data Unit
EIS_MKFITS [1], EIS_MKFITS [2], EIS_MODFITS [1], EIS_MODFITS [2]
FITS WRITER CLASS, FITSFILE__DEFINE [3], HSI_PACKET2FITS, ITOOL_MODIFY_FH
ITOOL_WRITE_FITS, MAP2FITS, MK_SYNOPTIC, RH_INIT_HEADER
Radio Astronomy Group Fits Write, SHRINK_SUMER_FITS, SPECTRA2FITS
WRITE_CALFITS, XSM_PREP, eis_make_status_fits [2], eis_make_status_fits [3]
eit_getlimb, hsi_filedb_write, hsi_obs_summ_otp, hsi_obs_summ_soc__define
hsi_obs_summ_write, hsi_qlook__define, hxrs_drm2fits [1], hxrs_drm2fits [2]
hxrs_drm2fits [3], mk_trace_i0, polariz_display, rm2fits, smei_hdr_make
spectrum2fits, tr_wrt_fits, tr_wrt_fits_i1 [1], tr_wrt_fits_i1 [2]
write_ovsa_fits, wrt_fits_bin_exten [1]
Common :
None.
Restrictions:
If DATA is passed, then HEADER must be consistent with it. If no data
array is being written to the file, then HEADER must also be consistent
with that. The routine FXHMAKE can be used to create a FITS header.
If found, then the optional keywords BSCALE and BZERO in the HEADER
array is changed so that BSCALE=1 and BZERO=0. This is so that these
scaling parameters are not applied to the data a second time by another
routine. Also, history records are added storing the original values
of these constants. (Other values of BZERO are used for unsigned
integers.)
If the /NOUPDATE keyword is set, however, then the BSCALE and BZERO
keywords are not changed. The user should then be aware that FITS
readers will apply these numbers to the data, even if the data is
already converted to floating point form.
Groups are not supported.
Side effects:
None.
Category :
Data Handling, I/O, FITS, Generic.
Prev. Hist. :
W. Thompson, Jan 1992, from WRITEFITS by J. Woffard and W. Landsman.
Differences include:
* Made DATA array optional, and HEADER array mandatory.
* Changed order of HEADER and DATA parameters.
* No attempt made to fix HEADER array.
W. Thompson, May 1992, changed open statement to force 2880 byte fixed
length records (VMS). The software here does not
depend on this file configuration, but other
FITS readers might.
W. Thompson, Aug 1992, added code to reset BSCALE and BZERO records,
and added the NOUPDATE keyword.
Written :
William Thompson, GSFC, January 1992.
Modified :
Version 1, William Thompson, GSFC, 12 April 1993.
Incorporated into CDS library.
Version 2, William Thompson, GSFC, 31 May 1994
Added ERRMSG keyword.
Version 3, William Thompson, GSFC, 23 June 1994
Modified so that ERRMSG is not touched if not defined.
Version 4, William Thompson, GSFC, 12 August 1999
Catch error if unable to open file.
Version 4.1 Wayne Landsman, GSFC, 02 May 2000
Remove !ERR in call to CHECK_FITS, Use ARG_PRESENT()
Version 5, William Thompson, GSFC, 22 September 2004
Recognize unsigned integer types
Version :
Version 5, 22 Sep 2004