Skip to content

Commit

Permalink
updated 2 files; added 1 file
Browse files Browse the repository at this point in the history
  • Loading branch information
pryoung committed Jun 8, 2022
1 parent 32a58de commit 585b22c
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 51 deletions.
27 changes: 23 additions & 4 deletions synt_spec/ch_line_list.pro
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
;
; A latex (default) or an ascii file with the line list
;
; OPTIONAL OUTPUTS:
; Max_Int: The maximum intensity printed in the table.
;
; CALLS: Many SolarSoft routines.
;
;
Expand Down Expand Up @@ -154,15 +157,19 @@
; Corrected a bug introduced in the previous version.
; Also switched to \documentclass when making the latex file.
;
; v.10, 8-Jun-2022, Peter Young
; Added comment to state if population lookup tables were used for
; the calculation; added MAX_INT= optional output.
;
;
; VERSION : 9, 4-Aug-2005
; VERSION : 10, 8-Jun-2022
;
;-
pro ch_line_list, transitions, outname, latex=latex, ascii=ascii, $
wmin=wmin,wmax=wmax,$
SPECTRUM=SPECTRUM, abundfile=abundfile, min_abund=min_abund, $
minI=minI,photons=photons,kev=kev, $
all=all,no_sort=no_sort, sngl_ion=sngl_ion
all=all,no_sort=no_sort, sngl_ion=sngl_ion, max_int=max_int


;
Expand Down Expand Up @@ -315,6 +322,7 @@ IF NOT keyword_set(SPECTRUM) THEN BEGIN
;-----------------------------------

intensity = intensity*line_abunds
max_int=max(intensity)

;Check the min_abund.
;----------------------
Expand Down Expand Up @@ -541,7 +549,13 @@ printf,luo, ' '
printf,luo, 'log$_{10}$ T='+ arr2str(iso_t, ',',/trim)+'\\'
printf,luo, 'log$_{10}$ EM='+ arr2str(iso_em, ',',/trim)+'\\'

END
END

IF transitions.lookup EQ 1 THEN BEGIN
printf,luo,'\vspace{0.5cm}'
printf,luo,'\textbf{Calculation performed with population lookup tables.}'
ENDIF


printf,luo,'\vspace{0.5cm}'
;
Expand Down Expand Up @@ -678,7 +692,12 @@ printf,luo,strtrim(string(w_min,'(f6.1)'),2)+' to '+strtrim(string(w_max,'(f6.1)
printf,luo, 'log_10 T='+ arr2str(iso_t, ',',/trim)
printf,luo, 'log_10 EM='+ arr2str(iso_em, ',',/trim)

END
END

IF transitions.lookup EQ 1 THEN BEGIN
printf,luo,''
printf,luo,'Calculation performed with population lookup tables.'
ENDIF

printf,luo,''

Expand Down
115 changes: 115 additions & 0 deletions utilities/ch_web_linelists.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

PRO ch_web_linelists


;+
; NAME:
; CH_WEB_LINELISTS
;
; PURPOSE:
; Generates the set of line list tables that are linked to the CHIANTI
; website. Only the latex files are created; the user needs to run
; pdflatex to generate the pdf files.
;
; The line lists are created for the "extended-flare" DEM for a
; pressure of 10^16 and for photospheric abundances. Intensity limits
; are applied to reduce the number of lines in the tables. Population
; lookup tables are used to reduce computation time.
;
; CATEGORY:
; CHIANTI; line lists.
;
; CALLING SEQUENCE:
; CH_WEB_LINELISTS
;
; INPUTS:
; None.
;
; OUTPUTS:
; Creates the following six latex files in the working directory.
; ch_line_list_v10.0.1_1_50.tex
; ch_line_list_v10.0.1_50_150.tex
; ch_line_list_v10.0.1_150_912.tex
; ch_line_list_v10.0.1_912_2000.tex
; ch_line_list_v10.0.1_2000_10000.tex
; ch_line_list_v10.0.1_10000_600000.tex
;
; EXAMPLE:
; IDL> ch_web_linelists
;
; MODIFICATION HISTORY:
; Ver.1, 08-Jun-2022, Peter Young
;-



ch_ver=ch_get_version()
press=1e16

;
; The DEM is hard-coded to the extended flare DEM.
;
dem_name=concat_dir(!xuvtop,'dem')
dem_name=concat_dir(dem_name,'flare_ext.dem')
chck=file_info(dem_name)
IF chck.exists EQ 0 THEN BEGIN
message,/info,/cont,'The DEM file was not found. Returning...'
return
ENDIF

abund_name=concat_dir(!xuvtop,'abundance')
abund_name=concat_dir(abund_name,'sun_photospheric_2015_scott.abund')
chck=file_info(abund_name)
IF chck.exists EQ 0 THEN BEGIN
message,/info,/cont,'The abundance file was not found. Returning...'
return
ENDIF

w0=1
w1=50
mini=1.16e6/1e3
outfile='ch_line_list_v'+ch_ver+'_'+trim(w0)+'_'+trim(w1)+'.tex'
latex_wvl_dem,w0,w1,outfile=outfile,dem_name=dem_name,abund_name=abund_name,/all, $
mini=mini,pressure=press,/lookup

w0=50
w1=150
mini=2.28e6/1e3
outfile='ch_line_list_v'+ch_ver+'_'+trim(w0)+'_'+trim(w1)+'.tex'
latex_wvl_dem,w0,w1,outfile=outfile,dem_name=dem_name,abund_name=abund_name,/all, $
mini=mini,pressure=press,/lookup


w0=150
w1=912
mini=1.27e6/1e3
outfile='ch_line_list_v'+ch_ver+'_'+trim(w0)+'_'+trim(w1)+'.tex'
latex_wvl_dem,w0,w1,outfile=outfile,dem_name=dem_name,abund_name=abund_name,/all, $
mini=mini,pressure=press,/lookup


w0=912
w1=2000
mini=1.15e6/1e3
outfile='ch_line_list_v'+ch_ver+'_'+trim(w0)+'_'+trim(w1)+'.tex'
latex_wvl_dem,w0,w1,outfile=outfile,dem_name=dem_name,abund_name=abund_name,/all, $
mini=mini,pressure=press,/lookup


w0=2000
w1=10000
mini=3.29e4/1e3
outfile='ch_line_list_v'+ch_ver+'_'+trim(w0)+'_'+trim(w1)+'.tex'
latex_wvl_dem,w0,w1,outfile=outfile,dem_name=dem_name,abund_name=abund_name,/all, $
mini=mini,pressure=press,/lookup


w0=10000
w1=600000.
mini=1.0
outfile='ch_line_list_v'+ch_ver+'_'+trim(w0)+'_'+trim(w1)+'.tex'
latex_wvl_dem,w0,w1,outfile=outfile,dem_name=dem_name,abund_name=abund_name,/all, $
mini=mini,pressure=press,/lookup


END
82 changes: 35 additions & 47 deletions utilities/latex_wvl_dem.pro
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
;
; OPTIONAL INPUTS:
;
;
; OUTFILE: the name of the output latex file to be written.
;
; MINI: Minimum intensity for a line to be included in the output.
Expand All @@ -65,32 +64,21 @@
; infinity, i.e., no photoexcitation.)
;
; RADTEMP The blackbody radiation field temperature (default 6000 K).
;
; ABUND_NAME: The name of a CHIANTI abundance file. If not specified, then
; the user will be asked to select a file from a drop-down
; list.
;
; IONEQ_NAME: The name of a CHIANTI ioneq file. If not specified, then
; the user will be asked to select a file from a drop-down
; list.
;
; OUTPUTS:
; A Latex file containing the table of line intensities. The default name
; is 'linelist.text' but this can be over-ridden with OUTFILE=.
;
; a latex file: 'linelist.tex' in the working directory by default
;
;
; OPTIONAL OUTPUTS:
;
;
; KEYWORD PARAMETERS:
;
; MINI: Minimum intensity for a line to be included in the output
;
; SNGL_ION: specifies a single ion (e.g. SNGL_ION='Fe_10' to include
; only Fe X lines) or an array (e.g. SNGL_ION=['Fe_10','Fe_11']
; to include only Fe X and Fe XI lines) of ions to be used
; instead of the complete set of ions specified in
; !xuvtop/masterlist/masterlist.ions
;
; MASTERLIST: string of a specific masterlist file (full path).
; If defined as a keyword (i.e. MASTERLIST=1 or /MASTERLIST)
; then a widget allows the user to select a user-defined
; masterlist file. Shortcut for SNGL_ION.
;
;
; PHOTONS: units will be in photons rather than ergs
;
; KEV: wavelengths will be given in kev rather than Angstroms
Expand All @@ -99,36 +87,27 @@
; only an approximate wavelength is known (only theoretical energy
; levels are known) are included.
;
;
; OUTFILE: the name of the output latex file to be written. By default a
; file 'linelist.tex' in the user's working directory will be
; created.
;
; NOPROT If set, then proton rates are not included.
;
; LOOKUP: If set, then lookup tables are used, greatly speeding up the
; calculation.
;
;
; CALLS:
;
; CH_SYNTHETIC, CH_LINE_LIST
;
;
; COMMON BLOCKS: None
;
; RESTRICTIONS:
;
; SIDE EFFECTS:
;
;
; EXAMPLE:
;
; > latex_wvl_dem, 400.,800., mini=1, pressure=1.e+15,sngl_ion='o_4'
; > latex_wvl_dem, 400.,800., mini=1, pressure=1.e+15,sngl_ion='o_4'
;
;
; CATEGORY:
;
; spectral synthesis.
;
; WRITTEN :
; WRITTEN:
;
; Version 1, 8-Nov-01, Giulio Del Zanna (GDZ).
;
Expand All @@ -146,15 +125,19 @@
; Added /noprot, rphot and radtemp keywords.
;
; V. 3, 22-May-2002 GDZ. Removed const_net definitions.
;
; Ver.4, 08-Jun-2022, Peter Young
; Added abund_name= and ioneq_name= optional inputs.
;
; VERSION : Version 3, 22-May-2002
; VERSION : Version 4, 08-Jun-2022
;
;-

PRO latex_wvl_dem,wmin,wmax,pressure=pressure, density=density,$
minI=minI,photons=photons,kev=kev,all=all,$
sngl_ion=sngl_ion,masterlist=masterlist, $
outfile=outfile, noprot=noprot, rphot=rphot, radtemp=radtemp
minI=minI,photons=photons,kev=kev,all=all,$
sngl_ion=sngl_ion,masterlist=masterlist, $
outfile=outfile, noprot=noprot, rphot=rphot, radtemp=radtemp, $
dem_name=dem_name, abund_name=abund_name, lookup=lookup

;
if n_params(0) lt 2 then begin
Expand Down Expand Up @@ -185,11 +168,12 @@ ENDIF ELSE message, 'No density or pressure defined -- EXIT '


ch_synthetic, wmin, wmax, output=TRANSITIONS, err_msg=err_msg, $
pressure=pressure, density=density,all=all,sngl_ion=sngl_ion, $
photons=photons, masterlist=masterlist, $
verbose=verbose,$
logt_isothermal=logt_isothermal, logem_isothermal=logem_isothermal,$
noprot=noprot, rphot=rphot, radtemp=ratemp
pressure=pressure, density=density,all=all,sngl_ion=sngl_ion, $
photons=photons, masterlist=masterlist, $
verbose=verbose,$
logt_isothermal=logt_isothermal, logem_isothermal=logem_isothermal,$
noprot=noprot, rphot=rphot, radtemp=ratemp, $
dem_name=dem_name,lookup=lookup


IF err_msg NE '' THEN BEGIN
Expand All @@ -198,9 +182,13 @@ IF err_msg NE '' THEN BEGIN
ENDIF ELSE BEGIN

ch_line_list, TRANSITIONS, OUTFILE, /latex, $
wmin=wmin,wmax=wmax,$
minI=minI,photons=photons,kev=kev, $
all=all,no_sort=no_sort, sngl_ion=sngl_ion
wmin=wmin,wmax=wmax,$
minI=minI,photons=photons,kev=kev, $
all=all,no_sort=no_sort, sngl_ion=sngl_ion, $
abundfile=abund_name, max_int=max_int

print,''
print,format='("NOTE: maximum intensity displayed in table is: ",e10.2)',max_int

END

Expand Down

0 comments on commit 585b22c

Please sign in to comment.