Author Topic: Resample and fits header file  (Read 3253 times)

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Resample and fits header file
« on: 2013 February 13 21:56:36 »
If I resample an image (by 50%), the fits header file remains unchanged, so it will be incorrect with respect to such things as binning and pixel size.I realise I can replace these entries in the fits file with anything I want to, but they have to be changed one-by-one as far as I can tell and if I want to do this for a large number of files, it will be a long, tedious night.
Is there any way to speed up this process.  I couldn't manage to use the image container to even change one entry in multiple files.
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Resample and fits header file
« Reply #1 on: 2013 February 13 23:50:28 »
Hi Geoff,

These FITS header keywords (XBINNING, YBINNING, XPIXSIZE and YPIXSIZE), among others, represent the acquisition conditions, not the current state of the image after geometrical transformations such as resampling, rotation, etc., and hence shouldn't be changed.

Unless all of the images need exactly the same set of keywords, changing FITS header keywords selectively on a group of images requires writing a simple script. As noted, however, you're going to change keywords that should be preserved. What are you trying to do with these images?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Resample and fits header file
« Reply #2 on: 2013 February 14 13:21:49 »
Hi Juan
My reasons are a bit embarrassing. I did some imaging a few days ago and binned the subframes for one of the objects--a faint Abell planetary. For one reason and another I didn't get any binned flats, only unbinned ones. My best idea for a fix was to resample the unbinned flat masters to half their size and use these for the binned subs. This is not a perfect solution of course but was the only one available, since the optical train had been disassembled. The problem came with BPP. The script read the fits files and detected a conflict between the lights ( binned 2 x2) and the fits header of the flats reading 1 x1 binning. I could " fake" it by changing the fits entries in the resampled flats.
Geoff
« Last Edit: 2013 February 14 13:28:05 by Geoff »
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline LMLeitch

  • Newcomer
  • Posts: 15
Changing the binning of a flat
« Reply #3 on: 2013 October 07 10:49:48 »
Hi,
I have read that one should take all flat frames binned 1x1. This means IntegerResampling the R,G, and B flats from binned 1x1 to binned 2x2. I do this without problems in Maxim/CCD-Stack. I have not found a way to do this with Pixinsight. I keep getting an error message like:
** Warning: No flat frames have been selected to calibrate light frames (filter="Blue", binning=2, exposure=300.00s, length=10)
I have down-sampled the flats to binning 2x2, changed the XBINNING and YBINNING to 1, and could not change the NAXIS1 and NAXIS2.

I did search existing messages before posting and did find one that said a script is available. Would somebody point me to it?

Thanks.

Larry Leitch

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Changing the binning of a flat
« Reply #4 on: 2013 October 07 15:14:15 »
Hi,
I have read that one should take all flat frames binned 1x1. This means IntegerResampling the R,G, and B flats from binned 1x1 to binned 2x2. I do this without problems in Maxim/CCD-Stack. I have not found a way to do this with Pixinsight.

Larry Leitch
Hi Larry
You will find conflicting advice on this issue. There are at least three reasons for taking flats:
1. To get rid of dust motes
2. To correct vignetting.
3. To correct pixel to pixel variation in QE.

Unbinned flats applied to a binned image will only correct items 1 and 2.
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/