Document.Calibrate question

Discussion in 'Scripting and Programming' started by CraigNZ, Dec 16, 2019.

  1. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    I have successfully calibrated a science image using a previously created (and saved) Master Dark and Master Flat. But there seems to be a discrepancy between the FITS header and the file size.

    Original image FITS header:
    BITPIX = 16 / number of bits per data pixel
    File size is 12,288 KB (raw 16 bit camera image)

    Master Dark:
    BITPIX = -32 /8 unsigned int, 16 & 32 int, -32 & -64 real
    File size is 24,568 KB (was saved as a 32 bit image)

    Master Flat:
    BITPIX = -32 /8 unsigned int, 16 & 32 int, -32 & -64 real
    File size is 24,568 KB (was saved as a 32 bit image)

    Calibrated science image:
    BITPIX = 16 / number of bits per data pixel
    File size is 24,570 KB (saved as a 32 bit image)

    The Master images were saved using 32 bit floating point. That would explain the doubling in size of the master from the 16 bit raw images.

    The calibrated science image was also saved the same as the masters and it did indeed double the size of the image from the original. But the FITS header BITPIX shows the image is a 16 bit integer .. which does not match the file size.

    The image seems to load okay in MaximDL but not sure why that is.

    Craig
     
  2. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,956
    I can't reproduce that. Are you sure you're saving as 16-bit?
     
  3. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    I used the same parameters as I did for the master files so I would think it would be the same. Also, if I did save as 16 bit shouldn't the file size be 12 MB instead of 24 MB like the two masters? If you want I can send you the file to look at.

    Craig
     
  4. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    I viewed the image in Mira Pro and it shows a -32 for BITPIX in the image header. That would be consistent with what I tried to save and the file size.
    When I look at the pixels in both Mira Pro and Maxim DL, they both show decimal values. This agrees with Mira Pro, a 16 bit pixel shows no decimal values.
    But when I select FITS Header in the View menu item in Maxim DL it shows 16 bit value for BITPIX. So I think everything is okay except the FITS header display in MaximDL is showing the wrong value for BITPIX.

    Craig
     
  5. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,956
    Some of the information isn't updated until you write the file to disk. BITPIX is one of those things. Try saving it and then closing it and reopening it.
     
  6. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    This is the saved file, that is how I was able to view it in other programs to determine if it was indeed a 16 bit or 32 bit image.
     
  7. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,956
    I can't reproduce what you are reporting. MaxIm DL displays BITPIX = -32 for floating point files.
     
  8. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    I have uploaded the image to my private FTP server. Use same login details as lat time.
    Let me know what you see on your end.
     
  9. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,956
    Okay that's weird. You're right, MaxIm DL is showing BITPIX = 16 in the FITS header, but it is definitely a floating point image - it shows fractional ADU pixel values throughout.

    Also inspecting the header manually ("type filename.fit | more") I can see BITPIX = -32 in the header.

    So MaxIm DL is displaying that incorrectly for some reason. It's not a big deal because everything else is correct, and that value is only used during file read.
     
  10. CraigNZ

    CraigNZ Cyanogen Customer

    Joined:
    Dec 29, 2014
    Messages:
    86
    Location:
    Ngutunui, New Zealand
    Great that you see the same thing I am. Since the actual BITPIX value in the header is good I will proceed on then. Did not want to calibrate a lot of images and find I had to do it all over again.

    Craig
     

Share This Page