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

Pass events.time_ref to observation.pointing.to_fits_headerin observation.write #5257

Merged
merged 4 commits into from May 16, 2024

Conversation

MRegeard
Copy link
Member

@MRegeard MRegeard commented May 8, 2024

This PR fix #5256.

I pass the time reference of the eventlist to pointing.to_fits_header in observation.write so that the MJDREFF and MJDREFI written in the header of the eventlist is not set to 0 but to the good value.

@MRegeard MRegeard added bug backport-v1.2.x on-merge: backport to v1.2.x labels May 8, 2024
@MRegeard MRegeard added this to To do in gammapy.data via automation May 8, 2024
@MRegeard MRegeard modified the milestones: 1.3, 1.0.3 May 8, 2024
@MRegeard MRegeard requested review from maxnoe and adonath May 8, 2024 14:32
@MRegeard
Copy link
Member Author

MRegeard commented May 8, 2024

I think it also need a backport in 1.1.x .

Copy link
Contributor

@registerrier registerrier left a comment

Choose a reason for hiding this comment

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

Thanks @MRegeard . This looks good. Is the bug affecting v1.0.2? Does this need backporting to v1.0.x too?

v1.1.x is no longer maintained. No backport there.

@MRegeard
Copy link
Member Author

MRegeard commented May 9, 2024

@registerrier, Looking at the code in v1.0.x, I don't think it affect it because pointing is not used:

events = self.events
if events is not None:
hdul.append(events.to_table_hdu(format=format))

Copy link
Member

@bkhelifi bkhelifi left a comment

Choose a reason for hiding this comment

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

Thanks a lot @MRegeard

@QRemy QRemy merged commit ef80a46 into gammapy:main May 16, 2024
14 of 15 checks passed
gammapy.data automation moved this from To do to Done May 16, 2024
meeseeksmachine pushed a commit to meeseeksmachine/gammapy that referenced this pull request May 16, 2024
…ting.to_fits_header`in `observation.write`
registerrier added a commit that referenced this pull request May 16, 2024
…7-on-v1.2.x

Backport PR #5257 on branch v1.2.x (Pass `events.time_ref` to `observation.pointing.to_fits_header`in `observation.write`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v1.2.x on-merge: backport to v1.2.x bug
Projects
gammapy.data
  
Done
Development

Successfully merging this pull request may close these issues.

Writing EventList with Observation.write set MJDREFI and MJDREFF to 0
4 participants