[AstroPy] question on saving fits files
dburke.gw at gmail.com
Wed Feb 10 12:37:18 EST 2016
Apologies for the noise; the perils of sending an email from a long,
technical meeting -Doug
On Wed, Feb 10, 2016, 11:42 Doug Burke <dburke.gw at gmail.com> wrote:
> If you change 'dt = dt * 1000' to 'dt *= 1000' do you get what you expect?
> On Wed, Feb 10, 2016 at 11:30 AM Grigoris Maravelias <
> gr.maravelias at gmail.com> wrote:
>> I have a problem with a rather simple process, but I cannot understand
>> what I am doing wrong. I have an image in a fits file that i want to
>> open and process its data values, and save it as another file (including
>> some extra information on the header for what I did). So according to
>> the astropy docs  I did the following:
>> hdulist = fits.open('small.fits')
>> hdu = hdulist
>> hd = hdu.header
>> dt = hdu.data
>> hd.append(('HISTORY', 'blabla '), bottom=True)
>> print dt # check data before
>> dt = dt*1000
>> print dt # and after
>> If I print dt before and after their modification (multiplied by 1000) I
>> can see that they are indeed different (properly multiplied), but when I
>> save the fits file I just see the original data values (however, the
>> HISTORY line is added properly in the primary header).
>> What am I missing here?
>>  http://docs.astropy.org/en/stable/io/fits/usage/headers.html
>> AstroPy mailing list
>> AstroPy at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the AstroPy