You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a KeyError when attempting to calculate magnitudes for binary stars using the isochrones package. The error occurs specifically when accessing the key 'J' in the props_A or props_B dictionaries. This KeyError prevents the successful calculation of magnitudes for the J-band.
Steps to Reproduce:
Use the mist.track.generate function from the isochrones package to generate synthetic magnitudes for a binary star
Specify the bands to be 'J', 'H', 'K', 'BP', 'RP', and '
Attempt to access the 'J' key in the props_A or props_B dictionaries.
Expected Behavior:
The isochrones package should generate the synthetic magnitudes for the specified bands without any KeyError.
Actual Behavior:
A KeyError is raised for the key 'J' when trying to access the props_A['J'] or props_B['J'] values.
Operating System:
Python Version: 3.
isochrones Package Version: v2
Additional Information:
I have verified that the MIST evolutionary tracks are properly installed and up to date. I have also confirmed that the 'J' band is included in the bands list, matching the available bands in the MIST tracks.
PS:
Here is the code snippet I am using:
fromisochronesimportBinaryStarModelfromisochrones.utilsimportaddmagsdistance=500# pcAV=0.2mass_A=1.0mass_B=0.5age=9.6feh=0.0# Synthetic 2MASS and Gaia magnitudesbands= ['J', 'H', 'K', 'BP', 'RP', 'G']
props_A=mist.track.generate(mass_A, age, feh, distance=distance, AV=AV,
bands=bands, return_dict=True, accurate=True)
props_B=mist.track.generate(mass_B, age, feh, distance=distance, AV=AV,
bands=bands, return_dict=True, accurate=True)
unc=dict(J=0.02, H=0.02, K=0.02, BP=0.002, RP=0.002, G=0.001)
mags_tot= {b: (addmags(props_A[b], props_B[b]), unc[b]) forbinbands}
# Gaia parallax in mas for a system at 500 pcparallax= (2, 0.05)
mod_binary=BinaryStarModel(mist, **mags_tot, parallax=parallax, name='demo_binary')
Please let me know if you need any further information or if there are any suggested workarounds for this issue. Thank you for your attention to this matter
The text was updated successfully, but these errors were encountered:
Hi,
I replaced
mags_tot = {b: (addmags(props_A[b], props_B[b]), unc[b]) for b in bands}
with
mags_tot = {b: (addmags(props_A[b+'_mag'], props_B[b'_mag']), unc[b]) for b in bands}
the DataFrame returned by mist.track.generate() has such keys as 'J_mag', 'G_mag', etc.
I encountered a
KeyError
when attempting to calculate magnitudes for binary stars using the isochrones package. The error occurs specifically when accessing the key'J'
in theprops_A
orprops_B
dictionaries. ThisKeyError
prevents the successful calculation of magnitudes for the J-band.Steps to Reproduce:
mist.track.generate
function from the isochrones package to generate synthetic magnitudes for a binary starprops_A
orprops_B
dictionaries.Expected Behavior:
The isochrones package should generate the synthetic magnitudes for the specified bands without any KeyError.
Actual Behavior:
A
KeyError
is raised for the key 'J' when trying to access theprops_A['J']
orprops_B['J']
values.Additional Information:
I have verified that the MIST evolutionary tracks are properly installed and up to date. I have also confirmed that the 'J' band is included in the bands list, matching the available bands in the MIST tracks.
PS:
Here is the code snippet I am using:
Please let me know if you need any further information or if there are any suggested workarounds for this issue. Thank you for your attention to this matter
The text was updated successfully, but these errors were encountered: