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

maintain the FITS dtype in read_map #554

Merged
merged 2 commits into from
May 23, 2019

Conversation

zonca
Copy link
Member

@zonca zonca commented May 22, 2019

read_map forces input to a specific dtype, by default double.
Now if dtype is None, it maintains the original dtype.

read_map forces input to a specific dtype, by default double.
Now if dtype is None, it maintains the original dtype.
@zonca zonca requested a review from DanielLenz May 22, 2019 20:54
@zonca zonca self-assigned this May 22, 2019
Copy link
Contributor

@DanielLenz DanielLenz left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @zonca , I just had two minor comments.

@@ -397,15 +398,21 @@ def read_map(

for ff, curr_dtype in zip(field, dtype):
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the try/except statement statement still necessary? Perhaps we can simply call hdu.verify("fix"), and then proceed to read?

On a related note, it would also be good to gradually move away from print statements and use the logging module or (even better suited for users) warnings.warn().

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to use the try/except, not sure how expensive is the verification step.

yes, definitely that would be great to remove all the prints, probably warnings is enough for our purposes

healpy/fitsfunc.py Outdated Show resolved Hide resolved
@zonca zonca force-pushed the maintain_dtype_read_map branch from cd7dc11 to 3c368a0 Compare May 23, 2019 19:49
@DanielLenz
Copy link
Contributor

Thanks, feel free to merge after travis has run!

@zonca zonca merged commit 1fc6493 into healpy:master May 23, 2019
@zonca zonca deleted the maintain_dtype_read_map branch May 23, 2019 19:57
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.

2 participants