The database is installed into a MySQL database. In order to use it, the user needs to learn a
few things such as the structure of the database and its intricacies.
Note : Make sure you have the
credentials
required in order to connect to the database.
First, let's take a look a the database structure. At the moment, it contains 12 tables as shown
below. All table are interrelated by column names such as ModelID and ProjectID. Take note
of these names as they will come handy later on.
Each table has a purpose and can be explored via the Database tables located in the sidebar on this page.
The
shock_params
table contains all shock parameters used to compute a shock model. This is the most important table in the database.
The
emis
tables contain several emission lines from UV to IR given in unit of ergs/cm^2/s. Each emission line and its related keywords
and table can be found using this
application.
The
abundance
table contains several abundances sets available in the database.
The
ion_col_dens contains the ionic column density for several ions.
The
ion_frac contains the ionic fraction for several ions.
The
ion_temp contains average ionic temperature for several ions.
Usage
To use the database, you need to learn the
Structured
Query
Language (SQL), its basics and intricacies of data manipulation.
Note : To clear up confusion, the command lines that will follow are SQL code. In
order to use the database,
you do not need to install the MySQL shell client on your system if your intention is
to use Python as your main language. The
Setups
page is there to show you which Python libraries are required.
The following lines will show you basic SQL code in order to form queries to interact with the
MySQL database. Theses queries will become quite useful once embedded within Python code.
For readers unfamiliar with SQL queries, we shall begin with a simple example. Let's say we want
to get the emissivity of [N II] 6583 for the following shock parameters :
We start by indentifying the location of each parameters and its table. The answer to this exercise :
Shock parameter
SQL table . Column name
Grid reference
shock_params.ref
Model type
emis_VI.model_type
Abundances set
abundances.name
Pre-shock density
shock_params.preshck_dens
Transverse magnetic field
shock_params.mag_fld
Age
shock_params.time
[N II] 6583 line
emis_VI.NII_6563
Notice how we print the table and the parameters (or column name) separated with a "." dot. This
is how we select a table and one of its column in SQL.
Take also note that the parameters are located in 3 different tables. This means that we are going to need
to join these tables together at some point while writing the SQL request.
Let's write the SQL query. We start by selecting what we want from the database, in this case the
emissivity of the [N II] 6583 line :
Take note that all emission lines available can be found on this
page.
From the
shock_params table, in which all shock parameters are included :
We then indicate which table are to be joined :
Followed with the specific parameters wanted :
Finally, the overall SQL command looks like this :
Once sent, the database returns :
Data manipulation
Most of the time, the user will be interested in line ratios to be compared with their observations.
Futhermore, the user will want multiple returns from only one query. Let's see another example
in which we are interested at obtaining the ratios of [O III] 5007/Hβ, [N II]/Hα
and He II 1640/Hβ for shock velocities between 200 and 1000 km/s for shock models with
cut-off temperatures < 1000 K. In addition, we want the age for each shock in years, its distance traveled in
parsec for models including shock+precursor. The following shock parameters will be used :