Author Topic: Annotation script  (Read 110178 times)

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: Annotation script
« Reply #90 on: 2012 April 03 17:30:29 »
I had some luck getting what I wanted out of the full Hipparcos catalog and generated a tab-delimited text file using your column naming convention. I got it down to 41,137 entries by restricting it to over 8th magnitude.

However, the script doesn't load any of them. It says, "Custom catalog size: 0 objects." So obviously I'm doing something wrong. It seems to be formatted the same as your custom NGC txt file.

Any ideas? Here is the file: http://db.tt/CffQDSeK  (1.5 MB)
It seems that you are using a Macintosh so your file has lines ending in CR character. The script currently only supports Windows format (CR-LF) or UNIX format (LF). I will modify the script in order to support text files with lines ending in CR.
Meanwhile, you could modify your file to end the lines in CR-LF or LF. In Windows you could use Notepad++, but in Macintosh I can't recommend any software that can do this.

Also, the Right Ascension should be in degrees but in your file seems to be in hours. You have to multiply by 360/24 the values of the RA.

Yes indeed, on a Mac. I should have a tool to convert the line endings. Thanks for the heads up on the RA, I'll convert it with Excel and re-export. When I finish, do you want to see the resulting file?

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: Annotation script
« Reply #91 on: 2012 April 03 19:25:42 »
Success! Partial success, anyway. I got the file to load after exporting it as a Windows TXT file from Excel, so it must have put in the right line endings.

Some of the stars are quite right, but others are mislabeled, over blank space.

In the attached example, HIP 32020 is correct (confirmed by another source), but HIP 91758 in the bottom left is wrong. It has an RA of 18h 42m 40s, but it is mapped here at 6h 42m 40s, 12 hours off -- 180 degrees. It is listed correctly in the file (I think, as per your instruction) at 280.6 degrees.

I may need to do another correction factor (positive and negative 180 degrees instead of out of 360?), but perhaps it's something in the script? Not sure, will keep playing.

Here's a link to the working catalog (mags thru 7): dropbox.com/sh/g1ka17f7x8p189r/9lB5n-DpP5/HipparcosMag0-7.txt

Edit: Also, it would be nice to be able to limit by magnitude on the custom catalogs as well -- that way, I could make the named star (Alhena) visible without its HIP number too.
« Last Edit: 2012 April 03 19:34:21 by jlake »

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4450
    • View Profile
Re: Annotation script
« Reply #92 on: 2012 April 03 20:34:05 »
Yes indeed, on a Mac. I should have a tool to convert the line endings. Thanks for the heads up on the RA, I'll convert it with Excel and re-export. When I finish, do you want to see the resulting file?

good to hear someone on osx has this working... i can't get it to work. has every single version of this script worked for you, or just the most recent one?

my images solve fine on windows so it's quite a mystery why they won't solve on OSX.


Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 912
    • View Profile
Re: Annotation script
« Reply #93 on: 2012 April 04 02:48:49 »
Some of the stars are quite right, but others are mislabeled, over blank space.

In the attached example, HIP 32020 is correct (confirmed by another source), but HIP 91758 in the bottom left is wrong. It has an RA of 18h 42m 40s, but it is mapped here at 6h 42m 40s, 12 hours off -- 180 degrees. It is listed correctly in the file (I think, as per your instruction) at 280.6 degrees.

I can confirm that there is a bug in the script. The Gnomonic projection is not valid for points more than 90º away from the center of the image and the script is not checking this in the custom catalog. This afternoon I will publish a new version with a few corrections.

Quote
Edit: Also, it would be nice to be able to limit by magnitude on the custom catalogs as well -- that way, I could make the named star (Alhena) visible without its HIP number too.
Please check that "Remove duplicated objects" is checked and that the catalog "Named stars" is in the list before the custom catalog. I will also modify the condition for considering two objects the same. It will use the resolution of the image for initializing the tolerance.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 912
    • View Profile
Re: Annotation script
« Reply #94 on: 2012 April 04 02:54:58 »
good to hear someone on osx has this working... i can't get it to work. has every single version of this script worked for you, or just the most recent one?

my images solve fine on windows so it's quite a mystery why they won't solve on OSX.
I don't know what is happening in your computer. I haven't access to a OSX so I can not give support to that platform.

Have you tried to reset the settings of Pixinsight? For doing this you have to hold the Ctrl key pressed while you launch the PixInsight Core application.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2131
    • View Profile
Re: Annotation script
« Reply #95 on: 2012 April 04 03:05:20 »
...I don't know what is happening in your computer. I haven't access to a OSX so I can not give support to that platform.
Maybe you guys can to a screensharing session, for example using TeamViewer http://www.teamviewer.com . It is free for non-commercial use, easy to set up, and rock solid.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: Annotation script
« Reply #96 on: 2012 April 04 04:28:59 »
Yes indeed, on a Mac. I should have a tool to convert the line endings. Thanks for the heads up on the RA, I'll convert it with Excel and re-export. When I finish, do you want to see the resulting file?

good to hear someone on osx has this working... i can't get it to work. has every single version of this script worked for you, or just the most recent one?

my images solve fine on windows so it's quite a mystery why they won't solve on OSX.

Yes, but I just started using it yesterday. The key for me was to upgrade my version of PI (32-bit) to 01.07.05.0779... it didn't work before that and threw the same error you were getting.

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: Annotation script
« Reply #97 on: 2012 April 04 05:47:24 »
Some of the stars are quite right, but others are mislabeled, over blank space.

In the attached example, HIP 32020 is correct (confirmed by another source), but HIP 91758 in the bottom left is wrong. It has an RA of 18h 42m 40s, but it is mapped here at 6h 42m 40s, 12 hours off -- 180 degrees. It is listed correctly in the file (I think, as per your instruction) at 280.6 degrees.

I can confirm that there is a bug in the script. The Gnomonic projection is not valid for points more than 90º away from the center of the image and the script is not checking this in the custom catalog. This afternoon I will publish a new version with a few corrections.

Quote
Edit: Also, it would be nice to be able to limit by magnitude on the custom catalogs as well -- that way, I could make the named star (Alhena) visible without its HIP number too.
Please check that "Remove duplicated objects" is checked and that the catalog "Named stars" is in the list before the custom catalog. I will also modify the condition for considering two objects the same. It will use the resolution of the image for initializing the tolerance.

Remove Duplicates is indeed checked, but I think it is not matching up the known HIP star with the name. I tried adjusting the name format (adding a space, so "HIP 30202") but it still double labels the named stars. Do you know what label your Named Stars catalog uses for HIP stars? I will try to find out now...

By cutting my catalog in half and just using the 0-180 degree RA set, I got just what I wanted out of those. It would be great to be able to feed the whole list in, of course.

If possible, it would also be nice to limit by magnitude in the custom catalogs (if a MAGNITUDE column is present) so that we can filter the faintest stars in cases of over-annotating.

Thanks again for all your work, Andres, this is a major piece for me. I imagine Juan is watching this thread and I'm hoping he'll see the value of incorporating this functionality into the full PI build.  :D

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4450
    • View Profile
Re: Annotation script
« Reply #98 on: 2012 April 04 08:08:59 »
Yes indeed, on a Mac. I should have a tool to convert the line endings. Thanks for the heads up on the RA, I'll convert it with Excel and re-export. When I finish, do you want to see the resulting file?

good to hear someone on osx has this working... i can't get it to work. has every single version of this script worked for you, or just the most recent one?

my images solve fine on windows so it's quite a mystery why they won't solve on OSX.

Yes, but I just started using it yesterday. The key for me was to upgrade my version of PI (32-bit) to 01.07.05.0779... it didn't work before that and threw the same error you were getting.

okay, i'm not crazy then. i have been hesitant to apply the updates since someone was having a big problem with the new DSLR_RAW module and that's kind of important to me...

maybe i'll make a copy of the app and upgrade that one, just to see. thanks for the feedback.


Offline Jose Joaquin Perez

  • Newcomer
  • Posts: 40
    • View Profile
    • Astrofotografía Austral
Re: Annotation script
« Reply #99 on: 2012 April 04 09:03:52 »
Hi Andrés, how can I do to get the info from others popular catalogues? ( Barnard, van Den Vergh, Caldwell. Cederblab, etc.) ???

Do I need to download some kind of archive?

Thanks for your help.

Best regards,
You can try with VizieR. There are several hundreds of catalogs there: http://cdsarc.u-strasbg.fr/viz-bin/Cat. If you find the catalog that you want, then you have to make a custom catalog for the annotation script. For example:
  • Suppose that you want the catalog "VII/233 - 2MASS Extended sources". You have to find it in VizieR and enter in the query page: http://vizier.u-strasbg.fr/viz-bin/VizieR?-source=VII%2F233
  • In the target field select the coordinates of your image. Select also the columns that you want. For the custom catalog you will need at least the J2000 coordinates.
  • If you want to filter by magnitude or another criteria do it in this page.
  • In the preferences select the output as "ascii text/plain" and the maximum number of records. Press "Submit".
  • Save the result of the query as a file and open it in Excel
  • Using the capabilities of Excel it is usually easy to reformat the results so they are in the format of the custom catalogs of the annotation script.

If the catalog is not in VizieR, then you have to find a source and then reformat it in the same way.

Thanks Andrés for your quick and detailed response.

I will let you know my findings.

Best regards,
____________________
José Joaquín Pérez
Rancagua, Chile
www.astro-austral.cl

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 912
    • View Profile
Re: Annotation script
« Reply #100 on: 2012 April 04 10:56:23 »
okay, i'm not crazy then. i have been hesitant to apply the updates since someone was having a big problem with the new DSLR_RAW module and that's kind of important to me...

maybe i'll make a copy of the app and upgrade that one, just to see. thanks for the feedback.
Keep in mind that both AnnotateImage and ImageSolver use functionality introduced by Juan very recently. For using this scripts you MUST have the last version of PI with all the updates.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 912
    • View Profile
Re: Annotation script
« Reply #101 on: 2012 April 04 11:04:56 »
I have a new version of the annotation script with several bug fixes (thanks jlake ;) )
The improvements are these:
  • Fix for custom catalogs that cover the entire sky.
  • Support of custom catalogs with line endings in Mac format [CR].
  • Fixed problem in the labels of the grid near RA=0h.
  • More fields for the labels in the catalogs NamedStars (HD code, HIP code, Bayer-Flamsteed code) and Tycho2 (BT magnitude and HIP code).
  • Shortened the names of the variables in the persistence. PI seems to have a limit in the length of the parameter list.


Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6839
    • View Profile
    • http://pixinsight.com/
Re: Annotation script
« Reply #102 on: 2012 April 04 12:13:57 »
Hi Andrés,

Can I release an update with this version?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6839
    • View Profile
    • http://pixinsight.com/
Re: Annotation script
« Reply #103 on: 2012 April 04 12:17:39 »
Quote
Shortened the names of the variables in the persistence. PI seems to have a limit in the length of the parameter list.

What do you refer to exactly? The Parameters JavaScript object has no specific limit. The only limit is the maximum number of console lines, which is 1000 by default but can be increased or even disabled. Do you really need more than 1000 lines to write your script parameters to the command line each time your script is launched from an instance?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 912
    • View Profile
Re: Annotation script
« Reply #104 on: 2012 April 04 12:31:04 »
Juan, I think that both scripts are ready for publishing.

Quote
Shortened the names of the variables in the persistence. PI seems to have a limit in the length of the parameter list.

What do you refer to exactly? The Parameters JavaScript object has no specific limit. The only limit is the maximum number of console lines, which is 1000 by default but can be increased or even disabled. Do you really need more than 1000 lines to write your script parameters to the command line each time your script is launched from an instance?
I have tried to reproduce the problem that I had, but it doesn't fail anymore. The script uses tens of parameter for defining the values for all the layers. Yesterday doing tests of saving to an icon it started to fail. I can't remember the error but it got fixed when I made shorter the names of the parameters.

This is an example of command line:
Code: [Select]
run -x -p="engine_vizierServer,http://vizier.u-strasbg.fr/" -p="engine_removeDuplicates,true" -p="engine_outputMode,0" -p="engine_applySTF,false" -p="engine_epoch,2451544.5" -p="layer0_visible,true" -p="layer0_showMarkers,true" -p="layer0_lineColor,2164260863" -p="layer0_lineWidth,1" -p="layer0_showLabels,true" -p="layer0_labelSize,12" -p="layer0_labelBold,false" -p="layer0_labelItalic,false" -p="layer0_labelColor,4294967295" -p="layer0_labelFace,1" -p="layer0_density,4" -p="layer1_visible,true" -p="layer1_showMarkers,true" -p="layer1_lineColor,4294967295" -p="layer1_lineWidth,1" -p="layer1_showLabels,true" -p="layer1_labelSize,10" -p="layer1_labelBold,false" -p="layer1_labelItalic,false" -p="layer1_labelColor,4294967295" -p="layer1_labelFace,1" -p="layer1_magMin,1000" -p="layer1_magMax,1000" -p="layer2_visible,true" -p="layer2_showMarkers,true" -p="layer2_lineColor,4294967295" -p="layer2_lineWidth,1" -p="layer2_showLabels,true" -p="layer2_labelSize,10" -p="layer2_labelBold,false" -p="layer2_labelItalic,false" -p="layer2_labelColor,4294967295" -p="layer2_labelFace,1" -p="layer2_catalogPath,C:/Users/Andres/Documents/PCL/ngc2000.txt" -p="layer3_visible,true" -p="layer3_showMarkers,true" -p="layer3_lineColor,4294967295" -p="layer3_lineWidth,1" -p="layer3_showLabels,true" -p="layer3_labelSize,10" -p="layer3_labelBold,false" -p="layer3_labelItalic,false" -p="layer3_labelColor,4294967295" -p="layer3_labelFace,1" -p="layer3_magMin,1000" -p="layer3_magMax,1000" -p="layer4_visible,true" -p="layer4_showMarkers,true" -p="layer4_lineColor,4294967295" -p="layer4_lineWidth,1" -p="layer4_showLabels,true" -p="layer4_labelSize,10" -p="layer4_labelBold,false" -p="layer4_labelItalic,false" -p="layer4_labelColor,4294967295" -p="layer4_labelFace,1" -p="layer5_visible,true" -p="layer5_showMarkers,true" -p="layer5_lineColor,805306368" -p="layer5_lineWidth,1" -p="layer5_showLabels,true" -p="layer5_labelSize,14" -p="layer5_labelBold,false" -p="layer5_labelItalic,false" -p="layer5_labelColor,4294967295" -p="layer5_labelFace,1" -p="layer5_positionX,0" -p="layer5_positionY,100" -p="layer5_text," -p="layer6_visible,true" -p="layer6_showMarkers,true" -p="layer6_lineColor,805306368" -p="layer6_lineWidth,1" -p="layer6_showLabels,true" -p="layer6_labelSize,14" -p="layer6_labelBold,false" -p="layer6_labelItalic,false" -p="layer6_labelColor,4294967295" -p="layer6_labelFace,1" -p="layer6_positionX,0" -p="layer6_positionY,100" -p="layer6_text," -p="layer7_visible,true" -p="layer7_showMarkers,true" -p="layer7_lineColor,4294967295" -p="layer7_lineWidth,1" -p="layer7_showLabels,true" -p="layer7_labelSize,10" -p="layer7_labelBold,false" -p="layer7_labelItalic,false" -p="layer7_labelColor,4294967295" -p="layer7_labelFace,1" -p="layer7_magMin,1000" -p="layer7_magMax,15" -p="layer8_visible,true" -p="layer8_showMarkers,true" -p="layer8_lineColor,4294967295" -p="layer8_lineWidth,1" -p="layer8_showLabels,true" -p="layer8_labelSize,10" -p="layer8_labelBold,false" -p="layer8_labelItalic,false" -p="layer8_labelColor,4294967295" -p="layer8_labelFace,1" -p="layer8_magMin,1000" -p="layer8_magMax,15" -p="layer9_visible,true" -p="layer9_showMarkers,true" -p="layer9_lineColor,4294967295" -p="layer9_lineWidth,1" -p="layer9_showLabels,true" -p="layer9_labelSize,10" -p="layer9_labelBold,false" -p="layer9_labelItalic,false" -p="layer9_labelColor,4294967295" -p="layer9_labelFace,1" -p="layer9_magMin,1000" -p="layer9_magMax,15" -p="engine_layers,new GridLayer()|new CatalogLayer(new NamedStarsCatalog())|new CatalogLayer(new NGCICCatalog())|new CatalogLayer(new TychoCatalog())|new CatalogLayer(new PGCCatalog())|new TextLayer()|new TextLayer()|new CatalogLayer(new UCAC3Catalog())|new CatalogLayer(new PPMXLCatalog())|new CatalogLayer(new USNOB1Catalog())|new GridLayer()|new GridLayer()|new GridLayer()" -p="isGlobalTarget,true" -p="isViewTarget,false" -p="layer10_visible,true" -p="layer10_showMarkers,true" -p="layer10_lineColor,2164260863" -p="layer10_lineWidth,1" -p="layer10_showLabels,true" -p="layer10_labelSize,12" -p="layer10_labelBold,false" -p="layer10_labelItalic,false" -p="layer10_labelColor,4294967295" -p="layer10_labelFace,1" -p="layer10_density,4" -p="layer11_visible,true" -p="layer11_showMarkers,true" -p="layer11_lineColor,2164260863" -p="layer11_lineWidth,1" -p="layer11_showLabels,true" -p="layer11_labelSize,12" -p="layer11_labelBold,false" -p="layer11_labelItalic,false" -p="layer11_labelColor,4294967295" -p="layer11_labelFace,1" -p="layer11_density,4" -p="layer12_visible,true" -p="layer12_showMarkers,true" -p="layer12_lineColor,2164260863" -p="layer12_lineWidth,1" -p="layer12_showLabels,true" -p="layer12_labelSize,12" -p="layer12_labelBold,false" -p="layer12_labelItalic,false" -p="layer12_labelColor,4294967295" -p="layer12_labelFace,1" -p="layer12_density,4" --md5="dc8da8b0092b7ae0eca0b1984d62b286" -p="isGlobalTarget,false" -p="isViewTarget,true" -p="targetView,_2009_06_13_M13_v1" "C:/Users/Andres/Documents/PCL/AnnotateImage.js"
It works now, but yesterday a similar test failed.