Skip to content

Commit

Permalink
Merge pull request #863 from StingraySoftware/add_obsid_info
Browse files Browse the repository at this point in the history
Add obsid info
  • Loading branch information
matteobachetti authored Nov 22, 2024
2 parents b2e6e1a + 9faeebf commit 10cfb78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changes/863.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Read the OBS_ID keyword from the FITS file if present
2 changes: 2 additions & 0 deletions stingray/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ def _initialize_header_events(self, fname, force_hduname=None):
self._add_meta_attr("hduname", hduname)

header = hdulist[hduname].header
if "OBS_ID" in header:
self._add_meta_attr("obsid", header["OBS_ID"])

# self.header has to be a string, for backwards compatibility and... for convenience!
# No need to cope with dicts working badly with Netcdf, for example. The header
Expand Down

0 comments on commit 10cfb78

Please sign in to comment.