Showing posts with label FITS. Show all posts
Showing posts with label FITS. Show all posts

Saturday, November 9, 2019

KStars v3.3.7 Released

KStars v3.3.7 is released for Windows, MacOS and Linux. This late autumn release packs a lot of new features and fixes across the board.

ASTAP integration


ASTAP is an astrometric plate solver, stacking of images, photometry, and FITS Viewer application available for Windows, MacOS, and Linux on multiple architectures.

KStars included support for solving via ASTAP in the Align module in addition to the existing astrometry.net solver. ASTAP employs a different method to solve images making it extremely fast  while at the same time requiring a smaller star catalog compared to other astrometric solvers.

You need to download and install the G17 Star Catalog for ASTAP to work locally.

ASTAP Solver

The error reporting was improved to show the overall error in arcsec. Furthermore, the Align module initial FOV is calculated from the camera and telescope parameters (no longer default to 0x0'). This make the initial solve with a wider search radius faster compared to a blind solve. Once the exact FOV is measured, the search radius is reset to the default value to expedite subsequent searches.

Observatory Weather


Wolfgang Reissenberger continued his outstanding work on the observatory module by adding a dedicated weather widget with live plotting for each parameter.


FITS Enhancements


Hy Murveit contributed further improvements to the FITS loading mechanism which resulted in speed ups during sequence capturing.

When capturing images, previously once the capture was complete, images were written to disk, then read back, then displayed in the fits viewer (if enabled), and finally the next image could be captured. This delayed the next capture by a few seconds.

With this change, the FITS data is displayed using (a copy of) the INDI blob sent to INDI::CCD, a memory buffer, and the FITS data is written to disk on a separate thread, which does not block the next capture nor the display of the INDI data.

Focus Module


Eric Dejouhanet Fixed HFR calculation in the FITS Data class, which was accumulating integer instead of double values.

This led to incorrect consolidation of HFR over multiple stars in the focus procedure and incoherent results in full-frame mode.


The UI received an overhaul as well to make the various settings more accessible. Each detected star HFR is now displayed next to it.

Scheduler Updates


Eric Dejouhanet implemented customizable dusk and dawn offsets (D23869). This introduces two new Ekos options, located in the Scheduler option pane. Dusk (resp. dawn) offset will apply a positive or negative hour offset to today's astronomical dusk (resp. dawn) when scheduling observation jobs.
The dawn offset and the pre-dawn offset are cumulative, but the dawn offset allows an earlier or later dawn to be used both while scheduling and executing.

The resulting dusk-to-dawn interval is displayed in the Scheduler UI on the right side of the Twilight checkbox. If the Twilight restriction is checked, the modified dusk and dawn values will be used to schedule the observation job to night time.

If the Twilight restriction is not checked, the observation job will not depend on night time and the modified dusk and dawn will be ineffective in scheduling that job.

The dusk and dawn offsets can be modified from the Ekos Scheduler options, and the night time interval displayed in the Scheduler UI will be updated when applying the changes in that dialog.

Additionally, if the Scheduler is not running, jobs will be re-evaluated to take the new dusk and dawn values into account. However, jobs will only effectively update their schedule if the night time constrain them to do so, not if the night time restriction relaxes.

Guiding & PHD2 improvements


Robert Lancaster improved PHD2 integration with Ekos.

This update is intended to fix several PHD2 problems and provide several PHD2 enhancements.


Fixes an issue where if the user hits the stop button while guiding in the PHD2 interface, then the user restarts guiding from PHD2, Ekos did not pick up the guide state change since no settling occurred and the user didn't click guide in Ekos.
Fixes an issue where the guiding data was not put into the graphs if the user did not enter a focal length into PHD2. Formerly the solution was to put a warning in the Guide log, but users ignored that. Now this tries to set the current CCD, so the backup method can work the way it was intended to work.
  1. Fixes an issue when the user had external guide frames selected, they did not appear in the guide view, and instead loaded in the fits viewer.
  2. Enables the loop and capture buttons for PHD2 along with the corresponding functions to make them work. Works well if the camera is connected to Ekos, also works if its not, but it will not display in Ekos. A message prints to the log letting the user know why.
  3. Disables the binning combo box which was enabled accidentally.
  4. If the user has external guide frames enabled, this enables the tracking box so that the lock position in the image can be reported to the user, and it also enables the user to be able to click to change the lock position for PHD2.
  5. This improves Ekos's ability to recognize the guide camera by using PHD2's report of what guide camera it is using. Then Ekos can use this information to disable or enable the receipt of image frames as well as the option to use the SubFrame checkbox.
  6. Improves the communication about the various options and status for cameras connected to PHD2 and Ekos.
  7. Enables the SubFrame method for PHD2 cameras so that they can switch quickly back and forth between the Guide Star image and full frame external guide frames at the push of a button.
  8. After I cleaned up some of the old and no longer needed methods/code, Ekos now connects to PHD2 much faster.
  9. I added the option for the user to select autostar, or to have PHD2 use the star lock position chosen by the user.
  10. Removes the External Guide Frames option since this makes it obsolete
  11. Saves the subframe option between KStars sessions and sets Ekos to receive External Guide frames or not based on it.
  12. Removes all the setting and unsetting of external blobs for Linguider, which doesn't support INDI cameras anyway, so it was pointless.
Furthermore, the guiding module now shows directional guiding label to help see which directions are affected by the pulses.

Misc Enhancements & Bug Fixes


+ Added download time estimation to the capture module. (D25138)
+ Solved several issues with guiding & dithering in both capture & scheduling. (D25110, D25105)
+ Fixed gain setting in capture module. (D24417)
+ Fixed focus HFR-averaging issue. (D24352)
+ Connect Scheduler sleep timer to Simulation Clock scale change. (D24151)
+ Handling of aborts during parking/unparking of rolloff roofs corrected. (D24064)
+ Hitting a constraint sets a job to IDLE instead of COMPLETE so that it might be restarted later. (D24232)
+ Update OpenNGC to v20191019 (D24896)

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, October 28, 2016

KStars 2.7.0 is released

I'm very glad to announce the release of KStars v2.7.0 (Menkab)! This new version brings improvements all over the board, from speed improvements, better cross-platform support, and Android mobile/tablet support is now finally merged into mainline KStars!

Windows & Linux versions are available for download. OSX version should hopefully be available soon.

Here is a short demo made by Artem Fedoskin, our GSoC 2016 student and currently an active developer of KStars:



We are still working on a few minor issues with the KStars Lite for Android before we release it soon on the Google Play Store.

Using KStars on embedded devices such as Raspberry PI provides a much better experience now thanks to order-of-magnitude speedups made by Akarsh Simha that cut some computation cycles by over 50%!

Another important feature is object internet lookup from online catalogs! It is a very exciting feature developed by Akarsh that enables you to find any object whether it exists in KStars catalogs, or any online catalog. Akarsh made a great video to explain how to use this neat feature:



Significant changes were made to improve Ekos GUI. It is now much more compact and accessible, especially on low-resolution displays.



Internally, the guide module was completely rewritten to enable support of multiple external guiders. Now we support lin_guider in addition to PHD2 and of course the internal guider. Performing guiding and autofocusing is now a lot more intuitive since the FITSView is embedded within the module, and not as an external window in prior versions. This streamlines the astrophotography workflow even further and makes monitoring changes quite handy.



The guide drift graphics was rewritten in QCustomPlot and provides many facilities to inspect the data along with zooming and panning support plus the long-request RA/DE legend! Guiding control parameters were updated to provide finer control over the guiding process and can control not only guiding pulse corrections, but also their polarity within each axis.

The alignment module received minor improvements as well, but most importantly, it now detects parity after first capture and reuses this value for future captures. Reusing the parity should cut solving time in half since the astrometry.net solver attempts to search over both positive and negative polarities by default. The overall alignment GUI was made simpler with only options necessary to perform the alignment process remaining while all additional options were moved to the KStars settings.



Focus module also received significant updates! All focus operations are performed from within the embedded FITSView. Furthermore, the user can now select which focus algorithm to utilize to calculate the Half-Flux-Radius (HFR) value. I developed a new gradient-based focusing algorithm in addition to the previous centroid and threshold algorithms. This new algorithm is less susceptible to noise and gives far more accurate HFR values even for donut-shaped stars. It is used by default but the user may change to any algorithm at any time.



In previous versions, each Ekos module supported capture of dark frames, but each module was handling it separately. Furthermore, the dark frames were captured, subtracted, and then discarded. With 2.7.0, a universal dark library was developed whereas dark frames are reused once they are captured. By default, dark frames are reused for 30 days. When any setting that may affect the dark frame validity such as binning, exposure time, temperature..etc is changed, a new dark frame is captured and stored for future use. This is now shared across all modules, so if you take a dark frame in the focus module, it can be used across Ekos.

Additionally, the capture module also received a face-lift and now includes options to specify upload mode and remote directory to save images. This resolved a conflict where one directory was used to save remote and local images. The user may also pause/resume sequences whenever desired.



The following summary is written by our newest development team member: Robert Lancaster. Robert was instrumental in bringing many improvements to the FITSViewer tool and KStars support on Mac OSX.

The KStars FITSViewer and its embedded FITSView have received numerous enhancements with KStars v2.7. First, the FITSView zooming behavior has been refined so that if a point in the image has been selected with a marker or if there is a focus/alignment box in the image, by default it will zoom in or out on that point. If there is not a point selected, the zooming behavior will center on whatever region is currently centered in the FITSView viewport. In addition, for people who have track pads attached to their computer, the pinch gesture has been implemented for zooming in and out on any FITSView. A second useful trackpad gesture that was implemented in any FITSView is the pan gesture, so now you can not only use your trackpad to pinch for zooming in and out, but you can also use it for panning around the image easily. For those who do not have trackpads, clicking to drag the image for FITSViews that are embedded in the FITSViewer was implemented to make it easy to pan around the image.



Another set of additions to the FITSViewer is several overlays that allow you to more easily center objects in the FITSViewer and/or compose your exposure. One overlay, the Cross Hair, gives you a target in the center of your image and two axes, so you can see the horizontal and vertical centerlines of your image. This overlay is extremely important for those who are not using the Align Module to do their telescope alignment so that they can be sure they have centered the star that they are using to sync. A second overlay, the Pixel Grid, gives you a full grid overlay for your image so that you can quickly estimate pixel distances to different points in your image and easily compose your shot. These overlays can be turned on at the same time and will not interfere with each other.





A third major enhancement to the FITSViewer is the addition of several features that make use of the WCS Headers in WCS-enabled FITS files. If you have installed and set the correct path to wcsinfo and have already plate solved an image with your setup, then your images you take with Ekos will have WCS information in them. You can also add WCS Information to an image by using either the online plate solver from nova.astrometry.net or by using the command-line based plate solving routine solve-field. The good news is that the WCS information is loaded in a separate thread so it does not slow down the rest of the program. Once an image with WCS header information in it has been loaded into the FITSViewer, the new WCS based tools will be enabled. The first thing you will notice when you load such a file is that the RA and DEC of your mouse cursor will be displayed in the status bar at the bottom of the FITSViewer. This behavior is not new, but what is new is a feature where you can put your mouse over a deep sky object in your image and a ToolTip should pop up that identifies the object.


If you then right click on the object, you will get a contextual menu that provides options for getting details about the object, downloading sky survey images about the object, centering the object in the Skymap, and even centering the object in a connected telescope. The menu looks extremely similar to the contextual menu that pops up if you right click an object in the Skymap.


There are also several other functions in the FITSViewer toolbar which are useful to WCS enabled images and whose buttons are only enabled when an image containing WCS information is loaded. The first one of these is an overlay plot, which puts an Equatorial Coordinate grid on the image with regularly spaced and labeled gridlines. The second button overlays a set of marker points and labels for all of the deep sky objects identified in your image. A third button will enable a mouse tool that will let you click on any point in your captured image to re-center your telescope on that point. This is extremely useful for framing your deep sky photos



Finally, this new version of KStars provides greatly enhanced support for the Mac OS X platform. While an installer is still in the works, and some bugs are still being worked out, KStars has become fully functional on the Macintosh platform. Several months ago, KStars was very difficult to install on the OS X platform and even when it was successfully installed, numerous features were not working properly. After a successful install procedure was finally hashed out in mid-September 2016, the work of getting all of the bugs identified and worked out could begin. Over the course of the next month, numerous issues were identified, investigated, and in many cases, solved. One of the first issues was getting the icons working since kde icon themes are not supported in OS X. This issue was resolved by bundling the icons.


Another issue was getting astrometry.net, libinidi, and gsc properly built and installed so that the tools used by Ekos could have native support on OS X. The solution here was just to develop a procedure to install them, though on Mac OS Sierra, there may still be an issue installing libindi on some computers. Even so, KStars on OS X could still access remote INDI-servers. By the end of September, KStars was working pretty well on OS X, but it still needed some work. For OS X, the inclusion of pan and pinch gestures in the FITSView/FITSViewer as described above are vital on a computer like a Macbook because the gestures are much easier to use than the scroll-wheel emulation. Once the FITSViewer upgrades were finished in mid-October, work on the KStars OS X bugs could resume. A minor annoyance was that all the windows were independent of one another and thus sometimes, dialog windows could end up lost behind the KStars main window. This was resolved by making many of the KStars windows Tool windows on OS X, except the Ekos Manager, the INDI Device Manager, and the FITSViewer which each received special code to make them stay on top of the other KStars windows. One of the last major bugs in KStars on the OS X platform was the inability to load/use the “Get New Stuff” Download Manager. This feature is very important for downloading images of deep sky objects and different sky catalogs. It was finally resolved in late October by setting some environment variables and launching the KDE program kdeinit5 from within KStars.


While KStars is now fully functional on OS X, it is still being tested and more bugs are likely to be found. It is hoped that in the near future, a simple installer or dmg image file can be developed for a streamlined installation process. But until then, following the instructions should get you a functional KStars installation on OS X.

More OSX screenshots!


Tuesday, October 6, 2015

Direct FITS overlay on the sky map

In upcoming KStars 2.4.0, due to be released in KDE Application 15.12, astrophotographers will enjoy a new feature that would help them further in framing and visualizing their images: Direct FITS overlay!

Before you use Ekos Align module, make sure to enable both World-Coordinate-System (WCS) and Overlay checkboxes. WCS appends parameters to the captured FITS image to include information on the celestial coordinates, rotation, and scale..etc. Once you perform your first successful alignment, and subsequent images will be scaled and drawn directly on the sky map.




Sunday, September 20, 2015

FITSViewer Histogram gets a face lift

The FITS histogram tool is one of the few tools in KStars that did not receive any significant updates for more than 10+ years. I first wrote it back in 2004 and used a custom painting widget to show the overall shape of the histogram. But with KStars gaining color FITS support a while back, it was necessary to support multi-channel histogram within the viewer.

While the FITSViewer tool, as the name suggests, is not designed for processing of astrophotography images; features such as the histogram and statistics tools are often important for decision-making during the capture process and for quickly inspecting images, and hence they were made available to the end user. The histogram implementation was also quite buggy as it was designed for 8-bit FITS, but now KStars support 8, 16, 32-bit signed integer, 32-bit IEEE floating point, and 64-bit IEEE double precision floating point. The updated implementation now caters to all data types and is smarter about selection of bin widths for each image.

In addition to supporting multi-channel histograms, the GUI was revamped and is now utilizing the amazing QCustomPlot library. At first, I wanted to utilize the KPlotting KDE library, which was authored by our very own Jason Harris, KStars founder back in 2001! But QCustomPlot offers several advantages over KPlotting including user interaction capabilities such as zoom and drag in addition to a host of other features. Furthermore, QCustomPlot is being actively developed while KPlotting hasn't received any noticeable updates in a very long time.

The following is a screenshot of the older histogram implementation:


And this the updated implementation, to be available for KDE Applications 15.12: