Author Topic: Star Alignment Summary?  (Read 2003 times)

Offline james7

  • Member
  • *
  • Posts: 53
    • View Profile
Star Alignment Summary?
« on: 2014 March 19 22:09:58 »
Is there any tool or script that can be run in PixInsight that will perform a star alignment on a stack of subframes and output a summary of the registration offsets? It would be great if there was a way to plot the +/- offsets for all of the subframes with a statistical summary. In fact, it would be nice just to get a comma separated list of the values that could then be processed in a spreadsheet or with some other tool. Having such a tool in PixInsight would make it possible to analyze your guiding or even measure things like periodic error. The data is being written to the console, there just needs to be a way to log the results in a convenient format so that it can be processed.
« Last Edit: 2014 March 19 22:24:07 by james7 »

Offline bianry

  • PixInsight Enthusiast
  • **
  • Posts: 90
    • View Profile
Re: Star Alignment Summary?
« Reply #1 on: 2014 March 19 22:52:18 »
Not what you are looking for but you can write the output of the log to a file. Write 'help log' in the process console and you will get a list of all log commands. Then it would be a matter of parsing the log file. I could take a look at it if you sent me some output and explains what you are looking for.

regards

Mats

Offline james7

  • Member
  • *
  • Posts: 53
    • View Profile
Re: Star Alignment Summary?
« Reply #2 on: 2014 March 19 23:36:13 »
I've already got access to the log, it's just that I was hoping that someone might have already written a script or tool to parse the log and output either a summary or better yet a plot of the registration offsets. The data that would be useful would be a time stamp of when the image was captured, the exposure, and then the dx and dy offsets, rotation, and possibly the RMS and peak errors. Maybe two sets of files in a comma separated list, one very simple -- dx, dy, rotation, timestamp -- and the other with all of the above and a summary (mean dx and dy, mean rotation, range of dx, dy, and rotation, count of subframes, time range over which the subframes were captured). Of course a tool that would provide a nice summary and maybe plot the dx, dy values would be really great.

I'm looking to see if anything already exists before I consider writing something of my own.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 918
    • View Profile
Re: Star Alignment Summary?
« Reply #3 on: 2014 March 20 03:09:55 »
You don't need to parse the output log of StarAlignment. From PJSR you can execute StarAlignment and get as a result the transformation matrix between the two images. The first step of ImageSolver is based on this.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6934
    • View Profile
    • http://pixinsight.com/
Re: Star Alignment Summary?
« Reply #4 on: 2014 March 20 03:48:23 »
Andrés has described the correct way to implement this. Although the reference documentation for StarAlignment is now obsolete, it is still useful to get information on its output properties. See Table 6 -  StarAlignment Output Properties.

You can write a script that creates an instance of the StarAlignment process, populates its properties with the required data (basically, you only need to specify the reference and target images), executes it, and gathers its relevant output data. In this case you are interested in the H13 and H23 matrix elements, which are the X-axis and Y-axis displacements for each target image (neglecting rotation, scaling and other projective transformations).

I strongly recommend you study the sections of ImageSolver script that Andrés has pointed out. The following snippet shows the basic technique:

Code: [Select]
#define DX 13
#define DY 16

var S = new StarAlignment;
S.referenceImage = "/path/to/reference/image.fit";
S.referenceIsFile = true;
S.targets = [
   [ true, true, "/path/to/target/image1.fit" ],
   [ true, true, "/path/to/target/image2.fit" ],
   [ true, true, "/path/to/target/imageN.fit" ],
];
S.executeGlobal();
var deltaX = new Array;
var deltaY = new Array;
for ( var i = 0; i < S.outputData.length; ++i )
{
   deltaX.push( S.outputData[i][DX] );
   deltaY.push( S.outputData[i][DY] );
}

Once you have the dx and dy values for each target image, you can analyze them very easily. For example, you can use the integrated gnuplot utility to generate graphics in SVG format, which you can present on a graphical interface, just to mention one interesting possibility.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline james7

  • Member
  • *
  • Posts: 53
    • View Profile
Re: Star Alignment Summary?
« Reply #5 on: 2014 March 20 22:55:06 »
Okay, thanks to all for the information. It looks like there may not be anything that has already been written, so maybe I'll give it a try. Here is something (attached) that I did manually that plots the periodic error for an iOptron SkyTracker.