BINS,W,F,weight,WCENTER,WIDTHS,MEAN,SIGMA,WNPTS, $
/silent,file=file,/overwrite,/kev
W | Wavelength vector (unbinned). |
F | Flux vector (unbinned). |
wt | Weights for each wavelength (optional). |
WCENTER | Vector of central wavelength(s) for each bin. |
WIDTHS | Vector of data bin width(s), or scalar for constant width. |
MEAN | Mean flux in each bin. |
SIGMA | RMS deviation in each bin. |
WNPTS | Weighted number of points per bin. |
silent | If this keyword is set, results will not be displayed on the screen. |
file | If you wish to write the results to a file, you may enter a filename via this keyword (e.g., file='bozo.lis'), or simply set the keyword (/file) to use a default filename (bins.txt). |
overwrite | On systems that don't support version numbers (e.g., UNIX), BINS will normally check for a pre-existing file of the same name as that chosen with the FILE keyword, and ask the user if the old file should be overwritten. Setting OVERWRITE disables this query and overwrites the file. This keyword is ignored if the FILE keyword is not included. |
kev | If specified, wavelengths are converted to energy units (Kev) and fluxes are given as photons/cm2/sec/Kev. |
The most common method of weighting the points for IUESIPS data is to use the array as the weight. Those points with negative values will be excluded from the bin. The array can also be converted into weight values using the procedure WEIGHT (see Table 10.4). This procedure can also convert or flag values to weight values. (Note: Weighting of quality flags is most meaningful for boxcar extractions since other extraction techniques may not preserve some blemishes. Examine your data carefully before using this procedure.) Its calling sequence is:
WEIGHT,P,WT,/silent,/sigma,/epsilon,nu=nu
P | Your or flags, or your values. |
WT | Calculated weights (see Table 10.4). |
epsilon | If all of your flags are non-positive, WEIGHT will get them confused with flags. If they have fractional components, WEIGHT will think they are values. Normally, one would hope that there would be a few ``good'' flags, and they should be integers if you have done nothing to them, but if this is not the case and you still wish to run WEIGHT, you may set this keyword to tell WEIGHT that they are flags. |
sigma | values that do not have fractional components may be considered quality flags (e.g., uncalibrated errors from GEX). You may set this keyword to tell WEIGHT that you have given it a vector. |
nu | The program will automatically assume that a P vector with all non-positive values that have no fractional components is a flag vector. There is a default weighting scheme for flags (similar to that for flags). To create your own weighting scheme, you may enter a 16 element vector of weights (one for each bit of the flag) via this keyword. See Table 7.2 for a list of conditions associated with each bit. Remember that IDL subscripts start with 0, so that bit 15 is the 16th bit. Bits 0 and 1 have no problem conditions assigned. Weights assigned to each bit should be in the range from 0 (totally unacceptable condition) to 1 (full weighting). Flags with several problem conditions will have weights reflecting the cumulative effect of all the problems. Example: You assign bit 11 (saturated pixel) a weight of .03 and bit 13 (reseau) a weight of .02; 1./(300+200)=.002. will be the weight assigned to that point. Flags with any bit weighted zero will be assigned a weight of zero. |
silent | If you have no keywords set, the program will figure out what P is and tell you what it decides. To suppress this message, set this keyword. |
For vectors, the weight is normalized to the maximum of 1./ .
It is acceptable to enter the scalar 1.0 to weight all data equally, but you might as well type
wt=w*0+1. or wt=replicate(1.,n_elements(w))
WCENTER and WIDTHS may be vectors or scalars. For one bin, both WCENTER and WIDTHS may be scalars. Or, you may use a scalar for WIDTHS if all of the bins will have the same width. There are two ways to make up the WCENTER and WIDTHS vectors. For an arbitrary sequence of centers and bandpasses you will have to create the arrays:
WCENTER = FLTARR(n) & WIDTHS=FLTARR(n)
where n is the number of bandpasses desired. You set the values by typing:
READ,WCENTER
and then type in the values separated by <CR> or commas until the IUE_IDL>prompt returns. You can ``READ'' in the widths in a similar manner.
The second way to define these vectors is to use the computational capabilities of IDL. For 16 bins from 1200Å2000 Å and spaced every 50 Å with width 100 Å
WCENTER=FINDGEN(16)*>50.+1200.
If the system variable !NOPRINT=0 (the default), or if the SILENT keyword is set, the binned data will be displayed at your terminal in a table. Otherwise, the screen display will be suppressed, but the data will still be available to you through the output parameters and can still be written to a file if you use the FILE keyword.