Author Topic: ImageCalibration+Overscan & Coordinate origin settings  (Read 5815 times)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
ImageCalibration+Overscan & Coordinate origin settings
« on: 2012 October 10 22:59:18 »
Hi,
As I understand, FIT Coordinate origin settings must act only on viewing of a FIT files.
In other words, all processing should be independent of the Coordinate origin settings. I am right?

But, ImageCalibration + Overscan produces different pixels data dependent of the Coordinate origin setting. Impossible to use saved ImageCalibration ProcessIcon. ;)

For me, it's very dangerous, because Overscan calibration going totally wrong.

Best regards,
Nikolay.
   

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #1 on: 2012 October 11 00:44:33 »
Hi Nikolay,

Quote
In other words, all processing should be independent of the Coordinate origin settings. I am right?
Quote
it's very dangerous

You are completely right in both affirmations. Unfortunately, however, this is not how the FITS format works. The coordinate origin settings are not intended to control how a FITS image is represented; they are necessary to tell the application how a FITS file has been generated, so it can be loaded with the correct orientation.

Most professional image acquisition systems generate FITS files with the bottom-to-top, left-to-right orientation. This means that the first row of pixels is stored at the end of the HDU data block in the .fit file.

All amateur equipment generate FITS files with the top-to-bottom, left-to-right orientation. This means that the first row of pixels is stored at the beginning of the HDU data block in the .fit file.

I added the coordinate origin setting to the FITS file format support to let PixInsight adapt to both situations. Most imaging software does not have this flexibility, and only supports the amateur convention, but PixInsight  does.

Since the initial versions of PixInsight, the default FITS orientation has been bottom-to-top, left-to-right, i.e. the professional convention. Although this was a purist's choice, it definitely was a strategic error, since perhaps the 95% of FITS files loaded in PixInsight follow the amateur convention.

So in the next version 1.8 of PixInsight the default FITS orientation is top-to-bottom, left-to-right (amateur). This will remove all practical problems since PI will behave out-of-the-box just as expected by most users. It will cause us a few problems with professional users, but nobody's perfect :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #2 on: 2012 October 11 02:53:20 »
Does that mean that if I generated bias in PI 1.7 and saved them as FITS file (with defaults), I will have to think of their orientation if I use them to calibrate at FITS image loaded (with default) in PI 1.8?
Could there be a HISTORY or some keyword that keep tracks of what was the orientation when the file was loaded?
-- bitli

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #3 on: 2012 October 11 09:19:04 »
I don't expect issues with calibration, registration or integration, those processes don't flip orientations of their input and output .fits files.

But I do flip manually when starting to process an integration. So all of my processed .fits images, and those nested in projects, will load inverted.

Also all of my script generated data visualization .fits will load inverted, with their text labeling upside down.

The easy solution is to switch back to the old default when necessary.

Mike
« Last Edit: 2012 October 11 09:27:05 by mschuster »

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #4 on: 2012 October 11 23:11:49 »
So in the next version 1.8 of PixInsight the default FITS orientation is top-to-bottom, left-to-right (amateur).
Sounds good, but is it possible to add into ImageCalibration module to Overscan section one small checkBox enabled by default:"Coordinate origin sense" and save current Coordinate origin setting to Process.Icon? I mean module must automatically invert(recalculate) Overscan numbers if Icon's setting not equal to PI setting.

Why I ask you and why it' important: Example: I saved ImageCalibration Process Icon with some Overscan settings for my FLI PL16803. Then, I send the Process Icon via email to my friend, which also have FLI PL16803. But, my friend use PixInsight with other Coordinate origin setting(He can not change the settings as uses other cameras simultaneously). Thus, it will get the wrong calibration.

Best regards,
Nikolay.

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #5 on: 2012 October 13 16:56:58 »
Nikolay, maybe I misunderstand, but why is Juan's input and output hints option not sufficient to solve your issue? If your saved process icons have explicitly set both input and output origin hints then they should be portable across differing default origin settings, at least I believe so.

Thanks,
Mike

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #6 on: 2012 October 14 03:43:50 »
Quote
Does that mean that if I generated bias in PI 1.7 and saved them as FITS file (with defaults), I will have to think of their orientation if I use them to calibrate at FITS image loaded (with default) in PI 1.8?

Yes. Probably the easiest and fastest way to deal with this issue is using an ImageContainer to execute two FastRotation instances (rotate 180d, horizontal mirror) as a batch process.

Quote
Could there be a HISTORY or some keyword that keep tracks of what was the orientation when the file was loaded?

Unfortunately, the FITS standard provides no standard (pun intended) way to specify the orientation and coordinate origin of the image. I am strongly against using private FITS keywords to store fundamental image properties, but perhaps we should make an exception in this case. I'll think on that.

FITS was designed when punched cards were cool. And I don't think is has evolved since then, not essentially at least. Nowadays, well, punched cards are not cool anymore...
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #7 on: 2012 October 14 03:48:25 »
Quote
If your saved process icons have explicitly set both input and output origin hints then they should be portable across differing default origin settings

Absolutely correct. And this is one of the main purposes of format hints, precisely.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: ImageCalibration+Overscan & Coordinate origin settings
« Reply #8 on: 2012 October 17 01:11:34 »
If your saved process icons have explicitly set both input and output origin hints then they should be portable across differing default origin settings, at least I believe so.
Mike, Thank you very much!
Format hints work great!