Skip to content

Commit

Permalink
fix assoc stream test
Browse files Browse the repository at this point in the history
  • Loading branch information
FusRoman committed Dec 1, 2023
1 parent 4234b5e commit 428705a
Showing 1 changed file with 71 additions and 74 deletions.
145 changes: 71 additions & 74 deletions fink_fat/test/stream_association_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@
"roid": [0.0, 0.0, 4.0, 4.0],
}
)

test_fit = pd.DataFrame(
{
"trajectory_id": [2],
"ra_0": [0],
"dec_0": [0],
"ra_1": [1],
"dec_1": [1],
"jd_0": [0],
"jd_1": [1],
"mag_1": [1],
"ra_0": [8],
"dec_0": [8],
"ra_1": [9],
"dec_1": [9],
"jd_0": [2],
"jd_1": [3],
"mag_1": [9],
"fid_1": [2],
"xp": [np.array([-0.0011995, -0.00564948, 1.0016361])],
"yp": [np.array([-0.00018998, 0.05895939, -0.01032991])],
Expand Down Expand Up @@ -128,14 +129,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [2, 3],
"ra_0": [0, 5],
"dec_0": [0, 5],
"ra_1": [1, 6],
"dec_1": [1, 6],
"jd_0": [0, 0],
"jd_1": [1, 1],
"mag_1": [1, 3],
"fid_1": [2, 1],
"ra_0": [8, 11],
"dec_0": [8, 11],
"ra_1": [9, 12],
"dec_1": [9, 12],
"jd_0": [2, 4],
"jd_1": [3, 5],
"mag_1": [9, 9],
"fid_1": [2, 2],
"xp": [
np.array([-0.0011995, -0.00564948, 1.0016361]),
np.array([-4.36140290e-04, -5.30757377e-03, 9.93308991e-01]),
Expand All @@ -151,7 +152,6 @@
}
)


assert_frame_equal(
res_traj.fillna(0).reset_index(drop=True),
test_traj.reset_index(drop=True),
Expand Down Expand Up @@ -250,14 +250,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [3, 4, 5, 6],
"ra_0": [0, 5, 5, 0],
"dec_0": [0, 5, 5, 0],
"ra_1": [1, 6, 6, 1],
"dec_1": [1, 6, 6, 1],
"jd_0": [0, 0, 0, 0],
"jd_1": [1, 1, 1, 1],
"mag_1": [1, 3, 3, 1],
"fid_1": [2, 1, 1, 2],
"ra_0": [8, 11, 6, 6],
"dec_0": [8, 11, 6, 6],
"ra_1": [9, 12, 7, 7],
"dec_1": [9, 12, 7, 7],
"jd_0": [2, 4, 4, 4],
"jd_1": [3, 5, 5, 5],
"mag_1": [9, 9, 1, 1],
"fid_1": [2, 2, 1, 1],
"xp": [
np.array([-0.0011995, -0.00564948, 1.0016361]),
np.array([-4.36140290e-04, -5.30757377e-03, 9.93308991e-01]),
Expand All @@ -279,7 +279,6 @@
}
)


assert_frame_equal(
res_traj.fillna(0).reset_index(drop=True),
test_traj.reset_index(drop=True),
Expand Down Expand Up @@ -338,13 +337,13 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [3, 4],
"ra_0": [0, 0],
"dec_0": [0, 0],
"ra_1": [1, 1],
"dec_1": [1, 1],
"jd_0": [0, 0],
"jd_1": [1, 1],
"mag_1": [1, 1],
"ra_0": [8, 10],
"dec_0": [8, 10],
"ra_1": [9, 11],
"dec_1": [9, 11],
"jd_0": [2, 4],
"jd_1": [3, 5],
"mag_1": [9, 11],
"fid_1": [2, 2],
"xp": [
np.array([-0.0011995, -0.00564948, 1.0016361]),
Expand All @@ -361,7 +360,6 @@
}
)


assert_frame_equal(
res_traj.fillna(0).reset_index(drop=True),
test_traj.reset_index(drop=True),
Expand Down Expand Up @@ -421,14 +419,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [3, 4],
"ra_0": [0, 5],
"dec_0": [0, 5],
"ra_1": [1, 6],
"dec_1": [1, 6],
"jd_0": [0, 0],
"jd_1": [1, 1],
"mag_1": [1, 3],
"fid_1": [2, 1],
"ra_0": [8, 8],
"dec_0": [8, 8],
"ra_1": [9, 9],
"dec_1": [9, 9],
"jd_0": [2, 2],
"jd_1": [3, 3],
"mag_1": [9, 9],
"fid_1": [2, 2],
"xp": [
np.array([-0.0011995, -0.00564948, 1.0016361]),
np.array([-4.43128421e-04, -4.57759549e-03, 9.92826538e-01]),
Expand All @@ -444,7 +442,6 @@
}
)


assert_frame_equal(
res_traj.fillna(0).reset_index(drop=True),
test_traj.reset_index(drop=True),
Expand Down Expand Up @@ -506,14 +503,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [2, 3],
"ra_0": [0, 5],
"dec_0": [0, 5],
"ra_1": [1, 6],
"dec_1": [1, 6],
"jd_0": [0, 0],
"jd_1": [1, 1],
"mag_1": [1, 3],
"fid_1": [2, 1],
"ra_0": [1, 6],
"dec_0": [1, 6],
"ra_1": [8, 9],
"dec_1": [8, 9],
"jd_0": [1, 1],
"jd_1": [2, 3],
"mag_1": [8, 9],
"fid_1": [2, 2],
"xp": [
np.array([-0.00937999, 0.0090754, 1.0]),
np.array([-0.00114756, -0.00218251, 0.99240388]),
Expand Down Expand Up @@ -625,14 +622,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [2, 3, 4, 5, 6, 7],
"ra_0": [0, 0, 0, 5, 5, 5],
"dec_0": [0, 0, 0, 5, 5, 5],
"ra_1": [1, 1, 1, 6, 6, 6],
"dec_1": [1, 1, 1, 6, 6, 6],
"jd_0": [0, 0, 0, 0, 0, 0],
"jd_1": [1, 1, 1, 1, 1, 1],
"mag_1": [1, 1, 1, 3, 3, 3],
"fid_1": [2, 2, 2, 1, 1, 1],
"ra_0": [1, 1, 1, 6, 6, 6],
"dec_0": [1, 1, 1, 6, 6, 6],
"ra_1": [8, 10, 15, 9, 11, 14],
"dec_1": [8, 10, 15, 9, 11, 14],
"jd_0": [1, 1, 1, 1, 1, 1],
"jd_1": [2, 4, 5, 3, 2, 4],
"mag_1": [8, 10, 9, 9, 5, 8],
"fid_1": [2, 1, 2, 2, 1, 1],
"xp": [
np.array([-0.00937999, 0.0090754, 1.0]),
np.array([-0.00241128, 0.00210669, 1.0]),
Expand Down Expand Up @@ -758,14 +755,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [2, 3, 4, 5, 6, 7],
"ra_0": [0, 0, 5, 5, 5, 5],
"dec_0": [0, 0, 5, 5, 5, 5],
"ra_1": [1, 1, 6, 6, 6, 6],
"dec_1": [1, 1, 6, 6, 6, 6],
"jd_0": [0, 0, 0, 0, 0, 0],
"jd_1": [1, 1, 1, 1, 1, 1],
"mag_1": [1, 1, 3, 3, 3, 3],
"fid_1": [2, 2, 1, 1, 1, 1],
"ra_0": [1, 1, 6, 6, 6, 6],
"dec_0": [1, 1, 6, 6, 6, 6],
"ra_1": [8, 9, 10, 11, 8, 9],
"dec_1": [8, 9, 10, 11, 8, 9],
"jd_0": [1, 1, 1, 1, 1, 1],
"jd_1": [2, 3, 4, 5, 2, 3],
"mag_1": [8, 9, 10, 11, 8, 9],
"fid_1": [2, 2, 1, 2, 2, 2],
"xp": [
np.array([-0.00937999, 0.0090754, 1.0]),
np.array([-0.00392633, 0.00362174, 1.0]),
Expand Down Expand Up @@ -1029,14 +1026,14 @@
test_fit = pd.DataFrame(
{
"trajectory_id": [3, 4, 7, 8, 9, 10],
"ra_0": [0, 5, 5, 0, 5, 5],
"dec_0": [0, 5, 5, 0, 5, 5],
"ra_1": [1, 6, 6, 1, 6, 6],
"dec_1": [1, 6, 6, 1, 6, 6],
"jd_0": [0, 0, 0, 0, 0, 0],
"jd_1": [1, 1, 1, 1, 1, 1],
"mag_1": [1, 3, 3, 1, 3, 3],
"fid_1": [2, 1, 1, 2, 1, 1],
"ra_0": [0, 5, 5, 8, 10, 8],
"dec_0": [0, 5, 5, 8, 10, 8],
"ra_1": [1, 6, 6, 9, 11, 11],
"dec_1": [1, 6, 6, 9, 11, 11],
"jd_0": [0, 0, 0, 2, 4, 2],
"jd_1": [1, 1, 1, 3, 5, 5],
"mag_1": [1, 3, 3, 9, 11, 11],
"fid_1": [2, 1, 1, 2, 2, 2],
"xp": [
np.array([-0.00392633, 0.00362174, 1.0]),
np.array([-7.69771796e-04, -2.56030434e-03, 9.92403877e-01]),
Expand Down

0 comments on commit 428705a

Please sign in to comment.