AngularDistance Script

Enzo De Bernardini

PixInsight Ambassador
Hello,

I want to introduce you to the first version of a script that I have been working on. This new script allows to measure the angular distance and the position angle of two points (stars or arbitrary) in an image that has previously been astrometrically solved. The distance and position angle are measured from the first point to the second point selected, and are calculated using spherical trigonometry. Successive clicks changes the points, latest two are used.

AngularDistance Script

Basic usage
  • CTRL + click to select the points/stars.
  • Mouse wheel to zoom.
  • Drag and drop to scroll.
Settings
  • Selection Mode
    • Star Detection: Use the StarDetector engine to calculate the star's centroid. For this type of measurement is required a star like point, and preferably unsaturated. The click coordinates are not critical, the script will search the closest centroid to clicked point inside a region (detection box). Limitations: If the function does not detect the star, the search for the centroid could fail or fall on another detected star. Stars too close to the edge (half detection box size) will not be well placed (script limitation).
    • Arbitrary Point: Any point in the image, regardless of whether or not there are stars. The script will use exactly the clicked coordinates (subpixel resolution, so, zoom in to better accuracy)
  • Detection Box: Size of the square centered on the clicked point where matching stars will be searched (increase to include big stars). Only for Star Detection.
  • RA Format, Dec Format: Format to show the positions of the stars.
Known issues
  • Zoom and scroll need improvement (I have found it quite difficult to handle that part of the interface)
Next versions ideas
  • More StarDetector configs (sensitivity, peak response...)
  • Output improvement (like only export selected measurements)
  • One point measurements (no distance and position angle, only RA and Dec, useful for asteroids and other objects?)
  • Images without the need to be solved astrometrically (measurements of distance and angles based on image px, useful for double stars?)

I want to thanks @Juan Conejero for the tremendous tools available on the platform. The potential in astrometry is by far beyond my scripting skills :geek:

Zip file attached. I hope you find it interesting. It is a first version, be gentle :giggle:

Best regards,

Enzo.

Updates:
  • 2021-04-27: version 1.1.0
  • 2023-11-13: version 1.1.1
 

Attachments

  • AngularDistance_1_1_1.zip
    13 KB · Views: 65
Last edited:
Wow it looks great! out of my curiosity does it take into account model distortions for wide fields?

I love it, the manual star selection opens my mind to a lot of potential astrometry stuff :) how nice!
 
I don't understand, it doesn't work plate solving or Annotate image
 

Attachments

  • Screenshot_25.jpg
    Screenshot_25.jpg
    154.5 KB · Views: 64
A great script - congratulations and thank you!
An STF button would be nice to be able to measure linear images as well.
 
Hello,

I have updated the script, introducing some improvements. The file was updated in the original post.

AngularDistance-01.png

Updates:
  • Auto Stretch button (for preview purposes only, measurements are made on the original image)
  • Results table:
    • Button Store Result to save the result to the table.
    • Button Remove Unchecked to remove the unchecked results from the table.
  • Export
    • Select a Output directory
    • Button Export Results to CSV to save the results table to CSV file.
  • Layout Toggle: change the sizes of the preview and the table of results, to facilitate the visualization of the data.
Best regards,

Enzo.
 
This script works fine. I am working in double stars and it is very useful for me. I agree enzodb, zoom and scroll need improvement becuase zoom is so high that I lose the star in the field and is cumbersome to find the stars. It would be appreciated to be able to move the image field more easily.

Best regards,

José Bosch
 
I was looking for a script that would do exactly this, it's very good and just as a suggestion it would be nice if when activating stf it could also be deactivated with the same button and also some option to improve the detection of stars. But it is very good and congratulations for the excellent work!
 
Another suggestion: When done with your selection(s), to have the ability to export your Auto-Stretched image (as a xisf) with the selection annotations.
 
Hello,

I have some problems with this script (AngularDistance 1.1.0 , PI 1.8.9.2, Windows10) :
If I open the script and try to select an 'Arbitrary Point', mouse pointer is a crosshair, not an arrow like in demonstration of script above.
A crosshais is fine to select a point in image, BUT after seleceting the first point, mouse pointer immediately changes to a small hand. Yes I can select the second point with the hand, but it is practically impossible to hit it as precisely as with the crosshair, you never know which part of the hand determines the point.
What am I doing wrong?

Regards,

Thomas
 
Hello Thomas,

Yes, I have noticed that behavior. At some point after some update it started happening. I need to check the code...

Regards,

Enzo.
 
Hello Enzo,

Your script is a great help for all measurements, thank you very much for your work.

If it is possible, maybe you can please also add a marker of the pixel (or point) used for the measurement.
Sometimes the circle used now does not show this accurately enough.

Regards,

Thomas
 
Last edited:
Hello,

I have updated the script, you can find the latest file in the original post. Two little improvements:
  • The problem with the cursor should be fixed.
  • Added pixel mark of the center point.
I still don't like zoom and pan too much, but I find it very complicated to code. Maybe one day there will be a standard PJSR component that will be easier to implement. For now, remember: you can pan with the mouse middle button.

Best regards,

Enzo.
 
Back
Top