MK_BSC ------ MK_BSC makes BSC_INDEX and BSC_DATA structures from the BDA INDEX and DATA. These structures contain instrumentally corrected BCS data for selected channels and accumulation times. A typical run would look like: IDL> mk_bsc,index,data,bsc_index,bsc_data,dp_sync=dp_sync To analyze BCS data, you would begin by using YODAT to read the BDA data file for the dates and times that you are interested in. Yodat will return a BDA index structure INDEX, a BDA data array DATA, and a structure DP_SYNC which contains the DP synchronous data needed for deadtime corrections. MK_BSC will prompt for various inputs such as start and stop times, channels to process, integration times, and which corrections (deadtime, crystal curvature, flux calibration) to apply. The DP_SYNC keyword is optional, but must be entered the first time if deadtime corrections are required. Subsequent calls to MK_BSC will use the last values of DP_SYNC data passed via this keyword. The following keywords are also accepted: /LAST - run using the information stored in the latest BSC_INDEX. /DEF - run using the default settings. /WID - run via a widget interface. /BSA - run to make BSA index only (do not make BSC_DATA). /SAVE - save BSC (or BSA) index (and data) in a file. (The file will be named BSCyymmdd.hhmm, based on the time of the first data interval). /VERBOSE - echo extra information about SAA/NIGHT or MODEID/BLOCKID BDAFILE - input BDAFILE to read. The instrumentally corrected data will be output to a new set of structures BSC_INDEX and BSC_DATA. The data in BSC_DATA are stored as 256 element floating point arrays in fields with the following definitions: .COUNTS -- accumulated counts (per detector bin) .BIN -- physical detector position .WAVE -- nominal wavelength array (A) .ERROR -- spectral uncertainties (in counts) .FLUX -- flux-calibrated data (ph cm-2 s-1 A-1) Not all of the above fields will be present. The fields that are present will depend on the corrections requested in MK_BSC. The actual data in each field array will occupy the first 0:NBINS-1 locations, where NBINS is the number of actual detector bins containing valid data. The value of NBINS is stored in BSC_INDEX.BSC.NBINS. PLOT_BSC -------- The results of MK_BSC and FIT_BSC can be examined with PLOT_BSC. IDL> plot_bsc,bsc_index,bsc_data PLOT_BSC will plot lightcurves and spectra for user selected channels and times, as well as fitted spectra from FIT_BSC. Optional keywords: CHAN -- channel to plot SS -- selected indicies of spectra to plot (def is all) /NOWID -- to not use widget mode (def is widgets, if more than 1 spectrum) The following keywords apply only when /NOWID is set: /EBAR -- oplot spectral uncertainties /HC -- make a hard copy (single spectrum only) /PS -- make a postscript file (single spectrum) The following keywords apply only when /NOWID is set, and BSC_INDEX and DATA contain fitted spectra: /BLUE -- to oplot second blueshift component (if fitted by FIT_BSC) /VUNIT -- to print fitted Doppler widths in km/s units (def is MK) /NOFIT -- inhibit oplot of fitted spectra (def is oplot fit) /NOOBS -- inhibit plot of observed spectra (def is plot obs) FIT_BSC ------- FIT_BSC fits synthetic spectra to observed spectra in BSC_DATA. IDL> fit_bsc,bsc_index,bsc_data,fit_index,fit_data,chan=chan In the above call, the fitted results are returned in the new structures FIT_INDEX and FIT_DATA for the channel specified by the keyword CHAN. If CHAN is not specified, then all channels will be fit. The FIT_DATA structure contains two additional fields: .FLUX_FIT -- a 256-element floating point array containing the fitted model spectrum matching the observed spectrum in the .FLUX field .WAVE_FIT -- a 256-element floating point array containing computed wavelengths of the fitted model spectrum in .FLUX_FIT. .FLUX_FIT2 -- a 256-element floating point array containing the fitted model spectrum corresponding to a secondary shifted spectrum in the .FLUX field The FIT_INDEX structure contains an additional .FIT field that contains important fit information (parameters fit, number of iterations, chi squared, etc). FIT_BSC accepts the following optional keywords: SS -- index selection vector or scalar (e.g. SS=[45,46] to fit only spectra 45 and 46) TSTART -- UT time string (e.g. '9:45'). Only spectra at or after TSTART will be fit TEND -- Only spectra at or before TEND will be fit LRANGE -- 2-element wavelength vector range (A) within which to limit line fitting [DEF is entire range] CRANGE -- 2-element wavelength vector range (A) within which to limit continnum fitting [DEF is LRANGE] TE6 -- input starting guess for electron temperature (MK) [DEF is to use internal values] TD6 -- input starting guess for resonance line Doppler broadening (MK) [DEF is to infer from observed width] ATTEMPT -- level of fit attempt 1: solve only for primary emission measure (EM50) and line to continuum normalization factor (CNORM). Electron temperature and (TE6) and total Doppler broadening (TD6) fixed. 2: solve for TE6, TD6, EM50, CNORM. 3: solve for primary+secondary shifted component. BLUE -- equivalent to attempt=3 /NEWGUES -- set to NOT use results of previous fit as starting input for fit to next spectrum /PLOT -- set to plot progress of fits /VERB -- set for more information about fitting progress For example, to fit a Ca XIX spectrum at UT='09:04' use: IDL> fit_bsc,index,data,findex,fdata,chan=3,tstart='09:04' To fit a blueshifted secondary component: IDL> fit_bsc,index,data,findex,fdata,chan=3,tstart='09:04',/blue SEL_BSC ------- SEL_BSC extracts wavelength and flux fields from BSC_DATA. IDL> sel_bsc,bsc_index,bsc_data,new_index,new_data,wave,flux,eflux The selected index and data structures are returned in NEW_INDEX and NEW_DATA. The wavelength, flux, and uncertainties in the flux are returned in the arrays WAVE, FLUX, and EFLUX. The following keywords are also accepted: CHAN (in) - BCS channel (def is all) TSTART (in) - start time to extract (UTPLOT format) TEND (in) - end time to extract BIN (out) - Physical petector positions COUNTS (out) - Counts / bin in the accumulation interval SS (out) - indicies matching requested channel FWAVE (out) - fitted wavelength array FIT (out) - fitted spectrum array SFIT (out) - fitted second component array LIST_BSC -------- LIST_BSC lists times, total counts, and accumulation times of BSC spectra. IDL> list_bsc,bsc_index,chan where CHAN is the desired channel to list. SAV_BSC ------- To save BSC index and data to a BSC file, use: IDL> sav_bsc,'bsc_file_name',bsc_index,bsc_data RD_BSC ------ To read a BSC file, use: IDL> rd_bsc,'bsc_file_name',ss,bsc_index,bsc_data This procedure will return the BSC index and data structures. SS is a vector with indicies of a particular subset of data within the BSC file. For example, using SS=INDGEN(10) will extract the first 10 data sets from the BSC file. To extract ALL the data sets, use SS=-1. HELP_BSC -------- To get quick on-line help for various BSC procedures and functions, type: IDL> help_bsc BSC2BSD ------- To convert a BSC file to a BSD file, use: IDL> bsc2bsd,'bsc_file_name','bsd_file_name' The BSD file name is optional, and will be created from the BSC file name if not supplied. MAP_BSC ------- MAP_BSC plots a pseudo-map of BSC spectra by stacking successive spectra. IDL> map_bsc,bsc_index,bsc_data. The following keywords are accepted: CHAN - BCS channel to plot. XSPACE - the value by which to shift successive spectra in the x-direction. [def=0] YSPACE - the value by which to shift successive spectra in the y-direction. [def=0] TSTART - the time of the first spectrum to plot (with date optional). [sample format,TSTART='9:32', def = first spectrum in BSC_DATA] TEND - the time of the last spectrum to plot. [def = last spectrum in BSC_DATA] LC_BSC ------ LC_BSC plots lightcurves of selected spectral regions. IDL> lc_bsc, bsc_index, bsc_data, t, y, chan=chan,/flux This program first plots a spectrum at the peak of the flare. The user can select a spectral region with the cursor. The lightcurve derived from the sum of wavelength points within this region is returned in the array Y. The UT time is returned in T. If the BSC data are flux calibrated, then using the FLUX keyword will return the lightcurve in units of photons cm-1 s-1. The following keyword is also accepted: OVER - overplot successive lightcurves WBDA ---- WBDA provides a simple widget interface that allows browsing of BDA files. It is invoked by: IDL> wbda The program will provide a set of menus from which BDA files can be selected either by date, filename, or directory location. WBDA will plot lightcurves and spectra for a specific channel, accumulate spectra for selected integration times, and apply dead-time, curvature, and flux corrections. The BDA INDEX and DATA variables produced by YODAT can be also input directly to WBDA: IDL> wbda,index,data GT_BSC_BINCAL ------------- This function returns a structure containing miscellaneous calibration information for specified BCS channels: For example, for channel 1, IDL> bincal=gt_bsc_bincal(1) will return the following structure: BINCAL={ .CHAN - channel # .NBINS - number of bins per channel .MODEID - mode id .WAVE - nominal wavelength array (A) .PHYSPOS - physical detector position array .FLUXFAC - conversion factor array for counts/bin to photons/cm/A .SENSIT - mean sensitivity array for grouped bins .DBIN - detector bin width .W0 - start wavelength of spectrum .DW - dispersion (angstrom/bin) .BINARC - conversion factor for arcmin to bin (bins/arcmin) .GAUSSW - FWHM gaussian detector width (A) .RWID - FWHM rocking width (A) .EFAREA - effective area (cm^2) .NSTART - first valid bin .NEND - last valid bin .VERSION - version number of BCS calibration file used} BCS_SYNTHETIC -------------- BCS_SYNTHETIC is a simple main program to compute BCS synthetic spectra in flux units. The program will prompt the user for the BCS channel number (1,2,3,4 = Fe XXVI, Fe XXV, Ca XIX, S XV), the electron temperature (MK) and the doppler temperature (MK). To run the program type: IDL> .run bcs_synthetic The program calls the procedure BCS_SPEC to perform the spectral calculations. It defaults to a wavelength coverage which is appropriate for mid-latitude observations. The bcs_spec defaults for atomic code, ionization balance and abundance will be used. The computation is made for an emission measure of EM = 10$^{50}$ cm$^{-3}$. BCS_SPEC --------- BCS_SPEC is a procedure to compute a BCS synthetic spectrum in flux units. Examples: IDL> flux = bcs_spec(Chan,Te6) ; Use Td6=Te6 and default wavelengths IDL> flux = bcs_spec(Chan,Te6,Td6,Wave,Waveo=Waveo,Ainfo=Ainfo,Vel=Vel) where the inputs are Chan (the BCS channel number of a BSC structure), Te6 and Td6 (electron and "Doppler" temperatures in MK), and Wave is a vector of the edges of the BCS wavelength bins. Returned will be flux (assuming EM = 10$^{50}$ cm$^{-3}$), Waveo (wavelengths at the centers of the bins), and Ainfo (a structure variable containing information about the calculated spectrum). Vel is an optional input keyword to specify the velocity in km/s. More information is available in the documentation header. BCS_SPEC is called by BCS_SYNTHETIC and FIT_BSC. Three routines control the defaults for the atomic data used in the calculatio These are GET_ELEMABUN (abundances), GET_IONBAL (ionization balance) and GET_ATOMIC (the atomic data for the line calculation). XDOC ---- DOC is a widget version of DOC_LIBRARY. It is invoked by typing: IDL> xdoc,'name' where NAME is the name of the procedure to be examined. The text of the input procedure will appear in a scroll window, with buttons to control print the file, and also extracting and copying the file to the current directory as .TXT file. Calling XDOC without a procedure name will produce a menu listing of all the directories and/or libraries that are defined in the current IDL_PATH. The user can subsequently scan the IDL path for any desired procedure by clicking on a particular path element. CHKARG ------ CHKARG is a routine that solves the problem of what to enter when you have forgotten the argument list or argument ordering of a particular procedure or function. It is invoked by typing: IDL> chkarg,'name' where NAME is the name of the procedure in question. CHKARG will echo the calling sequence (arguments and keywords) and also the directory/library location of the procedure.