icecube / skywriter

Upstream Tools for SkyDriver & the Skymap Scanner
MIT License
0 stars 0 forks source link

PyPI GitHub release (latest by date including pre-releases) PyPI - License Lines of code GitHub issues GitHub pull requests

skywriter

Upstream Tools for SkyDriver & the Skymap Scanner.

I3 to JSON converter

The main tool provided by skywriter is the i3_to_json converter function and script. The function reads a (list of) I3 file(s), processes them using the the realtime alert followup code (AlertEventFollowup module) and writes the events out as JSON files.

As SkyMap Scanner is designed to process the SplitUncleanedInIcePulses pulse series, the converter generates it by running the I3TriggerSplitter module on the original DAQ (Q) frame, hence creating one or more new Physics (P) frames (one for each "subevent" in the data). If already present, the SplitUncleanedInIcePulses object is deleted beforehand. In case of multiple subevents, only the subevent-id corresponding matching the original P-frame is processed.

The AlertEventFollowup module expects the Physics I3Frame to have a given set of keys. Such set of keys is currently hardcoded in the converter code. If the keys are present in the original P-frame, the corresponding objects are copied over to the output JSON. If not, they are filled with dummy values. If you plan to use these keys in your own Skymap Scanner reconstruction module make sure they have meaningful values.

Extra I3Particle objects, typically corresponding to reconstruction outputs, can be "extracted" through the --extra option. This means that the equatorial coordinates are calculated and written out in a JSON branch.

GCD

In order to produce lightweight payloads, the AlertEventFollowup code uses the so called "GCD diff" functionality (sometimes called "GCD compress"). The input GCD is compared against a given "base GCD" and only the difference is stored in the JSON-encoded GCD, along with the filename of the base GCD.

Skymap Scanner will look up a matching filename of the base GCD file in a pre-defined set of locations. In principle, it should not matter much which base GCD is used as long as Skymap Scanner can retrieve it. If you use a custom base GCD you should make sure it is made available to Skymap Scanner.

Example usage

Assuming you have set up your environment and loaded an IceTray shell, you can run the converter as (for example):

python skywriter/i3_to_json.py --extra "OnlineL2_SplineMPE" /data/ana/realtime/alert_catalog_v2/input_files/Level2pass2_IC86.2011_data_Run00118435_Subrun00000000_00000144_event58198553.i3

this will use the default base GCD.

Known limitations