monodera / pfs_target_uploader

A web application to validate and upload target lists with pointing simulations for PFS observation
https://pfs-etc.naoj.hawaii.edu/uploader/
MIT License
1 stars 0 forks source link

PPP fails to assign pointings for more than 43 pointings #116

Closed monodera closed 7 months ago

monodera commented 8 months ago

Describe the bug PPP does not return None when I provides only one object with texp=39600s (44 pointings), while it successfully finishes with texp=38700s (43 pointings)

To Reproduce Steps to reproduce the behavior:

  1. Select the attached CSV file.
  2. Click on 'Simulate'

Expected behavior PPP assigns 44 pointing for the object.

log message

print(cR_L_, sub_l, obj_allo_L_fin, uS_L2, cR_M_, sub_m, obj_allo_M_fin, uS_M2)
[I 231029 20:56:11 ppp:917] PPP run finished in 199.9 seconds
[] [] [] [] [] [4] ppc_code group_id ppc_ra ppc_dec ppc_pa ppc_priority tel_fiber_usage_frac allocated_targets ppc_resolution
-------- -------- ------ ------- ------ ------------ -------------------- ----------------- -------------- obj_id   ob_code     ra  dec exptime priority resolution filter_g  flux_g flux_error_g filter_r  flux_r flux_error_r filter_i  flux_i flux_error_i filter_z  flux_z  flux_error_z filter_y  flux_y flux_error_y exptime_PPP local_count       weight      allocate_time
------ ----------- ----- --- ------- -------- ---------- -------- ------- ------------ -------- ------- ------------ -------- ------- ------------ -------- -------- ------------ -------- ------- ------------ ----------- ----------- ----------------- -------------
     0 ob_00000000 150.0 2.0 39600.0        4          M    g_hsc 4856.43       357.16   r2_hsc 1043.53       250.75   i2_hsc 2974.72       244.01    z_hsc 19014.01      2713.29    y_hsc 1366.99       288.39     39600.0           1 33.65113055217853             0

random_example_n00001_p.csv

wanqqq31 commented 7 months ago

I fix the bug for this test sample. But this problem may happen again for other similar samples.

The problem is raised because too many same PPCs are determined for only a few targets. If there is one target at (ra1, dec1) requesting 44 PPCs, all PPCs will initially be at (ra1, dec1). But netflow does not assign fibers to the target in such case (not sure, may be due to cobra movement..?). After a minor local perturbation of 0.x degree for all PPCs, it should assign fibers.

To prevent such error at this stage, PPP now stops if the perturbation repeats for more than 5 times, and no table/figure will be shown.

monodera commented 7 months ago

fixed by de0f786f4c68aeebde4745f15501ca085457b5e8