************************************************************ * BSDFIT * A. Fludra, MSSL (19709::AF, AF@UK.AC.UCL.MSSL.C) * * 23-Mar-1992 AF, written V1.2 * 29-jun-92 RDB Changed data directories to $DIR_BCS_* * 29-Jul-92 AF, updated ************************************************************ GENERAL INFORMATION -------------------- * * Purpose: Fit theory spectra to YOHKOH BCS channel 1 - 4 data * (Fe XXVI, Fe XXV, Ca XVIII-XIX, S XV) * * BSDFIT determines: * Te Electron temperature * Td Doppler temperature (line width) * EM Emission measure * Back Background / continuum * EM2 [optional: EM of 2nd component] * Velocity [optional: Vel of 2nd component] * * * WARNING: Fe XXVI (channel 1) not tested and best to be avoided. * *------------------------------------------------------------------------- * * Input files: * * BSD file The BCS data is read from the BSD files. * * [currently not implemented: The files must have been updated by * the BSDCAL programme before BSDFIT will attempt * to fit the spectra.] * * BPC file: * This file contains results of BSDCAL. The programme * searches for this file on the current directory and * then on directory of the BSD file if the BSD file is * not on the current directory. * * The contents of the BPCxxxxxx.xxxx file are used * to determine the first guess for: * Te, Td, Em, Back * If VELFIT is non-zero, EM2 and velocity are * also determined from the BPC file. * * Normally, DW and WO from BPC file are used. * However, some problems have been encountered with inaccurate DW, WO * from BPC files. Therefore at the moment DW and WO are supplied from * a routine GETDW.FOR * * * In addition, the following directories must be first defined * in the control file: * * BALUIC Directory of CABAA.DAT, FEBAA.DAT, SUBAA.DAT files * (contain ionization balance calculations). * ATOUIC Directory containing CASEC3.dat,FESEC3.dat, SSEC3.DAT * FE23.dat,FEXXII.dat, TEM1.DAT,..., TEM4.DAT * *------------------------------------------------------------------------- * * Program has one mode of operation: * * * (1) all fit parameters and options are given in the control * file. * $ run BSDFIT * The user is prompted for the control file name. * * *------------------------------------------------------------------------- * * Output files: * * BFTxxxxxx.xxxx * * Results (electron temperatures, emission measures, velocities) * are written to an ASCII file called BFTxxxxxx.xxxx, * which has the same file i.d. as the input BSD file. * * Current format version is 1. * * These results (time history of all fitted parameters) can be * plotted using IDL routine PLOTPARMS. * * BTHxxxxxx.xxxx [optional, but strongly recommended] * * If the SPCFLG flag is non-zero, an unformatted file called * BTHxxxxxx.xxxx, which has the same file i.d. * as the input BSD file, is created. This file contains * the final synthesized theory spectra. * * BSD spectra with overplotted theory spectra can be plotted * using IDL routine PLOTSPC. *------------------------------------------------------------------------- * * Procedure of BSDFIT: * * Part 1: Read control file and find out BSD filename, * get spectra to fit, channel number(s). * Part 2: Read the BSD file for the appropriate spectrum. * Part 3: Determine the first guess from one of two techniques: * a) If the BPCxxxx.xxx file can be read, use these * results to determine Te, Td, EM and Background. * b) Find the most intense spectrum between the * ranges specified by /nm0: and /nm1: - then * determine first guesses for this spectrum. * For the rest of the spectra, work forward and * backward in time, using the previous results for * the first guess. * Part 4: Fit the spectra to determine Te, Td, EM, Background. * If VELFIT > 1, also fit EM2 [optionally velocity]. * For fitting, only part of each spectrum is used, * usually the resonance line and some of the * satellites: n=3 in calcium, 'j' line in Fe XXV, * 'x+y' and 'z+j+k' lines in sulphur. * This is sufficient to determine * the temperature in the isothermal approximation. * * * Part 5: Write the results in BFTxxxx.xxx & BTHxxxx.xxx files. * *------------------------------------------------------------------------- * Comments on V1.2 * * * 1) A BPCxxxx.xxx file must exist for the first guess * determination scheme for at least the brightest * spectrum in the range specified by /nm0: and /nm1: * * 2) When velocity fitting (2nd component), the entry * must exist in the BPC file and two-components must have * been successfully fit by BSDCAL. Otherwise, BSDFIT * will apply only a one component fit. * ********************************************************************** GENERATING THEORY SPECTRA: (only for the seriously curious, as this is done inside BSDFIT) ------------------------------------------------------------ 1. Colisionally excited lines: * purpose: Calculate the Fe XXV (Ca XIX, S XV) w,x,y,z * and Fe XXIV (Ca XVIII, S XIV) q,r,s,t,u,v collisional * effective excitation rate coefficients (cm+3 s-1). * For Fe XXVI Ly-alpha1 and Ly-alpha2: * Calculate direct excitation coefficient *------------------------------------------------------------------------------ * * Definition of Effective excitation rate coefficient (EERC): * * In the description below, reference to the effective excitation * rate coefficient (EERC) is defined as follows: * * I (ph cm-3 s-1) = Ne Nz EERC * * where I is the line emissivity, Ne (cm-3) is the electron density, * Nz (cm-3) is the number density of the ion stage responsible * for the line emission, and EERC is given in cm+3 s-1. * *------------------------------------------------------------------------------ * * Input data files: * * CASEC3.DAT, FESEC3.DAT These files are read * SSEC3.DAT by subroutine RDFAC2. * *------------------------------------------------------------------------------ * * * Variables: OM Read in by RDFAC from CASEC3 or FESEC3 * or SSEC3.DAT files. * OM is the energy averaged oscillator * strength*(Z-.5)*exp(e/kT) * integrated over maxwellian distribution. * BRANCH contains rad. branching ratios for q,r,s,t,u,v * TEMP temperatures corresponding to OM(T) * *------------------------------------------------------------------------------ 2. Dielectronic satellites: * purpose: Calculate the D.R. effective excitation rate * coefficients (cm+3 s-1) of Fe XXIV n>2 or Ca XVIII-XIX * or S XIV - S XV. *------------------------------------------------------------------------------ * * Input data files: the same as above * *------------------------------------------------------------------------------ * * COMMENTS: * For each satellite line four things are read in. * These are kept in the following arrays: * * LEV (NLINES) Contains the energy level of the spectator * electron. Eg. LEV(2) corresponds to 2s or 2p. * WVLNGH(NLINES) Contains the wavelengths (Ang) of the lines. * F2S (NLINES) Contains the atomic factor F (s). (See Gabriel * papers for notation) 2 * ILINE (NLINES) Contains a number from 1 to 14 corresponding * to the principle Fe XXII-XXV lines: * w,x,y,x,d13,t,q,r,j, + 3 Fe XXIII + 2 Fe XXII * *___________________________________________________________________________ GETTING STARTED: ---------------- Before running BSDFIT: 1. Prepare a BSD file ($run MKBSD) for the time interval of interest. Check visually the quality of the spectra (IDL>plotbsd,'BSD_name'). If they are very noisy, run MKBSD again with a longer integration time. 2. Run BSDCAL which should produce a BPC file 3. Edit a control file for BSDFIT (example file is at the end of this message, or BSDFIT.CFL supplied with your software as an example). Change the BSD file identifier, the directory name with the BSD file, and other parameters if necessary. 4. Run BSDFIT. 5. When completed successfully, run IDL>plotspc,'BSD_name', to check the results of the fitting. Run IDL>plotparms,'BSD_name' to see the time history of fitted parameters. QUALITY OF BSDFIT RESULTS: ---------------------------- BSDFIT is the end program in the trio MKBSD - BSDCAL - BSDFIT. It should be remembered that BSDFIT is a research tool which uses currently available atomic data and makes certain assumptions about physical processes in the 4 - 30 million K plasma emitting the Yohkoh BCS spectra. BSDFIT also assumes that all instrumental corrections have been made by MKBSD and that BSDCAL has successfully produced a BPC file. Results from the BPC file are used to obtain a first guess of fitted parameters. Quality of BSDFIT fits depends on the following factors: 1. Dispersion DW and wavelength offset WO from the BPC file (determined by BSDCAL). If these are not accurate, the theory spectrum is offset relative to the observed spectrum and the fit can be poor. Such problems have already been encountered and at the moment DW, WO are calculated internally in BSDFIT by a routine GETDW. It is also posible to manually set the dispersion in the control file (version 2) to supersede values from the BPC file or GETDW. 2. Accurate atomic data: wavelengths and excitation coefficients. SSEC3.DAT, CASE3.DAT, FESEC3.DAT files are used. Any suggestions and recommendations for different data are welcome. 3. Ionization balance calculation. For calcium and sulphur spectra an incorrect ionization balance will not affect the quality of the fit, it may only change the value of the derived emisison measure. For Fe XXV spectra, which have also Fe XXII - XXIII lines, an incorrect ionization balance will change the ratios of some lines. At the moment BSDFIT uses an ionization balance calculation of Arnaud and Rothenflug (files SUBAA.DAT. CABAA.DAT, FEBAA.DAT). Ionizations fractions are NOT free parameters. A mismatch between the theory Fe XXV spectra and observed spectra is already apparent. Cure: (1) supply a different ionization balance calculation or change atomic data for Fe XXII - XXIII lines, (2) fit ionization fractions as free parameters (this will give at least better looking fits) - planned for the future versions of BSDFIT. 4. Signal-to-noise ratio: on very noisy spectra BSDCAL and BSDFIT may fail. As a rough guidance, if you have problems identifying some less intense lines, so may have the programs. TROUBLESHOOTING: ----------------------- 1. If a spectrum was not fitted by BSDCAL, BSDFIT will not attempt to fit this spectrum. 2. If the Fe XXII - XXIII lines in Fe XXV spectra do not match the spectra too well - see Point 3 (ioniz. balance) above. 3. If there is a BSDFIT fit which generally does not look good: check a BSDCAL fit for this spectrum and if this is not good, try to edit the BPC file. Sometimes changing the resonance line 'w' position, intensity or width in the BPC file helps. None of these? Please report to 19709::AF. EXAMPLE of the CONTROL FILE (BSDFIT.CFL): _________________________________________________________________________ 2 ! Version number 911206.1920 ! BSD file id [user.own.directory] ! directory of BSD file $DIR_BCS_ATODAT ! directory of atomic data files $DIR_BCS_BALDAT ! directory of ioniz. balance files F T T T ! which channels to be processed: (T)rue or (F)alse 8 26 ! First and last spectrum to fit: 0,0 = all 1 ! use uncertainties from BSD file (1/0) 1 ! write theory spectra file (1/0) 0 20 0.01 ! IPROF, KMAX, DELCHI (ignore, do not change) 3 ! velocity component (0=single comp./3=two-comp.) 1 ! use wavelength from sec3.dat files -1 -1 -1 -1 ! gt 0 ==> use limits below to override BSD limits 30 35 13 20 ! lowest solar bin in channel 1, 2, 3, 4 220 217 112 115 ! highest solar bin in channel 1, 2, 3, 4 -1 1 -1 -1 ! if >0: use dispersion DW below 1. 3.65e-4 1. 1. ! dispersion to override any other value __________________________________________________________________________ NB. (1) dashed lines ----------- are NOT part of the control file. (2) BSDFIT should also work with version 1 control files. Note: Directories of the atomic data should be accessed by the logicals $DIR_BCS_ATODAT and $DIR_BCS_BALDAT.