diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e83ddb47..aabba563e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,7 @@ MACRO_BOOL_TO_01(INDI_FOUND HAVE_INDI) set_package_properties(INDI PROPERTIES DESCRIPTION "Astronomical instrumentation control" URL "https://www.indilib.org" TYPE OPTIONAL PURPOSE "Support for controlling astronomical devices on Linux with KStars.") if (INDI_FOUND AND NOT ANDROID) - find_package(StellarSolver REQUIRED) + find_package(StellarSolver REQUIRED 2.0) endif(INDI_FOUND AND NOT ANDROID) MACRO_BOOL_TO_01(StellarSolver_FOUND HAVE_STELLARSOLVER) diff --git a/kstars/auxiliary/ksutils.cpp b/kstars/auxiliary/ksutils.cpp index 1b9b53f6a..481eebf2d 100644 --- a/kstars/auxiliary/ksutils.cpp +++ b/kstars/auxiliary/ksutils.cpp @@ -1165,6 +1165,17 @@ QString getDefaultPath(const QString &option) #endif return prefix + "/bin/solve-field"; } + else if (option == "WatneyBinary") + { + #if defined(ASTROMETRY_PREFIX) + return QString(ASTROMETRY_PREFIX "/opt/watney/watney-solve"); + #elif defined(Q_OS_OSX) + return "/usr/local/bin/watney-solve"; + #elif defined(Q_OS_WIN) + return "C:/watney/watney-solve.exe"; + #endif + return prefix + "/opt/watney/watney-solve"; + } else if (option == "SextractorBinary") { #if defined(SEXTRACTOR_PREFIX) diff --git a/kstars/ekos/align/align.cpp b/kstars/ekos/align/align.cpp index 859ac6b01..091ce9b38 100644 --- a/kstars/ekos/align/align.cpp +++ b/kstars/ekos/align/align.cpp @@ -1867,7 +1867,7 @@ void Align::startSolving() if (solverModeButtonGroup->checkedId() == SOLVER_LOCAL) { - if(Options::solverType() != SSolver::SOLVER_ASTAP) //You don't need astrometry index files to use ASTAP + if(Options::solverType() != SSolver::SOLVER_ASTAP && Options::solverType() != SSolver::SOLVER_WATNEYASTROMETRY) //You don't need astrometry index files to use ASTAP or Watney { bool foundAnIndex = false; for(QString dataDir : astrometryDataDirs) @@ -1916,16 +1916,20 @@ void Align::startSolving() m_StellarSolver->setParameters(m_StellarSolverProfiles.at(Options::solveOptionsProfile())); const SSolver::SolverType type = static_cast(m_StellarSolver->property("SolverType").toInt()); - if(type == SSolver::SOLVER_LOCALASTROMETRY || type == SSolver::SOLVER_ASTAP) + if(type == SSolver::SOLVER_LOCALASTROMETRY || type == SSolver::SOLVER_ASTAP || type == SSolver::SOLVER_WATNEYASTROMETRY) { QString filename = QDir::tempPath() + QString("/solver%1.fits").arg(QUuid::createUuid().toString().remove( QRegularExpression("[-{}]"))); alignView->saveImage(filename); m_StellarSolver->setProperty("FileToProcess", filename); - m_StellarSolver->setProperty("SextractorBinaryPath", Options::sextractorBinary()); - m_StellarSolver->setProperty("SolverPath", Options::astrometrySolverBinary()); - m_StellarSolver->setProperty("ASTAPBinaryPath", Options::aSTAPExecutable()); - m_StellarSolver->setProperty("WCSPath", Options::astrometryWCSInfo()); + ExternalProgramPaths externalPaths; + externalPaths.sextractorBinaryPath = Options::sextractorBinary(); + externalPaths.solverPath = Options::astrometrySolverBinary(); + externalPaths.astapBinaryPath = Options::aSTAPExecutable(); + externalPaths.watneyBinaryPath = Options::watneyBinary(); + externalPaths.wcsPath = Options::astrometryWCSInfo(); + m_StellarSolver->setExternalFilePaths(externalPaths); + //No need for a conf file this way. m_StellarSolver->setProperty("AutoGenerateAstroConfig", true); @@ -1973,7 +1977,7 @@ void Align::startSolving() if (useImagePostion && solution.ra > 0) m_StellarSolver->setSearchPositionInDegrees(solution.ra, solution.dec); else - m_StellarSolver->setProperty("UsePostion", false); + m_StellarSolver->setProperty("UsePosition", false); } else { @@ -1992,7 +1996,7 @@ void Align::startSolving() if(useImagePostion) m_StellarSolver->setSearchPositionInDegrees(telescopeCoord.ra().Degrees(), telescopeCoord.dec().Degrees()); else - m_StellarSolver->setProperty("UsePostion", false); + m_StellarSolver->setProperty("UsePosition", false); } if(Options::alignmentLogging()) @@ -2011,10 +2015,6 @@ void Align::startSolving() m_StellarSolver->setSSLogLevel(SSolver::LOG_OFF); } - //Unless we decide to load the WCS Coord, let's turn it off. - //Be sure to set this to true instead if we want WCS from the solve. - m_StellarSolver->setLoadWCS(false); - // Start solving process m_StellarSolver->start(); } @@ -2047,7 +2047,7 @@ void Align::solverComplete() { FITSImage::Solution solution = m_StellarSolver->getSolution(); // Would be better if parity was a bool field instead of a QString with "pos" and "neg" as possible values. - const bool eastToTheRight = solution.parity == "pos" ? false : true; + const bool eastToTheRight = solution.parity == FITSImage::POSITIVE? false : true; solverFinished(solution.orientation, solution.ra, solution.dec, solution.pixscale, eastToTheRight); } } diff --git a/kstars/ekos/align/opsalign.ui b/kstars/ekos/align/opsalign.ui index b472917a2..438c46b47 100644 --- a/kstars/ekos/align/opsalign.ui +++ b/kstars/ekos/align/opsalign.ui @@ -6,7 +6,7 @@ 0 0 - 444 + 470 179 @@ -91,7 +91,7 @@ - Selects the method of plate solving with the StellarSolver Library. The StellarSolver option uses StellarSolver's internal build of Astrometry.net and requires no external programs. Local Astrometry uses a local installation of command line astrometry.net on Linux and Mac or ANSVR on Windows. ASTAP uses a local installation of the ASTAP program. And Online uses either astrometry.net over the internet or ANSVR on a nearby computer. + Selects the method of plate solving with the StellarSolver Library. The StellarSolver option uses StellarSolver's internal build of Astrometry.net and requires no external programs. Local Astrometry uses a local installation of command line astrometry.net on Linux and Mac or ANSVR on Windows. Local Watney uses a local installation of the Watney Astrometry Solver Program. ASTAP uses a local installation of the ASTAP program. And Online uses either astrometry.net over the internet or ANSVR on a nearby computer. @@ -108,6 +108,11 @@ Local ASTAP + + + Local Watney + + Online Astrometry diff --git a/kstars/ekos/align/opsprograms.cpp b/kstars/ekos/align/opsprograms.cpp index ff76214a5..f0e7e467b 100644 --- a/kstars/ekos/align/opsprograms.cpp +++ b/kstars/ekos/align/opsprograms.cpp @@ -43,37 +43,15 @@ void OpsPrograms::slotApply() void OpsPrograms::loadDefaultPaths(int option) { - ExternalProgramPaths paths; - - switch(option) - { - case 0: - return; - break; - case 1: - paths = StellarSolver::getLinuxDefaultPaths(); - break; - case 2: - paths = StellarSolver::getLinuxInternalPaths(); - break; - case 3: - paths = StellarSolver::getMacHomebrewPaths(); - break; - case 4: - paths = StellarSolver::getWinANSVRPaths(); - break; - case 5: - paths = StellarSolver::getWinCygwinPaths(); - break; - default: - paths = StellarSolver::getLinuxDefaultPaths(); - break; - } + if(option == 0) + return; + ExternalProgramPaths paths = StellarSolver::getDefaultExternalPaths((SSolver::ComputerSystemType) (option - 1)); kcfg_SextractorBinary->setText(paths.sextractorBinaryPath); kcfg_AstrometryConfFile->setText(paths.confPath); kcfg_AstrometrySolverBinary->setText(paths.solverPath); kcfg_ASTAPExecutable->setText(paths.astapBinaryPath); + kcfg_WatneyBinary->setText(paths.watneyBinaryPath); kcfg_AstrometryWCSInfo->setText(paths.wcsPath); defaultPathSelector->setCurrentIndex(0); diff --git a/kstars/ekos/align/opsprograms.ui b/kstars/ekos/align/opsprograms.ui index fcf59bcea..032d56af8 100644 --- a/kstars/ekos/align/opsprograms.ui +++ b/kstars/ekos/align/opsprograms.ui @@ -7,7 +7,7 @@ 0 0 658 - 481 + 517 @@ -169,6 +169,32 @@ + + + + Watney Solver + + + + + + Watney binary: + + + + + + + Astrometry.net solve-field binary + + + + + + + + + @@ -262,4 +288,4 @@ - + \ No newline at end of file diff --git a/kstars/ekos/auxiliary/stellarsolverprofile.cpp b/kstars/ekos/auxiliary/stellarsolverprofile.cpp index 909ae58ed..7109df6e4 100644 --- a/kstars/ekos/auxiliary/stellarsolverprofile.cpp +++ b/kstars/ekos/auxiliary/stellarsolverprofile.cpp @@ -24,8 +24,8 @@ QList getDefaultFocusOptionsProfiles() focusDefault.keepNum = 100; focusDefault.minarea = 20; focusDefault.maxEllipse = 1.5; - // JM 2021.10.03: Seems to be a lot more reliable than 2 FWHM - StellarSolver::createConvFilterFromFWHM(&focusDefault, 1); + focusDefault.convFilterType = SSolver::CONV_GAUSSIAN; + focusDefault.fwhm = 1; focusDefault.r_min = 5; focusDefault.maxSize = 10; focusDefault.removeBrightest = 10; @@ -37,7 +37,8 @@ QList getDefaultFocusOptionsProfiles() stars.listName = "2-AllStars"; stars.description = i18n("Profile for the source extraction of all the stars in an image."); stars.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&stars, 1); + stars.convFilterType = SSolver::CONV_GAUSSIAN; + stars.fwhm = 1; stars.r_min = 2; profileList.append(stars); @@ -45,7 +46,8 @@ QList getDefaultFocusOptionsProfiles() smallStars.listName = "3-SmallSizedStars"; smallStars.description = i18n("Profile optimized for source extraction of smaller stars."); smallStars.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&smallStars, 1); + smallStars.convFilterType = SSolver::CONV_GAUSSIAN; + smallStars.fwhm = 1; smallStars.r_min = 2; smallStars.maxSize = 5; smallStars.initialKeep = 500; @@ -57,7 +59,8 @@ QList getDefaultFocusOptionsProfiles() mid.description = i18n("Profile optimized for source extraction of medium sized stars."); mid.maxEllipse = 1.5; mid.minarea = 20; - StellarSolver::createConvFilterFromFWHM(&mid, 4); + mid.convFilterType = SSolver::CONV_GAUSSIAN; + mid.fwhm = 4; mid.r_min = 5; mid.removeDimmest = 20; mid.minSize = 2; @@ -71,7 +74,8 @@ QList getDefaultFocusOptionsProfiles() big.description = i18n("Profile optimized for source extraction of larger stars."); big.maxEllipse = 1.5; big.minarea = 40; - StellarSolver::createConvFilterFromFWHM(&big, 8); + big.convFilterType = SSolver::CONV_GAUSSIAN; + big.fwhm = 8; big.r_min = 20; big.minSize = 5; big.initialKeep = 500; @@ -101,7 +105,8 @@ QList getDefaultGuideOptionsProfiles() stars.listName = "2-AllStars"; stars.description = i18n("Profile for the source extraction of all the stars in an image."); stars.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&stars, 1); + stars.convFilterType = SSolver::CONV_GAUSSIAN; + stars.fwhm = 1; stars.r_min = 2; profileList.append(stars); @@ -109,7 +114,8 @@ QList getDefaultGuideOptionsProfiles() smallStars.listName = "3-SmallSizedStars"; smallStars.description = i18n("Profile optimized for source extraction of smaller stars."); smallStars.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&smallStars, 1); + smallStars.convFilterType = SSolver::CONV_GAUSSIAN; + smallStars.fwhm = 1; smallStars.r_min = 2; smallStars.maxSize = 5; smallStars.initialKeep = 500; @@ -121,7 +127,8 @@ QList getDefaultGuideOptionsProfiles() mid.description = i18n("Profile optimized for source extraction of medium sized stars."); mid.maxEllipse = 1.5; mid.minarea = 20; - StellarSolver::createConvFilterFromFWHM(&mid, 4); + mid.convFilterType = SSolver::CONV_GAUSSIAN; + mid.fwhm = 4; mid.r_min = 5; mid.removeDimmest = 20; mid.minSize = 2; @@ -135,7 +142,8 @@ QList getDefaultGuideOptionsProfiles() big.description = i18n("Profile optimized for source extraction of larger stars."); big.maxEllipse = 1.5; big.minarea = 40; - StellarSolver::createConvFilterFromFWHM(&big, 8); + big.convFilterType = SSolver::CONV_GAUSSIAN; + big.fwhm = 8; big.r_min = 20; big.minSize = 5; big.initialKeep = 500; @@ -152,8 +160,8 @@ QList getDefaultAlignOptionsProfiles() SSolver::Parameters defaultProfile; defaultProfile.listName = "1-Default"; defaultProfile.description = i18n("Default profile. Generic and not optimized for any specific purpose."); - // JM 2021.10.03: Seems to help in cases where solver fails to solve any images. - StellarSolver::createConvFilterFromFWHM(&defaultProfile, 1); + defaultProfile.convFilterType = SSolver::CONV_GAUSSIAN; + defaultProfile.fwhm = 1; profileList.append(defaultProfile); SSolver::Parameters fastSolving; @@ -165,7 +173,8 @@ QList getDefaultAlignOptionsProfiles() fastSolving.keepNum = 50; fastSolving.initialKeep = 500; fastSolving.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&fastSolving, 4); + fastSolving.convFilterType = SSolver::CONV_GAUSSIAN; + fastSolving.fwhm = 4; profileList.append(fastSolving); SSolver::Parameters parLargeSolving; @@ -176,7 +185,8 @@ QList getDefaultAlignOptionsProfiles() parLargeSolving.keepNum = 50; parLargeSolving.initialKeep = 500; parLargeSolving.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&parLargeSolving, 4); + parLargeSolving.convFilterType = SSolver::CONV_GAUSSIAN; + parLargeSolving.fwhm = 4; profileList.append(parLargeSolving); SSolver::Parameters fastSmallSolving; @@ -187,7 +197,8 @@ QList getDefaultAlignOptionsProfiles() fastSmallSolving.keepNum = 50; fastSmallSolving.initialKeep = 500; fastSmallSolving.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&fastSmallSolving, 4); + fastSmallSolving.convFilterType = SSolver::CONV_GAUSSIAN; + fastSmallSolving.fwhm = 4; profileList.append(fastSmallSolving); return profileList; @@ -205,7 +216,8 @@ QList getDefaultHFROptionsProfiles() hfrDefault.minarea = 20; hfrDefault.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&hfrDefault, 2); + hfrDefault.convFilterType = SSolver::CONV_GAUSSIAN; + hfrDefault.fwhm = 2; hfrDefault.r_min = 5; hfrDefault.maxSize = 10; @@ -224,7 +236,8 @@ QList getDefaultHFROptionsProfiles() big.minarea = 40; big.maxEllipse = 1.5; - StellarSolver::createConvFilterFromFWHM(&big, 8); + big.convFilterType = SSolver::CONV_GAUSSIAN; + big.fwhm = 8; big.r_min = 20; big.maxSize = 0; @@ -242,7 +255,8 @@ QList getDefaultHFROptionsProfiles() most.minarea = 10; most.maxEllipse = 0; - StellarSolver::createConvFilterFromFWHM(&most, 1); + most.convFilterType = SSolver::CONV_GAUSSIAN; + most.fwhm = 1; most.r_min = 3.5; most.minSize = 0; most.maxSize = 0; diff --git a/kstars/ekos/auxiliary/stellarsolverprofileeditor.cpp b/kstars/ekos/auxiliary/stellarsolverprofileeditor.cpp index c80b7725a..e33c1da30 100644 --- a/kstars/ekos/auxiliary/stellarsolverprofileeditor.cpp +++ b/kstars/ekos/auxiliary/stellarsolverprofileeditor.cpp @@ -241,14 +241,16 @@ SSolver::Parameters StellarSolverProfileEditor::getSettingsFromUI() params.kron_fact = kron_fact->text().toDouble(); params.subpix = subpix->text().toInt() ; params.r_min = r_min->text().toFloat(); - //params.inflags params.magzero = magzero->text().toFloat(); + params.threshold_bg_multiple = threshMultiple->text().toFloat(); + params.threshold_offset = threshOffset->text().toFloat(); params.minarea = minarea->text().toFloat(); params.deblend_thresh = deblend_thresh->text().toInt(); params.deblend_contrast = deblend_contrast->text().toFloat(); params.clean = (cleanCheckBox->isChecked()) ? 1 : 0; params.clean_param = clean_param->text().toDouble(); - StellarSolver::createConvFilterFromFWHM(¶ms, fwhm->value()); + params.convFilterType = (SSolver::ConvFilterType) convFilter->currentIndex(); + params.fwhm = fwhm->value(); //Star Filter Settings params.resort = resort->isChecked(); @@ -289,11 +291,14 @@ void StellarSolverProfileEditor::sendSettingsToUI(SSolver::Parameters a) r_min->setText(QString::number(a.r_min)); magzero->setText(QString::number(a.magzero)); + threshMultiple->setText(QString::number(a.threshold_bg_multiple)); + threshOffset->setText(QString::number(a.threshold_offset)); minarea->setText(QString::number(a.minarea)); deblend_thresh->setText(QString::number(a.deblend_thresh)); deblend_contrast->setText(QString::number(a.deblend_contrast)); cleanCheckBox->setChecked(a.clean == 1); clean_param->setText(QString::number(a.clean_param)); + convFilter->setCurrentIndex(a.convFilterType); fwhm->setValue(a.fwhm); //Star Filter Settings diff --git a/kstars/ekos/auxiliary/stellarsolverprofileeditor.ui b/kstars/ekos/auxiliary/stellarsolverprofileeditor.ui index 54e475cbd..c5d6ea85f 100644 --- a/kstars/ekos/auxiliary/stellarsolverprofileeditor.ui +++ b/kstars/ekos/auxiliary/stellarsolverprofileeditor.ui @@ -347,7 +347,7 @@ 3 - + The minimum radius for stars for flux calculations. @@ -357,43 +357,47 @@ - - - - - 0 - 0 - + + + + A variable to store the fwhm in pixels used to generate the convolution filter for star detection. - - <a href = "https://sep.readthedocs.io/en/v1.0.x/api/sep.extract.html" >Extraction Params</a> + + 1 - - true + + 10 - - - - <a href="https://sep.readthedocs.io/en/v1.0.x/api/sep.extract.html">Deblending Params</a> + + + + This is the 'zero' magnitude used for setting the magnitude scale for the stars in the image during sextraction. - - true + + 20 - - + + - This is the 'zero' magnitude used for setting the magnitude scale for the stars in the image during sextraction. + The percentage of flux a separate peak must have to be considered a separate object. - 20 + 1 + + + + + + + Min Cont. - + This sets the Kron Factor for use with the kron radius for flux calculations. @@ -403,47 +407,131 @@ - - + + - Min Area + Kron Factor - - - - Attempts to 'clean' the image to remove artifacts caused by bright objects + + + + Conv FWHM + + + + - Clean? + magzero - - true + + + + + + Whether to use the SEP_SUM_ELLIPSE method or the SEP_SUM_CIRCLE method or automatically choose. NOTE: Circle is usually better at the moment + + 0 + + + + Default + + + + + Custom + + + + + Gaussian + + + + + Mexican Hat + + + + + Top Hat + + - - + + - This is the minimum area in pixels for a star detection, smaller stars are ignored. + The number of thresholds the intensity range is divided up into. - 5 + 32 - - + + + + + 0 + 0 + + + + <a href = "https://sep.readthedocs.io/en/v1.0.x/api/sep.extract.html" >Extraction Params</a> + + + true + + + + + + + r_min + + + + + - The subpixel sampling factor for star extraction + Whether to use the SEP_SUM_ELLIPSE method or the SEP_SUM_CIRCLE method or automatically choose. NOTE: Circle is usually better at the moment + + + 1 + + + Auto + + + + + Circle + + + + + Ellipse + + + + + + - 5 + <a href="https://sep.readthedocs.io/en/v1.0.x/api/sep.extract.html">Deblending Params</a> + + + true - + Thresh @@ -466,38 +554,34 @@ - - + + - Sub Pix + Conv Filter - - - - The number of thresholds the intensity range is divided up into. - + + - 32 + Shape - - - - Kron Factor + + + + Attempts to 'clean' the image to remove artifacts caused by bright objects - - - - - magzero + Clean? + + + true - + The cleaning parameter @@ -507,79 +591,71 @@ - - + + + + Sub Pix + + + + + - Whether to use the SEP_SUM_ELLIPSE method or the SEP_SUM_CIRCLE method or automatically choose. NOTE: Circle is usually better at the moment + The subpixel sampling factor for star extraction - - 1 + + 5 - - - Auto - - - - - Circle - - - - - Ellipse - - - - + + - Conv FWHM + Min Area - - + + + + This is the minimum area in pixels for a star detection, smaller stars are ignored. + - Min Cont. + 5 - - + + - r_min + Thresh Offset - - + + - The percentage of flux a separate peak must have to be considered a separate object. + This is the minimum area in pixels for a star detection, smaller stars are ignored. - 1 + 0 - - + + - Shape + Thresh Multiple - - + + - A variable to store the fwhm in pixels used to generate the convolution filter for star detection. - - - 1 + This is the minimum area in pixels for a star detection, smaller stars are ignored. - - 10 + + 2.0 @@ -1004,4 +1080,4 @@ - + \ No newline at end of file diff --git a/kstars/fitsviewer/fitssepdetector.cpp b/kstars/fitsviewer/fitssepdetector.cpp index c943b5d30..4a1ccb9dc 100644 --- a/kstars/fitsviewer/fitssepdetector.cpp +++ b/kstars/fitsviewer/fitssepdetector.cpp @@ -113,10 +113,6 @@ bool FITSSEPDetector::findSourcesAndBackground(QRect const &boundary) else solver->setParameters(SSolver::Parameters()); // This is default - // Wait synchronously - - QEventLoop loop; - connect(solver, &StellarSolver::finished, &loop, &QEventLoop::quit); QList stars; const bool runHFR = group != Ekos::AlignProfiles; @@ -124,7 +120,7 @@ bool FITSSEPDetector::findSourcesAndBackground(QRect const &boundary) solver->extract(runHFR, boundary); else solver->extract(runHFR); - loop.exec(QEventLoop::ExcludeUserInputEvents); + stars = solver->getStarList(); if (stars.empty()) diff --git a/kstars/fitsviewer/structuredefinitions.h b/kstars/fitsviewer/structuredefinitions.h index 92556e6cb..16ba59945 100644 --- a/kstars/fitsviewer/structuredefinitions.h +++ b/kstars/fitsviewer/structuredefinitions.h @@ -6,45 +6,56 @@ #define STRUCTUREDEFINITIONS_H //system includes -#include "stdint.h" +#include +#include #include -#include -#include "math.h" namespace FITSImage { -/// Stats struct to hold statisical data about the FITS data -/// This is defined in both KStars and StellarSolver -typedef struct +typedef enum { - double min[3] = {0}, max[3] = {0}; - double mean[3] = {0}; - double stddev[3] = {0}; - double median[3] = {0}; - double SNR { 0 }; - /// FITS image data type (TBYTE, TUSHORT, TULONG, TFLOAT, TLONGLONG, TDOUBLE) - uint32_t dataType { 0 }; - int bytesPerPixel { 1 }; - int ndim { 2 }; - int64_t size { 0 }; - uint32_t samples_per_channel { 0 }; - uint16_t width { 0 }; - uint16_t height { 0 }; - /// Number of channels - uint8_t channels { 1 }; + POSITIVE, + NEGATIVE, + BOTH +} Parity; + +static const QString getParityText(Parity parity){ + return parity == FITSImage::NEGATIVE ? "negative" : "positive"; +} + +static const QString getShortParityText(Parity parity){ + return parity == FITSImage::NEGATIVE ? "neg" : "pos"; +} + +// Stats struct to hold statisical data about the FITS data +typedef struct Statistic +{ + double min[3] = {0}, max[3] = {0}; // Minimum and Maximum R, G, B pixel values in the image + double mean[3] = {0}; // Average R, G, B value of the pixels in the image + double stddev[3] = {0}; // Standard Deviation of the R, G, B pixel values in the image + double median[3] = {0}; // Median R, G, B pixel value in the image + double SNR { 0 }; // Signal to noise ratio + uint32_t dataType { 0 }; // FITS image data type (TBYTE, TUSHORT, TULONG, TFLOAT, TLONGLONG, TDOUBLE) + int bytesPerPixel { 1 }; // Number of bytes used for each pixel, size of datatype above + int ndim { 2 }; // Number of dimensions in a fits image + int64_t size { 0 }; // Filesize in bytes + uint32_t samples_per_channel { 0 }; // area of the image in pixels + uint16_t width { 0 }; // width of the image in pixels + uint16_t height { 0 }; // height of the image in pixels + uint8_t channels { 1 }; // Mono Images have 1 channel, RGB has 3 channels } Statistic; // This structure holds data about sources that are found within // an image. It is returned by Source Extraction -typedef struct +typedef struct Star { float x; // The x position of the star in Pixels float y; // The y position of the star in Pixels - float mag; // The magnitude of the star + float mag; // The magnitude of the star, note that this is a relative magnitude based on the star extraction options. float flux; // The calculated total flux float peak; // The peak value of the star - float HFR; // The half flux radius + float HFR; // The half flux radius of the star float a; // The semi-major axis of the star float b; // The semi-minor axis of the star float theta; // The angle of orientation of the star @@ -55,29 +66,36 @@ typedef struct // This struct holds data about the background in an image // It is returned by source extraction -typedef struct +typedef struct Background { - int bw, bh; // single tile width, height - float global; // global mean - float globalrms; // global sigma + int bw, bh; // single tile width, height + float global; // global mean + float globalrms; // global sigma int num_stars_detected; // Number of stars detected before any reduction. } Background; // This struct contains information about the astrometric solution // for an image. -typedef struct +typedef struct Solution { double fieldWidth; // The calculated width of the field in arcminutes double fieldHeight; // The calculated height of the field in arcminutes - double ra; // The Right Ascension of the center of the field - double dec; // The Declination of the center of the field + double ra; // The Right Ascension of the center of the field in degrees + double dec; // The Declination of the center of the field in degrees double orientation; // The orientation angle of the image from North in degrees - double pixscale; // The pixel scale of the image - QString parity; // The parity of the solved image. (Whether it has been flipped) JPEG images tend to have negative parity while FITS files tend to have positive parity. + double pixscale; // The pixel scale of the image in arcseconds per pixel + Parity parity; // The parity of the solved image. (Whether it has been flipped) JPEG images tend to have negative parity while FITS files tend to have positive parity. double raError; // The error between the search_ra position and the solution ra position in arcseconds double decError; // The error between the search_dec position and the solution dec position in arcseconds } Solution; +// This is point in the World Coordinate System with both RA and DEC. +typedef struct wcs_point +{ + float ra; // The Right Ascension in degrees + float dec; // The Declination in degrees +} wcs_point; + } // FITSImage #endif // STRUCTUREDEFINITIONS_H diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg index bcb7ac59c..e3d2c2dda 100644 --- a/kstars/kstars.kcfg +++ b/kstars/kstars.kcfg @@ -2143,6 +2143,11 @@ Path to the Sextractor executable. KSUtils::getDefaultPath("SextractorBinary") + + + Path to the Watney Solver executable. + KSUtils::getDefaultPath("WatneyBinary") +