Author Topic: FITS Header Flats  (Read 3525 times)

Offline Warhen

  • PTeam Member
  • PixInsight Old Hand
  • ****
  • Posts: 490
    • Billions and Billions
FITS Header Flats
« on: 2014 October 07 07:39:16 »
Not sure that I'd go as far as 'bug', perhaps s/b on 'wish list'. When integrating flat frames, the FITS header doesn't contain image type or filter info and BatchPreprocessing can't recognize master flats for what they are, nor the filter they correspond to w/o editing the header. In my case w/ a rotator, PIERSIDE E/W is important too, also gone after integration to the flat master. It w/b great if we could write the info to the header (type/filter at least) permanently, directly from BPP's 'Add Custom Frames'. Thanks!
« Last Edit: 2014 October 07 18:19:08 by Warhen »
Best always, Warren

Warren A. Keller
www.ip4ap.com

Offline Warhen

  • PTeam Member
  • PixInsight Old Hand
  • ****
  • Posts: 490
    • Billions and Billions
Re: FITS Header Flats
« Reply #1 on: 2015 January 20 06:30:13 »
Juan, I know you are busy! I do think this is significant. Masters should at least retain file type, filter, temp, exp. time, pier side, etc. Thanks for looking at this.
Best always, Warren

Warren A. Keller
www.ip4ap.com

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: FITS Header Flats
« Reply #2 on: 2015 January 20 07:09:51 »
Warren,
From the top of my head, I think that if you put 'flat' in the file name, BPP will infer the type from the file name if it does not find a FITS keyword.  I have no access to PI right here, but there is the following code in the PJSR engine:

if ( imageType == ImageType.UNKNOWN )
   {
      // If the image type still unknown, try to infer it from the file name.
      var fileName = File.extractName( filePath ).toLowerCase();
      if ( fileName.has( "bias" ) )
         imageType = ImageType.BIAS;
      else if ( fileName.has( "dark" ) )
         imageType = ImageType.DARK;
      else if ( fileName.has( "flat" ) )
         imageType = ImageType.FLAT;
      else if ( fileName.has( "light" ) )
         imageType = ImageType.LIGHT;
      else
      {
         this.diagnosticMessages.push( "Unable to determine frame type: " + filePath );
         return false;
      }
   }


Maybe this can help you, but this does not solve the problem of pier side, temperature and so on and other incompatibilities between common image sources and PI.

I am toying since some time with the idea of writing a script that can convert common FITS files to the PI desired specific format, maybe flipping over flipped image, converting range and maybe adding keyword by type.  I have some code, but not ready for prime time before a few weeks (PI relativistic weeks!).
-- bitli


Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 988
    • http://www.astrofoto.es/
Re: FITS Header Flats
« Reply #3 on: 2015 January 26 10:08:55 »
Hi Warren,

Actually the master flat frames generated by BPP store the image type and filter keywords. I think storing keywords like pier side or rotation angle could be a problem if these parameters change. I don't know the source code in BPP, but maybe rotation angle or pier side can be added as additional classifying feature, but I suspect it shoudn't be easy if it implies rewriting the structure of the script. One solution would be to store the pier side and rotation angle keywords of the first flat frame of each filter...

On the other hand, you have the FITSFileManager script that can rewrite for you the file names of your flat frames according to these keywords. It can even generate a directory tree to classify each frame according to these parameters.


Best regards,
Vicent.