pro package_xrt_spectrum_files ;; This program takes Aki's genx spectrum files (in ;; $SSW/hinode/xrt/idl/response/solar_spectrum) ;; and repackages them so make_xrt_wave_resp can use them. ;; Output file needs to be put in ;; $SSW/hinode/xrt/idl/response/emiss solar_spectrum_dir = '$SSW/hinode/xrt/idl/response/solar_spectrum/' ;solar_spectrum_dir ='/data/solarb/XRT/software/ssw_working_dir/svnrepos/xrt/trunk/ssw/hinode/xrt/idl/response/solar_spectrum/' ;UPDATE FOR NEW VERSION solar_spectrum_file = solar_spectrum_dir + 'solspec_ch1010_corona_chianti.genx' ;solar_spectrum_file = solar_spectrum_dir + 'solspec_ch1010_photos_chianti.genx' ;solar_spectrum_file = solar_spectrum_dir + 'solspec_ch1010_hybrid_chianti.genx' restgen, file = solar_spectrum_file, temp, wave, spec, text=text ;; The variable 'text' gives metadata about spectrum that is needed ;; below. This could be coded more generally, so that the variables ;; below are taken directly from 'text' ;; IDL> print, text ;;Solar specta (photon number) calculated with Chianti ver.9.0.1. for isothermal plasma with electron density : 1.0e9 cm^(-3) ;;Intensity unit : photons cm^3 s^-1 sr^-1 * EM, EM : unit column EM, 1. cm^-5. Abundance : sun_coronal_1992_feldman_ext.abund ;;Ioneq : chianti.ioneq . 4-Apr-2020 (AkT) with customized isothermal.pro. ;; get dA because this spectrum is in different units than APEC wlen = n_elements(wave) wave0 = [0.0, wave, 0.0] wave0[0] = (2 * wave0[1]) - wave0[2] wave0[wlen+1] = (2 * wave0[wlen]) - wave0[wlen-1] d_wave0 = (shift(wave0,-1) - shift(wave0,1)) / 2. wave1 = wave0[1:wlen] d_wave1 = d_wave0[1:wlen] ;; Angstroms, need to divide the spectrum by this spec_per_A = spec*0 for i=0,n_elements(temp)-1 do spec_per_A[*,i] = spec[*,i]/d_wave1 ioneq = 'chianti.ioneq' dens = 'density : 1.0e9 cm^(-3)' ;UPDATE FOR NEW VERSION WITH ABUNDANCE OUTPUT FROM TEXT (print, text) abund = 'sun_coronal_1992_feldman_ext.abund' ;abund = 'sun_photospheric_2021_asplund.abund' ;abund = 'sun_coronal_2012_schmelz_ext.abund' ;UPDATE FOR NEW VERSION outfile = 'XRT_emiss_model.default_CHIANTI.geny' ;outfile = 'XRT_emiss_model.default_CHIANTI_photospheric.geny' ;outfile = 'XRT_emiss_model.default_CHIANTI_hybrid.geny' ;UPDATE FOR NEW VERSION emiss_ch1010 = make_xrt_emiss_model('CHIANTI version 10.10 with coronal abundances', wave, 10^temp, spec_per_A, abund,$ ioneq,dens,outfile=outfile) end