Skip to content

Add DL3 writer#2979

Open
mdebony wants to merge 7 commits into
cta-observatory:mainfrom
mdebony:dl3_writer
Open

Add DL3 writer#2979
mdebony wants to merge 7 commits into
cta-observatory:mainfrom
mdebony:dl3_writer

Conversation

@mdebony

@mdebony mdebony commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Add a DL3 writer for the GADF format to catapipe.

This PR is sub element of #2727 to simplify the review.

@ctao-sonarqube

ctao-sonarqube Bot commented Apr 9, 2026

Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
1 New issue

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

@mdebony mdebony requested review from kosack and maxnoe April 9, 2026 17:29

@kosack kosack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still working through this, so this is not yet a complete review, but here are a few initial comments

Comment thread src/ctapipe/io/dl3.py Outdated

@pytest.fixture(scope="session")
def dl2_events_for_dl3(single_obs_gamma_diffuse_full_reco_file, dl2_meta_for_dl3):
preprocessor = DL2EventPreprocessor(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you like, I can open a PR to this branch to convert this to use the new EventPreprocessor, which could simplify a lot of the code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3004 where I started to see what changes I need to EventPreprocessor to support the DL2 to DL3 transition

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please feel free to do it.

Comment thread src/ctapipe/io/dl3.py Outdated
__all__ = ["DL3EventsWriter", "DL3GADFEventsWriter"]


class DL3EventsWriter(Component):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main comment here is that I think that the DL3 writer should not store state of the observation.

The inputs to the actual writing function should be the event list, the irfs and additionally needed data, but it should not keep that as state on the writer instance.

It should be possible to write multiple observation blocks using the same instance of the writer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the a data class as suggested and it should address your comments. Let me know.

Comment thread src/ctapipe/io/dl3.py Outdated
@mdebony mdebony requested review from kosack and maxnoe June 5, 2026 11:57
@maxnoe

maxnoe commented Jun 15, 2026

Copy link
Copy Markdown
Member

@mdebony please rebase against the main branch to get the fixes for the CI

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.

3 participants