Author Topic: Script to align, integrate and calibrate  (Read 21051 times)

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Script to align, integrate and calibrate
« on: 2010 May 14 11:19:05 »
Hello,

Here is a first version of a script that aligns and integrates already calibrated FITS images, using the naming conventions of lightbucket.com (works fine with images produced with LB0002, as they are already calibrated).

You can add a bunch of files and the script will find the files to align and integrate (using file name pattern). It creates the alignment files in a working directory, then it integrates each channel in a view, and finally combine the channels if they are LRGB or RGB (if only L, it is left alone). The registration will adapt the size of the image to the reference image (selectable, the first L by default), so binned channels can be integrated too.

The convention to follow is to have the input calibrated files ending in one of -Red, -Blue, -Green, -Luminance (the script currently does not do any calibration).
It is recommended to have an empty workspace, as I have limited control on the generated image ids.

The script is somewhat complicated, but it is structured so that I can add other naming conventions, and extend the operations. My goal is to support PI naming (unfortunately the R ending is used for Red and for Registered), add an automatic calibration based on master frames and take more advantage of the fits keywords (some files have an FWMH already calculated, this could help select the best reference image).  The GUI needs some polishing too and maybe some key properties could be made settable by the user. The name of the script may change when it is more general.

Comments welcome.
-- bitli

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Script to align, integrate and calibrate
« Reply #1 on: 2010 May 14 11:57:23 »
Hi

Many thanks for your hard work  ;D

Have had a go and would say

1) Why the restricted file names , would be hard work to rename hundreds of files

2) How can we alter the sigma settings as the default is always used  ???

Please keep at it as It will be very valuable addition  :D


Harry
Harry Page

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Script to align, integrate and calibrate
« Reply #2 on: 2010 May 14 13:11:03 »

1: Why the restricted file names , would be hard work to rename hundreds of files

2> How can we alter the sigma settings as the default is always used  ???

Thanks for the comments

1: Self fishness. I wanted to avoid setting the file type/channel for my usage, and it works fine with my files :). But I may add a capability to add by file type/channel like in DSS, or to select the type/channel. Not sure how to make easy at UI level.

2: I assume you refer to sigma high/low in image integration ? I could add the parameters. I just want to keep the UI simple with possibly a few key parameters, so it is possible to create an image relatively quicky. If needed, a second manual pass is always possible.

I do not know if it is possible show the user interface of a process (instead of executing it), so that the user can tweak a few parameters and then execute. This could be an alternative. I could also stop at the intermediate step so the user could have a look and stop or continue.  However I have limited free time  ;)

-- bitli

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Script to align, integrate and calibrate
« Reply #3 on: 2010 May 14 13:39:47 »
Hi

I did try altering the settings in the intergration tool , but had no effect  ???


Harry
Harry Page

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: Script to align, integrate and calibrate
« Reply #4 on: 2010 May 14 13:47:25 »
Sounds good! I will give it a try shortly.

If your interesting in doing more we could use a script to make masters calibration frames, bias, dark and flats


Max

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Script to align, integrate and calibrate
« Reply #5 on: 2010 May 14 13:59:49 »
Hi,
HArry, for the sigma, can you please check the history of the resulting image? If I change the valeu in the script, the resulting image has the new values. MAybe setting the flags to generate the rejected values images could help finding the problem.

Otherwise yes, I am interested in doing more. If there is a script that generates masters, then it would be easy to use them for calibration in my script. I am not sure how many steps we can automate in practice, as at some point the running time can be quite long.

-- bitli

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Script to align, integrate and calibrate
« Reply #6 on: 2010 May 14 14:15:08 »
Hi

I did check the consol and whatever settings I changed in the process( Intergration ) it just used the default  ???


Harry
Harry Page

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Script to align, integrate and calibrate
« Reply #7 on: 2010 May 14 15:07:43 »
Hi Harry
Processes are objects... once you create a new instance, in this case on the script, it's parameters are initializated with the default values. So, the script should import the settings from the opened process instance by the main application. Don't know how to do this :P I'm not involved on the other side ;)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Script to align, integrate and calibrate
« Reply #8 on: 2010 May 14 17:08:17 »
Quote
Why the restricted file names , would be hard work to rename hundreds of files

Hi Harry,

You want to get a hold of "Sequentialize.exe" from a company called "Polybytes" - it is a free stand-alone (it does NOT get 'installed', it just runs from where you 'store it'). Polybytes no longer seem to have it on their own website, but a Google search does find 3rd party distributors who still have it for distribution.

It is a great little utility - I use it for EVERY session, to get my filename structure they way 'I' want it !!

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Fco. Bosch

  • Member
  • *
  • Posts: 66
Re: Script to align, integrate and calibrate
« Reply #9 on: 2010 May 15 01:29:54 »
Hi bitli! I can't see any link in your post! (with Firefox, nor IE, nor Opera). What is happen? Tanks :surprised:
Fco. Bosch

Offline Fco. Bosch

  • Member
  • *
  • Posts: 66
Re: Script to align, integrate and calibrate
« Reply #10 on: 2010 May 15 01:32:54 »
Forget it!  :surprised: :surprised: Thanks!!
Fco. Bosch

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: Script to align, integrate and calibrate
« Reply #11 on: 2010 May 15 07:10:11 »
Looks Great but I can't use it with this naming convention.

How about using/ matching the fits key word filter.


Max

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • Mike's Astro
Re: Script to align, integrate and calibrate
« Reply #12 on: 2010 May 18 14:01:34 »
How about using/ matching the fits key word filter.

Max

That's my suggestion too and the way I'm planning to do it in the AutoCalibration script that I am working on.  There is information about accessing the fits header info in this post,
http://pixinsight.com/forum/index.php?topic=1904.0

Mike

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Script to align, integrate and calibrate
« Reply #13 on: 2010 May 18 21:15:14 »
Yes, it was my original idea, but I was not able to read FITS keywords before the correction of Juan. I may adapt it later.
Anyhow Light bucket seems to require special processing for calibration due to their non standard FITS files.
-- bitli

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Script to align, integrate and calibrate
« Reply #14 on: 2010 May 19 01:18:34 »
As far as I know you can't download individual calibration files from LB. As you can't have access to the individual bias, dark and flat frames, you can't generate your master calibration frames. In this way you lose control over an extremely important part of the whole process —with high probability the master calibration frames are wrong, IMHO (see Vicent's tutorial). Besides incompatibility problems caused by the use of floating point FITS files, it is too bad that you can't generate your masters with PixInsight's calibration tools.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/