Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParameterOutOfBounds: crash for some stellar parameter values #85

Open
iancrossfield opened this issue Aug 6, 2024 · 3 comments
Open

Comments

@iancrossfield
Copy link

When attempting a PandExo (v3) transit simulation and using the following 'star' input:

{'type': 'phoenix', 'starpath': 'filename_star', 'w_unit': 'Angs,um,nm,Hz,sec,cm', 'f_unit': 'FLAM or W/m2/um or erg/s/cm2/Hz or Jy', 'mag': 7.009, 'hmag': 'H Band Magnitude', 'jmag': 'J Band Magnitude', 'ref_wave': 2.2, 'temp': 4780.0, 'metal': 0.31, 'logg': 4.66, 'radius': 0.68, 'r_unit': 'R_sun'}
The code crashes with
ParameterOutOfBounds: Parameter '[4800.0, 0.5, 5.0, 'phoenixp05/phoenixp05_4800.fits[g50]']' has no valid data.

This seems to be because the file 'g50' field of file grp/hst/cdbs/grid/phoenix/phoenixp05/phoenixp05_4800.fits contains only zeros!

Not really a problem with PandExo per se -- just that slightly more rigorous error-catching could be useful to handle this (and any similar) odd edge-cases.

@iancrossfield
Copy link
Author

For what it's worth, I got around this by hacking engine/jwst.py to read in the star_spec as:

try:
   star_spec = create.outTrans(pandexo_input['star'])
except:
   pandexo_input['star']['metal'] = min(0.3, pandexo_input['star']['metal'])
   star_spec = create.outTrans(pandexo_input['star'])

@natashabatalha
Copy link
Owner

Ugh.. These Phoenix files are full of issues.. Will implement a check for this moving to pandexo 4.

@MartianColonist
Copy link

I just always set the metallicity to 0.0 for PandExo runs using the PHOENIX models. This is because the solar metallicity models have the highest spectral resolution and interpolation reliability with pysynphot, while some of the non-solar grid locations have issues... They actually replaced the solar metallicity PHOENIX models to fix some of these issues shortly before pysynphot was discontinued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants