PixInsight Forum (historical)
Software Development => New Scripts and Modules => Topic started by: Andres.Pozo on 2012 February 28 06:04:14
-
Some time ago I a had an idea for implementing a plate solving algorithm using Pixinsight. The idea is quite simple: using StarGenerator we generate a reference image with known coordinates. Then with StarAlignment we align the image which we want to solve against the reference image.
For generating the reference image we need to estimate the coordinates of the center of the image. The coordinates don't need to be very precise, but they must be inside the image. Also, for estimating the resolution of the image the user has to set the focal length and pixel size of the camera. Again, this parameters don't need to be very precise, but they should be within a factor of two of the real values. The algorithm iterates using the results of the last step as inputs of the following step.
The initial values can be initialized from the keywords OBJCTRA, OBJCTDEC, FOCALLEN, XPIXSZ, YPIXSZ and DATE_OBS if present in the image.
The result of the algorithm is like this:
Image plate-solve v0.1:
------------------------
Referentiation Matrix (Coords[RA,Dec] = Matrix * Coords[x,y]):
[ -0.0002884164925960009 -0.0000058272042116800396 315.2354073119532
0.0000056731204796174085 -0.0002884526396079686 43.887194882104225
0 0 1]
Resolution X: 1.0385 arcsec/pix
Resolution Y: 1.0386 arcsec/pix
Resolution: 1.0386 arcsec/pix
Rotation: -1.138191 deg
Focal: 1469.67 mm
Image center:
RA: +20 59 46.066
Dec: +43 36 26.229
Image bounds:
TopLeft: RA: +21 00 56.498 Dec: +43 53 13.902
TopRight: RA: +20 58 38.404 Dec: +43 53 54.646
BottomLeft: RA: +21 00 53.729 Dec: +43 18 57.811
BottomRight: RA: +20 58 35.635 Dec: +43 19 38.556
I have been trying to analyze the precision of the results, but I can only compare with astrometry.net. I don't know the precision of astrometry.net, but my script is usually at 1 or 2 arcseconds of it. Also, I have only tried with my images taken with a 8" SCT with resolutions between 0.6" and 1.2" and LRGB and narrowband filters. It would be very helpful if somebody could test the script using images of different resolutions and signal levels and also compare the results with other programs (PinPoint?).
The precision of the algorithm depends on the precision of the PixInsight's star database and of the precision of StarAlignment.
There is still work to do:
- The dialog should let to set the resolution of the image choosing between focal & pixelsize or arcsec/px.
- There should be a checkbox for activating the writing of the WCS keywords in the image (http://fits.gsfc.nasa.gov/fits_wcs.html).
I hope that this script is useful for someone.
Edited for removing an obsolete version of the script. Please, use the last version.
-
This is really cool 8). Thought about doing something like this myself, but never came around to it!
Remark about astrometry.net/BlindSolver: The special thing about this is that it does not necessarily need hints about scale and region. Solves are usually ok, but if you want sub-arc-second accuracy, you need a more accurate plate solver as a second stage. Also, occasionally, astrometry.net gets things very wrong.
Georg
-
I have a question for Juan: ¿In the matrix returned by StarAlign what coordinate convention is used? ¿What coordinates in pixels has the center of the top-left pixel of the image? ¿(0,0)? ¿0.5,0.5)? ¿(1,1)?
-
(0.5,0.5)
-
Thanks Carlos. That is what I assumed when I wrote the script.
I have been reading about FITS WCS and it uses (1,1) for the first pixel. Section 2.1.4 at http://www.aanda.org/index.php?... (http://www.aanda.org/index.php?option=com_article&access=bibcode&Itemid=129&bibcode=2002A%2526A...395.1061GFUL)
-
I have found an error in the v0.1 version of the script. A new fixed version is attached.
Yesterday I analyzed the precision of the algorithm and I found that the center coordinates are ok but not the corners nor the resolution.
I have to understand better the gnomonic projection and how StarGenerator uses it. I will keep working on this.
Edited for removing an obsolete version of the script. Please, use the last version.
-
Nice work, Andrés!
I've played with the script and it has worked well for a wide field shot (105 mm) but I've had to reduce the limit magnitude (otherwise StarGenerator takes ages; I have to improve it) and StarAlignment does not correct for wide field distortions. For long focal lengths this script should work very well if we had a much denser (and precise) star catalog. With PPMX there are too few stars in most cases. We have a lot of work to do here!
-
Last night I improved the algorithm and now it gets much better precision. It is also faster since it converges in less iterations. In fact, usually after only 2 iterations the result it is good enough.
The algorithm finds a transformation matrix that transform between pixel coordinates to rectangular coordinates projected with a gnomonic projection. After this, the celestial coordinates (RA,Dec) are calculated using the inverse transformation of the gnomonic projection.
I have made several comparisons with images solved with Pinpoint LE and the results of the script are very similar. The difference in the center of image and the four corners is usually less than 1 arcsecond.
Image plate-solve v0.2:
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
-0.0005499025856485008 0.0012010112162600477 -0.23786918649860667
-0.0012024127660266374 -0.0005506869240066633 1.6027866280764136
0 0 1
Resolution..... 4.7582 arcsec/pix
Rotation....... -114.624791 deg
Focal.......... 411.82 mm
Image center... RA: +05 04 56.325 Dec:-07 15 55.952
Image bounds:
TopLeft...... RA: +05 05 54.144 Dec: -08 52 05.014
TopRight..... RA: +05 10 26.512 Dec: -06 23 49.330
BottomLeft... RA: +04 59 24.863 Dec: -08 07 47.598
BottomRight.. RA: +05 03 58.918 Dec: -05 39 46.437
Now I have all the pieces necessary for constructing the WCS keywords. I hope to have it ready in a few days.
Edited for removing an obsolete version of the script. Please, use the last version.
-
I have tested the script with the entries of this month contest. I have been able to solve all but one:
IC 342
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
0.0005928055309323613 0.0004721516334621138 -0.3641335937119266
0.0004728565185741555 -0.0005916493493551539 -0.00987076357729913
0 0 1
Resolution..... 2.7274 arcsec/pix
Rotation....... -51.364863 deg
Image center... RA: +03 46 48.761 Dec:+68 05 53.511
Image bounds:
TopLeft...... RA: +03 50 43.399 Dec: +68 06 19.140
TopRight..... RA: +03 45 51.281 Dec: +67 44 41.531
BottomLeft... RA: +03 47 48.030 Dec: +68 27 04.205
BottomRight.. RA: +03 42 54.326 Dec: +68 05 07.112
Abell 21
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
-0.00017752461864504115 -0.0003462425984331703 0.33785349020514893
0.0003465636739290167 -0.00017736813001716022 -0.10858073741452492
0 0 1
Resolution..... 1.4011 arcsec/pix
Rotation....... 117.097688 deg
Image center... RA: +07 28 52.881 Dec:+13 18 08.828
Image bounds:
TopLeft...... RA: +07 27 29.488 Dec: +13 24 38.958
TopRight..... RA: +07 28 25.952 Dec: +12 57 52.795
BottomLeft... RA: +07 29 19.885 Dec: +13 38 24.683
BottomRight.. RA: +07 30 16.199 Dec: +13 11 37.000
IC 434
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
0.00011493140954809154 -0.0013640430722459327 1.0403898575396264
0.0013645330330926432 0.00011602831684888024 -0.9141934627080415
0 0 1
Resolution..... 4.9290 arcsec/pix
Rotation....... 85.153468 deg
Image center... RA: +05 38 35.029 Dec:-02 15 29.564
Image bounds:
TopLeft...... RA: +05 34 25.131 Dec: -01 20 34.277
TopRight..... RA: +05 33 51.636 Dec: -02 59 01.900
BottomLeft... RA: +05 43 18.138 Dec: -01 31 53.783
BottomRight.. RA: +05 42 45.241 Dec: -03 10 22.162
IC 410
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
0.000004488091200476447 0.0004522264429892269 -0.2470204484846687
-0.0004512441673826314 0.000004807985415067577 0.3053680102246028
0 0 1
Resolution..... 1.6263 arcsec/pix
Rotation....... -89.347971 deg
Image center... RA: +05 22 45.113 Dec:+33 24 57.636
Image bounds:
TopLeft...... RA: +05 23 55.960 Dec: +33 06 36.224
TopRight..... RA: +05 23 54.695 Dec: +33 43 35.274
BottomLeft... RA: +05 21 36.027 Dec: +33 06 17.587
BottomRight.. RA: +05 21 33.765 Dec: +33 43 16.513
IC2935, NGC2660 and Vela SNR
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
-0.000002322224546967854 -0.0005849419845754362 0.840461421527047
0.0005845852099993975 -0.000002310131817363132 -1.2506452759052227
0 0 1
Resolution..... 2.1052 arcsec/pix
Rotation....... 90.244416 deg
Image center... RA: +08 39 39.350 Dec:-48 10 14.721
Image bounds:
TopLeft...... RA: +08 34 44.207 Dec: -46 54 49.431
TopRight..... RA: +08 34 33.086 Dec: -49 25 14.750
BottomLeft... RA: +08 44 30.961 Dec: -46 54 26.275
BottomRight.. RA: +08 44 49.243 Dec: -49 24 50.428
NGC 7635
------------------------
Referentiation Matrix (Gnomonic = Matrix * Coords[x,y]):
-0.000012054661364035286 0.0002167142613088296 -0.2028667913942405
-0.0002167986511588695 -0.000012184676337912991 0.22847614359138313
0 0 1
Resolution..... 0.7815 arcsec/pix
Rotation....... -93.210448 deg
Image center... RA: +23 20 45.632 Dec:+61 11 44.619
Image bounds:
TopLeft...... RA: +23 22 25.988 Dec: +60 57 59.086
TopRight..... RA: +23 22 39.451 Dec: +61 23 57.829
BottomLeft... RA: +23 18 53.281 Dec: +60 59 25.520
BottomRight.. RA: +23 19 03.809 Dec: +61 25 25.446
-
Brilliant work, Andrés! :)
-
I have tested the script with the entries of this month contest. I have been able to solve all but one:
:'( :'(
Jaja, great script, thank you!
Saludos.
Alejandro.
-
Hola Andrés,
Where can I find the Star Database?
Regards, Alejandro.
-
Hola Andrés,
Where can I find the Star Database?
Regards, Alejandro.
Here:
http://pixinsight.com/download/ (http://pixinsight.com/download/)
"PPMX Astrometric Catalog"
Greetings,
Enzo.
-
I'm using a Mac with stuffit expander - it will not open the PPMX.bin file. Any way to open this on Mac?
-
Hola Andrés,
Where can I find the Star Database?
Regards, Alejandro.
Hi Alejandro,
Enzo has already responded, but the next version will have a tooltip with the download address.
-
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.
-
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 (http://cdsarc.u-strasbg.fr/viz-bin/Cat?target=http&cat=VII%2F118&) catalog, would be possible to circle objects IDs directly on image? (wishlist :D )
Best regards,
Enzo.
-
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 (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.
-
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 (http://pixinsight.com/forum/index.php?topic=3985.0) 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.
-
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 (http://pixinsight.com/forum/index.php?topic=3966.0). 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.
-
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 (http://www.usno.navy.mil/USNO/astrometry/optical-IR-prod/ucac), 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.
-
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:
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 (http://wtrns.fr/l6-k7iio1LO2cno)
The OS is Win7 x64 with PixInsight 1.7.5.779 and all the updates.
-
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.
-
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).
-
I had the same problem, commenting the line also allowed it to solve the image.
A great script indeed.
-- bitli
-
Also works better for me with the original line. Image was 85mm wide field.
Georg
-
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
-
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 (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.
-
Hi
Will give that a go
Many thanks
Harry
-
Hi
Still can not make this work :yell:
Any other ideas :-*
Harry
-
Hi
Still can not make this work :yell:
Any other ideas :-*
Harry
Please, check that the epoch is correct.
If you think everything is ok, please upload the image anywhere so that I can study what is happening. I will need the starting coordinates and the details of the optical system.
-
Hi
Do you need a fits file ?
Harry
-
Do you need a fits file ?
A JPEG is enough, but it should have the full resolution.
-
Hi
Here we go take your pic
http://www.harrysastroshed.com/Temp.html (http://www.harrysastroshed.com/Temp.html)
Thanks for looking
Harry
-
I have achieved to solve it. It has been quite difficult because StarAlignment detects more that 14000 stars in the image.
The trick is to un-stretch the image to get a "pseudo-lineal" image. Doing this StarAligment detects less stars. Also I think that StarAlignment usually works better with lineal images. You could try with the original lineal image.
This image is very deep (congratulations!!) and for getting good results with this script probably would be necessary to use a bigger catalog than PPMX.
Image Plate Solver script version 1.2
===============================================================================
Referentiation Matrix (Gnomonic projection = Matrix * Coords[x,y]):
-0.000027916896 -0.000375223214 +0.465230287671
+0.000375253137 -0.000027957121 -0.661236173004
+0.000000000000 +0.000000000000 +1.000000000000
Resolution ........ 1.35 arcsec/pix
Rotation .......... 85.744 deg
Focal ............. 1370.43 mm
Pixel size ........ 9.00 um
Field of view ..... 1d 23' 14.4" x 49' 46.9"
Image center ...... RA: 09 55 19.951 Dec: +69 23 23.46
Image bounds:
top-left ....... RA: 10 00 27.599 Dec: +68 43 26.66
top-right ...... RA: 09 59 35.455 Dec: +70 06 33.29
bottom-left .... RA: 09 51 21.024 Dec: +68 39 51.68
bottom-right ... RA: 09 49 52.839 Dec: +70 02 44.08
===============================================================================
-
Hi,
I'm having problems with the plate solving of the Orion image. Really it's not a problem of the plate solving itself... The problem is that the geometric distortions are not well modeled. Here you have the annotated JPEG (http://www.astrofoto.es/astrofoto/foros/Orion_Tycho2.jpg) where TYCHO-2 stars up to 9 mag are marked.
There is an additional problem: the lens was not exactly perpendicular to the image sensor. So the geometrical distortions are not symmetric from the center of the image.
Can the standard WCS routines compensate these distortions? And can this be inserted in the FITS header?
Regards,
Vicent.
-
Can the standard WCS routines compensate these distortions? And can this be inserted in the FITS header?
The specification is in this PDF: http://fits.gsfc.nasa.gov/wcs/dcs_20040422.pdf (http://fits.gsfc.nasa.gov/wcs/dcs_20040422.pdf)
The script is quite simple and all the heavy lifting is done by StarAligment. The key for this is if StarAlignment could model the distortions in a compatible way.
-
Hi
Thanks for doing this I will have a go some other images of mine :D
Thanks for your great work
Harry
-
Hi
Still struggaling to get this to work with a lot of my images :D , what star catalog do you recomend for use to improve things ;)
Harry
-
Hi
Still struggaling to get this to work with a lot of my images :D , what star catalog do you recomend for use to improve things ;)
Harry
Currently the script is based on StarGenerator and it only supports the catalog PPMX. I think that Juan is thinking in improving it.
-
Andres-
Your ImageSolver script is a terrific tool and works great and quickly on all the finished images I've tried it on. Thanks very much for putting all this work into it.
I have found, however, that if I wanted to use this in the field on subimages with my (XP) laptop that, even after calibration, it can take a very variable amount of time with a large number of trials. In particular, if you mistype so the input coordinates are out bounds, the script hangs up the entire computer badly until 10 or 15 minutes later when it either actually gets a solution or, more likely, gives up with an error message. My question is: can the script poll for a click on the PI process window ABORT button often enough so that the user can STOP the script quickly if it obviously is going off into hyperspace to struggle for a solution, probably through an input typing error? Or maybe it is always going to be too much of a computing load to use in the field while real-time mount and camera control software operating at the same time with critical time-response requirements.
Thanks very much.
Clear skies,
Jeff
-
My question is: can the script poll for a click on the PI process window ABORT button often enough so that the user can STOP the script quickly if it obviously is going off into hyperspace to struggle for a solution, probably through an input typing error? Or maybe it is always going to be too much of a computing load to use in the field while real-time mount and camera control software operating at the same time with critical time-response requirements.
First, you have to reduce the priority of PixInsight from "TimeCritical" to "Normal". For an unknown reason Juan keeps releasing versions using "TimeCritical" as the default priority. I don't know if that is ok in Linux, but it is a BAD choice for Windows. For changing this value you have to open "Edit | Global preferences | Parallel processing and threads" and set "Maximum thread priority" to "normal". This change avoids PixInsight hoarding the whole computer.
After this, it should possible to abort the process although sometimes you have to press the Abort button several times. If you keep having problems, please post again so I can know that there is a problem.
-
Harry, Jeff,
I have been doing several tests and it seems that I get better results if a couple of parameters in StarAlignment are used with their default values.
If you have time you could do this test:
Comment or delete the lines with the following text:
align.matcherTolerance = 0.01; //0.0030;
align.ransacTolerance = 6.00;
They should be the lines 961 and 962.
Please, let me know if the script behaves better with this change.
Thanks in advance.
-
I have tried the script with a couple of image (with the lines commented as stated earlier) and it worked very well for me, even on a picture with a cluster on it. Very impressive, thanks.
-- bitli
-
Hi, Andres-
I put PI to normal priority and commented out those two lines and that seems to have done the trick. I can interrupt the process with the abort button (some times takes a second click) and continue it and I'm getting good rapid convergence on the single subs that I tried.
Even better, it converged just about as rapidly on an UNCALIBRATED sub that hadn't been dark-subtracted or flat-fielded with a few dust motes in it. No problem, evidently, so that is really great.
I do have an additional question, however, on what exactly is asked for as "EPOCH". I probably was 'raised' on GOTO scopes (doing astro 4 years only) without worrying about this but is this the EPOCH of the database from which I input the RA/DEC coordinates or something else like the date of the image? I was thinking it would need both to do the job and, until now, was entering the date of the image. Today I found it didn't matter, as far as I could tell, whether I entered the date of the image (16Feb2012) or the EPOCH of the coordinate base from TheSky6 Pro which I believe is 1Jan2000.
Thanks again.
-Jeff
-
I do have an additional question, however, on what exactly is asked for as "EPOCH". I probably was 'raised' on GOTO scopes (doing astro 4 years only) without worrying about this but is this the EPOCH of the database from which I input the RA/DEC coordinates or something else like the date of the image? I was thinking it would need both to do the job and, until now, was entering the date of the image. Today I found it didn't matter, as far as I could tell, whether I entered the date of the image (16Feb2012) or the EPOCH of the coordinate base from TheSky6 Pro which I believe is 1Jan2000.
For "EPOCH" I ask for the date of the image. This is the same value as the "epoch" in StarGenerator. I will add a tooltip to clarify this.
-
I have published a new version of the script in this thread:
http://pixinsight.com/forum/index.php?topic=3966.msg27736#msg27736 (http://pixinsight.com/forum/index.php?topic=3966.msg27736#msg27736)
It has important changes that should increase the number of solved images.
-
I just selected local catalogue and pointed it to my local ppmx.bin file, but when I ran the script it still seemed to download a vizier one?
-
I just selected local catalogue and pointed it to my local ppmx.bin file, but when I ran the script it still seemed to download a vizier one?
i am seeing the same thing. also a bug report/support request is posted in the thread talking about the annotation script.
-
I have published a new version in the thread of ImageAnnotation:
http://pixinsight.com/forum/index.php?topic=3966.msg27950#msg27950 (http://pixinsight.com/forum/index.php?topic=3966.msg27950#msg27950)
-
Came back to use this but it doesn't seem work for me any more. With default local database, showing stars shows it picks (x's) all the bright stars in my m51 image, but 974 others, mostly dubious. It ends up not finding any putative star pairs. I tried it with different coordinates as well as with other posted m51 images and always get the same results. (Other databases likewise).
Any suggestions what I'm doing wrong?
Thanks,
-Jeff
-Thought it might be v1.51 but went back to another computer with 1.01 and got the same error message on an image that I know worked previously, although the local database file seems to be missing in 1.51 on one machine but not the other with the same results.
-I can still no longer get this to work with ANY of my images, including ones that it worked fine on before. Has there been some change in the Align.matherTolerence or other parameter recently. Is anyone else now having trouble getting it to solve again?
-
[...]Any suggestions what I'm doing wrong?
[...]Has there been some change in the Align.matherTolerence or other parameter recently. Is anyone else now having trouble getting it to solve again?
I have not made changes to this script in the last month. Also, I think that Juan has not changed anything in StarAligment that could affect.
You can follow some of the following tricks:
- First of all, delete all the previews. If there is a preview in the image StarAlignment only uses the stars in the preview for the matching.
- You need a good approximation to the resolution of the image or the coordinates of the center. You need at least one of them. Usually the resolution of the image is easier to know but you must not forget to take into account any rescaling of the image.
- ImageSolver is only a thin wrapper around StarAlignment. SA is designed to work with lineal images and it doesn't work so well with stretched images. Because of this, you could try to solve the original image before stretching it. If it has the same geometry as the final image, you can copy the coordinates to the final image using the FITSHeader process.
- If working with the lineal image is not an option, you can try to smooth the image using a convolution (ie: StdDev=3 or higher) and try again. This should reduce the noise of the image and SA will detect less false stars. After this you can use FITSHeader to set the coordinates to the original image.
- When the image is very deep, there are lots of saturated stars that StarAligment ignores. You can multiply the image by 0.8 without rescaling and then smooth it using the procedure of the previous trick.
- If you have a galaxy of nebula in the center where ImageSolver detects many fake stars, you can define a preview outside the problematic area. This preview must be as big as possible and big enough to have at least 100 detected stars.
- If everything fails, you can try to find the coordinates of the center manually. Find a star in the center of the image and search it in a star map. I usually use wikisky.org (http://wikisky.org/). This star must be as close as possible to the center of the image. With a good approximation to both the center and the resolution of the image, the script is usually capable to solve any image.
If you still can not solve you image, I would like to see it.
-
Thanks so much, Andres-
Late last night I managed to get it to work by primarily by increasing the magnitude of the stars used from 12 to 14. From your points below that would make sense since it is a fairly deep, stretched image that you can see at (double click on it to get downloadable one):
http://www.astrophotogallery.org/member-galleries/p9493-m51-lrgb.html
Although I haven't yet gone back to try it on the previous ones which were subs for this image, I presume they would require the same modification, although they were linear, non-stretched.
Also another key thing (probably obvious) was that ImageSolver did not work on this image directly (the posted JPG, or 16 bit TIF from Photoshop that I use for printing at home and posting jpg's). In fact, it wouldn't work when I just saved a new FIT file from the TIF I got back into PI from Photoshop. To get it to work, I had to go back to the original FIT file from PI 1.7 that was used to generate the posted image made in Photoshop. The images are nearly identical (but full-frame with less cropping) but presumably even the remade "FIT from TIF" doesn't support or contain the WCS, or other FIT headers needed by ImageSolver and the annotation script.
I believe that I had the coordinates (for m51) correct and image resolution/scale correct from the previous successful solutions, and I think with this image of almost 8 hours of integration time that it shouldn't have been noise that created problems, so I am puzzled why the stars display seemed to show so many +'s that didn't appear to be connected to stars in the image. Nonetheless, when it finally worked using an ORIGINAL FIT and using mag 14 stars, the result gave identification (with all the databases turned on) to almost all the visible galaxies and other objects (except for the 2 little edge-on's near m51B that must not be in any database). In ALL cases the markings were right on top of the features visible in my (full frame) image so it looks there was no significant distortion that might have been causing troubles.
Thanks again.
-Jeff
-
Thanks so much, Andres-
Late last night I managed to get it to work by primarily by increasing the magnitude of the stars used from 12 to 14. From your points below that would make sense since it is a fairly deep, stretched image that you can see at (double click on it to get downloadable one):
http://www.astrophotogallery.org/member-galleries/p9493-m51-lrgb.html
I have been able to solve the JPEG from the link that you have posted:
===============================================================================
Referentiation Matrix (Gnomonic projection = Matrix * Coords[x,y]):
-0.000349080686 +0.000079332176 +0.210712369645
-0.000079452584 -0.000348867409 +0.261692330810
+0.000000000000 +0.000000000000 +1.000000000000
Resolution ........ 1.288 arcsec/pix
Rotation .......... -12.798 deg
Focal ............. 1440.83 mm
Pixel size ........ 9.00 um
Field of view ..... 31' 36.5" x 25' 1.0"
Image center ...... RA: 13 29 51.519 Dec: +47 12 26.15
Image bounds:
top-left ....... RA: 13 31 06.328 Dec: +47 28 06.71
top-right ...... RA: 13 28 04.137 Dec: +47 21 04.07
bottom-left .... RA: 13 31 38.317 Dec: +47 03 41.99
bottom-right ... RA: 13 28 37.445 Dec: +46 56 42.57
===============================================================================
I had to do a little preprocess on the image:
- Convert it to 32bits
- Inverse stretching using a midtones of 0.96 for "relinear" the image.
- Convolution with stddev of 3.
I used as starting point a resolution of 1", the coordinates that the catalog returns for M51 and a sensitivity of 0.25.
-
Thanks, Andres-
Those three steps also worked for the TIF image back from PS that I was trying to annotate. However, when I undid them sequentially to get back to my original image, the WCS information also vanished, of course, so AnnotateImage wouldn't work on it. Not sure I see a way out of this conflict but it would be nice to be able to use these great scripts to annotate finished images as well as plate solve linear subs. Any suggestions?
-Jeff
-
Hi Jeff. You can create annotation as transparent image and combine it with processed image.
-
Thanks, Andres-
Those three steps also worked for the TIF image back from PS that I was trying to annotate. However, when I undid them sequentially to get back to my original image, the WCS information also vanished, of course, so AnnotateImage wouldn't work on it. Not sure I see a way out of this conflict but it would be nice to be able to use these great scripts to annotate finished images as well as plate solve linear subs. Any suggestions?
-Jeff
The easiest solution is using the FISTHeader process:
- Select the solved image and open the FITSHeader (FH) process.
- Click on the "check" button in the lower tool bar. This makes FH to read the keywords of the image.
- Save FH to an icon dragging the blue triangle to PI desktop.
- Undo the changes until you return to the finished image. Open the FH icon and apply it to the image.
If you solved a copy of the image, you can drag the keywords from one image to the other without needing to save them to an icon.
-
Thanks very much, Andres,Tomas-
Clear skies,
-Jeff
-
[/quote]
The easiest solution is using the FISTHeader process:
- Select the solved image and open the FITSHeader (FH) process.
- Click on the "check" button in the lower tool bar. This makes FH to read the keywords of the image.
- Save FH to an icon dragging the blue triangle to PI desktop.
- Undo the changes until you return to the finished image. Open the FH icon and apply it to the image.
If you solved a copy of the image, you can drag the keywords from one image to the other without needing to save them to an icon.
[/quote]
I'm unable to get the FH process to allow me to drag the keywords from the solved image to another image. Is there something I'm missing?
Charlie
-
The easiest solution is using the FISTHeader process:
- Select the solved image and open the FITSHeader (FH) process.
- Click on the "check" button in the lower tool bar. This makes FH to read the keywords of the image.
- Save FH to an icon dragging the blue triangle to PI desktop.
- Undo the changes until you return to the finished image. Open the FH icon and apply it to the image.
If you solved a copy of the image, you can drag the keywords from one image to the other without needing to save them to an icon.
I'm unable to get the FH process to allow me to drag the keywords from the solved image to another image. Is there something I'm missing?
Both methods (saving to an icon and copying from one image o another) work for me in Win7 64bits. I don't know why it is not working for you. Perhaps, you could try to deactivate the checkbox of the "Track View" button just before dragging.
-
I can save to an icon and I can drag the entire header to another image, but I cannot drag a single keyword from one image to another. Perhaps I misunderstood the context.
Thanks,
Charlie
-
I forgot to add that I really like the script. It is brilliant.
Charlie
-
I may have found a bug in this very usefull script.
I'm imaging around RA = 0 and get this output
* Previous attempt failed - this is try #16
useScaleDifferences=false
* Reference image: Limiting to 125 brightest stars.
* Target image: Limiting to 125 brightest stars.
25 putative star pair matches.
Performing RANSAC ...
17 star pair matches in 140 RANSAC iterations.
Summary of model properties:
Inliers : 0.680
Overlapping : 0.897
Regularity : 0.751
Quality : 0.729
Root mean square error:
?RMS : 0.821 px
Average RMS error deviation:
?RMS : 0.434 px
Peak errors:
?xmax : 1.930 px
?ymax : 0.961 px
Transformation matrix:
-1.0123 +0.1588 +3543.5747
-0.1616 -1.0261 +2905.7778
+0.0000 -0.0000 +1.0000
scale : 0.966
rotation : -170.72°
dx : +3543.57 px
dy : +2905.78 px
202.3 s
*****
Iteration 1, delta = 11828.053 arcsec (531.0 pixels)
Image center ...... RA: -00 27 03.143 Dec: +69 36 11.03
Resolution ........ 21.59 arcsec/pix
*****
*** Error [000]: /Applications/PixInsight64.app/Contents/src/scripts/ImageSolver+AnnotateImage/ImageSolver.js, line 1163: Error: StarGenerator.centerRA(): numeric value out of range: -6.7631
I think the script return a negative RA value that cause an error
Martin
-
I may have found a bug in this very usefull script.
I'm imaging around RA = 0 and get this output
[...]
I think the script return a negative RA value that cause an error
Martin
Hi Martin,
are you using the last version (v1.6)?. I think that I fixed this problem some time ago. You can find it in the first post of this thread: http://pixinsight.com/forum/index.php?topic=3966.0 (http://pixinsight.com/forum/index.php?topic=3966.0)
If you are already using the last version, I would need the image to be able of reproduce the problem.
Andrés.
-
Hi Andres
I had a previous version (1.5.2 I think) I tought this script was updated with the PI update process. Anyway I got the last version and I have to test it tonight.
Thanks for both this script and the anotation script. They are both very valuable to me.
Martin
-
I have written a detailed help file for ImageSolver. It covers the basic use of the script and what to do when there are problems.
It will be available from the update system in a few weeks. Meanwhile, I have generated a PDF with its contents that can be found in this other thread:
http://pixinsight.com/forum/index.php?topic=6535.0 (http://pixinsight.com/forum/index.php?topic=6535.0)
-
Hi There
I think we need to put you for "god status"
many ,many thanks for your hard work which you share for free :-*
Happy new year
Harry
-
Andres, I'm running into some rendering issues within the script windows for Image Solver and Catalog Star Generator. I'm running Pixinsight 1.8.0 1071 on Mac OS X 10.7.5 on a MacBook Pro.
Attached are screen captures of the issues I'm seeing.
Craig
-
Andres, I'm running into some rendering issues within the script windows for Image Solver and Catalog Star Generator. I'm running Pixinsight 1.8.0 1071 on Mac OS X 10.7.5 on a MacBook Pro.
Attached are screen captures of the issues I'm seeing.
Craig
Hi Craig,
I haven't a Mac so I can't test the scripts in OS X. However, since they work well in Windows and Linux, the problem probably is in PixInsight (or in one of the libraries it uses) and not in the scripts.
Have you tried the latest versions of the scripts distributed with PI 1.8.1?
-
I've run into that as well, a 'pinched' field at certain resolutions (usually when showing PI on a projector). If the script window could be resized, I bet it would expand and be visible.
Craig, have you tried changing your resolution? But I agree that this issue needs to be adjusted somehow.
-
I've run into that as well, a 'pinched' field at certain resolutions (usually when showing PI on a projector). If the script window could be resized, I bet it would expand and be visible.
Craig, have you tried changing your resolution? But I agree that this issue needs to be adjusted somehow.
What OS and PI version are you using Josh?
-
I cannot reproduce this problem on any platform, including Mac OS X 10.6 and 10.8. What screen resolution do you have?
-
All, I have a my laptop set to 1440 x 900. I also have a thunderbolt display running at 2560 x 1440 as a secondary monitor. Both show the same issue. I have tried a resolution of 1344 x 840 on the laptop screen and 2048 x 1152 on the thunderbolt display and I still see the same rendering issues.
I'll download PI 1.8.1 when a version that will work with my OS is available and retest.
Craig
-
I'll download PI 1.8.1 when a version that will work with my OS is available and retest.
A version for Mac OS X 10.6/10.7 is already available since yesterday, both on Software Distribution and Endor.
I have Mac OS X 10.6 and cannot reproduce this problem. Screen issues on Mac OS X are always infuriating....
-
I just retested with build 1079 of PI 1.8.1 and the latest versions of the scripts. They still render incorrectly, but Catalog Star Generator actually got worse.
Craig
-
I just started reading this thread, and literally had no idea what plate solving was or how it worked.
After reading most of the thread, and finding your help PDF file, I was able to solve a few of my images.
This is so cool!!!! 8)
Thanks
One thing that threw me was if I had a neg Dec, then I needed to select the "S" for Southern Hemisphere. Since I live in the Northern, I would not expect to ever select this. Did not see this in the doc.
But, by playing around with all the parameters, I got it to work.
Also I did not know the Image solver, prepared the Annotate to get the final image.
I also was able to download the catalog on the PI download site to run it locally on a system that's firewall wont let me out.
I really don't understand anything about these so called KEYWORDS yet or where they come from and are found.
Excellent, and a lot more to learn here.
Scott T.
-
well, S stands for the southern hemisphere of the celestial sphere... looking due south, anything in the sky between the southern horizon and an angle equivalent to your latitude are at negative declinations (southern declinations)
rob
-
Hi Craig,
I had the same problem...
I do not know if you've found the answer to this old question, if not, I found two ways to solve this problem.
1 - change the screen resolution in System Preferences> for me it worked with 1680x1050 resolution
otherwise
2 - modify slightly the script "ImageSolver.js" in line 423 that controls the size of the window of the plugin.
You must disable the following three lines with a / /
this.setVariableHeight ();
this.targetImageGroup.adjustToContents ();
this.adjustToContents ();
/ / if (solverCfg.useActive)
/ / this.setFixedSize ();
/ / else
this.setMinHeight ();
This allows you to resize the window and have access to hidden fields.
This plugin is wonderful, thank you for this beautiful work...
I hope it can help mac users.
Eric.
-
wrong thread??? but thanks for the hack, i have this problem as well.
-
wrong thread? sorry, I tried to answer to Craig, page 5...
I was mistaken?
Eric.
-
no my mistake, without the quote i couldn't tell :)
rob
-
I have published a new beta version in this thread: http://pixinsight.com/forum/index.php?topic=8616.0 (http://pixinsight.com/forum/index.php?topic=8616.0)