GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
227 stars 107 forks source link

Test an equivalent to a simple version of fpack/funpack using galsim.fits functions. #1091

Closed rmjarvis closed 4 years ago

rmjarvis commented 4 years ago

I was having trouble getting fpack to work on a system, and I realized that GalSim already did what I needed using readMulti and writeMulti.

Except that it didn't quite work correctly. I discovered that writeMulti didn't properly write the header information when there were non-trivial headers on the images, so the round trip lost the header values I needed from the original files.

So this PR fixes that, and also adds a note about how to effect at least a very simple version of fpack and funpack with galsim, and tests these operations that they preserve at least most of the header values. (Some get changed by astropy's verify operations, so I skip those.)

rmjarvis commented 4 years ago

This isn't a particularly sexy PR, so I'm fine if no one wants to review it. But in the interest of not letting it sit here forever, I'll plan to merge this by end of week unless someone objects.