Detecting and marking faint galaxies in Pixinsight

In this tutorial I will show you how you can mark faint background galaxies in your astrophotos using the Hyperleda and Sloan Digital Sky Survey (SDSS) databases.

To be able to do this you need the following programs:

Microsoft Word
Microsoft Excel

You can download the needed Excel file for converting the data from the database in this tutorial here.

We will perform this tutorial using an image of M51 to show how it works. The image is shown here:

You can just download this image by opening it and saving it somewhere for later use.


We will perform this tutorial using the M51 image above, but you can follow the same procedure for any image you like.

First you will download the faint galaxy data from the Hyperleda website which includes the SDSS data.

Go to the hyperleda website.

Choose under Tools: ‘Search near position or name’
Fill the name of an object in your image in ‘object designation’
Press the ‘Find coordinates in HyperLeda’ button

The coordinates will be filled in automatically.

Select a search radius that covers whole your image (you could use the script –> Image analysis –> ImageSolver in Pixinsight to solve the image and find the size of the image).

Here I used 60 arcminutes as the image is about 46×36′ in size.

Choose ‘List objects in Hyperleda’
– At the bottom of the page change ‘Display as’ into ‘formatted text’

Save the file which appears now as a text file on your computer

This text-file is the database file that you need to format for Pixinsight to import it into the AnnotateImage script. We will do this using Microsoft Excel. Before we can import the file into Excel we need to strip the shown header from the file. We can do this in Microsoft Word.

Open the text file in word and remove all the header data from the file and the last lines that contain the file footer
Save the file as a txt file 

Now open  ‘Hyperleda_datafilter.xlsx’ which you downloaded here.

Go to the tab ‘Import file here!’ in the Excel file and import the text file you generated into this worksheet using the import as text-file function. You don’t have to set anything, all will be automatically detected by Excel. Just press finish. If the file is refusing to load into the worksheet select ‘save to a new worksheet’.

Select all the imported data manually and copy this to the second tab ‘Copy data from import file here’.

If you now go to the third tab ‘Filtered data’ you will see the data formatted ready for export to a pixinsight custom catalog file.

– To avoid getting stars in the database, filter the data using the ‘diameter column’ and select all the fields with ‘1’ (unselect and re-select). In this way the filter is reset with the new dataset. The diameter column is temporary used as a filter for the galaxies in the database.

Select one of the fields which contains data and then select all the data in this worksheet (1x ctrl-a should select all data automatically) and copy the data to the fourth tab ‘Export data – Copy filter here!’ in field A1. Now remove all the values from the diameter column (leave the header!).

Now export the fourth tab to a tab delimited text file using the save as function in Excel and ignore the warnings (just choose OK).

Congratulations you have now generated your custom catalog for Pixinsight.

Now we will annotate the image using Pixinsight.

Open your image file in pixinsight and use the ImageSolver script to plate solve the image.

This should give the following results:

Next use the AnnotateImage script with a ‘Custom Catalog’ and select the text file you just generated. (If the Custom Catalog is not visible use the green + to add a layer with a custom catalog).


If all works well you should be able to see the galaxies annotated in a proper way (you can use the preview to check). You can also choose in the output mode for a transparant overlay or a SVG file that you can use in photoshop to use as an overlay for your image. If you select ‘write objects to a text file’ a catalog file will be generated with only the objects in your field of view.


Good luck and please show me your results if you like this tutorial!