Skip to content

Sanghi23 Fundamental Parameters #582

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

Closed
wants to merge 2 commits into from

Conversation

canavarrete01
Copy link
Contributor

Short description: Include what type of data being ingested and appropriate references.

Link to relevant issue: Closes #518

For data ingests:
[x ] includes script used for ingest
[ ] includes modified JSON files
[ ] Add new tests
[ ] Update the Versions table

reference = source['reference'],
)
print(f"Source {source['name']} ingested")
except:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should never have a "bare" except. If you aren't sure what exceptions you might get (e.g., ValueError, TypeError), I usually raise, or at least give a warning, with the Exception.

Suggested change
except:
except Exception as e:
raise e # or logger.warning(e)

Comment on lines +25 to +31
ingest_source(
db,
source = source['name'],
ra = source['ra_j2000_formula'],
dec = source['dec_j2000_formula'],
reference = source['reference'],
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to pass the column names for ra and dec explicitly because SIMPLE uses the non-default names. (Default is ra_deg and dec_deg).

Suggested change
ingest_source(
db,
source = source['name'],
ra = source['ra_j2000_formula'],
dec = source['dec_j2000_formula'],
reference = source['reference'],
)
ingest_source(
db,
source = source['name'],
ra = source['ra_j2000_formula'],
dec = source['dec_j2000_formula'],
reference = source['reference'],
ra_col_name = 'ra',
dec_col_name = 'dec'
)

Comment on lines +41 to +52
modeled_parameters_evo_ingest_dict = [
{'sourceName': row['name'],
'sourceAltName': row['name_simbadable'],
'ra': row['ra_j2000_formula'],
'dec': row['dec_j2000_formula'],
'Radius': {'value': row['radius_evo'], 'value_error': row['radius_evo_err'], 'parameter': "radius", 'unit': 'R_jup', "model": "evolutionary"},
'log_g': {'value': row['logg_evo'], 'value_error': row['logg_evo_err'], 'parameter': "log g", 'unit': 'dex', "model": "evolutionary"},
'T_eff': {'value': row['teff_evo'], 'value_error': row['teff_evo_err'], 'parameter': "T eff", 'unit': 'K', "model": "evolutionary"},
'Mass': {'value': row['mass_evo'], 'value_error': row['mass_evo_err'], 'parameter': "mass", 'unit': 'M_jup', "model": "evolutionary"},
'reference': "Sang23"
} for _, row in evo_table.iterrows()
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very hard to read. Try formatting with Black. https://code.visualstudio.com/docs/python/formatting

Comment on lines +66 to +84
def find_source_name(db, source_name, source_alt_name, ra, dec, reference):
found_source = find_source_in_db(db, source_name, ra=ra, dec=dec, ra_col_name = "ra", dec_col_name = "dec")
if len(found_source) > 0:
source_name = found_source[0]

else:
print(f"Source {source_name} not found in database. Trying with Simbad name")
found_source = find_source_in_db(db, source_alt_name, ra=ra, dec=dec, ra_col_name = "ra", dec_col_name = "dec")
if len(found_source) > 0:
print(f"Found with simbad name {source_alt_name}. Ingesting alternative name.")
ingest_names(db, found_source[0], source_name)
source_name = found_source[0]
else:
print(f"Source {source_name} not found. Skipping for now.")
source_name = None


print(f'Found correct source name, saving as {source_name}')
return source_name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about why you need to do this since you should have ingested all of the sources above.

@kelle
Copy link
Collaborator

kelle commented Mar 6, 2025

I think we should break this down -- let's do a PR which justs ingests the missing sources, alt names, and discovery refs. Once that's merged, we can ingest the paramaters.

@kelle kelle closed this Apr 14, 2025
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

Successfully merging this pull request may close these issues.

Ingest modeled parameters from Sanghi et al. 2023
2 participants