Skip to content

Commit

Permalink
fix cli test with new orbital params
Browse files Browse the repository at this point in the history
  • Loading branch information
FusRoman committed Nov 28, 2023
1 parent 22f27c5 commit 3a0b1ad
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
4 changes: 4 additions & 0 deletions bin/fink_fat_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,15 @@ def fink_fat_main(arguments):
# solve orbit in local mode
if arguments["local"]:
t_before = t.time()
prop_epoch = config["SOLVE_ORBIT_PARAMS"]["prop_epoch"]
# return orbit results from local mode
orbit_results = compute_df_orbit_param(
traj_to_orbital,
int(config["SOLVE_ORBIT_PARAMS"]["cpu_count"]),
config["SOLVE_ORBIT_PARAMS"]["ram_dir"],
int(config["SOLVE_ORBIT_PARAMS"]["n_triplets"]),
int(config["SOLVE_ORBIT_PARAMS"]["noise_ntrials"]),
prop_epoch=float(prop_epoch) if prop_epoch != "None" else None,
verbose=int(config["SOLVE_ORBIT_PARAMS"]["orbfit_verbose"])
).drop("provisional designation", axis=1)
orbfit_time = t.time() - t_before
Expand Down Expand Up @@ -1157,13 +1159,15 @@ def fink_fat_main(arguments):

if arguments["local"]:
t_before = t.time()
prop_epoch = config["SOLVE_ORBIT_PARAMS"]["prop_epoch"]
# return orbit results from local mode
orbit_results = compute_df_orbit_param(
traj_to_orbital,
int(config["SOLVE_ORBIT_PARAMS"]["cpu_count"]),
config["SOLVE_ORBIT_PARAMS"]["ram_dir"],
int(config["SOLVE_ORBIT_PARAMS"]["n_triplets"]),
int(config["SOLVE_ORBIT_PARAMS"]["noise_ntrials"]),
prop_epoch=float(prop_epoch) if prop_epoch != "None" else None,
verbose=int(config["SOLVE_ORBIT_PARAMS"]["orbfit_verbose"])
).drop("provisional designation", axis=1)
orbfit_time = t.time() - t_before
Expand Down
Binary file modified fink_fat/test/cli_test/fink_fat_out_test/mpc/old_obs.parquet
Binary file not shown.
Binary file modified fink_fat/test/cli_test/fink_fat_out_test/mpc/orbital.parquet
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions fink_fat/test/cli_test/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use_dbscan=False
store_kd_tree=false

[SOLVE_ORBIT_PARAMS]
n_triplets=15
n_triplets=10
noise_ntrials=10
prop_epoch=2459769.02144
prop_epoch=None
orbfit_verbose=3

orbfit_limit=6
Expand Down
20 changes: 12 additions & 8 deletions fink_fat/test/cli_test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,31 @@

try:
assert_frame_equal(
old_obs.sort_values("candid").round(decimals=5),
old_obs_test.sort_values("candid").round(decimals=5),
old_obs.sort_values("candid").round(decimals=5).reset_index(drop=True),
old_obs_test.sort_values("candid").round(decimals=5).reset_index(drop=True),
check_like=True
)

assert_frame_equal(
trajectory_df.sort_values("trajectory_id").round(decimals=5),
trajectory_df_test.sort_values("trajectory_id").round(decimals=5),
trajectory_df.sort_values("trajectory_id").round(decimals=5).reset_index(drop=True),
trajectory_df_test.sort_values("trajectory_id").round(decimals=5).reset_index(drop=True),
check_like=True
)

assert_frame_equal(
obs_orb_test.sort_values("ssoCandId").round(decimals=5),
obs_orb.sort_values("ssoCandId").round(decimals=5),
obs_orb_test.sort_values("ssoCandId").round(decimals=5).reset_index(drop=True),
obs_orb.sort_values("ssoCandId").round(decimals=5).reset_index(drop=True),
check_like=True
)

assert_frame_equal(
orb_test[["ssoCandId", "ref_epoch", "a", "e", "i"]]
.sort_values("ssoCandId")
.round(decimals=5),
.round(decimals=5).reset_index(drop=True),
orb[["ssoCandId", "ref_epoch", "a", "e", "i"]]
.sort_values("ssoCandId")
.round(decimals=5),
.round(decimals=5).reset_index(drop=True),
check_like=True
)

shutil.rmtree("fink_fat/test/cli_test/fink_fat_out")
Expand Down

0 comments on commit 3a0b1ad

Please sign in to comment.