Showing posts with label Astrometry. Show all posts
Showing posts with label Astrometry. Show all posts

Saturday, November 21, 2020

KStars v3.5.0 is Released

Glad to announce the release of KStars v3.5.0 for Windows, MacOS, and Linux. This release marks a significant milestone for KStars with the integration of StellarSolver, the Cross Platform Sextractor and Astrometry.net-Based Internal Astrometric Solver.

Check out the Change log for more details.

StellarSolver

Robert Lancaster spent a significant portion of 2020 developing and refining this amazing library. Here is an excerpt from StellarSolver Github on the motivations behnd its development:

Astrometry.net is a fantastic astrometric plate solver, but it is command line only and has many dependencies such as python, netpbm, libjpeg, cfitsio, and many other things. It is fairly easy to install on Linux and works incredibly well in that environment. With the correct recipes in homebrew, craft, macports, or other package managers, it can be installed and run from the command line on Mac OS X as well. On Windows, however, it must be run within a compatibility layer such as Microsoft Subsystem for Linux, Cygwin, or Ansvr. None of these things will stop the program from running, but it does make it more difficult to set up and use and all of the files and dependencies and configuration files must be setup properly in order to get it to work.


StellarSolver major features:
  • An Astrometric Plate Solver for Mac, Linux, and Windows, built on Astrometry.net and SEP (sextractor)
  • Meant to be an internal library for use in a program like KStars for internal plate solving on all supported operating systems
  • Python is not required for the library.
  • Netpbm is not required for the library.
  • Internal Library, so calls to external programs are not required.
  • No Astrometry.cfg file is needed, the settings are internal to the program
  • Directly loads the image data into SEP and then takes the generated xy-list internally from Sextractor into astrometry.net, so there is no need to save any files.
  • No temporary files need to be created for solving and no WCS file needs to be created to read the solved information. Although astrometry.net does monitor for the creation of 2 files indicating that a field is solved or a cancel was made, so these are created for now.
  • The Index Files are still required for solving images, but the program or the user can specify the folder locations rather than putting them in the config file.

It took significant re-tooling inside KStars to integrate StellarSolver, but right now we are confident in the benefits in will bring to all our users. For the first time since Ekos was developed back in 2012, KStars does not require any external applications to perform any of its astrophotography related tasks. The solver is completely built-in and supported on all platforms equally. Windows users would be glad to learn they do not have to download and install extra programs to get the astrometry functionality to work.


But StellarSolver is not only limited to astrometry, its major function in Ekos is actually for star detection. Therefore, it is now used in Capture, Guide, and Focus modules as well. Future versions should pave the way to perform photometric calculations right within FITS Viewer.

FITS Viewer

While the name remains as FITS viewer, we also added support to load JPG/PNG and RAW files from DSLR cameras. Granted, not all the features of a FITS file is going to be available, but this feature has long been requested by users and now we finally have it baked in!


Analyze Module

Hy Murveit introduced a new Ekos module to help analyze the imaging session in details. It records and displays what happened in an imaging session. That is, it does not control any if your imaging, but rather reviews what occurred.


Sessions are stored in an analyze folder, a sister folder to the main logging folder. The .analyze files written there can be loaded into the Analyze tab to be viewed. Analyze also can display data from the current imaging session.The Analyze Module records and displays what happened in an imaging session. That is, it does not control any if your imaging, but rather reviews what occurred. Sessions are stored in an analyze folder, a sister folder to the main logging folder. The .analyze files written there can be loaded into the Analyze tab to be viewed. Analyze also can display data from the current imaging session.

Testing Framework

This release culminates 3 months of continued incremental improvements to KStars testing framework spearheaded by Eric Dejouhanet. These tests cover both Unitary tests and User Interface tests. While we are still far away from covering sufficient tests for all KStars uses, it paves the way to Test Driver development approach in which tests are created to illustrate the issue and then fixes.

MR #114 by Wolfgang Reissenberger perfectly highlights Test Driven development and we hope to follow this model in upcoming releases.

Friday, February 14, 2020

KStars v3.4.0 is Released


Celebrate Valentines' Day with some KStars Love! Happy to announce the release of KStars 3.4.0 on February 14th, 2020 on Linux, MacOS, and Windows.

What's new with this release?

The Linear Focus Algorithm.


Hy Murveit continued to work on linear focusing algorithm. This is an alternative auto-focus algorithm available in the Process section of the Focus tab.



You can think of this algorithm as "slow and steady". It should be less sensitive to backlash and measurement noise, but will likely take more samples to achieve its minimum HFR than a successful polynomial search. If you are having issues with auto-focus, you should consider trying this out.

It takes regularly sampled HFR values, i.e. (mostly) moving the position inward by a fixed amount--step size in the 1st pass of the algorithm, and 1/2 step size in the 2nd pass. The polynomial algorithm varies the change in position. Linear rarely changes direction, and mostly moves inward. In its first pass it takes a number of samples inward to establish a V-curve and an approximate minimum-HFR position, then makes a 2nd inward pass looking for that minimum. It only samples the HFR after an inward move. When it needs to move outward, e.g. in between the the 1st and 2nd passes, it moves outward much further than needed, and then moves back in before capturing an image.

The system should be at rough focus before the algorithm starts. The most important parameter is the step size, which needs to be found experimentally. See the screenshot as to how it was chosen (step size = 25) for a Moonlight v2 focuser. Recommend that full-field and the SEP detection algorithm be used with it.

Faster Astrometry.net Solver


Robert Lancaster added an option to use Sextrator as the primary method to identify stars within an image. This has two benefits:

1. It removes the python dependency, which was a painful issue for MacOS users.
2. It vastly improves the solver speed, according to some early reports from our beta testers.



You can turn on the Sextrator option in Astrometry.net settings. 



You can see the astrometry.net solver in now noticeably faster and more reliable than before!

Improvements & Bug Fixes

  • Fixed a few memory allocation issues to reduce the process memory usage.
  • Fixed DSLR ImageToFITS loading when auto convert is used.
  • Fixed focus direction for relative DC focusers.
  • Improved reliability of setting snoop property for the active profile.
  • Fixed File name sanitization issues.
  • Communication with remote INDI Web Manager is now mostly asynchronous.
  • Align property labels in the INDI dialog vertically on top.

Monday, September 9, 2019

KStars v3.3.6 is released

The KStars team is glad to announce the release for KStars v3.3.6 for Windows, MacOS, and Linux.

This release is packed with many small quality of life improvements and bug fixes.

Intuitive Popup Menu

We cleaned up the popup menu so that mount actions are more intuitive. Took this chance as well to add some lovely Breeze icons to the mix.


We will continue to make mount controls even more accessible, especially to users over VNC.

Live Debayering


The KStars Live Video window can now debayer frames in real-time, thereby allowing for color video streams.



FITS Viewer


A few improvements landed in FITS Viewer:

  • Updated Statistics display that can display value for each color channel separately, if present.
  • Faster loading times thanks to a performance patch by Hy Murveit.

Astrometry.net Config and Indexes


Robert Lancaster made huge improvements to the handling of Astrometry.net configuration management and indexes. This should make these features a lot more accessible to a wider pool of users.


You can edit the astrometry.net configuration file directly in KStars. Furthermore, you can easily add/remove folders that that contain the index files. Many users have the indexes files stored in external hard drivers, and with this feature, it is now very easy to add the additional folders so they get utilized by the solver.


This change is accompanied by changes to the index downloader. Now you can check all your collections, and you have the ability to download indexes to a particular folder in your collection. A green index file indicates that the file is available in the system and does not require to be downloaded.

Observatory Weather Info


Wolfgang Reissenberger continued his outstanding work in improving the Observatory Module. With this release comes weather data directly displayed in the module. Along with the configurable thresholds for Warning and Alert states, you can rest easily knowing that KStars can take the appropriate actions to protect your observatory from adverse weather conditions.


Meridian Flip


A small quality-of-life improvement to the Meridian Flip value. You can now toggle between Degrees (default) and hours. Many mounts indicate the meridian flip limit in degrees so we opted to make this as default.


Mount Control Motion Reverse


You can now reverse the direction of each axis of motion separately, in case you prefer to controls to behave in the way you expect them to in the Mount Control Panel.

Setting Coordinates Manually


The dialog now opens pre-populated with the currently selected object coordinates. You can easily switch between JNow, J2000, or your own custom Epoch.


Under The Hood


Yuri Chornoivan is the unsung hero of internationalization efforts in KStars. Many volunteers work in KDE internationalization effort and Mr. Chornoivan keeps a vigilant eye on KStars to make sure it remains accessible to the widest audience possibly globally.

Mr. Chornoivan replaced many obsolete functions in KStars with their up-to-date alternatives.


Tuesday, April 24, 2018

KStars 2.9.5 is out!

KStars v2.9.5 is now available for Windows, MacOS, and Linux.

Autofocus module users would be happy to learn that the HFR value is now responsive to changing seeing conditions. Previously, the first successful autofocus operation would set the HFR Threshold value of which subsequent measurements are compared against during the in-sequence-focusing step.

However, this method suffers from two issues:

  1. Seeing could change during the night.
  2. HFR value could be different for different filters.
These issues can lead to interesting artifacts under the right conditions, most notably repeatedly running a complete autofocus run after each subsequent exposure thereby losing precious observation time in a futile attempt to bring the HFR value down.

In KStars 2.9.5, we introduce an experimental adaptive HFR Thresholding algorithm that selects the median HFR value filter-wise. It still has to be seen whether this is an overall better approach, so go out and test this!

Ekos Scheduler module has received major patches from Eric Dejouhanet to improve its reliability and fix some corner cases. More patches are in the pipeline to make the scheduler rock solid in various complex scenarios.

A quite illusive and annoying time-zone related bug was fixed when using INDI GPS devices. Now KStars correctly accounts for the UTC offset. Another related issue is related to preventing race conditions between multiple devices that may send time information, such as mounts and GPS devices, so now you can explicitly select which device to receive the location and time information from.



Finally, Align module FOV now default to zero on startup. Previously, FOV as calculated from the telescope focal length & camera pixel size was used to derive other values passed to the solver. However, it turns out that the FOV for real optical trains can be different. Using focal reduces, coma correctors, and even filter wheels or spacers can alter this value, sometimes quite significantly to the unsuspecting user.

Therefore, relying alone on the calculated FOV might actually cause astrometry.net to fail since the actual FOV might fall beyond the field of view threshold boundary. With this addition, the first solver run would take a little bit longer but it would also produce a quite accurate effective FOV. You can think of the effective FOV as the real FOV that your combination of your camera, telescope, and whatever sits in between (aka optical train) ends up producing.


This effective FOV is then saved for each Profile-Telescope-Camera combination for future use. This is all done behind the scenes to make user experience much more pleasant and bullet proof when using the Ekos Alignment module.

Clear skies!

Thursday, April 12, 2018

Spring season KStars v2.9.4 is Released!

Glad to announce the release of KStars v2.9.4 aka Emad is now release for Windows, MacOS, and Linux!

The new release brings in more performance improvements and bug fixes.

Spring Galaxy Season
Credit Turki AlAmri


Valentin Boettcher
introduced a highly efficient binary interface for asteroids that would allow quite large (> 100MB) and distant catalogs to be loaded into KStars without a major impact on performance. Before this change, loading any JPL catalogs for faint asteroids (> 15 mag) resulted in significant slowdown of KStars during startup as well as during run-time. Now users can comfortably load fainter asteroids given they have enough system memory to handle it.

Automatic Flat field calculations were fixed for multi-channel DSLR frames along with an improved DSLR popup dialog. The online astrometry option with offline server bug was fixed and now users can connect to local instances of astrometry.net without any problems.

The Ekos scheduler workflow was revamped to evaluate all jobs every time a new job is invoked to ensure all scores are updated accordingly and not only on the first job run. More SEP work for star & galaxy detection is merged into the internal guide module resulting in a better object detection even in noisy environments.
Messier Marathon with Ekos Scheduler

Furthermore, the guide module is now a lot more tolerant to passing clouds. When a star lock is lost, it will attempt to reacquire the lost star for several iterations before giving up.

On the capture frontend, users can now instruct Ekos to take flat field frames exactly at the same focus position where light frames of the same filter were captured. For example, suppose you are taking an LRGB sequence, and the best autofocus position for Green filter is 37,000 ticks. By the time you finish the sequence the focus position would most likely have moved due to the Blue filter (unless they're perfectly parafocal). Once you start capturing flat fields afterwards, typically the focus position is kept as-is. However, now it is possible to synchronize the focus position when capturing flat fields as well. When a flat field Green capture is requested, Ekos shall instruct the focuser to move to 37,000 ticks as indicated by the last successful autofocus operation of the same filter.

Finally, users might have noticed especially on slower systems that opening large FITS files can take a while to load up. In v2.9.4, the FITS handling code was optimized with loading times improving on the order of 300%.

FITS Speed improvements

Turns out that statistics calculations were eating up significant amount of precious CPU cycles. Many of these calculations would greatly benefit from SIMD support like SSE/NEON but since KStars runs on multiple architectures, it requires an architecture-agnostic solution and major refactoring of the code base. Another solution that was more readily available is to employ multiple threads to by partitioning the image and therefore spreading the calculations. It is certainly a poor-man's SIMD in a way, but the results were immediately noticeable.

Using 16 threads, computing min and max values was reduced from 122ms to only 30ms. Running mean and standard deviation calculations took 118ms instead of 270ms. Here is an excerpt from the Qt Concurrent magic that made this signifantly easier to code than using plain pthreads.

QList<QFuture<QPair<double,double>>> futures;

for (int i=0; i < nThreads; i++)
{
 // Run threads
 futures.append(QtConcurrent::run(this, &FITSData::getSquaredSumAndMean<T>, tStart, (i == (nThreads-1)) ? fStride : tStride));
 tStart += tStride;
}

double mean=0, squared_sum=0;

// Now wait for results
for (int i=0; i < nThreads; i++)
{
 QPair<double,double> result = futures[i].result();
 mean += result.first;
 squared_sum += result.second;
}

double variance = squared_sum / stats.samples_per_channel;

stats.mean[n] = mean/nThreads;
stats.stddev[n] = sqrt(variance);

There is room for more improvement still, especially since now we are loading the FITS twice unnecessarily. This could be resolved by using an implicit sharing data model among FITS files that does not require a deep-copy of the data until the underlying data is altered. This could result in a 100% improvement in loading speeds when using Ekos as well. Stay tuned!

Friday, February 17, 2017

KStars 2.7.4 for Windows is released!

Glad to announce the release of KStars v2.7.4 for Windows 64bit. This version is built a more recent Qt (5.8) and the latest KF5 frameworks for Windows bringing more features and stability.


This release brings in many bugs fixes, enhancements for limited-resources devices, and improvements, especially to KStars premier astrophotography tool: Ekos. Windows users would be glad to learn that they can now use offline astrometry solver in Windows, thanks to the efforts of the ANSVR Local Astrometry.net solver. The ANSVR mimics the astrometry.net online server on your local computer; thus the internet not required for any astrometry queries.

After installing the ANSVR server and downloading the appropriate index files for your setup, you can simply change the API URL to use the ANSVR server as illustrated below:



In Ekos align module, keep the solver type to Online so it would use the local ANSVR server for all astrometry queries. Then you can use the align module as you would normally do. This release also features the Ekos Polar Alignment Assistant tool, a very easy to use spot-on tool to polar align your mount.

Clear skies!

Thursday, February 16, 2017

Ekos Polar Alignment Assistant Tool

When setting up a German Equatorial Mount (GEM) for imaging, a critical aspect of capturing long-exposure images is to ensure a proper polar alignment. A GEM mount has two axis: Right Ascension (RA) axis and Declination (DE) axis. Ideally, the RA axis should be aligned with the celestial sphere polar axis. A mount's job is to track the stars motion around the sky, from the moment they rise at the eastern horizon, all the way up across the median, and westward until they set.


In long exposure imaging, a camera is attached to the telescope where the image sensor captures incoming photons from a particular area in the sky. The incident photons have to strike the same photo-site over and over again if we are to gather clear and crisp image. Of course, actual photons do not behave in this way: optics, atmosphere, seeing quality all scatter and refract photons in one way or another. Furthermore, photons do not arrive uniformly but follow a Poisson distribution. For point-like sources like stars, a point spread function describes how photons are spatially distributed across the pixels. Nevertheless, the overall idea we want to keep the source photons hitting the same pixels. Otherwise, we might end up with an image plagued with various trail artifacts.

Since mounts are not perfect, they cannot perfectly keep track of object as it transits across the sky. This can stem from many factors, one of which is the mis-alignment of the mount's Right Ascension axis with respect to the celestial pole axis. Polar alignment removes one of the biggest sources of tracking errors in the mount, but other sources of error still play a factor. If properly aligned, some mounts can track an object for a few minutes with only deviation of 1-2 arcsec RMS.

However, unless you have a fancy top of the line mount, then you'd probably want to use an autoguider to keep the same star locked in the same position over time. Despite all of this, if the axis of the mount is not properly aligned with the celestial pole, then even a mechanically-perfect mount would lose tracking with time. Tracking errors are proportional to the magnitude of the misalignment. It is therefore very important for long exposure imaging to get the mount polar aligned to reduce any residual errors as it spans across the sky.

Several polar-alignment aids exist today, including, but not limited to:

1. Polar scope built-in your mount.
2. Using drift alignment from applications like PHD2.
3. Dedicated hardware like QHY's PoleMaster.
4. Ekos Legacy Polar Alignment tool: You need to take exposure of two different points in the sky to measure the drift and find out polar error in each axis (Altitude & Azimuth)
5. SharpCap Polar Alignment tool.

Out of the above, the easiest to use are probably QHY's PoleMaster and SharpCap's Polar alignment tool. However both software are exclusive to Windows OS only. KStars users have long requested support for an easy to use Polar Alignment helper in Ekos leveraging its astrometry.net backend.

During the last couple of weeks, I worked on developing Ekos Polar Alignment Assistant Tool (PAA). I started with a simple mathematical model consisting of two images rotated by a an arbitrary degree. A sample illustration of this is below:



Given two points, we can calculate the arc length from the rotation angle, and hence the radius. Therefore, it is possible to find two circle solutions that would match this, one of which would be the mount's actual RA axis within the image. Finding out which solution is the correct one turned out to be challenging, and even the mount's own rotation angle cannot be fully trusted. To be able to uniquely draw a circle, you need 3 points. So it was suggested by Gerry Rozema, one of INDI venerable developers, to capture 3 images to uniquely identify the circle without involving a lot of fancy math.

Since it relies on astrometry.net, PAA has more relaxed requirements than other tools making it accessible to more users. You can use your own primary or guide camera, given they have wide-enough FOV for the astrometry solver.

Moreover, the assistant can automatically capture, solve, and even rotate the mount for you. All you have to do is to make the necessary adjustments to your mount.

The new PAA works by capturing and solving three images. It is technically possible to rely on two images only as described above, but three images improves the accuracy of the solution. After capturing each, the mount rotates by a fixed amount and another image is captured and solved.



Since the mount's true RA/DE are resolved by astrometry, we can construct a unique circle from the three centers found in the astrometry solutions. The circle's center is where the mount rotates about (RA Axis) and ideally this point should coincide with the celestial pole. However, if there is a mis-alignment, then Ekos draws a correction vector. This correction vector can be placed anywhere in the image. Next the user refreshes the camera feed and applies correction to the mount's Altitude and Azimuth knobs until the star is located in the designated cross-hair. It's that easy!

Ekos PAA is now in Beta and tests/feedback are highly appreciated.