Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/emilyhunt/gaianir-open-clusters. Companion code to determine the star cluster selection function of the proposed GaiaNIR astrometric mission.
Something went wrong. Try again.
1.3 kB · 43 lines
Python
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344"""Creates interpolator assets for use generating photometry.
Runtime: <1 minute"""
import pandas as pdfrom gaianir_open_clusters.config import RESULTS_DIRECTORYfrom gaianir_open_clusters.photometry import FILTERS
# Grab raw photometric resultsprint("Loading data...")kurucz_photometry = ( pd.read_csv( RESULTS_DIRECTORY / "_temporary_files/photometric_model.ecsv", comment="#" ) .query("A0==0.0 and alpha==0.0 and R0==3.1") .reset_index(drop=True))btsettl_photometry = pd.read_csv( RESULTS_DIRECTORY / "_temporary_files/btsettl_photometric_model.ecsv", comment="#")
# Process them into a nicer format, with each band as a column (instead of many rows)PHOTOMETRIC_GRID = pd.concat([kurucz_photometry, btsettl_photometry])
bands = PHOTOMETRIC_GRID["passband"].unique()
for band in bands: filter = FILTERS[band]
# Copy photometry just to the valid set valid = PHOTOMETRIC_GRID["passband"] == band PHOTOMETRIC_GRID.loc[valid, band] = ( PHOTOMETRIC_GRID.loc[valid, "mag0"] - filter.Vega_zero_mag )
mags = {band: pd.NamedAgg(band, "first") for band in bands}
PHOTOMETRIC_GRID = ( PHOTOMETRIC_GRID.groupby(["teff", "logg", "feh"]).aggregate(**mags).reset_index())PHOTOMETRIC_GRID.to_parquet(RESULTS_DIRECTORY / "photometry.parquet")