PixInsight Forum (historical)

PixInsight => Bug Reports => Topic started by: johnpane on 2016 January 05 20:04:23

Title: Losing Keywords in SubframeSelector
Post by: johnpane on 2016 January 05 20:04:23
Hi,

I am having difficulty with SubframeSelector.

I used BatchDebayer on a series of CR2 files from a Canon 7D Mark II camera. The resulting files have a series of FITS keywords, including DATE-OBS.

When I load them into SubframeSelector, the Date-Time column is empty. Accepted files, written by SubframeSelector with the Copy operation, lack all of the keywords, including DATE-OBS.

Screen shots attached. I am running 1.8.4.1195 and just checked for updates -- none.

Probably I am doing something wrong but I cannot figure it out.

Thanks,
John
Title: Re: Losing Keywords in SubframeSelector
Post by: mschuster on 2016 January 05 20:52:49
Hi John,

The copy should have the same extension. Your example the extensions mismatch and also the _a file has an earlier modification time.

I double checked that keywords are copied properly on Mac OS X 1195, for both .xisf and .fit inputs.

Maybe you could double check the keywords in your inputs, and rerun the script placing the copies in a different directory to avoid possible confusion?

Thanks,
Mike

Title: Re: Losing Keywords in SubframeSelector
Post by: johnpane on 2016 January 06 00:16:49
Thank you Mike. I reproduced the exact problem again, being careful not to confuse file. BatchDebayer produced an .xisf file with the correct keywords and SubframeSelector produced a .fit file without the keywords. I do not see a setting in SubframeSelector to choose the output file type. (Note, the timestamp differences were because I took the screen shots at different points in my diagnostic process.)

Apparently this was a preferences corruption problem. This was also evident in the tiny top pane of the File Explorer. I reset my preferences and now SubframeSelector produces an .xisf file and the keywords are preserved.

Thank you again for your time.

John
Title: Re: Losing Keywords in SubframeSelector
Post by: johnpane on 2016 January 06 01:04:12
I spoke too soon. After that test, I reran SubframeSelector again, without changing any parameters except the output weight keyword and SubframeSelector generated debayer_a.fit files that did not preserve the FITS keywords!

The bug occurs iff you have a weight keyword!
Title: Re: Losing Keywords in SubframeSelector
Post by: johnpane on 2016 January 06 04:55:14
I see the problem in SubframeSelector.js.

Starting at line 1944 is a section of code for writing files if the weightKeyword is not specified.
Starting at line 1998 is a different section of code for if the weightKeyword is present. This on line 2000 seems to be clue why a .fit file is created even if the source image was an .xisf file:
            makeApprovedSubframeFilePath(filePath, ".fit") :

Also, in SubframeSelectorReadWriteImage, line 341 seems to force .fit file format.

As for why the existing keywords don't make it into the output file. Maybe the try section of SubframeSelectorReadWriteImage starting at line 324. It seems to only read the keywords if the input file has the .fit extension.

I haven't explored why the DATE-OBS data doesn't make it into SubframeSelector's table.

Based on the above, a workaround might be for me to specify that BatchDebayer should output .fit files instead of .xisf files. I haven't tested that yet.

John
Title: Re: Losing Keywords in SubframeSelector
Post by: johnpane on 2016 January 06 05:41:06
I can now confirm that converting the debayered files to .fit format results in:
a) Date/Time now appears in SubframeSelector table
b) Keywords are preserved in the output file, even when there is a weight keyword included.

John
Title: Re: Losing Keywords in SubframeSelector
Post by: mschuster on 2016 January 06 06:41:55
Hi John,

Sorry for the trouble and thank you for the diagnosis. I will work on fixes.

Regards,
Mike
Title: Re: Losing Keywords in SubframeSelector
Post by: Greg Schwimer on 2016 January 14 21:46:55
+1 on this. SFS was not adding the weight keywords in .xisf files. My last batch was all .fits and it seemed to just work.
Title: Re: Losing Keywords in SubframeSelector
Post by: Sebastiano on 2016 September 12 16:51:25
I confirm that: SubframeSelector can't add the right Weight value in xisf headers.
Title: Re: Losing Keywords in SubframeSelector
Post by: jerryyyyy on 2019 June 29 21:57:56
Has this ever been fixed?  Seem to be having this problem in 2019. 
Title: Re: Losing Keywords in SubframeSelector
Post by: Juan Conejero on 2019 June 29 23:33:40
Please note that this thread is from 2016 and refers to the SubframeSelector script, when the SubframeSelector tool didn't yet exist. This problem has not been reported elsewhere so I think it was fixed with an update to the script long time ago. Are you using the script or the process?
Title: Re: Losing Keywords in SubframeSelector
Post by: jerryyyyy on 2019 June 30 07:31:47
Yes, I recall this now... was using the script.  Thanks... into some heavy duty processing so pulling out all the tricks.