; Radiometry.pro Radiometry of SUMER Detectors A and B (with 3rd order) ;******************************************************************************* ; Converts count rates of SUMER detectors A or B into physical units ++++ ; Category : Calibration ;;;; ;------------------------------------------------------------------------------- ; Change record eeee ;------------------------------------------------------------------------------- ; Initial version 20 Nov. 1996,KW,WC ; Programme can now accept arrays of rates 10 Dec. 1996,TAK ; CAL_KBR_LINE, CAL_BARE_LINE, CAL_KBR_PX, CAL_BARE_PX, ; SUN_KBR_LINE, SUN_BARE_LINE condensed into one routine: ; CAL_SUM 13 Dec. 1996,TAK ; GET_CALIBRATION function added 13 Dec. 1996,TAK ; Full-Sun scheme modified and editing (####) 08 Jan. 1997,KW ; Keyword /ARCSEC added (****) 13 Jan. 1997,KW ; Input of actual wavelength (@@@@) 31 Jan. 1997,KW ; Slit widths updated with best ground measurements ($$$$) 06 Feb. 1997,KW ; Wavelength and count rate same dimensions (%%%%) 11 Feb. 1997,KW ; All slit dimensions with uncertainties given (^^^^) 29 Apr. 1997,KW ; Uncertainty of telescope area (for information) (^^^^) 29 Apr. 1997,KW ; Detector B added (++++) 12 May 1997,KW ; Changed programme name to RADIOMETRY.PRO (++++) 13 May 1997,KW ; File names changed (~~~~) 03 June 1997,KW ; Extrapolation detector A in 2nd order (>>>>) 11 June 1997,KW ; Editing; gain depression and dead time warnings (<<<<) 05 Aug. 1997,KW ; Gain correction detector B (preliminary data) (////) 06 Aug. 1997,US,KW ; Refined detector B calibration data now available (\\\\) 11 Dec. 1997,US ; Corrected dispersion for detector B (----) 09 Feb. 1998,ID,KW ; 2nd correction of dispersion for detector B (????) 11 Aug. 1998,KW ; 3rd correction of dispersion for detector B 01 Sep. 1998,KW ; The programme is now using the flight S/W concept (....) 26 Nov. 1998,KW ; The mean spectral pixel size of Detector A set to 0.0266 mm ; Procedures: MAGNIFICATION, GRATING_B_511, LAMBDA_N, ; and PARAM_CORR separately established ; Warning issued if KBr or det_a used as default (====) 01 Feb. 1999,KW ; Keyword /EPOCH_% (Access old responsivity curves) (,,,,) 07 Apr. 1999,KW ; New responsivity evaluation for detector A ('''') 27 Apr. 1999,KW ; New responsivity evaluation for detector B ("""") 27 Apr. 1999,US ; Corrected responsivity for detector B (!!!!) 07 May 1999,US ; Editing (````) 19 May 1999,KW ; Responsivity for detector A without Ne VII ratio: ; Ne VII (465 A) identification considered unreliable(::::) 08 Oct. 1999,KW ; Change in responsivity after SOHO attitude loss (____) 28 Dec. 1999,KW,US ; Corrected wavelength input format (||||) 13 Mar. 2000,KW ; Category: Calibration added (;;;;) 11 Oct. 2000,KW ; Irradiance at 1 AU (no change in calibration) (iiii) 23 May 2001 KW ; Revision after re-assessment of responsivity loss (rrrr) 23 May 2001,KW ; Revision after 2nd ISSI calibration WS (ssss) 20 Dec. 2001,KW ; New keywords /SEPARATE, /JOINT (not for 2nd order and /BARE), ; /TEST, and /ATTENUATOR ; 3rd order calibration added (3333) 20 Dec. 2001,KW,WC ; Editing (eeee) 20 Dec. 2001,KW ; Detector A in 1st order from 770 A to 1619.60 A (cccc) 22 Jan. 2002,LT,KW ; Editing (cccc) 22 Jan. 2002,KW ; Revision after 3rd ISSI session (Jan. 2002) (dddd) 06 Feb. 2002,KW ; Corrected bug arising when only one element in ; count_rate, but more than one in wavelength (ffff) 13 Feb. 2002,TAK ;******************************************************************************* ; IDL restore files required: ;******************************************************************************* ; (They are available in the software tree SOLARSOFT) ,,,, ;------------------------------------------------------------------------------- ; a_bare_1st.rst ,,,, ; a_bare_2nd.rst ,,,, ; a_kbr_1st_old.rst ,,,, ; a_kbr_2nd.rst ,,,, ; a_kbr_2nd_e_old.rst ,,,, ; a_kbr_1st.rst ,,,, ; a_kbr_2nd_e.rst ,,,, ; a_kbr_1st_4_99.rst ,,,, ; a_kbr_2nd_4_99.rst ,,,, ; a_bare_1st_4_99.rst ,,,, ; a_bare_2nd_4_99.rst ,,,, ; a_kbr_1st_10_99.rst :::: ; a_kbr_2nd_10_99.rst :::: ; a_bare_1st_10_99.rst :::: ; a_bare_2nd_10_99.rst :::: ; b_bare_1st_old.rst ,,,, ; b_bare_2nd_old.rst ,,,, ; b_kbr_1st_old.rst ,,,, ; b_kbr_2nd_old.rst ,,,, ; b_bare_1st.rst ,,,, ; b_bare_2nd.rst ,,,, ; b_kbr_1st.rst ,,,, ; b_kbr_2nd.rst ,,,, ; cal_b_1st_bare_5_99.rst !!!! ; cal_b_2nd_bare_5_99.rst !!!! ; cal_b_1st_kbr_5_99.rst !!!! ; cal_b_2nd_kbr_5_99.rst !!!! ;------------------------------------------------------------------------------- ; Epoch_8 files ssss ;------------------------------------------------------------------------------- ; a_kbr_1st_before.rst ssss ; a_kbr_1st_after.rst ssss ; a_bare_1st_before.rst ssss ; a_bare_1st_after.rst ssss ; a_kbr_2nd_before.rst ssss ; a_kbr_2nd_after.rst ssss ; a_bare_2nd_before.rst ssss ; a_bare_2nd_after.rst ssss ; b_kbr_1st_before.rst ssss ; b_kbr_1st_after.rst ssss ; b_bare_1st_before.rst ssss ; b_bare_1st_after.rst ssss ; b_kbr_2nd_before.rst ssss ; b_kbr_2nd_after.rst ssss ; b_bare_2nd_before.rst ssss ; b_bare_2nd_after.rst ssss ; kbr_1st_a_before.rst ssss ; kbr_1st_a_after.rst ssss ; kbr_1st_b_before.rst ssss ; kbr_1st_b_after.rst ssss ; bare_1st_a_before.rst ssss ; bare_1st_a_after.rst ssss ; bare_1st_b_before.rst ssss ; bare_1st_b_after.rst ssss ; kbr_2nd_before.rst ssss ; kbr_2nd_after.rst ssss ; bare_2nd_before.rst ssss ; bare_2nd_after.rst ssss ; kbr_3rd_after.rst 3333 ; bare_3rd_after.rst 3333 ;------------------------------------------------------------------------------- ; a_bare_1st_before_2002.rst dddd ; a_bare_1st_after_2002.rst dddd ; a_bare_2nd_before_2002.rst dddd ; a_bare_2nd_after_2002.rst dddd ; bare_1st_a_before_2002.rst dddd ; bare_1st_a_after_2002.rst dddd ; bare_1st_b_before_2002.rst dddd ; bare_1st_b_after_2002.rst dddd ;------------------------------------------------------------------------------- ; If no epoch keyword (or /EPOCH_9) will be set, only the Epoch_8 dddd ; and Epoch_9 files are needed. dddd ;******************************************************************************* ; Warnings and notes: <<<< rrrr ;******************************************************************************* ; Apply gain-depression and dead-time corrections (if required) <<<< ;******************************************************************************* ; This programme has been written and compiled over the last six years. eeee ; In addition to substantial changes that are required from time to time, eeee ; editorial issues are also necessary in order to ease legibility as much eeee ; as possible. These editing activities should not affect the calibration. eeee ;------------------------------------------------------------------------------- ; Although we have updated the detector A calibration at short wavelengths, :::: ; below 530 A the calibration is not yet available to our complete '''' ; satisfaction. We recommend for quantitave work to use, if possible, '''' ; both the KBr and the bare portions of the detector and to assume '''' ; uncertainty levels of 50 %. Please, report any discrepancies. '''' ;------------------------------------------------------------------------------- ; On 24 September 1996, it was decided that the detector B ```` ; should be operated at low gain. A comparison was made to determine //// ; the difference that this makes to the instrument responsivity. //// ; According to an analysis done by J. Hollandt, the low gain level //// ; leads to a 17 % decrease in responsivity apparently independent of //// ssss ; wavelength. When using the laboratory calibration data for radiometric //// ; calibration, the results obtained therefore should be increased by 17 % . //// ; This correction is included in the refined restore files, \\\\```` ; but until 5 August 1997 it was not. ,,,, ; There was an interim test period for detector B from 24 September to ssss ; 6 October 1996 with still lower gain. Set keyword /TEST when analyzing ssss ; data of this time interval. ssss ;------------------------------------------------------------------------------- ; The uncontrolled attitude of SOHO during several months in 1998 led to a ____ ; change in the responsivity of SUMER. In particular, the Intercal_1 data ____ ; clearly indicate that all spectral lines monitored (He I 584 A; ____ ; N V 1238 A; Ne VIII 770 A; Mg X 609/624 A) and the continuum at 880 A ____ ; changed between 25 % and 45 % (Schuehle et al. 2000, A & A, 354, L71) ____ ; As it was not possible from the data available to establish a dependence ____ ; on wavelength, Wilhelm et al. (2000, Metrologia, 37, 393) determined ____ ; an average loss in responsivity of 43 %. It should be noted that only ____ ; the He I line showed a very low change, whereas the other windows ____ ; experienced changes close to the mean value. We could not find any ____ ; difference in the behaviours of detectors A and B. Consequently, we ____ ; apply the mean value found for both detectors. Note that ____ ; Epoch 6 will remain the default value, but we add another keyword, ____ ; which has to be set to either /BEFORE or /AFTER (the attitude loss). ____ ; No default value will be defined here for safety reasons. ____ ; No new restore files are required. ____ ;******************************************************************************* ; The preceding paragraph has been updated by the change on 23 May 2001 rrrr ;******************************************************************************* ; Following the ISSI Workshop on SOHO radiometry in February 2001, rrrr ; a critical re-assessment of the post-recovery situation was performed. rrrr ; Although a perfect solution is still not available, the following rrrr ; change has been implemented on 23 May 2001: rrrr ;------------------------------------------------------------------------------- ; Based on work by Schuehle et al. (ESA SP-463, 427, 2000) and rrrr ; Pauluhn et al. (Appl. Opt. 40 no. 34, 2001), an average loss in rrrr ; responsivity of 31 % will be assumed (based on 26 % for He I, rrrr ; 28 % for Mg X 609, 28 % for Mg X 624, 34 % for Ne VIII, 39 % for N V, rrrr ; and 29 % for the Lyman continuum). The new relative uncertainties are rrrr ; conservatively estimated to be 33 % (1 sigma) for detector A and rrrr ; 36 % for B for post-recovery work. The values of 15 % for A and 20 % rrrr ; for B for pre-loss periods have not changed. (cf. Wilhelm et al. 2000). rrrr ; Use keywords /EPOCH_7 (default) and /BEFORE or /AFTER as appropriate. rrrr ; The calibration before the attitude loss is not affected. rrrr ; No new restore files are required. rrrr ; To reproduce calibration work done with keyword /AFTER before 23 May 2001 rrrr ; set keyword /EPOCH_6. rrrr ;------------------------------------------------------------------------------- ; Following the second ISSI Workshop on SOHO radiometry in October 2001, ssss ; yet another re-assessment of the post-recovery situation was performed, ssss ; which led to changes at the long-wavelength side. ssss ; A complete set of new restore files is required for Epoch 8 (default). ssss ;******************************************************************************* ; It is recommended to use /JOINT if the corresponding calibration ssss ; is available, but not for wavelengths between 759 and 880 A. ssss ; This keyword calls up a joint evaluation of detectors A and B, which cccc ; has been performed after a normalization of the detector responsivities. cccc ; It is still required to specify the detector, because the normalization cccc ; coefficients are different. cccc ;******************************************************************************* ; Following the third ISSI Meeting on SOHO radiometry in January 2002, dddd ; a small optimization of the fitting procedure for the KBr-to-bare ratio dddd ; was implemented between 650 A and 800 A. The set of restore files for dddd ; Epoch 8 is still required for the most recent calibration amended by dddd ; those of Epoch 9. The change will only affect the evaluation on bare. dddd ;******************************************************************************* ; For more information see the SUMER WWW page on radiometry. ,,,, ; A full account of the radiometric status of SUMER will be published ssss ; in the proceedings of the ISSI meetings. It is also available from: ssss ; ftp vms1.mpae.gwdg.de ssss ; login: anonymous ssss ; password: e-mail address ssss ; cd sumer/wilhelm ssss ; get sumer_issi.ps ssss ;******************************************************************************* ; Input parameters and keywords (keywords not case sensitive) eeee ;******************************************************************************* ; Input parameter Remarks ;------------------------------------------------------------------------------- ; 1. slit slit number from image header ; (widths and lengths in arcseconds) ; 1: width of 4.122 +- 0.5 % ^^^^$$$$ ; 2: width of 0.986 +- 1.6 % ^^^^$$$$ ; 3 - 5: width of 0.993 +- 1.6 % ^^^^$$$$ ; 6 - 8: width of 0.278 +- 4.5 % ^^^^$$$$ ; ; 1: length of 299.2 +- 0.3 % ^^^^ ; 2: length of 299.2 +- 0.3 % ^^^^ ; 3 - 5: length of 119.6 +- 0.5 % ^^^^ ; 6 - 8: length of 119.6 +- 0.5 % ^^^^ ; ; 2. wavelength in Angstroem (A) @@@@#### ; (either array or single value) ; 3. order of diffraction (your judgement! 3rd order ; calibration is now available.) 3333 ; 4. count_rate <<<<#### ; (either array or single value; eeee ; If both wavelength and count rate eeee ; are given as arrays they must be eeee ; of the same dimension) eeee ;------------------------------------------------------------------------------- ; Keywords eeee ;------------------------------------------------------------------------------- ; /PX (default) count/(s*px_spat*px_spec) eeee ; /LINE count/(s*px_spat*line) eeee ; /SUN-LINE count/(s*line) over full Sun ####eeee ; (provides irradiance) eeee ; /ARCSEC count/(s*arcsec^2*line) ****eeee ; (Slit selection has no consequence eeee ; for last two kewords) eeee ; /BARE (Data on bare part of the detector) #### ; /ATTENUATOR (Lyman alpha observations on the ssss ; attenuator, it should noted that ,,,, ; the attenuation is nominally a ,,,, ; factor of 10 and that behind the ,,,, ; attenuator there is the bare MCP. ,,,, ; /KBR (default) (Central portion of detectors) #### ; /DET_A (default) Detector A ++++ ; /DET_B Detector B ++++ ; /TEST (default: no test) Interim phase for Detector B ssss ; /EPOCH_9 (default) (recent calibration) dddd ; (affects only joint evaluation) dddd ; /EPOCH_8 (30 Nov. 2001 - 07 Feb. 2002) ddddssss ; /EPOCH_7 (24 May 2001 - 30 Nov. 2001) rrrrssss ; (affects only post-recovery work) rrrr ; /EPOCH_6 (08 Oct. 1999 - 23 May 2001) rrrr ; (affects only post-recovery work) rrrr ; /EPOCH_5 (27 Apr. 1999 - 08 Oct. 1999) :::: ; /EPOCH_4 (10 Feb. 1999 - 27 Apr. 1999) ,,,, ; /EPOCH_3 (30 Jan. 1999 - 09 Feb. 1999) ,,,, ; /EPOCH_2 (06 Aug. 1997 - 29 Jan. 1999) ,,,, ; /EPOCH_1 (13 May 1997 - 05 Aug. 1997) ,,,, ; /EPOCH_0 (20 Nov. 1996 - 12 May 1997) ,,,, ; /BEFORE (before SOHO accident) ____ ; /AFTER (after SOHO accident) ____ ; Evaluation: ; /SEPARATE Detectors treated independently ssss ; /JOINT Detectors combined after proper ssss ; adjustment ssss ; ;******************************************************************************* ; Output parameters and keywords ;******************************************************************************* ; Radiance results SI units eeee ;------------------------------------------------------------------------------- ; /WATTS (default) W/(m^2 sr A) or ####<<<[.run radiometry] eeee ; IDL>result=radiometry(slit,wavelength,order,count_rate[,/keyword(s)]) ++++eeee ; Note keywords defining detector, epoch, count-rate format, and ====eeee ; photocathode have to be given, unless you want to apply the default ====eeee ; seetings. It is, however, required to set /BEFORE or /AFTER the SOHO ====eeee ; accident, as well as /SEPARATE or /JOINT detector evaluation ssss ; (unless in 3rd order which is available only for /AFTER and /DET_A). 3333 ; IDL>print,result ;******************************************************************************* ; Define functions and procedures eeee ;******************************************************************************* ; Restore appropriate calibration files eeee ;------------------------------------------------------------------------------- function get_calibration,detector,epoch,attitude,evaluation,order; ssss3333 ;------------------------------------------------------------------------------- calibration=fltarr(10000,12) ; ,,,, sen_kbr_1st=fltarr(10000) ; ,,,, sen_bare_1st=fltarr(10000) ; ,,,, sen_kbr_2nd=fltarr(10000) ; ,,,, sen_bare_2nd=fltarr(10000) ; ,,,, sen_kbr_3rd=fltarr(10000) ; 3333 sen_bare_3rd=fltarr(10000) ; 3333 lam_kbr_1st=fltarr(10000) ; ,,,, lam_bare_1st=fltarr(10000) ; ,,,, lam_kbr_2nd=fltarr(10000) ; ,,,, lam_bare_2nd=fltarr(10000) ; ,,,, lam_kbr_3rd=fltarr(10000) ; 3333 lam_bare_3rd=fltarr(10000) ; 3333 dir=getenv('RADIO') case epoch of 0: begin ; 20 Nov. 1996 to 12 May 1997 if detector eq 'det_a' then begin restore,concat_dir(dir,'a_kbr_1st_old.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda restore,concat_dir(dir,'a_kbr_2nd.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda restore,concat_dir(dir,'a_bare_1st.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda restore,concat_dir(dir,'a_bare_2nd.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda endif else message, $ 'No calibration could have been performed for Detector B at this time.' end 1: begin ; 13 May 1997 to 05 Aug. 1997 if detector eq 'det_a' then restore,concat_dir(dir,'a_kbr_1st_old.rst') $ else restore,concat_dir(dir,'b_kbr_1st_old.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_e_old.rst') else $ restore,concat_dir(dir,'b_kbr_2nd_old.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_1st.rst') $ else restore,concat_dir(dir,'b_bare_1st_old.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_2nd.rst') $ else restore,concat_dir(dir,'b_bare_2nd_old.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 2: begin ; 06 Aug. 1997 to 29 Jan.1999 if detector eq 'det_a' then restore,concat_dir(dir,'a_kbr_1st_old.rst') $ else restore,concat_dir(dir,'b_kbr_1st.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_e_old.rst') else $ restore,concat_dir(dir,'b_kbr_2nd.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_1st.rst') $ else restore,concat_dir(dir,'b_bare_1st.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_2nd.rst') $ else restore,concat_dir(dir,'b_bare_2nd.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 3: begin ; 30 Jan. 1999 to 09 Feb. 1999 if detector eq 'det_a' then restore,concat_dir(dir,'a_kbr_1st.rst') $ else restore,concat_dir(dir,'b_kbr_1st.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_e_old.rst') else $ restore,concat_dir(dir,'b_kbr_2nd.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_1st.rst') $ else restore,concat_dir(dir,'b_bare_1st.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_2nd.rst') $ else restore,concat_dir(dir,'b_bare_2nd.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 4: begin ; 09 Feb. 1999 to 27 Apr. 1999 if detector eq 'det_a' then restore,concat_dir(dir,'a_kbr_1st.rst') $ else restore,concat_dir(dir,'b_kbr_1st.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_kbr_2nd_e.rst') $ else restore,concat_dir(dir,'b_kbr_2nd.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_1st.rst') $ else restore,concat_dir(dir,'b_bare_1st.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then restore,concat_dir(dir,'a_bare_2nd.rst') $ else restore,concat_dir(dir,'b_bare_2nd.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 5: begin ; 27 Apr. 1999 to 08 Oct. 1999 if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_4_99.rst') else $ restore,concat_dir(dir,'cal_b_kbr_1st_5_99.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_4_99.rst') else $ restore,concat_dir(dir,'cal_b_kbr_2nd_5_99.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_4_99.rst') $ else restore,concat_dir(dir,'cal_b_bare_1st_5_99.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_4_99.rst') else $ restore,concat_dir(dir,'cal_b_bare_2nd_5_99.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 6: begin ; 09 Oct. 1999 to 30 November 2001::::ssss if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_10_99.rst') else $ restore,concat_dir(dir,'cal_b_kbr_1st_5_99.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_10_99.rst') else $ restore,concat_dir(dir,'cal_b_kbr_2nd_5_99.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_10_99.rst') $ else restore,concat_dir(dir,'cal_b_bare_1st_5_99.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_10_99.rst') $ else restore,concat_dir(dir,'cal_b_bare_2nd_5_99.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 7: begin ; 09 Oct. 1999 to 30 November 2001, ; (same as epoch 6) ::::rrrrssss if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_10_99.rst') else $ restore,concat_dir(dir,'cal_b_kbr_1st_5_99.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_10_99.rst') else $ restore,concat_dir(dir,'cal_b_kbr_2nd_5_99.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_10_99.rst') $ else restore,concat_dir(dir,'cal_b_bare_1st_5_99.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lambda if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_10_99.rst') $ else restore,concat_dir(dir,'cal_b_bare_2nd_5_99.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lambda end 8: begin ; 30 November 2001 to 07 February 2002 ssssdddd if order ne 3 then $ if evaluation eq 0 then if attitude eq 0 then begin if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_before.rst') else $ restore,concat_dir(dir,'b_kbr_1st_before.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_before.rst') $ else restore,concat_dir(dir,'b_bare_1st_before.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_before.rst') $ else restore,concat_dir(dir,'b_kbr_2nd_before.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_before.rst') $ else restore,concat_dir(dir,'b_bare_2nd_before.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lamb endif else begin if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_after.rst') else $ restore,concat_dir(dir,'b_kbr_1st_after.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_after.rst') $ else restore,concat_dir(dir,'b_bare_1st_after.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_after.rst') $ else restore,concat_dir(dir,'b_kbr_2nd_after.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_after.rst') $ else restore,concat_dir(dir,'b_bare_2nd_after.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lamb endelse else if attitude eq 0 then begin if detector eq 'det_a' then $ restore,concat_dir(dir,'kbr_1st_a_before.rst') else $ restore,concat_dir(dir,'kbr_1st_b_before.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'bare_1st_a_before.rst') $ else restore,concat_dir(dir,'bare_1st_b_before.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb restore,concat_dir(dir,'kbr_2nd_before.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb endif else begin if detector eq 'det_a' then $ restore,concat_dir(dir,'kbr_1st_a_after.rst') else $ restore,concat_dir(dir,'kbr_1st_b_after.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'bare_1st_a_after.rst') $ else restore,concat_dir(dir,'bare_1st_b_after.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb restore,concat_dir(dir,'kbr_2nd_after.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb endelse else begin restore,concat_dir(dir,'kbr_3rd_after.rst') sen_kbr_3rd(0)=sensit & lam_kbr_3rd(0)=lamb restore,concat_dir(dir,'bare_3rd_after.rst') sen_bare_3rd(0)=sensit & lam_bare_3rd(0)=lamb endelse end 9: begin ; 07 February 2002 to present dddd if order ne 3 then $ if evaluation eq 0 then if attitude eq 0 then begin if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_before.rst') else $ restore,concat_dir(dir,'b_kbr_1st_before.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_before_2002.rst') $ else restore,concat_dir(dir,'b_bare_1st_before.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_before.rst') $ else restore,concat_dir(dir,'b_kbr_2nd_before.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_before_2002.rst') $ else restore,concat_dir(dir,'b_bare_2nd_before.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lamb endif else begin if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_1st_after.rst') else $ restore,concat_dir(dir,'b_kbr_1st_after.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_1st_after_2002.rst') $ else restore,concat_dir(dir,'b_bare_1st_after.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_kbr_2nd_after.rst') $ else restore,concat_dir(dir,'b_kbr_2nd_after.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'a_bare_2nd_after_2002.rst') $ else restore,concat_dir(dir,'b_bare_2nd_after.rst') sen_bare_2nd(0)=sensit & lam_bare_2nd(0)=lamb endelse else if attitude eq 0 then begin if detector eq 'det_a' then $ restore,concat_dir(dir,'kbr_1st_a_before.rst') else $ restore,concat_dir(dir,'kbr_1st_b_before.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'bare_1st_a_before_2002.rst') $ else restore,concat_dir(dir,'bare_1st_b_before_2002.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb restore,concat_dir(dir,'kbr_2nd_before.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb endif else begin if detector eq 'det_a' then $ restore,concat_dir(dir,'kbr_1st_a_after.rst') else $ restore,concat_dir(dir,'kbr_1st_b_after.rst') sen_kbr_1st(0)=sensit & lam_kbr_1st(0)=lamb if detector eq 'det_a' then $ restore,concat_dir(dir,'bare_1st_a_after_2002.rst') $ else restore,concat_dir(dir,'bare_1st_b_after_2002.rst') sen_bare_1st(0)=sensit & lam_bare_1st(0)=lamb restore,concat_dir(dir,'kbr_2nd_after.rst') sen_kbr_2nd(0)=sensit & lam_kbr_2nd(0)=lamb endelse else begin restore,concat_dir(dir,'kbr_3rd_after.rst') sen_kbr_3rd(0)=sensit & lam_kbr_3rd(0)=lamb restore,concat_dir(dir,'bare_3rd_after.rst') sen_bare_3rd(0)=sensit & lam_bare_3rd(0)=lamb endelse end endcase calibration(0,0)=lam_kbr_1st ; ,,,,ssss calibration(0,1)=sen_kbr_1st ; \\\\,,,,ssss calibration(0,2)=lam_bare_1st ; ,,,,ssss calibration(0,3)=sen_bare_1st ; \\\\,,,,ssss calibration(0,4)=lam_kbr_2nd calibration(0,5)=sen_kbr_2nd ; \\\\ calibration(0,6)=lam_bare_2nd calibration(0,7)=sen_bare_2nd ; \\\\ calibration(0,8)=lam_kbr_3rd ; 3333 calibration(0,9)=sen_kbr_3rd ; 3333 calibration(0,10)=lam_bare_3rd ; 3333 calibration(0,11)=sen_bare_3rd ; 3333 ;------------------------------------------------------------------------------- ; Reduce size of redundant arrays eeee ;------------------------------------------------------------------------------- lambda=0.0 lamb=0.0 sensit=0.0 lam_kbr_1st=0.0 sen_kbr_1st=0.0 lam_bare_1st=0.0 sen_bare_1st=0.0 lam_kbr_2nd=0.0 sen_kbr_2nd=0.0 lam_bare_2nd=0.0 sen_bare_2nd=0.0 ;------------------------------------------------------------------------------- return,calibration end ;******************************************************************************* ; Slit and vignetting corrections ;******************************************************************************* pro vignetting,slit,wavelength,diffr_cor,slit_width ;------------------------------------------------------------------------------ wavelength=float(wavelength) ; |||| case 1 of slit eq 1: Begin & vig=6.0 & slit_width=4.122 & end; $$$$ slit eq 2: Begin ; $$$$ vig=11.688-2.9773d-3*wavelength+2.80308d-6*wavelength^2; $$$$ slit_width=0.986 & end; $$$$ (slit ge 3) and (slit le 5): Begin ; $$$$ vig=11.688-2.9773d-3*wavelength+2.80308d-6*wavelength^2; $$$$ slit_width=0.993 & end; $$$$ (slit ge 6) and (slit le 8): Begin ; $$$$ vig=12.921+3.3522d-3*wavelength+4.46974d-6*wavelength^2; $$$$ slit_width=0.278 & end; $$$$ else: Begin & print,'Wrong slit selection.' & return & end; $$$$ endcase; $$$$ diffr_cor=100.0/(100.0-vig) ; Correction for diffraction and Lyot stop $$$$ return end ;******************************************************************************* pro photocathode,surface,order,calibration,lambda,sensit; eeee ;******************************************************************************* if order eq 1 then case surface of; eeee 'kbr' : Begin & lambda=calibration(*,0) & sensit=calibration(*,1) & end 'bare': Begin & lambda=calibration(*,2) & sensit=calibration(*,3) & end endcase if order eq 2 then case surface of; eeee 'kbr' : Begin & lambda=calibration(*,4) & sensit=calibration(*,5) & end 'bare': Begin & lambda=calibration(*,6) & sensit=calibration(*,7) & end endcase if order eq 3 then case surface of; 3333 'kbr' : Begin & lambda=calibration(*,8) & sensit=calibration(*,9) & end 'bare': Begin & lambda=calibration(*,10) & sensit=calibration(*,11) & end endcase valid=where(sensit,count) if count gt 0 then begin sensit=sensit(valid) lambda=lambda(valid)*10 endif else begin sensit=0 lambda=0 endelse return end ;******************************************************************************* ; SUMER radiometry eeee ;******************************************************************************* function radiometry,slit0,wavelength,order,count_rate,$ ; ++++ @@@@ BARE=BARE,PX=PX,LINE=LINE,SUN_LINE=SUN_LINE,ARCSEC=ARCSEC,$ ; **** PHOTONS=PHOTONS,WATTS=WATTS,DET_A=DET_A,DET_B=DET_B,KBr=KBr,$ ; ====++++ EPOCH_0=EPOCH_0,EPOCH_1=EPOCH_1,EPOCH_2=EPOCH_2,EPOCH_3=EPOCH_3,$ ; ,,,, EPOCH_4=EPOCH_4,EPOCH_5=EPOCH_5,EPOCH_6=EPOCH_6,$ ; :::: BEFORE=BEFORE,AFTER=AFTER,$ ; ____ IRRAD_AU=IRRAD_AU,$ ; iiii EPOCH_7=EPOCH_7,$ ; rrrr EPOCH_8=EPOCH_8,TEST=TEST,SEPARATE=SEPARATE,JOINT=JOINT,$ ; ssss EPOCH_9=EPOCH_9,ATTENUATOR=ATTENUATOR; ssssdddd on_error,1 ;------------------------------------------------------------------------------- ; Keyword Inputs (See documentation above for details) ;------------------------------------------------------------------------------- ; Constants eeee ;------------------------------------------------------------------------------- h=6.626d-34 ; W s^2 c=2.998d8 ; m/s phot_energy=h*c/wavelength*1d10 ; Ws/photon #### solid=2.350d-11; #### ; solid angle of 1 arcsec^2 in steradian. Note that the slit width is used #### ; to normalized the count rate to 1 arcsec in the direction perpendicular #### ; to the slit and mag/mag_a_b is used to do the job along the slit. #### ; If /ARCSEC or /SUN_LINE are used, no normalization is done, because eeee ; the user is required to perform it before entering the count rate. eeee mirror=0.0117 ; area of primary mirror in m^2 (9 * 13 cm^2 +- 0.2 %) ^^^^ mag=26.5/6.316 ; magnification factor required to map 1 arcsec #### ; on a spatial pixel #### ;------------------------------------------------------------------------------- ; Lengths of arrays eeee ;------------------------------------------------------------------------------- n_c_r=n_elements(count_rate) ; %%%% n_w=n_elements(wavelength) ; %%%% if (n_w ne n_c_r) and (n_w ne 1) and (n_c_r ne 1) then $ ; ssss message,'Wavelength and count-rate arrays not of same dimension.' ; ssss if n_w eq 1 then wavelength=fltarr(n_c_r)+wavelength ; %%%%ssss if n_c_r eq 1 then count_rate=fltarr(n_w)+count_rate ; %%%%ssss res = count_rate*0d0 ; ####ffff ;------------------------------------------------------------------------------- ; Keyword evaluation eeee ;------------------------------------------------------------------------------- if keyword_set(photons)+keyword_set(watts) eq 2 then $ message,'Set either /PHOTONS or /WATTS.' keyword_check=keyword_set(px)+keyword_set(line)+keyword_set(sun_line)+ $ ; eeee keyword_set(arcsec) ; eeee if keyword_check ge 2 then $ message,'Set only one of /PX, /LINE, /SUN_LINE, or /ARCSEC.' ; **** if keyword_check eq 0 then print,'/PX set by default.' ; ==== if (keyword_set(sun_line) or keyword_set(arcsec)) then begin ; **** slit = 2 message,/info,'Slit selection has no effect.' ; eeee endif else slit = slit0 surface = 'kbr' ; eeee if keyword_set(kbr)+keyword_set(bare) eq 2 or $ keyword_set(kbr)+keyword_set(attenuator) eq 2 then $ ; ssss message,'/KBR cannot be used with /BARE or /ATTENUATOR.' $ ; ssss else if keyword_set(KBr)+keyword_set(Bare)+keyword_set(attenuator) eq 0 $ ; ssss then print,'/KBR by default.' else $ ; ==== if keyword_set(bare) or keyword_set(attenuator) then $ ; ====ssss surface = 'bare' ; ==== detector = 'det_a' ; eeee if keyword_set(det_a)+keyword_set(det_b) eq 2 then $ ; ==== message,'/DET_A cannot be used with /DET_B.' ; ====eeee if keyword_set(det_a)+keyword_set(det_b) eq 0 then $ ; ==== print,'Detector A set by default.' $ ; ==== else if keyword_set(det_b) then detector = 'det_b' ; eeee test_phase=1.0; ssss if keyword_set(test) and detector eq 'det_b' then test_phase=0.82 ; ssss if keyword_set(test) and detector eq 'det_a' then $ ; ssss print,'Test phase only with detector B. No test phase set.' ; ssss if order eq 3 and detector eq 'det_b' then $ ; 3333 message,'3rd order calibration only available for detector A.' ; 3333 if keyword_set(test) eq 0 then print,'"No test" phase set by default.' ; ssss keyword_check=$ ; ,,,, keyword_set(epoch_0)+keyword_set(epoch_1)+keyword_set(epoch_2)+$ ; ,,,, keyword_set(epoch_3)+keyword_set(epoch_4)+keyword_set(epoch_5)+$ ; :::: keyword_set(epoch_6)+$ ; :::: keyword_set(epoch_7)+$ ; rrrr keyword_set(epoch_8)+$ ; ssssdddd keyword_set(epoch_9) ; dddd if keyword_check ge 2 then message,'Set at most one epoch keyword.' ; ,,,, if keyword_check eq 0 then begin ; ,,,, epoch = 9; dddd print,' Recent calibration set by default.'; ,,,, endif else begin ; ,,,, if keyword_set(epoch_0) then epoch = 0 ; ,,,, if keyword_set(epoch_1) then epoch = 1 ; ,,,, if keyword_set(epoch_2) then epoch = 2 ; ,,,, if keyword_set(epoch_3) then epoch = 3 ; ,,,, if keyword_set(epoch_4) then epoch = 4 ; ,,,, if keyword_set(epoch_5) then epoch = 5 ; ,,,, if keyword_set(epoch_6) then epoch = 6 ; :::: if keyword_set(epoch_7) then epoch = 7 ; rrrr if keyword_set(epoch_8) then epoch = 8 ; ssss if keyword_set(epoch_9) then epoch = 9 ; dddd endelse; ,,,, keyword_check=keyword_set(before)+keyword_set(after) ; ____ if keyword_check ne 1 then $ ; ____ message,'Set one and only one attitude keyword.' ; ____ if order eq 3 and keyword_set(before) then $ ; 3333 print,'/AFTER used by default in 3rd order.' ; 3333 if keyword_set(before) then attitude=0 else attitude=1 ; ssss keyword_check=keyword_set(separate)+keyword_set(joint) ; ssss if keyword_set(joint) and keyword_set(bare) and order eq 2 then $ ; ssss message,'/JOINT cannot be set with /BARE in 2nd order.' ; ssss if keyword_set(joint) and epoch lt 8 then $ ; ssss message,'/JOINT cannot be set with epoch less than 8.' ; ssss if keyword_check ne 1 and order ne 3 then $ ; ssss3333 message,'Set only one keyword /SEPARATE or /JOINT.' ; ssss if keyword_set(joint) then evaluation=1 else evaluation=0 ; ssss ;******************************************************************************* ; Read in data from SUMER calibration files ;******************************************************************************* calibration=get_calibration(detector,epoch,attitude,evaluation,order) ; ++++,,,,ssss photocathode,surface,order,calibration,lambda,sensit magnification,wavelength,order,mag_a,d_lam_a,mag_b,d_lam_b ; ++++.... ; Output d_lam in Angstroem #### if detector eq 'det_a' then begin mag_a_b=mag_a d_lam=d_lam_a endif else begin mag_a_b=mag_b d_lam=d_lam_b endelse if min(lambda) ne 0 then begin ; ,,,, minwave = min(lambda(where(lambda))) ; Minimum calibrated wavelength if detector eq 'det_a' and order eq 1 then minwave = 770 ; cccc maxwave = max(lambda) ; Maximum calibrated wavelength inrange = where((wavelength ge minwave) and (wavelength le maxwave), cin) outrange =where((wavelength lt minwave) or (wavelength gt maxwave), cout) if maxwave gt 1000 then order_message='(in first order)' else begin ; \\\\ if maxwave gt 700 then order_message='(in second order)' ; \\\\ if maxwave lt 700 then order_message='(in third order)' ; 3333 endelse if cin eq 0 then message,'Wavelengths must be between '+$ strtrim(minwave,2)+' and '+strtrim(maxwave,2) +' A '+order_message ; \\\\ if cout gt 0 then message,/info,$ 'Some of the wavelengths entered are outside the limits '+$ strtrim(minwave,2)+' and '+strtrim(maxwave,2) +' A. '+$ 'These values will be returned as -1.' endif else message,'There was no calibration for this detector at this epoch.' res(inrange) = interpol(sensit,lambda,wavelength(inrange)) case 1 of keyword_set(line): factor = 1d0 keyword_set(sun_line): factor = mag_a_b/mag/solid ; ####++++ keyword_set(arcsec): factor = mag_a_b/mag ; ****++++ else: factor = d_lam ; eeee endcase if keyword_set(photons) then res=res*factor else res=res*factor/phot_energy vignetting,slit,wavelength,diffr_cor,slit_width nonzero = where(res ne 0,cnz) response=1; ssss if keyword_set(after) and (epoch lt 6) then $ ; rrrr message,'/AFTER cannot be used with an epoch less than 6.' ; ssss if keyword_set(after) and (epoch eq 7) then response = 0.69 ; ssss if keyword_set(after) and (epoch eq 6) then response = 0.57 ; ssss if keyword_set(attenuator) then response = response*0.1 ; ssss result= double(res)*0d0 if cnz gt 0 then result(nonzero)=(count_rate*diffr_cor*mag_a_b)(nonzero)$ ; ++++ /mag/slit_width/solid/mirror/res(nonzero)/response $ ; ____ /test_phase else print,'Wavelengths are outside the calibrated range.' ; ssss if cout ne 0 then result(outrange) = -1 interval=where(wavelength ge 750 and wavelength le 880,cnt) ; ssss if keyword_set(joint) and cnt ne 0 then print, $ ; ssss 'It is recommended to use /SEPARATE for wavelengths bewteen 750 and 880 A.';ssss ; Irradiance at 1 AU if keyword_set(irrad_au) then if keyword_set(sun_line) then begin ; iiii print,$ ; iiii 'Solar radius from Earth at date in (1) mm/arcmin and (2) ss.ss/arcsec:' ;iiii ; See, for instance, Nautical Almanacs. iiii read,'(1) arcmin = ',arcmin,' and (2) arcsec = ',arcsec ; iiii radius=arcmin*60+arcsec ; iiii conv=0.98*(959.6/radius)^2; 0.98 = 0.99^2 (ratio SOHO/Earth distances) iiii result=result*conv ; iiii endif else print, $ ; iiii '/IRRAD_AU only effective together with /SUN_LINE.' ; iiii ;------------------------------------------------------------------------------- return,result end ;*******************************************************************************