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

Missing FitsImage fixes #62

Closed
tmillenaar opened this issue Aug 6, 2024 · 4 comments · Fixed by #63
Closed

Missing FitsImage fixes #62

tmillenaar opened this issue Aug 6, 2024 · 4 comments · Fixed by #63
Labels

Comments

@tmillenaar
Copy link
Contributor

Hey guys,

I was trying to read fits images using the pyse accessors, but ran into an error while the fits accessor from tkp worked fine. I looked into it and found that the version in pyse is from 7 years ago and is missing some fixes.

The problem I ran into is that I encounter the following line:

freq_eff = header['RESTFRQ']

but don't have 'RESTFRQ' in the header, hence a KeyError is raised.

It looks like this was addressed in the following tkp commit:
transientskp/tkp@ae5aa59

I imagine the simplest way to address this is by cargo-culting fits_image.py from tkp:
https://github.com/transientskp/tkp/blob/8a19cd23c7141c66c1ee8e42295957bbcf809531/tkp/accessors/fitsimage.py

@suvayu Shall I make a PR with the copied fits_image.py or would you prefer to tackle this yourself?

Cheers,
Timo

@tmillenaar tmillenaar added the bug label Aug 6, 2024
@suvayu
Copy link
Collaborator

suvayu commented Aug 6, 2024 via email

@tmillenaar tmillenaar linked a pull request Aug 6, 2024 that will close this issue
@tmillenaar
Copy link
Contributor Author

I'll manually check the other accessors as well

@tmillenaar
Copy link
Contributor Author

I went through the diffs of the files. It looks like most differences were related to

  • IOError vs OSError
  • logger.warn vs logger.warning
  • six metaclass vs buildin metaclass
  • formatting

I tried to stay away form the formatting changes, i.e. leave it as much as-is in pyse at the moment.

MR: #63

@suvayu suvayu closed this as completed in #63 Aug 6, 2024
@suvayu
Copy link
Collaborator

suvayu commented Aug 6, 2024

Thanks, the implementation of these data accessors are a bit over-engineered, e.g. the use of metaclasses. It should be simplified (see: #53).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants