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

split_ima() output files have wrong data type and EXTVER, also lack distortion info #33

Open
Vb2341 opened this issue Jan 31, 2019 · 0 comments
Assignees
Labels

Comments

@Vb2341
Copy link

Vb2341 commented Jan 31, 2019

hdu1 = fits.ImageHDU(data = science_data[5:-5,5:-5], header = self.ima_file['SCI',NSAMP-j-1].header, name='SCI')

Because numpy's default dtype for arrays is float64 the precision of the SCI, ERR, and TIME arrays get stored with twice the precision they start with in the IMA. This isn't a huge deal overall, but it increases file size by a good chunk (I think ~60%) and for some reason, causes TweakReg to crash when attempting to find sources. Putting a .astype(np.float32) on the end of the data = science_data[5:-5,5:-5] and similar for the other two arrays should fix this.

The diff output files also have the EXTVER keyword set to whatever it was in the IMA for that extension. This also causes crashes in drizzlepac tools, as they can't find extension 'SCI', 1 as the EXTVER for all but one of the diff files is set to something >1. Manually setting the EXTVER to 1 fixes the crash.

Lastly, the diff files do not carry the distortion information in the headers of the SCI hdus. This causes a crash when attempting to align/drizzle the files. Running updatewcs() fixes that.

If, in practice drizzlepac, tools aren't going to be used for these reductions then most of this issue may not matter, but with these changes the files behave well with Drizzle.

@Vb2341 Vb2341 added the bug label Jan 31, 2019
@Vb2341 Vb2341 changed the title split_ima() output files have wrong data type and EXTVER, also lack distortion info split_ima() output files have wrong data type and EXTVER, also lack distortion info Jan 31, 2019
@catherine-martlin catherine-martlin self-assigned this Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants