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

Ingest BONES Photometry #575

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lesliech1004
Copy link

@lesliech1004 lesliech1004 commented Jan 18, 2025

Short description: New Python script for ingesting the photometry from the BONES Archive.

Link to relevant issue: Closes #544 (photometry only)

For data ingests:

  • includes script used for ingest
  • includes modified JSON files
  • Add new tests
  • Update the Versions table

@lesliech1004
Copy link
Author

We're getting this error when using the ingest_photometry function in astrodb_utils. 01/18/2025 10:29:46AM INFO: Found 1 matching publications for GaiaDR2 or None or None: ['GaiaDR2'] Traceback (most recent call last): File "/Users/lesli/Documents/GitHub/SIMPLE-db/scripts/ingests/bones_archive/test.py", line 96, in <module> ingest_photometry( File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/astrodb_utils/photometry.py", line 171, in ingest_photometry conn.execute(db.Photometry.insert().values(photometry_data)) File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1418, in execute return meth( File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection return connection._execute_clauseelement( File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1632, in _execute_clauseelement compiled_sql, extracted_params, cache_hit = elem._compile_w_cache( File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 716, in _compile_w_cache compiled_sql = self._compiler( File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 316, in _compiler return dialect.statement_compiler(dialect, self, **kw) File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/compiler.py", line 1429, in __init__ Compiled.__init__(self, dialect, statement, **kwargs) File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/compiler.py", line 870, in __init__ self.string = self.process(self.statement, **compile_kwargs) File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/compiler.py", line 915, in process return obj._compiler_dispatch(self, **kwargs) File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch return meth(self, **kw) # type: ignore # noqa: E501 File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/compiler.py", line 5789, in visit_insert crud_params_struct = crud._get_crud_params( File "/opt/miniconda3/envs/simple-db/lib/python3.10/site-packages/sqlalchemy/sql/crud.py", line 335, in _get_crud_params raise exc.CompileError( sqlalchemy.exc.CompileError: Unconsumed column names: regime

It seems to be a problem with the template appearing to not have the regime field even though it is passed in inside the ingest_photometry function.

@Exu-112 Exu-112 requested a review from kelle January 18, 2025 15:51
@kelle
Copy link
Collaborator

kelle commented Jan 18, 2025

Great work -- this script looks great! Amazing start!

I am pretty sure this error is because the SIMPLE database doesn't have a regime column in the Photometry table. I think the easiest way to address this is to not ingest regime...it's an optional argument to the ingest_photometry function.

@kelle
Copy link
Collaborator

kelle commented Jan 18, 2025

Nope, regime is required. Let's add regime to the SIMPLE schema. Modify the schema.py file to add it. This is the place to add a new column:

class Photometry(Base):

(I'm on travel for two weeks starting Monday. Maybe @dr-rodriguez can help out while I'm away.)

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 the BONES Archive of low metallicity sources
2 participants