Skip to content

fix_sso_w_sourcegen#28

Open
axf295 wants to merge 4 commits into
mainfrom
fix_sso_gen
Open

fix_sso_w_sourcegen#28
axf295 wants to merge 4 commits into
mainfrom
fix_sso_gen

Conversation

@axf295
Copy link
Copy Markdown
Contributor

@axf295 axf295 commented May 25, 2026

add fluxes to ingested ssos and update time to be Astropydantic compatible.

  • just add faux flux of 200mJy for each sso
  • fix the time for create source to astropydantic acceptable one rather than unix timestamp int.

fix source generator problem.

🤖 sqlite errors fixed by claude.

Claude said the problem I was having was:

Root cause: With your working coords, no sources are found so SourceGenerator objects are never created. With new coords that actually contain sources, get_box creates SourceGenerator(source=s, ...) without passing a session_factory. SourceGenerator.init then tries to open a fresh database connection via Settings().sync_database_url — but opening a second SQLite connection to the same file on Lustre fails with "unable to open database file."

Fix (2 changes to the installed socat/client/db.py):

  • SolarSystemClient.init now explicitly computes and stores self._session_factory before building the session interface

  • get_box passes session_factory=self._session_factory to each SourceGenerator, so they reuse the already-established connection factory instead of trying to open a new one

@axf295 axf295 requested a review from Sulla2012 May 25, 2026 19:03
sso = client.sso.get_sso_MPC_id(MPC_id=mpc_id)[0]

for _, row in tqdm(
rows[::10].iterrows(), desc=f"Ingesting {designation}", total=len(rows[:10])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oops, I must have left that in

rows.iterrows(), desc=f"Ingesting {designation}", total=len(rows)
):
flux = None
flux = 200 * u.mJy # Default flux if not provided
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Who came up with this and why? Probably should be configurable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

me - and yes itshoudl be but a flux of None causes it to fail so I had to give it some finite value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

or - alternatively we have a 'monitored' flag that allows us to do forced photometry on sources that we don't have fluxes for (i.e. asteroids or transients / dave's favorite sources)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Uh what error does it raise? socat.db.ephem.create_ephem' should accept flux as None`.

Copy link
Copy Markdown
Collaborator

@Sulla2012 Sulla2012 left a comment

Choose a reason for hiding this comment

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

Looks mostly good except I'm confused about create_ephem raising an error if the flux is None. That's not expected behavior and we should fix it rather than patch it with some arbitrary default flux.

rows.iterrows(), desc=f"Ingesting {designation}", total=len(rows)
):
flux = None
flux = 200 * u.mJy # Default flux if not provided
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Uh what error does it raise? socat.db.ephem.create_ephem' should accept flux as None`.

Comment thread README.md

The Simons Observatory source CATalog. Contains information about sources
that the Simons Observatory is monitorning.
The Simons Observatory source CATalog. Contains information about sources that the Simons Observatory is monitoring.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The SO in SOCAT is actually for SOurce

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

create_ephem doesn't raise an error but somethign else did further down the line. It might have just been get_forced_photometry_sources or something. which I could have skirted by doing flux selection later

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you write a test that fails or otherwise give me something I can use to reproduce?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, just added test -- the cause is in SourceGenerator

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah ok well I'll run this but almost certainly the problem is that flux is one of the interpolated values in SourceGenerator. It was asked that I add this feature to support the ability to filter sources by flux. This is then sort of a high level question of what we want to do with sources without flux estimates. We can simply return None for the flux value if the source in socat has no flux estimate [i.e., return (x,y, None)], or we can change the shape of the return type to be only (x,y) as opposed to (x,y,flux.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we want to just return None for the flux; i.e. .at_time() would return (postition,None) and we don't have to worry about interpolating it.

We will have to decide what that means for forced photometry.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Addressed in PR #29

@Sulla2012 Sulla2012 mentioned this pull request May 28, 2026
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.

3 participants