Skip to content

Commit

Permalink
Faster runtime of FitModel, refactoring of ReadModel functions, added…
Browse files Browse the repository at this point in the history
… interpolate_grid, updated tutorials
  • Loading branch information
Tomas Stolker committed Feb 21, 2020
1 parent cf2c7a0 commit 0ed28ac
Show file tree
Hide file tree
Showing 16 changed files with 1,320 additions and 909 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This page contains a list of tutorials which highlight some of the functionaliti
tutorials/atmospheric_models.ipynb
tutorials/data_model.ipynb
tutorials/photometric_calibration.ipynb
tutorials/fitting_photometry.ipynb
tutorials/fitting_model_spectra.ipynb

.. important::
A flux calibrated spectrum of Vega is used for the conversion between flux density and magnitude. The magnitude of Vega is set to 0.03 mag for all filters (see also `Stolker et al. 2020 <https://ui.adsabs.harvard.edu/abs/2019arXiv191213316S>`_).
79 changes: 40 additions & 39 deletions docs/tutorials/atmospheric_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,16 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Initiating species v0.1.4... [DONE]\n",
"Creating species_config.ini... [DONE]\n",
"Initiating species v0.2.0... [DONE]\n",
"Database: /Users/tomasstolker/applications/species/docs/tutorials/species_database.hdf5\n",
"Data folder: /Users/tomasstolker/applications/species/docs/tutorials/data\n",
"Working folder: /Users/tomasstolker/applications/species/docs/tutorials\n",
"Creating species_database.hdf5... [DONE]\n",
"Creating data folder... [DONE]\n"
"Working folder: /Users/tomasstolker/applications/species/docs/tutorials\n"
]
},
{
"data": {
"text/plain": [
"<species.core.setup.SpeciesInit at 0x12d2e4470>"
"<species.core.setup.SpeciesInit at 0x124122080>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -89,7 +86,6 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading DRIFT-PHOENIX model spectra (151 MB)... [DONE]\n",
"Unpacking DRIFT-PHOENIX model spectra... [DONE]\n",
"Adding DRIFT-PHOENIX model spectra... [DONE] \n"
]
Expand Down Expand Up @@ -123,14 +119,34 @@
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'teff': (1000.0, 3000.0), 'logg': (3.0, 5.5), 'feh': (-0.6, 0.3)}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"read_model.get_bounds()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"model_param = {'teff':1510., 'logg':4.1, 'feh':0.1}"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -140,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -149,18 +165,13 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Adding filter: MKO/NSFCam.J... [DONE]\n",
"Adding filter: MKO/NSFCam.H... [DONE]\n",
"Adding filter: MKO/NSFCam.K... [DONE]\n",
"Adding filter: MKO/NSFCam.Lp... [DONE]\n",
"Adding filter: MKO/NSFCam.Mp... [DONE]\n",
"Plotting spectrum: model_spectrum.png... [DONE]\n"
]
}
Expand All @@ -177,7 +188,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -187,7 +198,7 @@
"<IPython.core.display.Image object>"
]
},
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -212,7 +223,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -225,7 +236,7 @@
" 'feh': array([-0.6, -0.3, -0. , 0.3])}"
]
},
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -243,7 +254,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -252,7 +263,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -262,7 +273,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -271,7 +282,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -294,7 +305,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand All @@ -304,7 +315,7 @@
"<IPython.core.display.Image object>"
]
},
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -322,25 +333,17 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Adding filter: Paranal/NACO.Mp... [DONE]\n"
]
}
],
"outputs": [],
"source": [
"read_model = species.ReadModel(model='drift-phoenix',\n",
" filter_name='Paranal/NACO.Mp')"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand All @@ -358,15 +361,13 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading Vega spectrum (270 kB)... [DONE]\n",
"Adding Vega spectrum... [DONE]\n",
"Apparent magnitude [mag] = 12.00\n",
"Absolute magnitude [mag] = 10.50\n"
]
Expand Down
Loading

0 comments on commit 0ed28ac

Please sign in to comment.