Author Topic: Image Plate Solve Script  (Read 53012 times)

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Image Plate Solve Script
« Reply #15 on: 2012 March 02 01:57:14 »
I'm using a Mac with stuffit expander - it will not open the PPMX.bin file. Any way to open this on Mac?

You don't have to expand the file. You have to use it as is.

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur
Re: Image Plate Solve Script
« Reply #16 on: 2012 March 02 11:20:31 »
I tested it with an eta Car image. Excellent work Andrés! Really nice.

I was thinking...having a local copy of, for example, the NGC/IC catalog, would be possible to circle objects IDs directly on image? (wishlist  :D )

Best regards,

Enzo.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Image Plate Solve Script
« Reply #17 on: 2012 March 05 07:21:54 »
I have finished the objectives that I wanted for this script. Now it writes the result of the computation on the header of the FITS file. There are two checkboxes in the dialog. The first activates the writing of the keywords FOCALLEN, OBJCTRA, OBJCTDEC, XPIXSZ and YPIXSZ with the new values.
The other checkbox activates the writing of the referentiation of the image using the conventions specified in the papers that can be found at http://fits.gsfc.nasa.gov/fits_wcs.html. The script generates the keywords CTYPEi, CRPIXi, CRVALi and CDi_j that define the world coordinates for the file. It also generates the keywords CDELTi and CROTAi that do the same but using an older and less precise convention.

The keywords should be compatible with Astromety.net and MaximDL with PinpointLE.

The script in its current state is reasonably accurate keeping in mind that it depends on the precision of the rendering and extraction of the stars of the catalog. A PCL module perhaps could bypass this process and use the coordinates of the catalog directly in the matching at StarAlignment.

Also, I have in mind an AnnotateImage script that overlaps a grid on the image and, if possible, the main objects (as Enzo suggested). This however would have to wait a bit.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Image Plate Solve Script
« Reply #18 on: 2012 March 11 18:07:01 »
Hi Andrés,

I have taken the liberty of releasing a new version of your script as an official update for all supported platforms, along with improved versions of the StarGenerator and StarAlignment tools, on which the revised version 1.1 of your script is based. Please read this thread for more information.

Thank you for creating this nice script. It is so good and original that I have felt the necessity to create the required infrastructure for it to work as your idea deserves.

An obvious improvement is to allow for some distortion modelling, i.e. WCS polynomial fits or, much better, computation and storage of 2-D surface spline coefficients, which would be nonstandard but more accurate and stable. This will require further improvements to the StarAlignment tool.

Just for completeness, I'll attach the source code for version 1.1 of your script to this message.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Image Plate Solve Script
« Reply #19 on: 2012 March 12 02:39:02 »
Excellent Juan. The script is now much better.
I have a few improvements in my local repository that I will merge with your version when I finish the annotation script. There are also a few class shared between both scripts that I intend to get to a jsh file.

In the annotation script I am now using online the PPMXL catalog from VizieR. PPMXL has much more stars than PPMX catalog used by StarGenerator (910 million stars instead of 18 million). That would be another good improvement when the script is used with high resolution images.

By the  way, the "need at least 6 stars" bug in StarAlignment affects this script too and now it can no be used.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Image Plate Solve Script
« Reply #20 on: 2012 March 12 03:55:04 »
Thanks Andrés. The SA bug is now fixed in the latest update, which we have just released. I look forward to your annotation script, which is a fantastic initiative.

We are working on USNO's UCAC3 catalog, and the corresponding database file will be available for download shortly (approx. 1.5 GB).  UCAC3 covers the entire sky and has more than 108 stars covering the 8 - 16 magnitude range. We'll complete it with bright stars from UCAC2's supplement or perhaps with a cross reference with PPMX. This catalog will be part of a new mosaic generation tool based on astrometric referencing, which we are designing now and should be available before Summer. The same database will be compatible with StarGenerator.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Image Plate Solve Script
« Reply #21 on: 2012 March 12 07:41:38 »
Hi Juan,

I am not sure that the last version has the "need at least six matched stars" bug completely fixed. One of my test images fails in the last version of StarAlignment. This same photo was solved without problems using last week version of StarAligment. Other photos now need several retries in StarAligment when before only needed one or two retries.

This is the log of StarAlignment:
Code: [Select]
StarAlignment: Processing view: M56_G
C:/Users/andres/AppData/Local/Temp/stars.csv:
Scanning star data: done.
1257 stars.
M56_G:
Structure map: 100%
Detecting stars: 100%
2559 stars found.
Matching stars ...
* Target image: Limiting to 2000 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #2
useScaleDifferences=false
* Target image: Limiting to 2000 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #3
useScaleDifferences=true
* Reference image: Limiting to 1000 brightest stars.
* Target image: Limiting to 1000 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #4
useScaleDifferences=false
* Reference image: Limiting to 1000 brightest stars.
* Target image: Limiting to 1000 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #5
useScaleDifferences=true
* Reference image: Limiting to 500 brightest stars.
* Target image: Limiting to 500 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #6
useScaleDifferences=false
* Reference image: Limiting to 500 brightest stars.
* Target image: Limiting to 500 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #7
useScaleDifferences=true
* Reference image: Limiting to 250 brightest stars.
* Target image: Limiting to 250 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #8
useScaleDifferences=false
* Reference image: Limiting to 250 brightest stars.
* Target image: Limiting to 250 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #9
useScaleDifferences=true
* Reference image: Limiting to 125 brightest stars.
* Target image: Limiting to 125 brightest stars.
11 putative star pair matches.
Performing RANSAC ...
* Previous attempt failed - this is try #10
useScaleDifferences=false
* Reference image: Limiting to 125 brightest stars.
* Target image: Limiting to 125 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #11
useScaleDifferences=true
* Reference image: Limiting to 60 brightest stars.
* Target image: Limiting to 60 brightest stars.
18 putative star pair matches.
Performing RANSAC ...
* Previous attempt failed - this is try #12
useScaleDifferences=false
* Reference image: Limiting to 60 brightest stars.
* Target image: Limiting to 60 brightest stars.
7 putative star pair matches.
Performing RANSAC ...
* Previous attempt failed - this is try #13
useScaleDifferences=true
* Reference image: Limiting to 30 brightest stars.
* Target image: Limiting to 30 brightest stars.
10 putative star pair matches.
Performing RANSAC ...
* Previous attempt failed - this is try #14
useScaleDifferences=false
* Reference image: Limiting to 30 brightest stars.
* Target image: Limiting to 30 brightest stars.
14 putative star pair matches.
Performing RANSAC ...
* Previous attempt failed - this is try #15
useScaleDifferences=true
* Reference image: Limiting to 15 brightest stars.
* Target image: Limiting to 15 brightest stars.
*** 0 star pair matches found - need at least six matched stars.
* Previous attempt failed - this is try #16
useScaleDifferences=false
* Reference image: Limiting to 15 brightest stars.
* Target image: Limiting to 15 brightest stars.
7 putative star pair matches.
Performing RANSAC ...
*** Error: Unable to find an initial set of putative star pair matches
<* failed *>

I have uploaded the image to WeTransfer:
http://wtrns.fr/l6-k7iio1LO2cno

The OS is Win7 x64 with PixInsight 1.7.5.779 and all the updates.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Image Plate Solve Script
« Reply #22 on: 2012 March 12 08:49:50 »
Yes, that bug is 100% fixed and has nothing to do with this script.

I guess the problem may be due to a change I made in line 961 of ImageSolver.js:

      align.matcherTolerance = 0.01; //0.0030;

I set the matcherTolerance parameter to 0.01, instead of its default value of 0.003. This parameter is not accessible from StarAlignment's GUI. It controls the maximum difference in triangle similarity tolerated by the star matching algorithm. A higher value makes the algorithm more tolerant of distortion, although less robust too, which may be causing these problems. This value worked very well with all of the images I used to test the script.

For some reason I can't download your file (wetransfer begins downloading but then it stops forever), but you can try setting this parameter back to 0.003, and if this fixes the problem, then I can publish a new update with the modified script. Please let me know.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Image Plate Solve Script
« Reply #23 on: 2012 March 12 09:10:06 »
Ok Juan. It was the matcherTolerance parameter. After commenting this line the script solves the image again.

The modifications that you added to StarGenerator and StarAlignment increase the accuracy so much that now the script can be modified so that it doesn't stop until the delta between two steps is less that 0.1 arcseconds instead of one. The previous version didn't converge reliably under 0.5-1" so I had to set the limit at 1". Now this limit can be reduced to 0.1".

The attached screen capture shows the accuracy of the coordinates. It has been generated with the Annotation script using the catalogs NGC, TYCHO-2 and USNO-B1 (mag<15).

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Image Plate Solve Script
« Reply #24 on: 2012 March 12 13:09:57 »
 I had the same problem, commenting the line also allowed it to solve the image.
A great script indeed.
-- bitli

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Image Plate Solve Script
« Reply #25 on: 2012 March 12 15:10:21 »
Also works better for me with the original line. Image was 85mm wide field.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Image Plate Solve Script
« Reply #26 on: 2012 March 14 15:40:41 »
Hi

I can not get this to work with a few of my images that I have tried , got any tips to improve things

Harry
Harry Page

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Image Plate Solve Script
« Reply #27 on: 2012 March 14 16:30:36 »
Hi Harry,

if you still have not commented the line "align.matcherTolerance = 0.01;" you could comment it and try again. The version of this script that I posted in the Annotation script thread has already this fixed:
http://pixinsight.com/forum/index.php?topic=3966.msg27562#msg27562

I have tested this script using images with focal between 500 and 3000mm. Probably it should work with 300 mm focals, but I don't think that it can work with focals much shorter than that. The distortions are too large.

The script is based on the ability of StarAlignment to match the reference star field with the image. The better the starting coordinates more possibilities of achieving a good match. It is also very important to choose an initial resolution or focal near the real value. If you don't know the exact resolution usually I have had better results using a lower value.

It can also help changing the magnitude filter so the number of stars is similar to the image.

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Image Plate Solve Script
« Reply #28 on: 2012 March 15 00:11:35 »
Hi


Will give that a go

Many thanks

Harry
Harry Page

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Image Plate Solve Script
« Reply #29 on: 2012 March 15 12:26:47 »
Hi

Still can not make this work  :yell:

Any other ideas  :-*

Harry
Harry Page