Author Topic: A modified AberrationSpotter script  (Read 13519 times)

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
A modified AberrationSpotter script
« on: 2012 March 05 16:26:05 »
Hello,

NOTE: this script has been updated later in this thread.

I modified the AberrationSpotter script to generate a nine panel mosaic of the corners, edges and center of the active image window.

I named it AbberationInspector to distinguish it from the original.

I am a newbie, this is my first script. Comments welcome.

I have not figured out how to deploy this in PI's Script menu, however. If anyone has instructions on how to do so this please post.

Thanks,
Mike Schuster

Updated script to version 0.2.

Code deleted - see end of this thread for links to newer versions
« Last Edit: 2012 May 16 16:37:05 by mschuster »

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: A modified AbberationSpotter script
« Reply #1 on: 2012 March 06 09:58:51 »
Attached is a snapshot of the script's dialog and an example mosaic. I added panels for the edges to make a 3 x 3 mosaic. I am diagnosing an image quality problem and need to see the frame's edges in addition to its corners.

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: A modified AbberationSpotter script
« Reply #2 on: 2012 March 06 10:11:00 »
Very nice. An obvious (after the fact) improvement to the AS script. I think yours should replace the one supplied with PI.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: A modified AbberationSpotter script
« Reply #3 on: 2012 March 06 18:35:24 »
Too bad it does not have a PSF function.

Max

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: A modified AbberationSpotter script
« Reply #4 on: 2012 March 11 11:53:33 »
Max, I have thinking about your suggestion. For each panel I have been using the DynamicPSF tool manually: Turn off auto and pick one of the individual functions for consistency, sample a number of stars, sort by A (amplitude) and delete stars with small A, sort by MAD (error) and delete stars with large MAD, select all stars and find average r (aspect ratio) and theta (rotation angle). It would be more robust to find median r and theta but the tool does not show these values.

I suppose this procedure could be scripted using a set of random star sampling positions. One unknown is how to avoid inadvertently sampling non-stellar objects, for example near the core of the cluster in my image there the stars are partially or completely unresolved. There are other tools that do this maybe those procedures could be included.

Thanks,
Mike

Offline marekc

  • PixInsight Addict
  • ***
  • Posts: 177
Re: A modified AbberationSpotter script
« Reply #5 on: 2012 March 11 22:35:44 »
You know, thinking about these last couple of posts, especially Max's suggestion...

This sounds like the beginning of a `great dream' that I'll bet more than one PI user has had: What if PI could auto-measure the PSF in many different parts of the image, and do so for R, G, and B. Then, do some sort of `rubber-sheet'-ing of each color channel, to take out chromatic aberration, coma, and other off-axis aberrations! Then, like magic, we all have apochromatic refractors!

I'm mostly kidding, of course. I doubt there will ever be a real software substitute for a very good optical system. Improvements in optics will, presumably, always be preferable to correcting aberrations with software. Still, it's a cool thing to dream about!

(But I'm still happier to see all this great new documentation get finished first! Documentation w00t!)

- Marek

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: A modified AberrationSpotter script
« Reply #6 on: 2012 March 14 16:11:54 »
Please note: I have aboandoned this script in favor of two new scripts that I will share soon in the PCL/PJSR Development Board.

This script is a first cut at PSF estimation for each panel in the mosaic. See the attached images. The input subexposure it did not repost, it is the same as the second post in this thread. Max gets credit for the idea.

I use StarAlignment's star detector to detect stars to fit, DynamicPSF to do the PSF estimation, and a my own scheme for finding robust and reliable estimates of r (aspect ratio) and theta (position angle) parameters.

These parameters are displayed in a second mosaic.

PSF estimation works only for linear, single channel Grayscale images. I expect it to work reasonably well for both uncalibrated and calibrated subexposures.

To use the script you will want to use a more restrictive Log(sensitivity) setting than normal for star detection purposes. I have found that PSF estimation works better when only brighter stars are used. But you need to have at least 10 stars per panel for a reasonable fit, so don't increase Log(sensitivity) too much.

The implementation is fairly involved, but straightforward. I am new to PJSR so I am sure it can be improved. It is also new so don't be surprised if you encounter bugs. I have tested it only on Windows, for other platforms you will have to at least supply an appropriate font name for the text rendering.

I hope this is useful and inspires some brainstorming.  :). If not, that is OK too as so far it has been a very interesting learning experience for me.

Thanks,
Mike

Edit: Script updated to version 0.4:

What's new:

- Added generate fitted star map option to output a mosaic with fitted stars marked with a small cross.
- Added eccentricity values to the PSF estimate mosaic.
- Changed theta to azimuth in the PSF estimate window.
- Added support for PSF estimates of RGB images.
- Added support for PSF estimates of nonlinear images.
- Bug fixes.

Edit: Script updated to version 0.6:

- Improved PSF estimation.
- Added support for more star detection parameters.
- Bug fixes.

Edit: Script updated to version 0.7:

- Added AvgDev PSF estimates.
- Bug fixes.

Known bugs:
- If no stars are detected in a panel the script will abort with an error dialog. The active window will be a temporary working image that you may close. Adjust the star detection parameters to more permissive values, close the mosaic window and try again.

see end of this thread for links to new versions
« Last Edit: 2012 May 16 16:38:11 by mschuster »

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: A modified AberrationSpotter script
« Reply #7 on: 2012 March 14 16:41:16 »
excellent work!
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline astrospotter

  • Newcomer
  • Posts: 41
Re: A modified AberrationSpotter script
« Reply #8 on: 2012 March 19 01:07:14 »
Truely what the doctor ordered.   This will be a fine tool especially with the angle so it can also be used for diagnostics of the optical system besides focus alone.

Offline Lex

  • PixInsight Guru
  • ****
  • Posts: 555
  • We do it at night...
Re: A modified AberrationSpotter script
« Reply #9 on: 2012 May 11 13:03:06 »
Hi gents;

could somebody please explain me how to integrate the last version my PI?

have I got to copy the code?  ???
Clear Skies!!

Lex

______________________________________

AZEQ6 GT, TS UNC 10" f5, ASI1600mm-c

HADSO (Hagen Deep Sky Observatory)20 km W of Luxemburg City

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: A modified AberrationSpotter script
« Reply #10 on: 2012 May 11 16:33:14 »
Hi Lex!
Just tried it. Copied and pasted the code into Script Editor.
Works very simple and fast.

A great module it runs nicely.

Aloha
Gerald

Offline Lex

  • PixInsight Guru
  • ****
  • Posts: 555
  • We do it at night...
Re: A modified AberrationSpotter script
« Reply #11 on: 2012 May 11 19:15:25 »
Gerald,

Thanks for the info, will try that out!

Best
Clear Skies!!

Lex

______________________________________

AZEQ6 GT, TS UNC 10" f5, ASI1600mm-c

HADSO (Hagen Deep Sky Observatory)20 km W of Luxemburg City

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: A modified AberrationSpotter script
« Reply #12 on: 2012 May 11 19:26:38 »
You can also add downloaded scripts to PI's Script menu using the Script>Feature Scripts... command. Create a folder for your downloaded scripts, click the Add button and choose the folder. Scripts can be added and removed pretty easily using this dialog.

Regarding the script in this thread, I have replaced it with two new scripts posted in the PCL/PJSR forum. One generates the quick mosaic, the other performs the PSF functions and includes many improvements. You can download the current versions from there.

Offline Lex

  • PixInsight Guru
  • ****
  • Posts: 555
  • We do it at night...
Re: A modified AberrationSpotter script
« Reply #13 on: 2012 May 11 19:31:29 »
Hi Mike,

Thanks for that, that's why I asked, I already tried to  take it in with Feature Scripts, but there was only the version 0.1 I think...

Thanks I will download it then and give it a try ASAP  :D
Clear Skies!!

Lex

______________________________________

AZEQ6 GT, TS UNC 10" f5, ASI1600mm-c

HADSO (Hagen Deep Sky Observatory)20 km W of Luxemburg City

Offline cs_pixinsight

  • PixInsight Addict
  • ***
  • Posts: 156
Re: A modified AberrationSpotter script
« Reply #14 on: 2012 May 14 12:37:50 »
You can also add downloaded scripts to PI's Script menu using the Script>Feature Scripts... command. Create a folder for your downloaded scripts, click the Add button and choose the folder. Scripts can be added and removed pretty easily using this dialog.

Regarding the script in this thread, I have replaced it with two new scripts posted in the PCL/PJSR forum. One generates the quick mosaic, the other performs the PSF functions and includes many improvements. You can download the current versions from there.

Mike, just to remove any doubts, are the two scripts your refer to above these?
http://pixinsight.com/forum/index.php?topic=4011.0
http://pixinsight.com/forum/index.php?topic=4010.0

Craig