PhotometricMosiac 4.0

Regarding updated documentation, perhaps including an updated version of the quick start guide in this thread would be possible?
Larry
 
I get this message when clicking Overlap Gradient or Target Gradient.
If you could send me a link to the reference and target image, I will look into it. A process icon would also help so I can reproduce your exact settings. Please use .xisf compression when saving the images. The black areas compress really well.

Which version of PhotometricMosaic are you using?
 
Hello,
I'm using the most recent one. I tried using windows on my Mac Book (partition) and it worked normally so it seems it is more of an issue with MAC. Are you on MAC or Windows ?
I'll PM links to the two files.

Thanks for any help on this.
 
Hello,
I'm using the most recent one. I tried using windows on my Mac Book (partition) and it worked normally so it seems it is more of an issue with MAC. Are you on MAC or Windows ?
I'll PM links to the two files.

Thanks for any help on this.
I use Windows 10, but I have access to a friend's Mac, so I can try it on that.
 
Hello,
it has 16GB. I have used the script before and it worked very well with a 5 panel mosaic so was wondering what could have changed. Alternatively, I could try to go back to an older version.
 
Hello,
it has 16GB. I have used the script before and it worked very well with a 5 panel mosaic so was wondering what could have changed. Alternatively, I could try to go back to an older version.
Myself and @pfile have manged to reproduce the error on MACS with 8 GB. Clearly it can also fail with 16 GB. No one has yet reproduced it with 32 GB or more.

The error occurs within the PixInsight C++ module SurfaceSpline, when its initialize(...) method is called. It throws a Segmentation violation (SIGSEGV).

PhotometricMosaic is calling this method with completely valid data (I added temporary test code to confirm this). However, it is possible that the maximum number of interpolation nodes I am giving to the SurfaceSpline may be too large. Usually the number used is well below the maximum, but this is not the case with your current dataset. As a temporary fix:
  1. Create a PhotometricMosaic process icon. Double click on it.
  2. Edit the 'maxSamples' parameter (double click on it) and reduce it (for example to 2000).
  3. Use the blue circle to start PhotometricMosaic.
  4. It will now set the maximum number of interpolation nodes to approximately 2000. This will be remembered between sessions until you press the script's reset button.

1639565967157.png


Alternatively, there is also an 'extraControls' parameter. If you set this to true, an extra dialog will be available within the Sample Generation section (Binned grid). You can use this to set the maximum number of interpolation nodes, and view how the original samples are binned to create this smaller set.

1639566290958.png


1639566436475.png

The blue squares are the original unbinned samples.
The red squares are the binned samples. They are created from the unbinned samples that were not rejected. Their position is based on the center of gravity of those unbinned samples, and their size depends on how many unbinned samples were used.

This dialog was created to help me check the script was working correctly, but you might find it useful or interesting. Bear in mind that this is only a test dialog, so it may be a bit clunky to use.

Regards, John
 
Last edited:
The maxSamples approach worked perfectly. I much appreciate the investigation that went into understanding the issue and the resolution. The tool is superb and I look forward to many more mosaics.
Frederic
 
After a great deal of hard work, I have just rewritten the Reference Documentation for PhotometricMosaic. PhotometricMosaic has many significant recent changes, so I would encourage everyone to read the 'Quick Start' section again. This documentation will be included in the next PixInsight release. If you need it before then, I have provided a link.


Install this to your PixInsight folder. For example, on windows, the installed files should include:
C:\Program Files\PixInsight\doc\scripts\PhotometricMosaic\PhotometricMosaic.html
C:\Program Files\PixInsight\doc\scripts\PhotometricMosaic\images\...

Regards, John Murphy
 
I’m having a problem with the PhotometricMosaic script not combining multiple images in a 2x2 matrix correctly. Almost certainly my fault, but I’m at a loss to explain what is happening and how to correct it.,

My first attempt consisted of 4 frames (10+ hours each), but due to an unintended camera rotation, there was a “hole” in the center, so the script failed. I ran another multiple hour exposure sequence with the camera positioned to cover the hole, but even with the entire area covered, the script dropped parts of the image and the output was useless.

Next, and after correcting the camera rotation, I decided not to waste so much time and attack this problem in a methodical manner. I did one night’s worth of data collection on NGC 1499, again shooting for a 2x2 mosaic configuration as follows:

Frame 1: Lower right
Frame 2: Lower left
Frame 3: Upper right
Frame 4: Upper left

All the preliminary steps (ImageSolver, MosaicByCoordinates, etc) specified in the documentation were followed, after which I ran the PhotometricMosaic script using all default parameters. The results were the same as my earlier attempt, first 3 frames combined nicely, but the 4th on resulted in the script “dropping” the 3rd frame. Specifically:

Combining frame 1 and 2 resulted in “Mosiac1_2”, which looked great (contains the bottom of the overall mosaic).

Combining Mosaic1_2 with frame 3 resulted in “Mosaic12_3”, which added the upper right portion. So far, so good.

Combining Mosaic12_3 with frame 4 resulted in adding the upper left, but removed the upper right portion. No errors, but it just added the upper left frame and removed the upper right one. Therein lies my problem.

I’ve tried several different permutations of combining the 4 frames, but the problem remains; all works well until I add the final frame. At that point, the final frame is added, but one of the previously added frames is removed.

Again, I’m guessing that it’s something that I’m not doing or doing incorrectly, but I can’t figure it out. A zipped folder containing the frames themselves (the output of all the preliminary steps and just before running the PhotometricMosaic script) are located at https://www.dropbox.com/s/22njbqb8qqdh67w/Mosaic_Input.zip?dl=0 if anyone wants to take a look. Very noisy data since it’s less than 2 hours integration per frame, but should be sufficient to either confirm the problem or point out what i’m doing wrong.

Thanks in advance for any advice,

- Ken
 
PhotometricMosaic is designed to only join one side at a time. From what you have described, I think you are trying to add a corner tile. This would involve a join on two sides, which will fail.

The solution is to build the mosaic up in rows or columns, and then join the resulting strips. This way you only have a join on one side. You are never left with that problem corner tile. So, for example, you first create Mosaic1_2, and then Mosaic3_4. Finally you join Mosaic1_2 with Mosaic3_4.

You should also be able to use the first data set. The hole in the center can then be filled later with the 'Replace Region' option.
 
Aha! Thanks very much, John. That will work out perfectly!
The data set you posted had some very strong gradients in it. I had to deselect the 'Target image' group check box to prevent this propagating across the target side of the join.

1639860566636.png


I used the 'Average' mosaic mode, with 5% Outlier rejection.
It was also important to select the image with the least gradient as the reference.
I also needed to use the 'Adjust scale' option on the red channel.

Regards, John
 
The data set you posted had some very strong gradients in it. I had to deselect the 'Target image' group check box to prevent this propagating across the target side of the join.

View attachment 12952

I used the 'Average' mosaic mode, with 5% Outlier rejection.
It was also important to select the image with the least gradient as the reference.
I also needed to use the 'Adjust scale' option on the red channel.

Regards, John
Thanks for the tips John, I'll remember to do that. The collected data was very short duration and of relatively poor quality, since I just wanted to get some frames with correct camera orientation and see if the mosaic worked. All frames were taken with a pretty full moon, which made the gradient even worse, especially since it changed over the course of the night.

The last two nights have been clear (albeit moonlit), so with more data and following your tips I should be able to get a much better final image.

Thanks again!
 
Thanks for the tips John, I'll remember to do that. The collected data was very short duration and of relatively poor quality, since I just wanted to get some frames with correct camera orientation and see if the mosaic worked. All frames were taken with a pretty full moon, which made the gradient even worse, especially since it changed over the course of the night.

The last two nights have been clear (albeit moonlit), so with more data and following your tips I should be able to get a much better final image.

Thanks again!
I would recommend using my NormalizeScaleGradient script before stacking the tiles, Select the image with the least gradient as the NSG reference. For example, if the tiles were taken over multiple nights, use an image that was taken on a Moonless night as the NSG reference. By doing this you should be able to significantly reduce the final gradient. This should allow you to keep the 'Target Image' check box selected. Provided the gradients are not too large, this usually produces a better result.
 
I have made an extra update to the Reference Documentation, expanding the Quick Start Guide (steps 7 and 9), and added two extra sections:
(1) Tutorial: Staggered Join
(2) Creating a large mosaic with a widefield template

Install this to your PixInsight folder. For example, on windows, the installed files should include:
C:\Program Files\PixInsight\doc\scripts\PhotometricMosaic\PhotometricMosaic.html
C:\Program Files\PixInsight\doc\scripts\PhotometricMosaic\images\...

It will also be included in the next PixInsight release.


I would also like to thank the 24 users that have 'bought me a coffee' (made a small donation) at


It is good to know that my hard work is being appreciated. Many thanks, and enjoy Christmas / the festive season!
 
In the last documentation update (in the zipped file), there is a file named "PhotometricMosaic.pidoc' and there is no longer a .html file.

I guess I may have missed something. What's the .pidoc intended use?
 
Back
Top