为36寸的大镜子写对焦程序

华盛顿大学 UW 有一台完全由本科学生维护的 36 英寸 RC 望远镜,我有幸混入了社团并且参与到软硬件的维护工作。

我上手的第一个大 feature 是为望远镜控制系统加入自动对焦,本文简述了这一目标的第一阶段 – 基于数据的对焦辅助的开发过程和测试结果。

下面的内容摘自第一次实际测试后的小报告(并没人要求我写,只是觉得挺有意思的)

(半)最终结果(半)最终结果

Evora Autofocus Phase I: Focus assist

Evora Autofocus Phase I: Focus assist

GitHub - siyu6974/evora_autofocus
Contribute to siyu6974/evora_autofocus development by creating an account on GitHub.
https://github.com/siyu6974/evora_autofocus#usage-version-01-awful-architecture-i-know-d

Method

Evora image test

This was to test star detection and the correlation between FWHM and HFD on evora images. Test image 2023-05-20T09-32-28_r_-81.19_250.0s_r.fits

The DAOStarFinder seems fine. FWHM is fairly consistent across the image. HFD has some weird negative values but the overall trend correlates with FWHM so it’s good.

Home test

Prior to the field test, a test was conducted at home to validate the method and general implementation of the algorithm.

The optic train consists of a Askar 65phq telescope (D=65mm, F/6.4) and a Qhy533M cooled CMOS camera. Data was collected while performing auto focus routine in NINA with hocus focus plugin. Focus was adjusted manually by commanding the ZWO EAF to advance inward and outward. The sweep was not mono-directional but backlash should be compensated automatically by NINA. After each movement, a 2 second exposure was taken with L filter.

nice round tight stars
out of focus example
FWHM predicted 13678.46
HFD predicted 13670.96

Results given by hocus focus on 2 others runs 2 hours later: 13636 for R, 13701 for L.

Without any modification to HFD calculation, the negative numbers disappeared. Great?

Near the focus point, HFDs were almost flat, which is probably caused by the lack of precision of the current implementation. Need to go sub pixel.

MRO field test

Initial test on 5s V-band exposures

Initial result was awful. 2 fits didn’t agree with each other, HFD values were nonsense. FWHM were also off, even if we excluded the outliner.

Checking the intermediate steps, the DAOStarFinder was picking noise as stars. Tuning the parameters (#brightest, fwhm, std) didn’t help at all, and the selection was not consistent across the sweep.

Hot fix with sep - thanks José!

comma or seeing?
sep thinks this is 40pix big

Sep worked wonder, with min-pix it’s even like black magic. This finally allowed the following calculation to work.

Stars are in bad shape, not sure if it’s seeing that’s tearing them apart. Longer exposure should help but takes more patience…

HFD values are completely unusable, guess the noise was fooling my naive implementation. But FWHM seems like an OK fit.

Real exposure

Eyeballed. 2023-10-21T08-57-43_B_-79.25_60.0s_0071.fits. FWHM: 4.2
Calculated. 2023-10-21T09-00-13_B_-79.25_60.0s_0072.fits. FWHM: 3.0

Much better!

Note: the focuser position was calculated on V band, the above exposure was on B so the final image could be even better.

TODO

  • sweep all filters, make an offset table
  • make better UI & integrate into evora
  • sub pixel HFD

After first field test

The hot fix using SEP and parameters that worked at MRO doesn’t work for my setup

  • Too many stars
  • FWHM fit can produce extreme outliers

Solutions

  • limit source extraction output
  • use median FWHM

HFD

  • Issue with previous HFD calculation: pixel distance set to the top left corner of the aperture, should be the center
  • sep.flux_radius is fast
previous
sep extraction, median