Skip to content

Commit

Permalink
add vald database
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrimm committed Jun 18, 2020
1 parent c040833 commit 086932a
Show file tree
Hide file tree
Showing 46 changed files with 1,132 additions and 21 deletions.
4 changes: 4 additions & 0 deletions ISO.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ int Init(Molecule &m, Param &param, char (*qFilename)[160]){
//NIST
sprintf(m.dataFilename[i], "%s%s.", param.path, m.mName);
}
if(param.dataBase == 32){
//VALD
sprintf(m.dataFilename[i], "%s%s.", param.path, m.mName);
}

}
fgets(sp, 4, pFile);
Expand Down
1 change: 0 additions & 1 deletion Kurucz3.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ def processLineList(i, j, Download, printA):

if(element == els):
A = 8.0 * math.pi * wn * wn * (10.0**loggf) / gUP * math.pi * e * e / (me * c)
gamma = 2.223e13 / (wl * wl)

sameLabel = 0
if(LabelL == LabelLOld and LabelU == LabelUOld and gUP == gUPOld and gLow == gLowOld and ELow == ELowOld and EUP == EUPOld):
Expand Down
2 changes: 2 additions & 0 deletions Kurucz4.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ def processLineList(i, j, printA):
#print(A[i], GammaRad, GammaR[i], wn[i])
if(printA == 1):
print(i, wn[i], A[i], ELow[i], ELowAverage[i], gUP[i], GammaRad, GammaR[i], Z, mass, file = Afile)
if(i % 10000 == 0):
print("reached line %d from %d" % (i, len(wn)))

G = GammaR[i]
if(G == 1.0):
Expand Down
58 changes: 47 additions & 11 deletions docs/helios_k/atoms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,73 @@ Kurucz database. We use T = 3000 K and P = 1 bar.



.. figure:: ../plots/atomic/plot00.png
.. figure:: ../plots/atomic/plotB00.png
:name: atomic00

.. figure:: ../plots/atomic/plot01.png
.. figure:: ../plots/atomic/plotB01.png
:name: atomic01

.. figure:: ../plots/atomic/plot02.png
.. figure:: ../plots/atomic/plotB02.png
:name: atomic02

.. figure:: ../plots/atomic/plot03.png
.. figure:: ../plots/atomic/plotB03.png
:name: atomic03

.. figure:: ../plots/atomic/plot04.png
.. figure:: ../plots/atomic/plotB04.png
:name: atomic04

.. figure:: ../plots/atomic/plot05.png
.. figure:: ../plots/atomic/plotB05.png
:name: atomic05

.. figure:: ../plots/atomic/plot06.png
.. figure:: ../plots/atomic/plotB06.png
:name: atomic06

.. figure:: ../plots/atomic/plot07.png
.. figure:: ../plots/atomic/plotB07.png
:name: atomic07

.. figure:: ../plots/atomic/plot08.png
.. figure:: ../plots/atomic/plotB08.png
:name: atomic08

.. figure:: ../plots/atomic/plot09.png
.. figure:: ../plots/atomic/plotB09.png
:name: atomic09

.. figure:: ../plots/atomic/plot10.png
.. figure:: ../plots/atomic/plotB10.png
:name: atomic10

.. figure:: ../plots/atomic/plotB11.png
:name: atomic11

.. figure:: ../plots/atomic/plotB12.png
:name: atomic12

.. figure:: ../plots/atomic/plotB13.png
:name: atomic13

.. figure:: ../plots/atomic/plotB14.png
:name: atomic14

.. figure:: ../plots/atomic/plotB15.png
:name: atomic15

.. figure:: ../plots/atomic/plotB16.png
:name: atomic16

.. figure:: ../plots/atomic/plotB17.png
:name: atomic17

.. figure:: ../plots/atomic/plotB18.png
:name: atomic18

.. figure:: ../plots/atomic/plotB19.png
:name: atomic19

.. figure:: ../plots/atomic/plotB20.png
:name: atomic20

.. figure:: ../plots/atomic/plotB21.png
:name: atomic21

.. figure:: ../plots/atomic/plotB22.png
:name: atomic22


23 changes: 22 additions & 1 deletion docs/helios_k/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,28 @@ Requirements
- pandas
- argparse
- re


- vald_request.py

- selenium
- argparse

- vald_download.py

- numpy
- math
- struct
- os
- argparse

- vald.py

- numpy
- math
- struct
- os
- argparse


Note, when using a computing cluster, all these libraries can be installed locally in the home directory with:

Expand Down
157 changes: 157 additions & 0 deletions docs/helios_k/vald.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
VALD3 Database
--------------

Step 1, Request the files
~~~~~~~~~~~~~~~~~~~~~~~~~

The download of the line lists can either be done manually through
the website, or in a more automated way, by using navigation scripts.

Before the VALD data can be acessed, one has to register on the VALD website.

Attention, there is a limit of 100000 transition lines per query. Some species have more lines
than that. Is this case, the wavenumber ranges have to be split into two parts. This is
especially the case for Fe and Cr.


Method A, manual request
^^^^^^^^^^^^^^^^^^^^^^^^

- Vist ``http://vald.astro.uu.se/``
- Register with email address
- Choose Mirror Server
- Click ``Extract Element``
- Click ``Unit selections`` and select:

- Energy level units: cm-1
- Give wavelenths in medium: vacuum
- Wavelength units: cm-1
- Van der Waals syntax: Default
- Isotopic scaling: Off
- click ``Save settings``

- click again ``Extract Element``
- check the units, they must be ``Energy unit: 1/cm - Medium: vacuum - Wavelength unit: 1/cm - VdW syntax: default``
- Enter Starting wavenumber, e.g. 0.001
- Enter Ending wavenumber : e.g. 1000000
- Enter Element: e.g Fe 1, (ionizaion number = 1 means neutral)
- Extraction format : Long format
- Retrieve data via : FTP
- Select ``Include HFS splitting``
- Enter a comment in ``Optional comment for request``, for example the element and ionization number.
- Click ``Submit request``



Method B, using scripts
^^^^^^^^^^^^^^^^^^^^^^^

Also this mehod requires to first visit the web interface manually and to
choose the correct units, the same way as Method A.
After that, the vald_request.py script can navigate the webiste and fill in the necessary webforms.
For this, a geckodriver needs to be installed.

Then type:

::

python3 vald_request.py -Z <z> -I <i> -u <email address>

where ``<z>``\ is the atomic number and ``<i>``\ the ionization state (i = 0 is neutral)
The email address must be the same as the user account from the VALD website.


Step 2, download the files
~~~~~~~~~~~~~~~~~~~~~~~~~~

After a few minutes you will get an email from VALD with a link to download the data file.


Method A, manual download
^^^^^^^^^^^^^^^^^^^^^^^^^
Download the file and unpack it. Rename the file to ``VALD<Z><I>.dat``.
E.g VALD2600.dat for Z = 26, I = 0 (I = 0 means neutral atoms).


Method B, using scripts
^^^^^^^^^^^^^^^^^^^^^^^

The requested files are stored temporarely on the VALD webiste with a name similar to
``SimonGrimm.4199418``, where the first part is the user name, and the second part is the
job number. The vald_download.py script can download all requested files, scan which element
they contain and rename them according to the element number.

::

python3 vald_download.py -jobstart <start> -jobend <end> -jobname <name>

The name is the user name from the VALD webiste, e.g SimonGrimm.
The jobstart is the first jobnumber (check email from VALD) .e.g 4199418.
The jobend is the last jobnumber (check email from VALD) .e.g 4199420.

The files are renamed as ``VALD<Z><I>.dat``.


Step 3, partition function files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Partition functions are not available in the VALD database.
Therefore we use the partition functions calculated from the NIST database.


Step 4, calculate natural broadening coefficients and create the binary files and ``< species >.param`` files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For many species, the vald database provides broadening coefficients,
but not for all. The missing coefficients are calculated in this step.
That can take a while to complete.

::

python3 vald.py -Z <z> -I <i>


This step creates the ``< species >.param`` and the `*.bin` files.


Step 5, data path
~~~~~~~~~~~~~~~~~

Include the path of the directory, which contains the obtained binary
files, the ``*.pf`` partition function files and the ``*.param`` file to
the HELIOS-K ``param.dat`` file under ``pathToData``.



References
~~~~~~~~~~

Vald provides reference files for each species. We rename these ``*.bib``
the same way as the data files. When using data from VALD, all these references
must be cited in publications.


We list here also the citation conditions from VALD:

::

A short note on using VALD data :

The VALD data and services are provided free of charge on the following conditions:

1. If VALD has been used in your research work, you agree to include the acknowledge
below as well as citations to the following papers where appropriate:

"This work has made use of the VALD database, operated at Uppsala University, the
Institute of Astronomy RAS in Moscow, and the University of Vienna."

Ryabchikova T., Piskunov, N., Kurucz, R.L., et al., Physics Scripta, vol 90, issue 5, article id. 054005 (2015), (VALD-3)
Kupka F., Ryabchikova T.A., Piskunov N.E., Stempels H.C., Weiss W.W., 2000, Baltic Astronomy, vol. 9, 590-594 (2000), (VALD-2)
Kupka F., Piskunov N.E., Ryabchikova T.A., Stempels H.C., Weiss W.W., A&AS 138, 119-133 (1999), (VALD-2)
Ryabchikova T.A. Piskunov N.E., Stempels H.C., Kupka F., Weiss W.W. Proc. of the 6th International Colloquium on Atomic Spectra and Oscillator Strengths, Victoria BC, Canada, 1998, Physica Scripta T83, 162-173 (1999), (VALD-2)
Piskunov N.E., Kupka F., Ryabchikova T.A., Weiss W.W., Jeffery C.S., A&AS 112, 525 (1995) (VALD-1)

2. You also agree to reference to original source(s) of the line data that are important for your research.
A complete list of references is available from the bibliography section of the VALD manual. A short list
of references is compiled and sent to you with every reply from VALD.

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Databases
helios_k/hitemp.rst
helios_k/kurucz.rst
helios_k/nist.rst
helios_k/vald.rst

Running HELIOS-K
~~~~~~~~~~~~~~~~
Expand Down
Binary file removed docs/plots/atomic/plot00.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot01.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot02.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot03.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot04.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot05.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot06.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot07.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot08.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot09.png
Binary file not shown.
Binary file removed docs/plots/atomic/plot10.png
Binary file not shown.
Binary file added docs/plots/atomic/plotB00.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB02.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB03.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB04.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB05.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB06.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB07.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB08.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB09.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB11.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB12.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB13.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plots/atomic/plotB14.png
Binary file added docs/plots/atomic/plotB15.png
Binary file added docs/plots/atomic/plotB16.png
Binary file added docs/plots/atomic/plotB17.png
Binary file added docs/plots/atomic/plotB18.png
Binary file added docs/plots/atomic/plotB19.png
Binary file added docs/plots/atomic/plotB20.png
Binary file added docs/plots/atomic/plotB21.png
Binary file added docs/plots/atomic/plotB22.png

0 comments on commit 086932a

Please sign in to comment.