Implement Finite Difference Velocity Transformations#13
Implement Finite Difference Velocity Transformations#13eteq wants to merge 189 commits intoadrn:coordinates/frame-velocity-supportfrom
Conversation
dc15777 to
8f82c3d
Compare
|
Sick!! Have you tried this going from GCRS to ICRS to see if it produces the correct Barycentric velocity correction? |
Just what I'm looking at right now actually! It doesn't work, but I think due to some straightforward-to-fix bugs. Will push a few more tests up soon hopefully, including that. |
856e89b to
68457ec
Compare
32c8c86 to
52f28b4
Compare
anything that sees strings as regex-like gets confused by [\]
17fbb3e to
867b685
Compare
bc3247b to
472f385
Compare
…support Add velocity support to coordinate frames and transformations
| class LSR2(LSR): | ||
| obstime = TimeFrameAttribute(default=J2000) | ||
|
|
||
| dt = 1*u.s |
There was a problem hiding this comment.
This overrides the dt passed in to the test function.
There was a problem hiding this comment.
oops! fortunately it passes either way...
| ax2.set_title('total') | ||
|
|
||
|
|
||
| sd = frame.data.differentials['s'].represent_as(SphericalDifferential, frame.data) |
There was a problem hiding this comment.
SphericalDifferential isn't imported
| # if its a lot bigger than this, finite-difference noise has ruined things | ||
| assert np.ptp(rv) < 65*u.km/u.s | ||
|
|
||
| def diff_info_plot(frame, times): |
There was a problem hiding this comment.
times should be time to work with variables in function.
|
You should be able to implement a test that checks this against some of the matrix transforms. For example: def test_faux_fk5_galactic():
class Galactic2(Galactic):
pass
dt = 1*u.s
@frame_transform_graph.transform(FunctionTransformWithFiniteDifference,
FK5, Galactic2, finite_difference_dt=dt,
symmetric_finite_difference=True,
finite_difference_frameattr_name=None)
def fk5_to_gal2(fk5_coo, gal_frame):
trans = DynamicMatrixTransform(fk5_to_gal, FK5, Galactic2)
return trans(fk5_coo, gal_frame)
@frame_transform_graph.transform(FunctionTransformWithFiniteDifference,
Galactic2, ICRS, finite_difference_dt=dt,
symmetric_finite_difference=True,
finite_difference_frameattr_name=None)
def gal2_to_fk5(gal_coo, fk5_frame):
trans = DynamicMatrixTransform(_gal_to_fk5, Galactic2, FK5)
return trans(gal_coo, fk5_frame)
c1 = FK5(ra=150*u.deg, dec=-17*u.deg, radial_velocity=83*u.km/u.s,
pm_ra_cosdec=-41*u.mas/u.yr, pm_dec=16*u.mas/u.yr,
distance=150*u.pc)
c2 = c1.transform_to(Galactic2)
c3 = c1.transform_to(Galactic)
# compare the values below
c2.pm_l_cosb.to(u.mas/u.yr), c2.pm_b.to(u.mas/u.yr)
c3.pm_l_cosb.to(u.mas/u.yr), c3.pm_b.to(u.mas/u.yr)I was finding ~0.3% accuracy. |
|
Alright, I think all the comments above have been addressed! |
e2d4f1c to
6bfd3d0
Compare
|
Closing this in favor of astropy#6226 |
WIP...