Apologies for the noise; the perils of sending an email from a long, technical meeting -Doug<div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 10, 2016, 11:42 Doug Burke <<a href="mailto:dburke.gw@gmail.com">dburke.gw@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div>Grigoris,</div><div><br></div><div>If you change 'dt = dt * 1000' to 'dt *= 1000' do you get what you expect?</div></div><div dir="ltr"><div><br></div><div>Doug</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 10, 2016 at 11:30 AM Grigoris Maravelias <<a href="mailto:gr.maravelias@gmail.com" target="_blank">gr.maravelias@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
I have a problem with a rather simple process, but I cannot understand<br>
what I am doing wrong. I have an image in a fits file that i want to<br>
open and process its data values, and save it as another file (including<br>
some extra information on the header for what I did). So according to<br>
the astropy docs [1] I did the following:<br>
<br>
hdulist = fits.open('small.fits')<br>
hdu = hdulist[0]<br>
hd = hdu.header<br>
dt = hdu.data<br>
<br>
hd.append(('HISTORY', 'blabla '), bottom=True)<br>
<br>
print dt            # check data before<br>
dt = dt*1000<br>
print dt            # and after<br>
<br>
hdulist.writeto('small_mod.fits')<br>
<br>
If I print dt before and after their modification (multiplied by 1000) I<br>
can see that they are indeed different (properly multiplied), but when I<br>
save the fits file I just see the original data values (however, the<br>
HISTORY line is added properly in the primary header).<br>
<br>
What am I missing here?<br>
<br>
Best<br>
Grigoris<br>
<br>
<br>
[1] <a href="http://docs.astropy.org/en/stable/io/fits/usage/headers.html" rel="noreferrer" target="_blank">http://docs.astropy.org/en/stable/io/fits/usage/headers.html</a><br>
<br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/astropy</a><br>
</blockquote></div></blockquote></div></div>