hnsky_b.gif www.hnsky.org

ASTAP, the Astrometric STAcking Program and FITS viewer


Download:

For MS Windows 64 bit:
For Linux 64 bit:
Additional:
Older versions:

Youtube:

Questions, feedback to the ASTAP Forum


Index:




ASTAP introduction

ASTAP is a free stacking and plate solver program for deep sky images. This program can view and stack astronomical FITS images using an astrometric solution or star alignment. For the astrometric solution it can use either the internal solver or a local version of Astrometry.net The internal routine compares the star positions to align.

Main features:

  1. Stacking images including Dark Frame and Flat Field correction
  2. Native Plate Solver, command line compatible with PlateSolve2.
  3. Filtering of deep sky images based on HFD value and average value.
  4. Alignment using an internal star match routine,  internal Plate Solver or a call to local Astrometry.net.
  5. FITS viewer with swipe functionality.
  6. Results can be saved to 16 bit or float (-32) FITS file.
  7. Export to 16 or 32 bit integer TIFF files for best preservation or  simple 8 bit PNG, BMP or JPEG.
  8. Mosaic building covering large areas using the astrometric linear solution WCS or WCS+SIP polynomial. 
  9. Background equalizing.
  10. FITS crop function.
  11. FITS header edit.
  12. Some pixel math functions and digital development process
  13. Available for 64 bit MS-Windows and Linux
This is a screen short of the stack menu. It contains several tabs for the file list and settings. File can be sorted on quality and values. Image can be visually inspected in the viwer by a double click on the file or using the popup menu.


Program requires FITS images as input, but it can also process PNG, TIFF or BMP files but only in 8 bit resolution. No import facility for DSLR raw files.



ASTAP is not:
A post processing software with advanced options like noise reduction and unsharp mask. It is only intended for convenient stacking of astronomical deep sky images.

Back to index

Program installation:

MS-Windows:

The single executable astap.exe can be used anywhere. Standard location is c:\program files\astap\astap.exe

Program works well using the internal alignment routine. Only for mosaics a plate solver should be installed

Linux installation:

The program is provide as an debian archive astap_amd64.deb which can be installed with the default installer.  Executable will be placed in /opt/astap

Program works well using the internal alignment routine. Only for mosaics a plate solver should be installed


Program operation:

Start the ASTAP program. (In MS-Windows astap.exe, in Linux astap)

Call up the stack window using the Σ button. Select the images, dark, flats, flat darks (bias)

Select the stacking method, average or sigma-clip-average.

For OSC camera images  select "Convert OSC images to colour". Select the correct Bayer pattern (4 options). Test the required pattern first in the viewer with a single image. The source images should be raw (gray)  without colour produced by  astronomical camera's.

Press the stack button.

Save result as FITS  ( IEEE float (-32) or 16 bit format), or export as 16 bit stretched, 16 bit or 32 bit TIFF.  The stretched export folllows the gamma and stretch setting of the display.



All the program settings and file selections will be save by leaving the program or click on the stack button.

Back to index


Mosaic building

This is possible with the internal Plate solver or local version of Astrometry.net. The reference of each pixel is the astronomical position. So stacking is not done against a reference image but against an position array set by the first image. If the oversize is set from the default 100 pixels to a  large value lets say 2000 pixels, the array is on all sides 2000 pixels larger then  the first image.  If the first image is 2000x1500 pixels, the stacking array will be 6000 x 5500 pixels large. So any following image will be placed in this 6000x5500 pixel array.  If the images are taken from different areas of the sky, the stacking will result in a mosaic as long the proceeding images are within this 6000x5500 pixels.


Here a suggested work method:
  1. Stacked method sigma-mean using the local Astrometry.net for solving. (option --downsampling 2)
  2. Mosaic option ON, oversize 2500 pixels. (The orginal tile images are 2328x1760 pixels)
  3. Crop the stacked result to about 5000x5000 pixels. 
  4. If required, applie the median-equalising filter under tab Pixel Math to equalise darker areas.
  5. Applied DDP (digital development process) under Pixel Math to strech the mosaic.
  6. Adjusted range and save as JPEG, 90% quality.
Here an example mosaic x 4 of M31 made with ASTAP:





Here an example of a mosaic build of DSS images:

The size can be reduced by a crop function (right mouse button) later. Making the oversize too large could result in memory overload.

Back to index

The stack menu:



Several objects can be stacked in one run. If classify-by-object is check marked, the program will stack all objects and save the results using the available darks and flats. If the classify-by-filter is check marked, the stack routine will combine the available filters to a RGB image. If only Red + Green +Blue image are available they will be combined in a RGB image. If Luminance images are available it will first stack the RGB colors and then apply a Gaussian blur on the RGB result. Finally the luminance image is coloured with the RGB result. The Gaussian value should be set somewhere between 0.5 and 1.5. The Gaussian blur is applied to remove noise in the RGB image. A minor blur will not be noticed but improves the signal to noise value of the final image.

Normally it is better to stack in two steps. First prepare the Red, Green, Blue and Luminance stacks. The run a stack again with the 
Red, Green, Blue and optional Luminance images. It is also possible to stack a colour image with an H-Alpha image.

Image file names containing "_stacked" will be by default un-checked to prevent they are reused
.

Images placed in the first tab will be organised based in the keyword
IMAGETYP. So assoon you click on the analyse button, dark and flats and flat darks/bias images will be move to the corresponding tab.

Pop-up menu has option to update a keyword of multiple files if required.



Results tab.

The stack results are reported in the results tab. By a double click they can be viewed the viewer. The number of files and exposure times are given. With the pop-up menu it is possible to copy the image file path to the clipboard for use in a file explorer.
 


Back to index





Master flat:         Typical setting 2x2 mean
Darks filter:         Typical setting apply Gaussian blur of 3.0 below sigma 5.0. No restore of outliers/hot pixels.
Stacked image:    Best option is "Sigma clip average". For only 2 or 3 images or when you are in a hurry "average"will do.
Convert OSC:     For one shot color cameras as QHY8. Set bayer pattern such that colors match in viewer.
Oversize: This could be 0, 100 or much larger for mosaic's   If  you want to  make a 2x2 mosaic, the overlap should at least the width of  the images.

The setting will be save if your either exit program or start a stack.

There are test button for dark and mean filter. They will be aplied on the image in the viewer.

Typical cold CMOS master dark:

Application of Gaussian blur under sigma 5:

Gaussian blur under sigma 5 and hot pixel removed:



Back to index


The alignment menu:

For alignment there are three options, internal star alignment,  native plate solver or a local version of Astrometry.net. For mosaic building you have to use the Plate Solver of Astrometry.net.


 Internal star alignment



This internal star matching alignment is the best and fastest option to stack images It is not suitable for mosaics. No settings, fully automatics alignment for shift in x, y, flipped or any rotation using the stars in the image. It will work for images of different size/camera's with some limitations.

The program combines four close stars into a pyramid and compares the six pyramid dimensions with pyramids of the first/reference image. It selects at least the six best matches and uses the centre position of the pyramids in a least square fitting routine for alignment. 

Background info: A pyramid drawn from 4 star positions has six sides. The five shortest sides are divided by the longest side to scale them independent of the image scale.  The final pyramid definition are then the five scaled sides, the centre position and the longest side. For pyramid matching the scaled five sides are used. They will be independent on the image scaling. This will give a number of pyramid matches. From the matching pyramids list,  the not scaled sixth side is used to calculate the mean and  standard deviation and outliers are removed. (five times the standard deviation). From the remaining list of pyramids, the central positions are used for lsq fitting in two dimensions
.


Astrometric alignment.
 
   Internal astrometric solver (plate solver). The works with the same pyramids as in the Star alignment. The pyramids are compared with the U16 star database (to be installed in the program directory). It has the following settings:


At the moment the astrometry.net solver has the best subpixel accuracy. Use this one for mosaics.


   Some guidelines for astrometric stacking using astrometry.net:


Back to index

Pixel math.

 Several options including background equalising.



Back to index


Additional functionality:

The  FITS viewer can imitate PlateSolve2 and add the plate solution to the FITS header. Also PNG, JPEG, TIF, BMP files can be plate solved if an estimate of the center position is given. With the batch routine several FITS image can be "plate solved".   Raw images of OSC (color) sensors using a Bayer matrix can be coverted to color.

ASTAP viewer screen shot:


 
Working of the program:

It is possible to use ASTAP as a substitute of PlateSolve2 plate solver. Rename the ASTAP.EXE program as Platesolve2.exe and call it instead of PlateSolve2. The solution will be written to file with an extension APM at the same location as to original file. In the alignment tab you could set a conversion to FITS and binning to reduce the dimensions of te resulting file. Reducing dimensions is required to allow speedy display in a planetarium program such as HNSKY.

Example for APT:
Rename or copy astap.exe to platesolve2.exe. Then select in APT, pointcraft, settings the directory where this surrogate platesolve2.exe (=astap.exe) is located.

Note that APT saves the pointcraft image to solve to: .... TemporaryStorage\ImageToSolve.jpg

Set in HNSKY the FITS path to .... TemporaryStorage\ImageToSolve.jpg (This is the location where APT saves the pointcraft image to solve to)
After solving, either refresh HNSKY with space bar or move to map to the object or open the FITS file in the file menu.

1) ASTAP loads the image specified  in the command line. (from APT)
2) ASTAP solves the image.
3) The solution is written to the APM file. APT will read it.
4) If set in the alignment menu, the JPG is saved as FITS with binning as specified. The FITS file will also contains the solution and could be displayed in a planetarium program. Binning should be set such that the file dimension are near 300 or 400 pixels wide/height for speedy display in a planetarium program..

Example for SGP, Sequence Generator Pro:

For SGP, PlateSolve.exe is located at C:\Users\you\AppData\Local\SequenceGenerator\

  1. Rename Platesolve2.exe to something like PlateSolve2.exeorginal
  2. Place ASTAP.exe at the same directory together with th U16 database.
  3. Rename ASTAP.exe to Platesolve2.exe


There is a big variation in FITS file keywords. If this version doesn't work, please send me the FITS file for testing.


Text entry:

Inspection on pixel level:

Back to index


CCD inspector

ASTAP has a CCD inspector under tools for median HFD value and Tilt measurement.  This will quickly show any focus problem in the corners:. The squares are 5 times the HFD value. 




Back to index


Background equalization tool:




Back to index

Installation of the plate solver:

MS-Windows:

Install a local copy of Astrometry.net (via ANSVR  or  Astrotortilla) or   Platesolve2 including star database as the astrometric solver. Or laternatively if you have Win10, 64 bit Creation edition you use the new Linux sub-system


ANSVR: The ANSVR link contains a newer compilation of astrometry.net made for SGP. It runs as a Linux program under Cygwin in MSWindows. Follow up to installation step 9. The link you have to put in ASTAP is as follows:

C:\Users\user_name\AppData\Local\cygwin_ansvr\bin\bash.exe

Adapt "user_name" to the login name used in Windows.

The server program ANSVR is not required. Remove the ANSVR shortcut in the startup menu. Location:

C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup


Alternative Linux sub-system in Win10 64bit Creators edition

Path for the astrometry.net solver program
ANSVR installation:
    C:\Users\user_name\AppData\Local\cygwin_ansvr\bin\bash.exe
Astrotortilla installation:
    C:\cygwin\bin\bash.exe
Win10 subsystem:
    C:\Windows\System32\bash.exe


Linux installation:
The single executable astap could be used anywhere. Standard directory could be c:/opt/astap but also at your home folder.

You need either a local copy of astrometry.net of Wine & PlateSolve2 

Installation of astrometry.net is described at installation. To get the source: sudo apt-get install libcairo2-dev libnetpbm10-dev netpbm libpng-dev libjpeg-dev python-numpy python-pyfits python-dev zlib1g-dev libbz2-dev swig libcfitsio-dev

Path to the astrometry.net solver program "solve-field" could be:

/usr/bin/
or
/usr/local/astrometry/bin

For PlateSolve2, install Wine first. Then extract PlateSolve2 at $HOME/.wine/drive_c/PlateSolve2.28   The separate star database UCAC3 could be extracted at $HOME/.wine/drive_c/PlateSolve2.28/UCAC3PS.  
PlateSolve2 requires the msvbvm60.dll to run. Try to find a copy and place it in $HOME/.wine/drive_c/PlateSolve2.28 or alternatively install winetricks vb6run
Run PlateSolve2 in Wine and set in menu FileConfigure Catalog Directories the path to the UCAC3 star catalog.  


Back to index

Send a message if you like this free program. Feel free to distribute !

Succes,  Han  K


Counter since 2017-11-15: