Skip to content

Conversation

@mjuric
Copy link
Member

@mjuric mjuric commented Nov 26, 2025

Update the generation code for Solar System-related tables, implementing https://ls.st/RFC-1138.

@mjuric mjuric marked this pull request as draft November 26, 2025 04:27
@Gerenjie Gerenjie force-pushed the tickets/DM-53310 branch 4 times, most recently from 242efb0 to e3cf8e3 Compare December 2, 2025 01:41
@isullivan isullivan marked this pull request as ready for review December 2, 2025 01:48
Copy link
Contributor

@isullivan isullivan left a comment

Choose a reason for hiding this comment

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

  • Please move package imports to the top of files where possible.
  • A few workarounds need tickets filed and referenced at the relevant location in the code.
  • Check the formatting of the new mpcorb connection dimensions.

doc="Minor Planet Center orbit table used for association",
name="mpcorb",
storageClass="DataFrame",
dimensions={},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
dimensions={},
dimensions=(),

f"Done. {len(ssSourceTable)} observations, {np.unique(ssSourceTable['ssObjectId']).size} objects."
)

# Compatibility for pre RFC-1138 ss_source_associated tables
Copy link
Contributor

Choose a reason for hiding this comment

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

Please file a ticket to remove this compatibility in the future, and add a reference to that ticket here.

meta_kernel_file.write(meta_kernel_text)
self.log.info('Sorcha process begun')

# FIXME: this is a workaround for breakage in sbpy 0.5.0 caused
Copy link
Contributor

Choose a reason for hiding this comment

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

Please file a ticket to remove the workaround, and reference the new ticket here.

if not os.path.exists(eph_path):
from time import sleep
print('not os.path.exists()', eph_path)
sleep(1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the sleep(1000) necessary?

Comment on lines 299 to 300
ephOffsetRa = np.array(residual_ras * np.cos(np.radians(ssSourceData["dec"]))) * 3600
ephOffsetDec = np.array(residual_decs) * 3600
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment explaining why these are multiplied by 3600

if "discoverySubmissionDate" in row.dtype.names: # DP2 does not have this field
# FIXME: here I arbitrarily guess we discover everything 7 days
# after first obsv. we should really pull this out of the obs_sbn tbl.
row["discoverySubmissionDate"] = row["firstObservationMjdTai"] + 7.0
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems guaranteed to be wrong. Will that be a problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see now that discoverySubmissionDate is excluded from the final schema, so I guess it is fine for now.

Comment on lines 11 to 12
from astropy.coordinates import get_body_barycentric_posvel, solar_system_ephemeris
import astropy.units as u
Copy link
Contributor

Choose a reason for hiding this comment

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

Move these imports to the top of the file

Comment on lines 229 to 230
from astropy.coordinates import SkyCoord, HeliocentricEclipticIAU76
import astropy.units as u
Copy link
Contributor

Choose a reason for hiding this comment

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

Move imports to the top of the file and deduplicate

],
).reset_index(drop=True)

from functools import partial
Copy link
Contributor

Choose a reason for hiding this comment

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

Move import

Comment on lines 58 to 59
import pyarrow as pa
import pyarrow.compute as pc
Copy link
Contributor

Choose a reason for hiding this comment

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

Move imports

@Gerenjie Gerenjie merged commit 83d2fb7 into main Dec 2, 2025
4 checks passed
@Gerenjie Gerenjie deleted the tickets/DM-53310 branch December 2, 2025 06:45
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.

4 participants