Skip to content

Commit

Permalink
Merge pull request #1096 from saultyevil/sphinx-sirocco
Browse files Browse the repository at this point in the history
Rename Python to Sirocco in the Sphinx documentation
  • Loading branch information
jhmatthews authored Oct 18, 2024
2 parents 7716844 + 7ee546f commit 3207e0a
Show file tree
Hide file tree
Showing 74 changed files with 484 additions and 480 deletions.
16 changes: 8 additions & 8 deletions docs/sphinx/source/atomic.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Atomic Data
###########

Any Python model is only as good as the atomic data which goes into making the model.
All of the atomic data that Python accepts is read in by the routine get_atomicdata,
Any SIROCCO model is only as good as the atomic data which goes into making the model.
All of the atomic data that SIROCCO accepts is read in by the routine get_atomicdata,
and all of the data is read in from a series of ascii data files and stored in structures
that are defined in atomic.h.


The purpose of documentation is as follows:

* to explain the atomic data formats used by Python and the relationship of different sets
* to explain the atomic data formats used by SIROCCO and the relationship of different sets
of data to one another

* to explain where the data currently used in Python and to explain how the raw data
is translated in to a format the Python accepts
* to explain where the data currently used in SIROCCO and to explain how the raw data
is translated in to a format the SIROCCO accepts

The routines used to translate raw data format for two-level atoms (as well as much of the raw data)
are contained in a separate github `repository <https://github.com/agnwinds/data-gen>`_
Expand All @@ -25,15 +25,15 @@ The routines used to generate data for MacroAtoms are described in :doc:`Generat

Choosing a dataset
-----------------------
The "masterfile" that determines what data will be read into Python is determined by the
The "masterfile" that determines what data will be read into SIROCCO is determined by the
line in the parameter file, which will read something like::

Atomic_data data/standard80.dat
where the file `data/standard80.dat` will contain names (one to a line) of files which will
be read in sequentially.

All of the atomic data that comes as standard with Python is stored in the `xdata` directory (and its subdirectories) but users are not required to put their data
All of the atomic data that comes as standard with SIROCCO is stored in the `xdata` directory (and its subdirectories) but users are not required to put their data
there. Various experimental or testing dataset masterfiles are stored in the `zdata` directory. Symbolic links to these directories
are setup by running `Setup_Py_Dir`.

Expand All @@ -44,7 +44,7 @@ are setup by running `Setup_Py_Dir`.
Data hierarchy and I/O
-----------------------
As mentioned above, the masterfile will contain names (one to a line) of files which will
be read in sequentially. Every line in the atomic data files read by Python consists of a keyword that defines the type
be read in sequentially. Every line in the atomic data files read by SIROCCO consists of a keyword that defines the type
of data and various data values that are required for that particular data type. Lines that
beging with # or are empty are ignored.

Expand Down
12 changes: 6 additions & 6 deletions docs/sphinx/source/atomic/bound_bound.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The file gfall.dat was used, though a few extra lines known to have been missing



There are two main sources of data currently used in Python.
There are two main sources of data currently used in SIROCCO.

* Kurucz
* Verner
Expand All @@ -22,11 +22,11 @@ We have also used a line list from Verner in the past



Translation to Python format
Translation to SIROCCO format
============================
There are several steps to creating the data used in Python from that in gfall.dat, that are carried out by py_read_kurucz and py_link. The first routine reads the gfall.dat file and creates two output files, a file containing the lines and the associated such as the effective oscillatory strength and a file which contains information about the ion levels. py_read_kurucz chooses only a portion of the Kurucz lines, namely those associated with ions with ionization potentials in a certain range and lines with gf factors exceeding a certain value. The second program py_link attempts to create a model ion with links between the levels and the ions. Both of these routines are driven by .pf files, similar to what are used in python. Examples of the .pf files are in the directory py_kurucz
There are several steps to creating the data used in SIROCCO from that in gfall.dat, that are carried out by py_read_kurucz and py_link. The first routine reads the gfall.dat file and creates two output files, a file containing the lines and the associated such as the effective oscillatory strength and a file which contains information about the ion levels. py_read_kurucz chooses only a portion of the Kurucz lines, namely those associated with ions with ionization potentials in a certain range and lines with gf factors exceeding a certain value. The second program py_link attempts to create a model ion with links between the levels and the ions. Both of these routines are driven by .pf files, similar to what are used in python. Examples of the .pf files are in the directory py_kurucz

In practice we have not used these data for any Python publications. At some point early in the AGN project, NSH increased the number of lines, and generated lines\_linked\_ver\_2.dat and levels\_ver\_2.dat. I think this was because there was a small bug which meant the oscillator strength cut that was stated was not that which was applied.
In practice we have not used these data for any SIROCCO publications. At some point early in the AGN project, NSH increased the number of lines, and generated lines\_linked\_ver\_2.dat and levels\_ver\_2.dat. I think this was because there was a small bug which meant the oscillator strength cut that was stated was not that which was applied.

Data format
===========
Expand Down Expand Up @@ -68,13 +68,13 @@ one needs to index everything self-consistentl



Python structure
SIROCCO structure
================

Line data is stored in the data structure **lines**

Comments
========
The version of gfall.dat that is used in Python is out of date, though whether this affects any of the lines actually used in python is unclear. The website listed above has a link to newer versions of gfall.dat.
The version of gfall.dat that is used in SIROCCO is out of date, though whether this affects any of the lines actually used in python is unclear. The website listed above has a link to newer versions of gfall.dat.


Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ These values of :math:`\Upsilon` simply replace :math:`\Omega`.

In the asbsence of data in this format, the Van Regemorter approximation is utilized.

Translation to Python format
Translation to SIROCCO format
============================

It is necessary to link each line in our line list with the relevant electron collision strength. This is achieved using the python script "coll_stren_lookup.py" which first reads in the "lines_linked_ver_2.py" line list, then attempts to work out which lines are which by comparing the energy and the oscillator strength of the line. If these match to within a factor of 10% then the code logs this as a possible match. If better matches come along, then the code adopts those instead.

Each matched line get a line in the data file which is basically all of the line data for the matched line. This is to give Python the best chance of linking it up with the line internally.
Each matched line get a line in the data file which is basically all of the line data for the matched line. This is to give SIROCCO the best chance of linking it up with the line internally.

Data format
===========
Expand Down Expand Up @@ -66,10 +66,10 @@ and

So, to get :math:`\Upsilon` for a given T, one converts T to x via the correct equation, then linearly interpolate between values of :math:`y(x)`, then convert back to :math:`\Upsilon`.

Python structure
SIROCCO structure
================

The data is stored in Python in the Coll\_stren structure which has memebers
The data is stored in SIROCCO in the Coll\_stren structure which has memebers


- int n - internal index
Expand Down Expand Up @@ -105,7 +105,7 @@ There are addtional transition types in the Chianti database
- 6 - Proton transitions


The latter are not currently used in **Python**
The latter are not currently used in *SIROCCO*

Discussion of how Chianti handles transitions can be found in
`The CHIANTI upsilon files (ups and scups) <http://www.chiantidatabase.org/tech_reports/13_scups/chianti_report_13.pdf>`_
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/source/atomic/bound_free.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Bound Free (Overview)
Source
======

Photonization data in Python is gennerally obtained from two sources
Photonization data in SIROCCO is gennerally obtained from two sources


- The `Opacity project <http://cdsweb.u-strasbg.fr/topbase/topbase.html>`_. See also `Cunto et at 1993, A&A, 275, L5 <http://articles.adsabs.harvard.edu/full/1993A%26A...275L...5C>`_
Expand Down
10 changes: 5 additions & 5 deletions docs/sphinx/source/atomic/bound_free_topbase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Source
Obtained from The `Opacity project <http://cdsweb.u-strasbg.fr/topbase/topbase.html>`_. See also `Cunto et at 1993, A&A, 275, L5 <http://articles.adsabs.harvard.edu/full/1993A%26A...275L...5C>`_


Translation to Python format
Translation to SIROCCO format
============================

ksl - It's not clear that we are now making use of the topbase data in this way but my original attempt to incorporate topbase photoinization data into Python is contained in the directory topbase. Processing of these files was done by py_top_phot. My feeling is that we can replace these remarks with those that are more up to date, once Nick and James discuss this section, and delete any mention of my original attempt on this in the data-gen archive.
ksl - It's not clear that we are now making use of the topbase data in this way but my original attempt to incorporate topbase photoinization data into SIROCCO is contained in the directory topbase. Processing of these files was done by py_top_phot. My feeling is that we can replace these remarks with those that are more up to date, once Nick and James discuss this section, and delete any mention of my original attempt on this in the data-gen archive.



Expand Down Expand Up @@ -63,15 +63,15 @@ For the macro atom case, the indices relate to the energy levels, that is these

The TopBase energies are inaccurate and so generally adjustments are made using Chianti or some other source to fix up the energy levels.

Python structure
SIROCCO structure
================

The data are stored in the Topbase_phot stucture which can be found in atomic.h

Criteria for usage in Python run
Criteria for usage in SIROCCO run
================================

Data has to be read into Python in a logical order. For a set of phototionization x-sections to be accepted, the energy levels (or configuratios) must already have been defiend. See :doc:`levels`
Data has to be read into SIROCCO in a logical order. For a set of phototionization x-sections to be accepted, the energy levels (or configuratios) must already have been defiend. See :doc:`levels`

The items that must match are:

Expand Down
12 changes: 6 additions & 6 deletions docs/sphinx/source/atomic/bound_free_verner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ There are three sources for this data
- `Kaastra \& Mewe 1993 <http://adsabs.harvard.edu/abs/1993A\%26AS...97..443K>`_ :Electron and photon yield data


Translation to Python format
Translation to SIROCCO format
============================

**Tabulation Process**

The raw VFKY data comes in a series of fit parameters. We decided, circa Python 78, to tabulate this data instead. Partly, I think I because the on the fly method was time consuming (yes, computing all the pow() commands to commute the cross sections on the fly took a huge amount of time) and we decided that tabulating pre program was better than doing it in the program, so that everything was of the same format.
The raw VFKY data comes in a series of fit parameters. We decided, circa SIROCCO 78, to tabulate this data instead. Partly, I think I because the on the fly method was time consuming (yes, computing all the pow() commands to commute the cross sections on the fly took a huge amount of time) and we decided that tabulating pre program was better than doing it in the program, so that everything was of the same format.

The script which does this is progs/tabulate\_xs/photo\_xs.py -- it creates a file like photo\_vfky\_tabulated.data.

Expand All @@ -35,7 +35,7 @@ It then writes out the inner shell cross sections into "vfky_innershell_tab.data
Data format
===========

Explain the ascii format of the file which is read into Python
Explain the ascii format of the file which is read into SIROCCO

**VFKY_outershell_tab.data**

Expand All @@ -61,13 +61,13 @@ This data is linked to the relevant ion via z and state, islp and level are not

This data is linked to the relevant ion via z and state. the n_shell and l_subshell numbers are used to cross reference to the electron yield records. As above, the last record shows how many points are in the fit, and the data pairs making up the fit follow with the keyword InnerVY.

Python structure
SIROCCO structure
================

Where the data is stored internally in Python
Where the data is stored internally in SIROCCO


Comments
========

The manner in which this data is read into Python is a bit labyrinthine at the moment. The intention is to use a combination of VFKY and VY for all ground states, an
The manner in which this data is read into SIROCCO is a bit labyrinthine at the moment. The intention is to use a combination of VFKY and VY for all ground states, an
4 changes: 2 additions & 2 deletions docs/sphinx/source/atomic/direct_ionization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Source
The data comes directly from `Dere 2006, A&A, 466, 771 <https://www.aanda.org/articles/aa/pdf/2007/17/aa6728-06.pdf>`_ . This paper gives direct ionization and excitation-autoionization rate coefficients for many ions as a function of temperature for Maxwellian electron distributions.


Translation to Python format
Translation to SIROCCO format
============================


Expand Down Expand Up @@ -40,7 +40,7 @@ The rate coefficient R(T) is recovered from the scaled rate coefficient in the t

where :math:`E_{1}` is the first exponential integral. In python we use the gsl_sf_expint_E1 routine in gsl.

Python structure
SIROCCO structure
================

This data is stored in the dere_di_rate structure with members
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/source/atomic/electron_yields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Source

This data comes from `Kaastra and Mewe 1993, A&A, 97, 443 <http://articles.adsabs.harvard.edu/full/1993A%26AS...97..443K>`_ . The data is downloaded from the vizier site linked and put into a file called "electron_yield.data"

Translation to Python format
Translation to SIROCCO format
============================

The translation takes place using the python script "kaastra_2_py.py" which takes the saved raw data file "electron_yield.data" and compares it line by line to the inner shell cross section data in "vy_innershell_tab.data"(see above). The n shell and l subshell to which each record applies is coded in the KM data and needs to be decoded. This is what the script does, and all the script then does is output the yield data into a new file "kaastra_electron_yield.data" which contains the n and l cross reference.
Expand All @@ -35,7 +35,7 @@ This is the data format of the electron yield data
The data is linked to the correct inner shell photoionization cross section (and hence rate) via z, state, n shell and l subshell. The IP is not used. <E> is the mean electron energy ejected, used to calculate the PI heating rate in radiation.c. The last ten columns in the file (2 shown in the table above) show the chance of various numbers of electrons being ejected in units of 1/10000.


Python structure
SIROCCO structure
================

The data is stored in python in the inner_elec_yield structure which contains
Expand Down
10 changes: 5 additions & 5 deletions docs/sphinx/source/atomic/elem_ions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Elements and Ions
#################


The first file that must be read into **Python** is the file that defines the elements and ions. The
The first file that must be read into *SIROCCO* is the file that defines the elements and ions. The

Source:
=======
Expand All @@ -13,7 +13,7 @@ This data comes from `Verner, Barthel & Tytler, 1994, ApJ 108, 287. <http://arti
Translation to python:
======================

The original data and the translation can be found in py\_verner. A simple awkscript converts the downloaded data to Python format.
The original data and the translation can be found in py\_verner. A simple awkscript converts the downloaded data to SIROCCO format.


Data Format
Expand Down Expand Up @@ -92,9 +92,9 @@ Note that only evident changed is the label, but in this case the number of nlte



Python structure:
SIROCCO structure:
=================
This data is held in Python in various fields in structures **elements** and **ions**.
This data is held in SIROCCO in various fields in structures **elements** and **ions**.

Comments:
=========
Expand All @@ -103,6 +103,6 @@ Comments:

As indicated the numbers here are maximum values, and the actual numbers of levels for particular ion will depend on the data that follows.
One can use the numbers here to limit the complexity of, for example, a macro-atom to see whether making a more complicated macro-atom affects
the reusult of a calculation. One does not need to change the "downstream" data to make this happen, **Python** will simply ignore the extra
the reusult of a calculation. One does not need to change the "downstream" data to make this happen, *SIROCCO* will simply ignore the extra
data.

4 changes: 2 additions & 2 deletions docs/sphinx/source/atomic/free-free.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ where

:math:`\Delta=\log(x)-\log(\gamma^2)`

Python structure
SIROCCO structure
================
This data is held internally in Python in the structure **gaunt_total** which has members
This data is held internally in SIROCCO in the structure **gaunt_total** which has members

- log_gsqrd
- gff
Expand Down
6 changes: 3 additions & 3 deletions docs/sphinx/source/atomic/levels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Levels
######


Once the element and ion data has been read into \textsc{Python}, the next step is to read in the level information.
Once the element and ion data has been read into \textsc{SIROCCO}, the next step is to read in the level information.

Source:
=======
Expand Down Expand Up @@ -93,9 +93,9 @@ Since they quote J, one converts to g = 2J+1

The ionization potential is not used, as it is redundant with the excitation energy which is, and the last column giving the configuration is also for information only.

Python structure:
SIROCCO structure:
=================
This data is held in Python in various fields in structure **config**.
This data is held in SIROCCO in various fields in structure **config**.

Comments:
=========
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/source/atomic/photon_yields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Source
======
This data comes from `Kaastra and Mewe 1993, A&A, 97, 443 <http://articles.adsabs.harvard.edu/full/1993A%26AS...97..443K>`_ . The data is downloaded from the vizier site linked and put into a file called "fluorescent\_yield.data"

Translation to Python format
Translation to SIROCCO format
============================

The translation takes place using the python script "kaastra_2_py.py". All identical to electron yield, but input file is "fluorescent_yield.data" and output is "kaastra_fluorescent_yield.data"
Expand All @@ -34,7 +34,7 @@ This is the data format of the electron yield data
The data is linked to the correct inner shell photoionization cross section (and hence rate) via z, state, n shell and l subshell. The photon energy field is thew energy of the fluorescent photon in eV, and yield is the number of said photons emitted per ionization multiplied by :math:`10^4`.


Python structure
SIROCCO structure
================

The data is stored in python in the inner_fluor_yield structure which contains
Expand Down
Loading

0 comments on commit 3207e0a

Please sign in to comment.