D28477: Fixes a bug where the HFR was not displayed.

Hy Murveit noreply at phabricator.kde.org
Sat Apr 4 22:55:07 BST 2020

murveit updated this revision to Diff 79350.
murveit added a comment.

  Added a significant bug fix and speedup.
  Bug fix. There is a significant bug in the findSEPStars code that is fixed here.
  Without this fix, uint16 samples, which is likely the most frequent data type used,
  are treated as int16 and thus, sample values greater than 32K are treated as negative numbers.
  This results in the calculation of incorrect much larger HFR values for these stars.
  This general short/ushort issue was clearly seen before in KStars and was fixed in the privateLoad method, see
  line 264 in fitsdata.cpp::PrivateLoad(), where the comment says "read SHORT image as USHORT".
  Without this fix, KStars would not work. The fix to findSEPStars() is to reference the m_DataType
  variable, already correctly setup in privateLoad(), instead of directly referencing the fits header field.
  In the future, if another approach is to be used for differentiating shorts and ushorts, 
  it should be addressed in privateLoad() and not in findSEPStars().
  Speed Up. In profiling findSEPStars(), I found that the lion's share of the time (when run
  on sub exposures -- e.g. not very short ones that might be used for focus, but rather exposure
  times that would be used for subs) was taken by the calls to sep_flux_radius(). The radius is 
  calculated for each star, even though, below in the method, only the top 100 widest stars were selected.
  I chose to use the size of the star's oval radii instead of width, and this is output by the star detection
  so sep_flux_radius only needed to be called on the stars chosen (e.g. 100) instead of all (e.g. 500-1000).
  This oval size is very closely related to the HFR, so we get about the same set of stars is had we 
  selected by largest HFR.
  I will follow up with further improvement to the SEP HFR calculations in future PRs.

  R321 KStars


  hfr-display-fix (branched from master)



To: murveit, mutlaqja, TallFurryMan
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20200404/4c0482e3/attachment-0001.html>

More information about the kde-edu mailing list