Динамическая PSF

Данный раздел описывает два важных шага, выполняемых для определения звёзд на отдельных кадрах. Определение на отдельном изображении можно выполнить или уточнить с помощью Основное меню ‣ Данные об изображении ‣ Динамическая PSF или с помощью клавиатурной комбинации Ctrl + F6.

диалог

Динамическая PSF, выполняемая на изображении глубокого космоса.

Обработка выполняется следующим образом:

  • первоначальное определение кандидатов в звёзды

  • подгонка модели PSF для каждого кандидата. Проверка на адекватность, основываясь на параметрах подогнанной модели, чтобы убедиться, что кандидат является звездой и отбросить кандидаты, не являющиеся звёздами.

Результатом этого процесса является список звёзд, с их положением на изображении относительно левого верхнего угла и измеренными величинами всех звёзд в списке.

Первоначальные кандидаты в звёзды

Хотя при взгляде на изображение кажется очевидным, где располагаются звёзды, это несколько более трудная задача формализовать этот процесс в математических терминах и критериях. В этом разделе коротко описан алгоритм, лежащий в основе определения звёзд. Он вдохновлён руководством к программе DAOPHOT [Stetson1987], с некоторыми упрощениями, улучшающими производительность. Оригинальный алгоритм был нацелен на поиск всех возможных звёзд, служа цели создания каталогов звёзд. Siril же нуждается в определении звёзд как деталей для регистрации. Он так же должен уметь обрабатывать разнообразные изображения, которые предоставляют пользователи — большинству из нас недоступно профессиональное астрономическое оборудование на своём заднем дворе - и нам приходится делать определённый выбор, касающийся предварительных знаний об условиях получения изображений (масштаб, условия съёмки и пр.).

С течением времени, наша реализация алгоритма эволюционировала к тому, что она представляет собой сейчас. Она имеет целью не пропустить слишком яркие звёзды, которые важны для регистрации и выбраковать как можно больше выбросов, делая это с разумной скоростью.

Его можно разделить на следующие шаги:

  • вычисляется статистика изображения для получения уровня фона, в виде медианы изображения, и его шума. Это предполагает, что изображение относительно плоское. Как следствие, определение имеет тенденцию быть менее эффективным в углах, если после калибровки осталось сильное виньетирование.

  • Так же вычисляется динамический диапазон, определяемый как разница между максимумом изображения и его фоном. Позже это будет полезно для определения насыщенных звёзд.

  • изображение сглаживается при помощи гауссовского ядра. Для идеального сглаживания было бы необходимо использовать ядро того же размера, как FWHM изображения. Вместо этого, мы выбрали произвольный размер, который даёт удовлетворительный результат в очень большом диапазоне условий. Это позволяет быть "слепым" к условиям получения изображения.

  • on the smoothened version of the image, detect local maxima over a level defined as the background level plus X times the noise (X can be varied using the threshold value in the GUI). Make sure this is a maximum over a certain box size (defined by the radius parameter).

  • run sanity check to make sure the maximum and its neighbors are well above the surrounding pixels (to reject patches in the bright parts of nebula for instance).

  • run sanity check to guess if the core around the maxima is saturated, i.e. consistently close to the upper bound of the dynamic range. If true, run an edge-walking algorithm to detect the limit of the saturated part.

  • Use first and second derivatives along an horizontal and vertical line passing through the center to guess star local background, amplitude and width in all directions (top, down, left and right).

  • If the parameters are symmetrical enough in all directions (up to the roundness parameter), confirm the star as a potential candidate.

Once the list of potential candidates has been assembled, they are sorted by decreasing amplitudes and fed to the PSF fitting algorithm described in the minimization section.

Models

Two models are used in the Dynamic PSF window. In general, Moffat is much better suited to fit objects such as stars.

Star profile

Displays of two circular PSFs according to a Gaussian profile and a Moffat profile. Both models use the same parameters and the Moffat profile uses uses \(\beta = 1.4\).

Star profile

Rotated Gaussian and Moffat function have \(\sigma_x=2\sigma_y\), \(\theta=45°\). For Moffat, \(\beta = 1.4\).

Star profile moffat

Star Profile with Gaussian and Moffat models. Several \(\beta\) values are tried. \(\beta = 10\) gives a profile very close to the Gaussian one.

Теория

  1. An elliptical Gaussian fitting function defined as

    (1)\[ G(x,y) = B+Ae^{-\left(\frac{(x-x_0)^2}{2\sigma^2_x}+\frac{(y-y_0)^2}{2\sigma^2_y}\right)}.\]
  2. An elliptical Moffat PSF fitting function defined as

    (2)\[ M(x,y) = B+A\left(1+\frac{(x-x_0)^2}{\sigma^2_x}+\frac{(y-y_0)^2}{\sigma^2_y}\right)^{-\beta},\]

where:

  • \(B\) is the average local background.

  • \(A\) is the amplitude, which is the maximum value of the fitted PSF.

  • \(x_0\), \(y_0\) are the centroid coordinates in pixel units.

  • \(\sigma_x\), \(\sigma_y\) are the standard deviation of the Gaussian distribution on the horizontal and vertical axes, measured in pixels.

  • \(\beta\) is the exponent from the Moffat formula that controls the overall shape of the fitting function. The upper bound of this parameters was set to 10. A higher value is meaningless and means that the Gaussian is good enough to fit the star.

Other parameters are derived from these fitted variables:

  • \(\text{FWHM}_x\) and \(\text{FWHM}_y\): The Full Width Half Maximum on the X and Y axis in pixel units. These parameters are calculated as follow:

    • \(\text{FWHM}_x = 2\sigma_x\sqrt{2\log 2}\).

    • \(\text{FWHM}_y = 2\sigma_y\sqrt{2\log 2}\).

    • It is possible to obtain the FWHM parameters in arcseconds units. This requires you fill all fields corresponding to your camera and lens/telescope focal in the setting parameter window in the burger menu, then Image Information and Information. If standard FITS keywords FOCALLEN, XPIXSZ, YPIXSZ, XBINNING and YBINNING are read in the FITS HDU, the PSF will also compute the image scale in arcseconds per pixel.

  • \(r\): The roundness parameter. It is expressed as \(\text{FWHM}_x/\text{FWHM}_y\), with \(\text{FWHM}_x > \text{FWHM}_y\) the symmetry condition.

  • Another parameters is also fitted in both Gaussian and Moffat models. This is the rotation angle \(\theta\), defined in the range \([-90°,+90°]\). The addition of this parameter implies a coordinate change where the \(x\) and \(y\) variables expressed in (1) and (2) are replaced by \(x'\) and \(y'\):

    (3)\[\begin{split} x' &= +x \cos\theta+y \sin\theta \\ y' &= -x \sin\theta+y \cos\theta.\end{split}\]

Minimization

Minimization is performed with a non-linear Levenberg-Marquardt algorithm thanks to the very robust GNU Scientific Library. This algorithm is used to find the minimum of a function that maps a set of parameters to a set of observed values. It is a combination of two optimization techniques: the gradient descent method and the inverse-Hessian method.

The Levenberg-Marquardt algorithm adjusts the trade-off between these two methods based on the curvature of the function being minimized. When the curvature is small, the algorithm uses the gradient descent method, and when the curvature is large, the algorithm uses the inverse-Hessian method.

Since version 1.2.0, the saturated part of the star is removed from the fitting process, enabling to capture much more accurately the non-saturated part. This is what enables to "reconstruct" the star profile when using the Desaturate menu option or unclipstars command.

Use

Dynamic PSF can be called from two different ways depending on what you want:

You may want to fit just one or a few stars. In this case, after drawing a selection around an unsaturated star (this is important for the accuracy of the result) you can either right click and choose the Pick A Star item, click the + button in the Dynamic PSF dialog, or type Ctrl + Space. An ellipse is then drawn around the star. To open the dialog it is also possible to use the shortcut Ctrl + F6.

You may want to analyze as many stars as possible by clicking on the icon starfinder, or using the command line findstar. All detected stars are surrounded by an ellipse: orange if the star is ok, magenta if the star is saturated. It is also possible to show the average of the computed parameters as illustrated below, by clicking on the dynPSF-button button.

диалог

Average of the fitted stars in the Gaussian model.

Star detection has a number of uses:

  • Siril uses it internally for astrometric purposes when registering sequences of images. This is automatic and requires no user intervention.

  • Because stars are so bright compared with dim features of interest such as nebulae or galaxies, it is very common that some stars in an image will be saturated, meaning their brightness profile is clipped. This can cause problems for some image processing functions, particularly deconvolution, and results in loss of colour information and slightly greater star bloat when applying stretches. Analysis of all the stars will show you which ones are saturated, and you can then use the Desaturate menu option or unclipstars command to fix the problem by synthesis of the clipped part of the profile.

    Командная строка Siril

    unclipstars
    
    Re-profiles clipped stars of the loaded image to desaturate them, scaling the output so that all pixel values are <= 1.0
  • Ideally all stars in an image should be perfectly round, however problems such as coma, astigmatism and bad tracking, as well as issues such as incorrect back focus to field flatteners, can give rise to patterns of elliptical stars in an image. The ellipses produced by the Dynamic PSF tool can give a good visual illustration of such problems.

  • Examination of the average star parameters, especially FWHM and the Moffat fitting function beta parameter, can provide information about the quality of seeing in an image.

  • Detection of all stars is the first step in using the Star Tools ‣ Full Resynthesis tool. This synthesizes corrected luminosity profiles for all detected stars, and can be used to create a synthetic star mask which can then be mixed with a starless image generated by Starnet++ to fix otherwise irredeemable stars in an image. In this case detection of stars using the Moffat profile may give a more realistic result and can also make it easier to filter out galaxies incorrectly detected as stars by using the Minimum beta setting.

  • The Center Selected Star toggle button can be used to find a particular star in the list quickly and easily in the image, by centring it in the viewport. This is useful if you have detected all stars and wish to check specific solutions to ensure they really are a star and not a galaxy or a cosmic ray.

  • Similarly to this, clicking on an orange or magenta star ellipse in the main viewport will highlight the selected star solution in the Dynamic PSF dialog. This could be useful if you wish to see the parameters of an individual star.

  • Siril's deconvolution functions support using Dynamic PSF measurements to synthesize a deconvolution function that matches star parameters measured directly from the image.

Configuration

Dynamic PSF can be configured using the settings in the Dynamic PSF dialog:

  • Radius sets the half-size of the search box. If you have trouble detecting particular stars you can try changing this but usually the default is fine.

  • Threshold changes the threshold above the noise for star detection. If you increase this value, fewer faint stars will be detected. You may still wish to do this for very noisy images though. Decreasing this value may detect more faint stars, but will also make the algorithm more likely to misidentify random noise spikes as stars.

  • Roundness threshold sets the allowable ellipticity for detections to be accepted as stars. Highly elliptical stars may occur due to imperfect tracking or aberrations, but sometimes stars that are too close from each others are also detected as a single very elongated star. To highlight all these problems, it is possible to enable a higher bound for the roundness. A maximum value of 1 is equivalent to disabling the range, leaving only the minimum value. This roundness range should be disabled for registration or astrometry.

  • Convergence sets a criterion used by the solver. Increasing it will allow the solver more interations to converge and can potentially detect additional stars, but may increase the solver running time.

  • Profile type chooses between solving Gaussian or Moffat profiles for the stars.

  • Minimum beta sets a minimum permissible value of beta for a detection to be accepted as a star. Galaxies may sometimes be detected as Moffat profile stars but they have diffuse profiles and the value of beta is usually very low, less than around 1.5.

  • Relax PSF checks allows for relaxation of several of the star candidate quality checks. This is likely to result in a significant increase in false positive star detections, often with wild parameters.

  • A range of minimum and maximum amplitude can be set to limit the amplitude (parameter named A in reports) of detected stars. This is useful if only non-saturated stars need to be selected, for PSF fitting in deconvolution for example. Note that removing the saturated stars from detection can break registration and astrometry.

Совет

The settings defined in this window can be tested on the currently loaded image. However, you have to keep in mind that they will also be used for all images of the sequence, especially for the global alignment registration.

The findstar command will obey the same settings entered in the Dynamic PSF dialog, but it can also be configured using the setfindstar command.

Командная строка Siril

findstar [-out=] [-layer=] [-maxstars=]
Определяет звёзды на текущем загруженном изображении, чей уровень превышает пороговое значение, вычисленное Siril.
После этого применяется PSF и Siril выбраковывает все найденные структуры, которые не удовлетворяют набору ранее определённых критериев, указанных с помощью команды SETFINDSTAR.
Finally, an ellipse is drawn around detected stars.

Optional parameter -out= allows the results to be saved to the given path.
Опция -layer= указывает слой, на котором будет происходить определение звёзд (только для цветных изображений).
You can also limit the maximum number of stars detected by passing a value to option -maxstars=.


См. также команду CLEARSTAR

Ссылки: psf, setfindstar, clearstar

Командная строка Siril

setfindstar [reset] [-radius=] [-sigma=] [-roundness=] [-focal=] [-pixelsize=] [-convergence=] [ [-gaussian] | [-moffat] ] [-minbeta=] [-relax=on|off] [-minA=] [-maxA=] [-maxR=]
Defines stars detection parameters for FINDSTAR and REGISTER commands.

Passing no parameter lists the current values.
Passing reset resets all values to defaults. You can then still pass values after this keyword.

Configurable values:

-radius= defines the radius of the initial search box and must be between 3 and 50.
-sigma= defines the threshold above noise and must be greater than or equal to 0.05.
-roundness= defines minimum star roundness and must between 0 and 0.95. -maxR allows an upper bound to roundness to be set, to visualize only the areas where stars are significantly elongated, do not change for registration.
-minA and -maxA define limits for the minimum and maximum amplitude of stars to keep, normalized between 0 and 1.
-focal= defines the focal length of the telescope.
-pixelsize= defines the pixel size of the sensor.
-gaussian and -moffat configure the solver model to be used (Gaussian is the default).
If Moffat is selected, -minbeta= defines the minimum value of beta for which candidate stars will be accepted and must be greater than or equal to 0.0 and less than 10.0.
-convergence= defines the number of iterations performed to fit PSF and should be set between 1 and 3 (more tolerant).
-relax= relaxes the checks that are done on star candidates to assess if they are stars or not, to allow objects not shaped like stars to still be accepted (off by default)

Литература

[Stetson1987]

Stetson, P. B. (1987). DAOPHOT: A computer program for crowded-field stellar photometry. Publications of the Astronomical Society of the Pacific, 99(613), 191.