Author Topic: Annotation script  (Read 151997 times)

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Annotation script
« Reply #150 on: 2012 April 13 12:50:37 »
Hi

I know I have asked before , but I don't know how to do it but is there a list of fainter galaxys  ;D


Harry
Harry Page

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Annotation script
« Reply #151 on: 2012 April 13 15:00:16 »
Thanks, Andres, for all your hard work bringing us this great script. I was pleased to see the addition of more catalogs. Like Herbert, I would like to see the B-V index for a many stars as possible in an image as it's a great way to check star color. The Hipparcos catalog should provide this info but I'm not able to see any results. Tried 4 or 5 images but no data from that catalog is displayed. I've tried several of the choices in the Label Text drop down list with no results on image. Does it matter which Vizer server is chosen in the General properties section? Any help appreciated and again, many thanks.

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline Herbert_W

  • PixInsight Addict
  • ***
  • Posts: 204
    • Skypixels - Astrophotography by Herbert Walter
Re: Annotation script
« Reply #152 on: 2012 April 13 15:18:34 »
Hi Andres!

Thanks a lot for the added catalogs.
Your tool is absolut fanastic and it saves me a lot of time (in compare to aladin and other sources).

I dont need another software or links for objectidentification - just PixInsight - thats great!!


Thanks again and kind regards.
Herbert, Austria

What format do you need for the catalogs?
- my wishlist for catalogs is not finished   ;)  not yet

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #153 on: 2012 April 13 15:37:17 »
Hi

I know I have asked before , but I don't know how to do it but is there a list of fainter galaxys  ;D


Would the 2MASS catalog (http://vizier.u-strasbg.fr/viz-bin/VizieR?-source=VII%2F233) be enough? It has 1647599 objects.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #154 on: 2012 April 13 15:41:28 »
Thanks, Andres, for all your hard work bringing us this great script. I was pleased to see the addition of more catalogs. Like Herbert, I would like to see the B-V index for a many stars as possible in an image as it's a great way to check star color. The Hipparcos catalog should provide this info but I'm not able to see any results. Tried 4 or 5 images but no data from that catalog is displayed. I've tried several of the choices in the Label Text drop down list with no results on image. Does it matter which Vizer server is chosen in the General properties section? Any help appreciated and again, many thanks.

Steve
The Hipparcos catalog has only a few hundreds of stars. It is really only useful for wide field images.

The "UBVRI photometry of faint field stars" (http://vizier.u-strasbg.fr/viz-bin/VizieR?-source=II%2F277) has the B-V index for 34000 stars. This catalog is still quite short, but I can not find a bigger catalog with B-V indexes. Do you know a better catalog?

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #155 on: 2012 April 13 15:47:13 »
What format do you need for the catalogs?
- my wishlist for catalogs is not finished   ;)  not yet
The script currently supports catalogs served by VizieR servers or catalogs in a custom format defined in this message .
In this other message there is an explanation for creating a custom catalog.

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Annotation script
« Reply #156 on: 2012 April 13 16:47:15 »
Thanks for your quick reply. Currently I use Aladin in conjunction with my RGB image to check star color. In Aladin I use 2 catalogs to get V mag, R mag and/or g mag for the stars in the image abd then with these values one can determine what the star color should be. In Aladin this is done by clicking on a star, one star at a time. The 2 catalogs are:

NOMAD:  http://cdsarc.u-strasbg.fr/viz-bin/Cat?NOMAD1

SDSS Photometric, Release 7:  http://cdsarc.u-strasbg.fr/viz-bin/Cat?SDSS-DR7

I believe the SDSS catalog is more accurate but covers less sky than the NOMAD catalog.

If the V, R, and G mags could be displayed for the stars in the image, that would be outstanding  .

Thanks again for your help.

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline Herbert_W

  • PixInsight Addict
  • ***
  • Posts: 204
    • Skypixels - Astrophotography by Herbert Walter
Re: Annotation script
« Reply #157 on: 2012 April 13 21:50:17 »
Hi Andres!

OK - I overlooked the messages to create a custom catalog,.....


SDSS: release 8 is the newest.


Best regards.
Herbert, Austria

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Annotation script
« Reply #158 on: 2012 April 14 00:07:27 »
Hi

I know I have asked before , but I don't know how to do it but is there a list of fainter galaxys  ;D


Would the 2MASS catalog (http://vizier.u-strasbg.fr/viz-bin/VizieR?-source=VII%2F233) be enough? It has 1647599 objects.

Hi

Yes that would be excellent  ;D

Harry
Harry Page

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #159 on: 2012 April 14 03:04:00 »
After reading the feedback of the last night I am going to rethink the implementation of the labels.

I am thinking in allowing up to 8 labels around an object. The dialog instead of having one combobox for selecting the label, it would have eight, one in each possible location. Each combo would allow to be left empty or select one of the available fields:
______
Name
______
______      ______
MagV
______
MagB

I don't know whether this is really useful or it would be too hard to use for casual users.

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: Annotation script
« Reply #160 on: 2012 April 14 05:30:42 »
Hi

I don't think that would be a problem , the script is not difficult to use  :laugh:

I wonder long term if this script could be used in colour corection of our images if we know what stars are what colour  :D  I mean Juan does not have a lot to do these days  >:D

Harry
Harry Page

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
Re: Annotation script
« Reply #161 on: 2012 April 14 08:43:23 »
After reading the feedback of the last night I am going to rethink the implementation of the labels.

I am thinking in allowing up to 8 labels around an object. The dialog instead of having one combobox for selecting the label, it would have eight, one in each possible location. Each combo would allow to be left empty or select one of the available fields:
______
Name
______
______      ______
MagV
______
MagB

I don't know whether this is really useful or it would be too hard to use for casual users.

This is a great idea, I would use this functionality quite a bit!

Offline sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 431
Re: Annotation script
« Reply #162 on: 2012 April 14 08:53:39 »
Agree, the ability to display more than one label at a time is a great idea.

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: Annotation script addon - B-V white balance stars
« Reply #163 on: 2012 April 14 18:41:41 »
I've had this idea since the ImageSolver and AnnotateImage were first provided by Andres - to use them to locate white balance stars for ColorCalibration.  Last night I woke at 4am and couldn't get back to sleep, and for some reason it seemed like a good time to teach myself JavaScript, how to use the Vizier catalog search features, how to use star spectral information for white balance, and to hack AnnotateImage to give me something I wanted.  By 8am I came up with this and for the most part, it seems to work.  I am not a programmer and do not know much about JS, but I do have a bit of experience with scripting and programming - more hacking others code than writing my own.

At first I was thinking that I'd like to be able to label all G2V stars.  A simple way didn't occur to me at that time of the morning, but I did recall reading about another method of white balance using B-V magnitudes.  I discovered that the NOMAD1 catalog has the appropriate information.  Based on this PDF article on B-V colour calibration, I learned that G2 stars have a constant B-V magnitude of 0.65.  The article also talks about V-R magnitudes of 0.36 as well, although that's less relevant for some reason I don't understand yet.  He goes through a method using Aladin, and uses the NOMAD1 catalog to filter out just stars with B-V in an "acceptable" range of 0.6 to 0.7, and R-V of 0.2 to 0.6.

In looking through the data that NOMAD1 output, I see there is a column available called "recommended".  I assumed, and please correct me if I'm wrong, that these entries are the best ones to use.  I noted they seem to all have the applicable filter data for B, V, and R.  I understand that NOMAD1 is not supposed to be super-accurate, while SDSS is but covers less of the sky?

So I went into Andres' AstronomicalCatalogs.jsh file to see how he was getting the Hipparcos star information, copied that section to the end of the file, and started changing it to try to get the relevant information from the NOMAD1 catalog.  Below is what I added to the end of the above file.  So you add this to the end of the AstronomicalCatalogs.jsh file, save it, then run AnnotateImage on your solved file.  Add "B-V WB Catalog" which should now appear in your list of catalogs available.  I disable all the other annotations, just leaving this one ticked.  So when you click OK, what should show up are the stars in the NOMAD1 catalog that have pretty close spectra to G2 stars.  The label "name" is identical to the NOMAD1 ID.  The idea would be to add a preview to one of those stars that is unsaturated, then copy that preview to your RGB image to use as the white balance reference for ColorCalibration.

I did notice something odd with the output.  If I don't enter any values in the magnitude filter, I get stars being annotated.  With my sample image, I then tried filtering a magnitude range, and added 1 as min and 10 as max.  2 stars showed up, but interestingly these 2 stars were not in the unfiltered output.  So I need to get to the bottom of that.  Perhaps someone more knowledgeable than I can see the flaw in my script?

Anyway, here's my snippet.  Please feel free to comment, critique, improve, and add to the main script.  I hope someone else finds it as useful as I hope it can be.

Code: [Select]
// ******************************************************************
// B-V White Balance Stars from NOMAD1
// ******************************************************************
// hacked by Troy Piggins from the Hipparcos function above

function BVCatalog()
{
   this.name="B-V WB Catalog";
   this.description = "Displays only stars within B-V range for white balance use";

   this.__base__ = VizierCatalog;
   this.__base__( this.name );

   this.catalogMagnitude = 14;

   this.fields = [ "Name", "V mag", "B-V mag", "V-R mag" ];

   this.properties.push( ["magMin", DataType_Double] );
   this.properties.push( ["magMax", DataType_Double] );

   this.GetConstructor = function()
   {
      return "new BVCatalog()";
   }

   this.UrlBuilder = function(metadata, mirrorServer)
   {
      var fieldOfView=Math.max(metadata.width,metadata.height)*metadata.resolution;
      var url=mirrorServer+"viz-bin/asu-tsv?-source=I/297&-c=" +
         format("%f %f",metadata.ra,metadata.dec) +
         "&-c.eq=J2000&-c.r=" + format("%f",fieldOfView) +
         "&-c.u=deg&-out.form=|"+
         "&-out.add=_RAJ,_DEJ&-out=NOMAD1&-out=Vmag&-out=Bmag&-out=Rmag&-out=pmRA&-out=pmDE&-out=R" +
         this.CreateMagFilter( "Vmag", this.magMin, this.magMax ) ;

      return url;
   }

   this.ParseRecord = function( tokens, epoch )
   {
      if( tokens.length>=8 && parseFloat(tokens[0])>0 )
      {

// Only use NOMAD1 "recommended" stars.  They appear to have all 3 B, V, and R
// filters.
         var recommended = tokens[8].trim();

// Calculate B-V
         var BV = +tokens[4].trim()-+tokens[3].trim();

// Calculate V-R
         var VR = +tokens[3].trim()-+tokens[5].trim();

// Set acceptable ranges
         var BVmin = 0.6;
         var BVmax = 0.7;
         var VRmin = 0.2;
         var VRmax = 0.6;

// Filter out the stars we don't want
         if( recommended.search("R") !=-1 && BVmin <= BV && BV <= BVmax && VRmin <= VR && VR <= VRmax)
         {
            var x = parseFloat( tokens[0] );
            var y = parseFloat( tokens[1] );
            if( !(x>=0 && x<=360 && y>=-90 && y<=90) )
               return null;

            if( epoch!=null )
            {
               var pmX = parseFloat( tokens[6] );
               var pmY = parseFloat( tokens[7] );
               var dx = pmX*(epoch-2000)/3600000 * Math.cos( y*Math.PI/180 );
               var dy = pmY*(epoch-2000)/3600000;
               x += dx;
               y += dy;
            }
            var name = tokens[2].trim();
            var record = new CatalogRecord( new Point( x, y ), 0, name, parseFloat( tokens[3] ) );
            record["V mag"]=tokens[3].trim();
            record["B-V mag"]=BV+"";
            record["V-R mag"]=VR+"";
            return record;
         } else
            return null;
      } else
         return null;
   }
}

BVCatalog.prototype = new VizierCatalog;
__catalogRegister__.push( (new BVCatalog).GetConstructor() );

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #164 on: 2012 April 15 05:40:59 »
The idea of doing the color calibration with the assistance of a photometric catalog is very interesting. The annotation script is designed for reusing the implementation of the catalogs so it should be easy to use it for writing a calibration script. I don't think that adding calibration functionality to the annotation script would be convenient. It would be better to have an independent script.

I am integrating your catalog in the script. I have made a few modifications for making it more general. I hope to have it finished by this night. I am doing also other changes that need more tests.

I have removed the check for R's in the field Recommended because I have not been able to find any "recommended" stars. Now I only exclude the problematic stars ("R=*"). Also, I have added filters to the VizieR query so it returns only stars with values for Vmag, Bmag and Rmag.