Skip to content

DL3 Event List with EventPreprocessor#3004

Draft
kosack wants to merge 2 commits into
mainfrom
feature/dl3_eventlist_with_processor
Draft

DL3 Event List with EventPreprocessor#3004
kosack wants to merge 2 commits into
mainfrom
feature/dl3_eventlist_with_processor

Conversation

@kosack
Copy link
Copy Markdown
Member

@kosack kosack commented May 18, 2026

This adds a FeatureSet to the EventPreprocessor for transforming DL2 to DL3 observed events. This is a work-in-progress to see what is needed to replace some of what is in #2979

To support coordinate transforms, I added a altaz_to_icrs helper function, and allow arbitrary objects to be passed into the FeatureGenerator (in this case the observatory location).

TODO:

  • use correct GADF column names
  • add metadata to table

Example:

preprocess = EventPreprocessor(feature_set="dl2_to_dl3")

with TableLoader(test_dl2, dl2=True, pointing=True, observation_info=True) as loader:
      processed = []
      for chunk in tqdm(
          loader.read_subarray_events_chunked(chunk_size=10_000, stop=100_000)
      ):
          processed.append(
              preprocess(chunk.data, LOCATION=loader.subarray.reference_location)
          )
processed = QTable(vstack(processed))
EVENT_ID TIME RA DEC ENERGY ALT AZ FOV_LON FOV_LAT GAMMANESS
deg deg TeV deg deg deg deg  
3611 0.0 36.39662350967956 13.181637086091095 0.7886559320362269 73.47979669912594 191.68312922045783 3.308260464769828 3.7976173873254258 0.635594432581715
7815 0.0 41.497736016190096 11.13345829907106 0.1201553049782346 71.70613976698166 174.58745551052763 -1.6974919647423072 1.7815269359464097 0.5352792594560092
10605 0.0 nan nan nan nan nan nan nan nan
10607 0.0 44.119883677161845 9.231156218646664 4.5139644334844435 69.48510550212504 167.61302288026295 -4.311362381591428 -0.07564972460559523 0.855976625014405
22312 0.0 nan nan nan nan nan nan nan nan
36609 0.0 nan nan nan nan nan nan nan nan
36611 0.0 39.32701254373573 6.380309010565509 0.1071564794967893 67.0024948143038 181.01639543139208 0.3976198153673294 -2.994190390275193 0.844323214214656
42217 0.0 39.758252574150056 13.182609322182753 0.9676237982439976 73.8115075459884 180.0999841805689 0.02793579401849974 3.8115311089855477 0.8351008610837526
101604 0.0 35.49254214507106 7.759876584987491 0.8787181468947538 67.98702098851416 191.28771591764462 4.208977246630804 -1.622427043094159 0.8820927737812743
... ... ... ... ... ... ... ... ... ...
752600 0.0 42.10742472015945 11.599367854919294 0.41113608299100585 72.1158017345081 172.53367176818304 -2.288765887411892 2.2560905763764167 0.8814234287985462
752601 0.0 41.98723511795694 11.637984282652196 0.35472578628359946 72.16646055132047 172.9023774705431 -2.1703681338113268 2.2929095016497767 0.7525534351333694
799915 0.0 37.809847621855184 7.47057923538318 0.7347241179828652 68.00797207094908 185.10600332313112 1.9109700122261497 -1.9119729025655396 0.5581226046512989
814810 0.0 39.68103797197321 15.548286472017384 0.11767882880254765 76.17601379325806 180.5141171245

@kosack kosack mentioned this pull request May 18, 2026
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

Successfully merging this pull request may close these issues.

1 participant