The notebook is available here: https://github.com/starkit/starkit/tree/master/docs/examples/starkit_photometry.ipynb


Integrating photometry in StarKitΒΆ

In [39]:
from starkit import assemble_model
from starkit.gridkit import load_grid
from starkit.base.operations.imager import Photometry
import wsynphot

import pandas as pd
from astropy import units as u
In [115]:
GRID_PATH = '/Users/wkerzend/projects/starkit/grids/phoenix_t2300_12000_w19000_25000_R10000.h5'
In [116]:
grid.flux_unit = u.Unit('erg/s/angstrom')
In [15]:
grid = load_grid(GRID_PATH)
[starkit.gridkit.base][INFO   ]  Reading index (base.py:266)
[starkit.gridkit.base][INFO   ]  Discovered columns teff, logg, mh (base.py:269)
[starkit.gridkit.base][INFO   ]  Reading Fluxes (base.py:272)
[starkit.gridkit.base][INFO   ]  Fluxes shape (5175, 10978) (base.py:275)
[starkit.gridkit.base][INFO   ]  Initializing spec grid (base.py:309)
[starkit.gridkit.base][WARNING]  **** NO WAVELENGTH TYPE SET DEFAULTING TO GRID (vacuum) ****

 (base.py:75)
[starkit.gridkit.base][WARNING]  No format_version in meta data for this grid. Please get an updated grid. This will fail in the future. (base.py:316)
In [70]:
decam_filters=wsynphot.FilterSet(['Keck/NIRC2/Kp'])
phot_operation = Photometry(filter_set=decam_filters, mag_type='vega')
In [71]:
photometry = (20.3444, 18.6799, 17.6418, 17.2215, 17.0349)
photometry_uncert = (0.0861, 0.0845, 0.0346, 0.0532, 0.0659)

magset = wsynphot.MagnitudeSet(decam_filters, photometry, photometry_uncert)
In [72]:
spectral_model = assemble_model(grid, distance=2500.0)
In [73]:
phot_model = spectral_model | phot_operation
In [117]:
phot_model.teff_0 = 9940
phot_model.logg_0 = 4.33
phot_model.mh_0 = -0.5
phot_model.distance_1 = 3.5

In [118]:
phot_model()
Out[118]:
array([-1.2789739])
In [ ]: