Author Topic: Registering on Comet ?  (Read 9560 times)

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Registering on Comet ?
« on: 2011 August 22 15:01:12 »
Hi!
Need advice how to do, or hint where to find the "todo"
how to register a large number of comet images on the comet only.

Registration on the stars worked perfect. But what tool and what parameter are
used to align the "on the stars registered images" now on the comet?
Thanks for your help.
Gerald

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Registering on Comet ?
« Reply #2 on: 2011 August 23 03:51:01 »
Hi Enzo!
Thanks for your fast reply.
The links you mentioned i have found before using the search tools.
I could not find there a hint how to simply register 65 preregistered images
on the comet only. (no need for star removal in the first try)
Yes, i tried Dynamic Star Align. But in this tool i
only found the possibility to register 2 images. So, i did this manually
with 3 images using DSA. This was not really user friendly. If i have
to do these steps for the 65 images from yesterday and/or the 160 from last
night i will be ready for special treatment in closed environment.
There must be another way in PI, i think i am to blind to find it so fare.

In addition i did not find in DSA to register the first and the last image as they
seem to be to far apart. For sure my fault, but i would need also a  hint how
to register images where the comet has moved a long way already.

Yes, i could go back to ImagesPlus, where this task would be very simple.
However, so far i could find for each processing problem a solution in PI so there
is no need anymore for PS, ImagePlus, Astroart and other processing tools
which are not as complete as PI is! And i have dumped the incomplete SW like
PS and ImagePlus anyhow into the trashbin.

Much talking - simple question:
is there a way to register large numbers of images only on the comet with PI?
(Its not a problem if the stars become lines in the final image)

Help
Gerald

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • Astrophotography
Re: Registering on Comet ?
« Reply #3 on: 2011 August 29 12:32:54 »
Hi Gerald,

I was just solving same problem this weekend (Garradd at M71).
In theory, problem is simple (but not automated in PI).
1) You need to have all pictures registered on stars, so comet movement between frames is linear.
2) You need to measure distance of the comet between two frames (ideally first one and last one)
3) Knowing time of each shot (from image metadata), you can easily compute position of the comet on each frame using simple linear interpolation.
4) You need to shift each picture by corresponding offset in x and y.

This is how I did it:
1) I simply registered all frames with StarAlignment
2) I took first and last frame and using DynamicAlignment, I measured distance of the comet (simply by selecting comet core on each frame and reading dx and dy from the dialog.
3) Now the tricky part. I'm using DSLR, so I needed to extract time of the exposure for each frame (DSLR Exif metadata). I do not know any way how to get it in PixInsight (and even if readed from RAW file, they will be lost in FIT conversion, calibration and registration process). So, I used DeepSkyStacker to get the data. I simply opened all RAW files in DeepSkyStacker, selected all data from file table (right-bottom) and Ctrl+C copied them to clipboard. Two columns of the table were interesting - name of the file and time of the exposure.
Pasting the table to Excel and knowing comet pixel distance between first and the last frame, I easily computed dx and dy for each frame. I used the frame in the middle as reference one.
4) Then I wrote simple script in PixInsight to load each star-registered picture, shift it using Image.translate(dx, dy) method and save it under new name. Array of dx and dy values was simply copy-pasted from Excel (thus hardcoded in the script).

Here is my single-purpose script with hardcoded data:
Code: [Select]
var files = new Array("CRW_2749",
                        "CRW_2750",
                        "CRW_2751",
                        "CRW_2752",
                        "CRW_2753",
                        "CRW_2754",
                        "CRW_2755",
                        "CRW_2757",
                        "CRW_2758",
                        "CRW_2759",
                        "CRW_2760",
                        "CRW_2768",
                        "CRW_2769",
                        "CRW_2770",
                        "CRW_2771",
                        "CRW_2773",
                        "CRW_2774",
                        "CRW_2775",
                        "CRW_2776",
                        "CRW_2778",
                        "CRW_2779",
                        "CRW_2780",
                        "CRW_2782",
                        "CRW_2783",
                        "CRW_2784",
                        "CRW_2785",
                        "CRW_2786",
                        "CRW_2787",
                        "CRW_2788",
                        "CRW_2789",
                        "CRW_2790",
                        "CRW_2791"
                        );

var dx = new Array(-61.60326087,
                  -56.68478261,
                  -52.5,
                  -49.02173913,
                  -45.57065217,
                  -42.0923913,
                  -38.64130435,
                  -33.99456522,
                  -30.51630435,
                  -27.06521739,
                  -23.58695652,
                  -10.02717391,
                  -6.684782609,
                  -3.342391304,
                  0,
                  4.211956522,
                  7.554347826,
                  10.89673913,
                  14.23913043,
                  20.73369565,
                  24.07608696,
                  27.41847826,
                  33.28804348,
                  36.63043478,
                  39.97282609,
                  43.31521739,
                  46.6576087,
                  50,
                  53.3423913,
                  56.68478261,
                  60.05434783,
                  63.39673913
                  );

var dy = new Array(-6.012478261,
                  -5.532434783,
                  -5.124,
                  -4.784521739,
                  -4.447695652,
                  -4.108217391,
                  -3.771391304,
                  -3.317869565,
                  -2.978391304,
                  -2.641565217,
                  -2.302086957,
                  -0.978652174,
                  -0.652434783,
                  -0.326217391,
                  0,
                  0.411086957,
                  0.737304348,
                  1.063521739,
                  1.38973913,
                  2.023608696,
                  2.349826087,
                  2.676043478,
                  3.248913043,
                  3.575130435,
                  3.901347826,
                  4.227565217,
                  4.553782609,
                  4.88,
                  5.206217391,
                  5.532434783,
                  5.861304348,
                  6.187521739
                  );

var numFiles = files.length;
var path = "F:/astrofoto/110826_Garrad_M71/"

for (var i = 0; i < numFiles; i++)
{

   var sourceName = "r_debayer_c_"+files[i]+".fit";
   var sourceWindow = ImageWindow.open(path+sourceName);
   var sourceView = sourceWindow[0].mainView;

   sourceView.beginProcess();
   sourceView.image.translate(dx[i], dy[i]);
   sourceView.endProcess();

   sourceWindow[0].saveAs(path+"cs_"+sourceName, false, false, false, false);
   sourceWindow[0].forceClose();
   gc();
}

There could be improvements to this workflow. I assume if one have FITs instead of RAWs, you can read time of the exposure directly from the script (just guessing, I'm not sure).

The script can also be easily reused (with little modification) to take integrated star-free comet image and subtract it from each of the original frames with corresponding shift, leaving comet-free images to be stacked separately and then combined with the integrated comet image (I did it).

Here is my result:

Not as good I as hoped - due to unexpected problems with autoguider, I had to resort to manual guiding (what a terrible experience) and star size far from ideal.

hope it helps,
Zbynek
« Last Edit: 2011 August 29 12:39:13 by zvrastil »

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Registering on Comet ?
« Reply #4 on: 2011 August 29 12:57:37 »
Hi Zbynek,

Bravo! :)

I'll improve metadata management in the next version of the standard file format modules. I'll also modify the batch conversion script to preserve relevant DSLR EXIF metadata as their equivalent standard FITS keywords.

You can retrieve all FITS keywords with the keywords property of ImageWindow:

Array ImageWindow.keywords

The returned value is an array of FITSKeyword objects.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Registering on Comet ?
« Reply #5 on: 2011 August 29 13:49:21 »
Hi Zbynek!
Thanks for the extensive and detailed advice for solving the comet stacking issue.
Point 1 in your first paragraph i did already. Gives already a nice animation of 145 images (90 Seconds exposure each)
with PI_Animation_Script.
Now, to get the dx and dy values from Fits-Header into your script
will take some trying and thinking.
Your workflow looks clear - we will see how my implementation will succeed.

My not very succesful tries so far are  -
The Windsorized Sigma stacked version without stars removals
(After manually(!)  moving the images centering on the comet)
http://www.werbeagentur.org/oldwexi/gallery_deepsky/Garrad_145x90_crop.jpg

The try to integrate M71 and Garrad in one image which looses a lot of Comet tail...
http://www.werbeagentur.org/oldwexi/gallery_deepsky/Garrad_145x90_M71_30x180_crop.jpg

Thanks for your help any further adivíce is highly appreciated.

Gerald


Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur
Re: Registering on Comet ?
« Reply #6 on: 2011 August 29 15:11:22 »
Zbynek, nice job!.  :)

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Registering on Comet ?
« Reply #7 on: 2011 August 30 16:17:30 »
Here my latest version of Garrad with M71.

full size version:
http://www.werbeagentur.org/oldwexi/gallery_deepsky/Garrad_M71.jpg

QHY8 on C14 with Hyperstar.
Stars   31x180 Sec. exposed 23.8.2011
Comet 135x90 Sec. exposed 26.8.2011

Used Morphology for removing stars in cometstack.
Used PixelMath for integrating comet with M71 and stars.
Thanks for all the advices.

All Image processing with PixInsight except the comet registration.

Gerald

« Last Edit: 2011 August 30 16:22:59 by oldwexi »