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

Assist ephem #7

Closed
wants to merge 2 commits into from
Closed

Assist ephem #7

wants to merge 2 commits into from

Conversation

KatKiker
Copy link
Contributor

@KatKiker KatKiker commented Jul 3, 2024

No description provided.

@KatKiker KatKiker requested a review from akoumjian July 11, 2024 05:11
Copy link
Contributor

@akoumjian akoumjian left a comment

Choose a reason for hiding this comment

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

I'd definitely prefer this on the EphemerisMixin in adam-core. I saw that there was some kind of error in slack. I'm guessing some kind of inheritance issue?

I'd like to see linting pass and we should have at least one unit test for this, perhaps where we can hardcode some values from a sorcha run or from a JPL ephemeris tool where we know it fails without the light time correction.

You should be able to run pdm run check to run the linting and unit tests.

origin_out=OriginCodes.SOLAR_SYSTEM_BARYCENTER,
),
)
observers_barycentric = observers.set_column(
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be moved to outside the for-loop, I think. Probably negligible in most cases, but adds some compute time if there are lots of orbits or lots of observers.

dlt = 1
while dlt > lt_tol:
observer_position = observer.coordinates.values[0,:3]
orbit_i = orbit
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of renaming here, since these will be the same object in memory? I was confused because we concat the orbit instance at the end but we are modifying orbit_i and I had to realize they were the same.

for i, (orbit, observer) in enumerate(zip(orbits, observers)):
lt0 = 0
dlt = 1
while dlt > lt_tol:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a any handler for max-attempts. Is this loop guaranteed to converge? (I honestly don't know).

ephemeris_total = VariantEphemeris.empty()

for orbit in orbits:
propagated_orbits = self._propagate_orbits(orbit, observers.coordinates.time)
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
propagated_orbits = self._propagate_orbits(orbit, observers.coordinates.time)
propagated_orbits = self.propagate_orbits(orbit, observers.coordinates.time)

We should be calling the public API here, I think.


t1 = t0 - lt
t1 = Timestamp.from_mjd([t1], scale="tdb")
orbit_propagated = self._propagate_orbits(orbit, t1)
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
orbit_propagated = self._propagate_orbits(orbit, t1)
orbit_propagated = self.propagate_orbits(orbit, t1)

object_id=propagated_orbits_barycentric.object_id,
coordinates=spherical_coordinates,
weights=weights,
weights_cov=weights_cov,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does VariantEphemeris need the light_time column?

orbit_id=propagated_orbits_barycentric.orbit_id,
object_id=propagated_orbits_barycentric.object_id,
coordinates=spherical_coordinates,
light_time=light_time,
Copy link
Contributor

Choose a reason for hiding this comment

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

I notice we're not using the aberrated_coordinates column. I'm guessing it was decided that was too confusing?

@KatKiker KatKiker closed this Sep 20, 2024
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.

2 participants