# Find Stars

Detects stars on frames. The stars are supposed to be a Gaussian-like peaks with FWHM provided by user. Additional parameters are used to reject false detection due to various defects.

## Synopsis

`munipack find [.. parameters ..] file(s)[,result(s)]`

## Description

Fully automatic detection of stars on frames is very important and also difficult. Munipack uses an algorithm developed by P.B.Stetson for DAOPHOT II with small changes. The algorithm is very robust, insensitive to wide range of defects including hot pixels or cosmic-ray events. One also detect stars on varying background (Moon shine, in galaxies etc).

Stars are detected on base of their shapes. One supposes that second moments of stars are similar in vertical and horizontal axes with value nearly to FWHM. We also suppose that PSF of stars is not too sharp. The limits of parameters can be tuned (while it is not needed frequently): round and sharp parameters are in detail described in DAOPHOT - A computer program for crowded-field stellar photometry by P.B.Stetson.

## Algorithm

Stars detection algorithm:

- As the preparation step, the background level with the noise B,σ of image is determined on a grid covering full frame.
- As the first step, the image is convoluted with Gaussian hat with FWHM provided by user. The convolution has effect of a digital filter which emphasizes star-like objects and suppress point defects or large-scale gradients.
- The convoluted image is searched for local peaks. For every peak, a maximum value is determined. A star candidate has the value above threshold level B+tσ (parameter t corresponds to `--th` switch) and below saturation S limit (given by `--saturate`)
- The parameters `round` and `sharp` are determined for every candidate. When both parameters lies inside acceptable intervals (tune it via `--rndlo,--rndhi,--shrplo,--shrphi` options), the candidate is stored and classified as a star.
- Rectangular coordinates and peak ratio are determined for every star.

The data under level B-uσ (where parameter u corresponds to `--lothresh`) are not used during the detection process.

This routine adds a FIND extensions to original frames as a table, its is described in Find Format.

## Relation to DAOPHOT II

The routine is on base of original code of DAOPHOT II by P.B.Stetson (has been forked from Midas's implementation at 1996). Some additional enhancements has been done:

- Robust estimators replaces the original estimators of averages.
- All processing is done in memory (no disc buffering is used).
- FITS files for both input and output are used
- Log format is changed.
- Seldom bugs are corrected.
- Code is updated for Fortran 95 (and perhaps above).

## Input And Output

On input, list of frames with already applied photometric pre-calibrations is expected.

On output, a table with detected stars, represented by FITS extension, is added to all input images.

Warning. The saturation and the read-noise parameters can be specified; their values are kept in header of the new FITS extension. If the same values are also included in the original image header, they will be untouched having consequence that the values will be distinct. Munipack next processing (mainly photometry) will get the new values.

## Parameters

### Important:

`-f`
  Set FWHM in pixels. The value is set by default to 3 pixels which will satisfactory for small telescopes. Hubble space telescope requires values below 1 pixel and a well sampled image has FWHM between 5 - 10 pixels.
`-th`
  Threshold in sigmas above background. One affects how much and how faint stars will be detected. Common values are about 5-10. Brigh stars detection only requires the threshold above 10 and the dim stars (and many defect) is under 1. Checking values below sky noise is not recommended.
`--saturate`
  Saturation in ADU. The value is determined from FITS header using SATURATE key, when the keyword is not found the upper-limit of float numbers in single precision is supplied (approximate 1038). The value will usually not satisfactory because the saturation is primary given by electrical capacity of pixels (device manufacturers supplies theirs values as the full well capacity) and one is usually not related to a numerical range.

### Searching Limits:

`--lothresh`
  lower for threshold in sigmas
`--rndlo`
  lower for round
`--rndhi`
  higher for round
`--shrplo`
  lower for sharp
`--shrphi`
  higher for sharp

### Additional:

`--read-noise`
  Read noise in ADU. A value from frame header is used by default. Use this option when the value is missing or needs correction. Read noise is important for determining of photometry errors.

See Common options for input/output filenames.

When options for the saturation or read noise are specified, FITS header is updated according to the passed value.

## Examples

Detect stars on image:

    $ munipack find -f 2 -th 10 pleiades.fits

## See Also

Aperture photometry, Common options, Processing file.