The notebook is available here: https://github.com/starkit/starkit/tree/master/docs/examples/starkit_photometry.ipynb
Integrating photometry in StarKitΒΆ
[ ]:
from starkit.gridkit import load_grid
from starkit.base.operations.imager import Photometry
from starkit.filters import Filter
[115]:
GRID_PATH = '/Users/wkerzend/projects/starkit/grids/phoenix_t2300_12000_w19000_25000_R10000.h5'
[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)
The Keck/NIRC2 Kp curve from the SVO Filter Profile Service. It is downloaded on first use and kept in the astropy download cache. See Synthetic photometry for filters read from files or given as arrays.
[ ]:
kp = Filter.from_svo('Keck/NIRC2.Kp')
kp
[ ]:
phot_operation = Photometry.from_grid(grid, filter_set=[kp], mag_type='vega')
The model computes magnitudes from the flux stored in the grid, without a distance. Check what the fluxes of the grid are with check_flux_scale (see Grid flux units). For a grid of surface flux, these are magnitudes of the stellar surface: their differences (colors) can be compared with observed colors, but comparing the magnitudes themselves with observations requires scaling the flux by \((R/d)^2\), with \(R\) the stellar radius and \(d\) the
distance.
[ ]:
phot_model = grid | phot_operation
[ ]:
phot_model.teff_0 = 9940
phot_model.logg_0 = 4.33
phot_model.mh_0 = -0.5
[ ]:
phot_model()