Annotation script

Andres.Pozo

Well-known member
I am writing a new script related to the Plate-Solving script that I wrote the last week. It will annotate images that have coordinates in the WCS convention.
The annotation will be designed by layers:
  • Objects: It will use a catalog with nearly 10000 objects from the NGC and IC catalogs and it will draw a circle around the object and write a label with the catalog number and name of the object.
  • Grid: the script will draw a grid with the equatorial coordinates of the image.
The user will be able to decide which layers and elements wants to draw. The graphics properties (color, transparency, line width,...) will be configurable.
I already have the kernel of the script, but I still haven't written the user interface. The annotation will be something like the attached image (the image is from gvanhau). New ideas will be welcome.

Latest version
This message will be kept updated with the latest versions of the scripts:
  • ImageSolver v1.6
  • AnnotateImage v1.2
 

Attachments

  • Image22.jpg
    Image22.jpg
    211.5 KB · Views: 528
  • Solver_Annotate.zip
    174.7 KB · Views: 280
Cool! Astrometry.net does that too but their object list is rather short. It would be great if you could 'open' the catalog format so we can add arbitrary catalogs. I'm thinking the PGC would be nice for galaxy peepers. Alternatively you could do away with the catalogs and do an online SIMBAD search instead.
 
Nocturnal said:
Alternatively you could do away with the catalogs and do an online SIMBAD search instead.
I have been studying it and I think I can do it. I will maintain the current NGC/IC catalog since it is not large and it allows working without Internet connection. The configuration dialog will allow to select one or more catalogs.
 
Cartes du Ciel recently added SIMBAD lookup. It's not quite the same as you'd be looking for objects in a certain field of view and CdC looks for the coordinates of a named object. Maybe the source code helps you. It's in Pascal but pretty easy to read and convert.
 
I have already done several test and it is going to be quite easy. I only need to construct an URL with the query and Vizier returns a file with a table that contains only the objects that pass the filter. I have already implemented both the query constructor for the PGC (HYPERLEDA I) and the table parser.
 
This is fantastic!  I was just wondering yesterday if this was possible, and here it is the day after and someone has independently started work on it!

Do you intend to make it fairly customisable in terms of colours, linetypes, linewidths, fonts etc for the overlay?
 
troypiggo said:
This is fantastic!  I was just wondering yesterday if this was possible, and here it is the day after and someone has independently started work on it!

Do you intend to make it fairly customisable in terms of colours, linetypes, linewidths, fonts etc for the overlay?
The engine now has the following properties:
  • Grid layer: lineColor, lineWidth, gridDensity, showLabels, labelColor, labelSize
  • Object layers: showCircle, lineColor, lineWidth, showLabels, labelColor, labelSize
All layers will be optional.

The engine is 75% complete, but I have not started the user interface yet. I hope to have it finished by the end of the next week. Perhaps in a few days I could publish a first and incomplete version, but I can not promise anything because this weekend I am not going to be able to work on it.
 
Andres.Pozo said:
troypiggo said:
This is fantastic!  I was just wondering yesterday if this was possible, and here it is the day after and someone has independently started work on it!

Do you intend to make it fairly customisable in terms of colours, linetypes, linewidths, fonts etc for the overlay?
The engine now has the following properties:
  • Grid layer: lineColor, lineWidth, gridDensity, showLabels, labelColor, labelSize
  • Object layers: showCircle, lineColor, lineWidth, showLabels, labelColor, labelSize
All layers will be optional.

The engine is 75% complete, but I have not started the user interface yet. I hope to have it finished by the end of the next week. Perhaps in a few days I could publish a first and incomplete version, but I can not promise anything because this weekend I am not going to be able to work on it.

8)
 
I have already integrated a few catalogs from Vizier: PGC-HYPERLEDA, TYCHO2, USNO-B1 and PPMXL.

The star catalogs can be filtered by magnitude. Some of the catalogs have so much information that without filtering the annotation becomes a mess. Also, since some of the objects belongs to more than one catalog I have to eliminate the duplicates.

I have made an example using NGC/IC, PGC, TYCHO and USNO-B1 (<15 magnitude).
 
wow fantastic work - this would be so good showing people items you can capture.  Look forward to a finished version :)
 
I have ready a first version of the script. It is still not finished, but it can be used for testing.

The attached .zip has four files:
  • Annotation script
  • Shared code
  • New version of plate-solve script
  • NGC-IC catalog for the NGC layer in the script.

The script still needs a lot work. In the following days (?weeks?) I plan to write the following functionality:
  • SVG output
  • Proper motion for stars in catalogs with this data
  • More catalogs. I accept suggestions.
  • Reordering of layers.
  • Saving the settings to a file.
  • Better layout of the configuration dialog and cleanup of the code

Feedback will be welcome.

Edited for removing an obsolete version of the script. Please, use the last version.
 

Attachments

  • Annotation.png
    Annotation.png
    74.2 KB · Views: 136
  • Nebula.jpg
    Nebula.jpg
    151.1 KB · Views: 164
Excellent.  Been eagerly waiting this.

One minor comment.  Line 332 of script gives and error, because you've hard-coded the path to ngc2000.txt.  I manually changed it to my path and the script seems to be working fine.  Still running as I type this, the USNO catalog annotation seems to be taking a while to download and have a think about.

So you have to use ImageSolver first to get the WCS coords into image, then run AnnotateImage?
 
troypiggo said:
Excellent.  Been eagerly waiting this.

One minor comment.  Line 332 of script gives and error, because you've hard-coded the path to ngc2000.txt.  I manually changed it to my path and the script seems to be working fine.  Still running as I type this, the USNO catalog annotation seems to be taking a while to download and have a think about.

So you have to use ImageSolver first to get the WCS coords into image, then run AnnotateImage?

Thank you for pointing me to this error. I have fixed it.

Regarding the USNO catalog, you should try to find which mirror of VizieR works better for you. From Spain, both Strasbourg and Cambridge (UK) work very well and it takes only a few seconds to download the stars. The duplicates removing can be slow when there are lots of stars.

This script uses the WCS coords. You can get them using ImageSolver but also with PinPoint or even Astrometry.net.


Edited for removing an obsolete version of the script. Please, use the last version.
 
Hi Andr?s,

It would be very nice if you can just type the CDS catalog code. This would allow to identify sources of interest. For example, I have a deep photo of M51and want to locate the planetary nebulae in this galaxy. First, I go to Vizier and do a search for catalogs containing PNe in M51. Then I go to PI and in the options of your script I put the catalog code that Vizier gives. The result is my image in which only the sources I'm interested on are marked.

Another important option is, IMO, to be able to select a magnitude range, with both lower and upper limits.

And another wonderful option would be to select a list of files so it annotates all of them in a single action.


Congratulations. Best regards,
Vicent.
 
Andres.Pozo said:
troypiggo said:
Excellent.  Been eagerly waiting this.

One minor comment.  Line 332 of script gives and error, because you've hard-coded the path to ngc2000.txt.  I manually changed it to my path and the script seems to be working fine.  Still running as I type this, the USNO catalog annotation seems to be taking a while to download and have a think about.

So you have to use ImageSolver first to get the WCS coords into image, then run AnnotateImage?

Thank you for pointing me to this error. I have fixed it.

Regarding the USNO catalog, you should try to find which mirror of VizieR works better for you. From Spain, both Strasbourg and Cambridge (UK) work very well and it takes only a few seconds to download the stars. The duplicates removing can be slow when there are lots of stars.

This script uses the WCS coords. You can get them using ImageSolver but also with PinPoint or even Astrometry.net.

Sorry mate.  Got this error:

Code:
run --execute-mode=auto "/Users/troy/Applications/pixinsight/AnnotateImage.js"

Processing script file: /Users/troy/Applications/pixinsight/AnnotateImage.js
*** Error [000]: /Users/troy/Applications/pixinsight/AnnotateImage.js, line 341: Error: File.openForReading(): invalid argument type: String expected.
 
Back
Top