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

Swift event ingestion: Missing localization (session transaction closed) #53

Open
Theodlz opened this issue Jan 24, 2023 · 0 comments
Open

Comments

@Theodlz
Copy link
Collaborator

Theodlz commented Jan 24, 2023

Looks at production, recent SWIFT event's localizations are missing. The GCN Event are being created, but the localization is missing.

  1. Unfortunately (or fortunately!) errors are all caught and we have minimal insight over what could have gone wrong.
    However, looking at the logs, we understand that at some point an error has occurred, and the session wasn't rolled back. Therefore, we get that "the transaction was closed", which means a rollback is needed where the error handling has occurred (try/except), to allow to post the events that come after the one that caused an error to happen.
    Also, it seems that the error that might have caused the initial error is: Failed to consume gcn event: Invalid propotation filter value: could not convert string to float: 'undefined'.

  2. Running SP locally (not Icare, just SP), we get the following error while ingesting some events:

Traceback (most recent call last):
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/services/gcn_service/gcn_service.py", line 81, in <module>
    raise e
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/services/gcn_service/gcn_service.py", line 78, in <module>
    service()
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/services/gcn_service/gcn_service.py", line 73, in service
    raise e
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/services/gcn_service/gcn_service.py", line 69, in service
    post_gcnevent_from_xml(payload, user_id, session)
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/skyportal/handlers/api/gcn.py", line 246, in post_gcnevent_from_xml
    add_tiles_and_properties_and_observation_plans(
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/skyportal/handlers/api/gcn.py", line 1291, in add_tiles_and_properties_and_observation_plans
    raise e
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/skyportal/handlers/api/gcn.py", line 1140, in add_tiles_and_properties_and_observation_plans
    properties_dict, tags_list = get_skymap_properties(localization)
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/skyportal/utils/gcn.py", line 491, in get_skymap_properties
    result = ligo.skymap.postprocess.crossmatch(sky_map, contours=(0.9,), areas=(500,))
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/env/lib/python3.10/site-packages/ligo/skymap/postprocess/crossmatch.py", line 346, in crossmatch
    contour_idxs = np.digitize(contours, prob) - 1
  File "<__array_function__ internals>", line 180, in digitize
  File "/home/theodlz/alright/shift_management_admin_menu/skyportal/env/lib/python3.10/site-packages/numpy/lib/function_base.py", line 5551, in digitize
    raise ValueError("bins must be monotonically increasing or decreasing")
ValueError: bins must be monotonically increasing or decreasing

meaning that the prob variable (passed in digitize as bins) is not motonone. Some values might repeat themselves, or aren't ordered. I am not sure that this should be an issue, but the digitize method from numpy treats it as is.

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

No branches or pull requests

1 participant