PhotometricMosiac 3.1

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
John

Your tool is fantastic! I hope it gets included in future releases of PixInsight as standard. I could not have done any of the below without it. It takes little time learning to use it and despite the size of the panels it's handling for me, it always delivers!
Thank you for sharing it!

Roberto

M45 - 2x2


Veil Complex - 3x3
Hi Roberto
The images you posted are wonderful! Very nicely processed too.

Thanks for your positive feedback - it helps keep me motivated!
I have now finished writing version 3.0, and I am currently testing it. This will be a major update:
  • More accurate photometry
  • A more flexible approach is used to create the gradient models making it much easier to accurately correct the local gradients over the overlapping region but ignore these local effects when correcting the rest of the target frame.
  • The gradient graphs are now much easier to interpret.
  • The 'live' updates are now more responsive. Important for large images.
  • It is now much easier to specify where the join will occur.
I have also tried to make the script easier to use. To achieve this I now have auto settings that are calculated from values read from the FITS header - pixel size and image scale. In most situations, the user now only needs to modify a few settings for great results.

I will post version 3.0 within the next couple of days. My next challenge will be to completely rewrite the help file. The current help file is now quite misleading.

Regards
John Murphy
 
  • Like
Reactions: rbotero

Juan Conejero

PixInsight Staff
Sep 2, 2004
7,765
163
56
Valencia, Spain
pixinsight.com
Hi John,

It would be great if we could release the new version of this script with the upcoming version 1.8.8-7 of PixInsight. Either with the official release, or later as an update.

I will post version 3.0 within the next couple of days. My next challenge will be to completely rewrite the help file. The current help file is now quite misleading.
Can you write the documentation in PIDoc format? In this way we could integrate it with our official documentation repositories.
 

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
Hi John,

It would be great if we could release the new version of this script with the upcoming version 1.8.8-7 of PixInsight. Either with the official release, or later as an update.

Can you write the documentation in PIDoc format? In this way we could integrate it with our official documentation repositories.
Hi Juan

Yes, please include this script (PhotometricMosaic 3.0) in the upcoming version of PixInsight.
And yes, the documentation will be written in the PIDoc format. It will probably take me a couple of weeks to write.

Please also include the helper scripts:
TrimMosaicTile which is used to erode soft or rough edges before running the main script.
SplitMosaicTile which can be used to convert an ad-hoc mosaic into a regular grid (the main script requires that the tiles form a regular grid).

I have spent the day testing the script and believe that it is ready for release. I will post the script on the forum tomorrow, with some basic instructions on how to use it.

Regards
John Murphy
 
Last edited:
  • Like
Reactions: dld and jerahian

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
PhotometricMosaic 3.0

To install
The following scripts are now included in the official PixInsight release https://pixinsight.com/forum/index.php?threads/pixinsight-1-8-8-7-released.15729/
  • PhotometricMosaic
  • SplitMosaicTile
  • TrimMosaicTile
Run the three scripts in the usual way. For example: SCRIPT -> Mosaic -> PhotometricMosaic

Prerequisites
  • Register the tiles to each other (scripts: 'Image Analysis -> ImageSolver; Utilities -> MosaicByCoordinates). If you process the tiles after MosaicByCoordinates, check that the black background remains at zero. Keep the images linear.
  • Use the script 'Mosaic -> TrimMosaicTile' to remove any ragged or soft edges from the tiles. Do not skip this step - it is vitally important for a seamless result.
  • Apply an STF to the images. The dialogs that display image data use the target and reference image's STF.
Quick Start Guide
  • Display the Photometry Graph and remove any obvious outliers:
1606491034136.png
  • Display the Sample Generation dialog. This displays the overlapping region. Use 'Position (+/-)' to position the join (indicated by the green line). Try to avoid bright stars and, if possible, avoid lower quality regions - for example image corners:
1606491781862.png
  • Press the 'Overlap gradient' button in the 'Overlap region' group box. This shows the gradient that will be used to correct the overlap area. Set the 'Gradient smoothness so that the gradient line follows the data but not the noise. If, as in this case, there is a bright star close to the join, the scattered light will create a peak in the data. If necessary, reduce the smoothness until the curve follows the peak.
1606491994277.png
  • Press the 'Target gradient' button in the 'Target image' group box. This shows the gradient that will be applied to the rest of the target image. Set the 'Gradient smoothness so that the gradient line follows the general trend, but not any local gradients (e.g. scattered light from bright stars). The script automatically rejects samples close to bright stars, which explains why there are no data points between 3600 and 3800. However, the 'wings' of the peak are still visible. We will address that next.
1606492603533.png
  • If, as in this example, more samples need to be rejected for the target image gradient, go back to the 'Sample Generation' dialog and select 'Target model'. The blue line shows the target side of the overlap region. It is important to reject all samples that are close to this line that contain scattered light from bright stars. To increase the blue rejection circle, deselect 'Auto' and then in the 'Target model sample rejection' group box, increase 'Growth limit'. Then, if necessary, increase 'Star growth rate'.
1606492986316.png
Now return to the target gradient graph and adjust the smoothness to follow the gradient trend.
  • You are now ready to press OK to produce the mosaic!
By default, a join mask is also created. Apply this mask to the mosaic to see where the join is. Toggle the mask visibility on / off (ctrl k) to check the quality of the join.

If you are creating a mosaic of more than two tiles, first join the frames into either rows or columns, and then join these strips to create the final mosaic. Try to start with the tile that has the least gradient. The script is designed for planned mosaics that form a regular grid. If your data is an ad-hoc mosaic, use the 'SplitMosaicTile' script to cut up the tiles so that a regular grid of tiles can be created.

Common problems
If the join fails really badly at the end of the join, this indicates that either the reference or target tile had a ragged edge, or the black area around the tiles is not totally black. It needs to be zero.

The script should always be able to produce a seamless join. If you are unable to achieve this, send me a link to two problem tiles (use the .xisf format, specifying XISF Data Block Compression - the black areas compress really well!) and I will provide some help.

Hope you find it useful
John Murphy
 
Last edited:

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
PhotometricMosaic Version 3.0

See post #24 for an overview of the script

There have been significant changes from version 2.x to 3.0, so even if you have used 2.x before, I would recommend reading the Help sections:
  • Quick Start Guide
  • Tutorial: Sample rejection and gradient graphs
If you are new to PhotometricMosaic, you should also read the sections:
  • Prerequisites
If the mosaic tiles did not join seamlessly, read the section:
  • Common Problems
If you still have trouble, send me a link to two problem tiles (use the .xisf format, specifying XISF Data Block Compression - the black areas compress really well!) and I will provide some help.

I would like to thank members of the Basingstoke Astronomical Society for proof reading the 2.1 help file, and in particular to Dave Boddington for providing me with some useful test data (I needed data from different cameras / telescopes to determine the optimum 'Auto' settings).

John Murphy
 
Last edited:

freed

Well-known member
Mar 6, 2017
66
4
This is an excellent tool. I tested and contrasted to Gradient Merge Mosiac and the difference is obvious.
 
  • Like
Reactions: jmurphy

pfile

PTeam Member
Nov 23, 2009
6,050
163
yes i have also run thru a large mosaic example (8 panes Ha) and the results were awesome - no artifacts at all.
 
  • Like
Reactions: jmurphy

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
PhotometricMosaic 3.1 now available!

This includes the features that were not finished in time for the 3.0 release.
The updates include:

Random mosaic mode
The Random mosaic mode has been improved to make it really good at blending a join between two tiles with different signal to noise ratios. The number of target pixels used now tapers from none at the join region's reference edge to 100% at the join region's target edge.
1609604183252.png
The top image shows an Overlay mode join, the bottom shows the improved Random mode join. The join region was set to 200 pixels wide.

Photometric Graph: Best fit line
Provided there are more than 5 photometric stars found, the brightness scale factor now uses the LinearFunction core JavaScript object (introduced in the previous PixInsight version 1-8-8-6) instead of Least Squares Fit. This PixInsight algorithm does a much better job of ignoring outliers, and therefore produces a more accurate and reliable best fit line.

Gradient Graph: improved scaling of single channel plots
When a single color graph (i.e. red, green or blue) is displayed, the vertical graph scale is now recalculated. Previously it used the scale calculated for the RGB display, which did not work well if there were large vertical offsets between the three colors.

TrimMosaicTile:
This can now check for the FITS header entries that PhotometricMosaic needs. If they don't exist, a dialog is displayed that allows the user to add them.

1609605468279.png
1609605521994.png

The script has been attached to post #34

Regards
John Murphy
 
Last edited:
  • Like
Reactions: rbotero

nm303

Active member
Feb 7, 2017
26
1
Hi John,

I was flicking through some PI scripts and saw this family of scripts that I had not noticed before. Had a quick google, had a play with some poor data (single Ha panels - i.e. not stacked) I had laying around. It worked great. I am looking forward to playing with it with more data. Thank you for doing this and providing it. Is it advisable to combine colour channels for each panel prior to mosaic formation?
 

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
Hi John,

I was flicking through some PI scripts and saw this family of scripts that I had not noticed before. Had a quick google, had a play with some poor data (single Ha panels - i.e. not stacked) I had laying around. It worked great. I am looking forward to playing with it with more data. Thank you for doing this and providing it. Is it advisable to combine colour channels for each panel prior to mosaic formation?
I am very pleased you like it!

For a RGB mosaic, it is probably easier to create colour tiles before using PhotometricMosaic, but make sure you use TrimMosaicTile to trim back far enough to fix ragged edges for all colour channels.

For LRGB, it might be worth creating a luminance mosaic and a RGB mosaic, and then combining the two to create the LRGB image.

Regards
John Murphy
 

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
PhotometricMosaic 3.1
This contains all the changes listed in post #31 and some improvements to the user interface.
  • Dialogs that contain background images now display much quicker.
  • A new checkbox can limit dialog heights to less than 900 pixels
  • The Join position / size now gets its own dialog.
I am currently updating the help file
Regards
John Murphy
 
  • Like
Reactions: rbotero

jmurphy

PTeam Member
Jun 13, 2010
53
31
Basingstoke, England
The update has been delayed a bit - I am adding a few extra features. In particular, the TrimMosaicTile is getting a bit of a make over. It now provides a real time preview which makes accurately removing ragged edges much easier and quicker:

1611140689792.png

I have also updated the script so that it can be used with ImageContainer. This allows multiple files or views to be edited at once.
Regards
John Murphy
 
  • Like
Reactions: pfile