-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
reference = source['reference'], | ||
) | ||
print(f"Source {source['name']} ingested") | ||
except: |
There was a problem hiding this comment.
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.
except: | |
except Exception as e: | |
raise e # or logger.warning(e) |
ingest_source( | ||
db, | ||
source = source['name'], | ||
ra = source['ra_j2000_formula'], | ||
dec = source['dec_j2000_formula'], | ||
reference = source['reference'], | ||
) |
There was a problem hiding this comment.
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).
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' | |
) |
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() | ||
] |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
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.
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. |
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