Updating FITS header

This commit is contained in:
2024-09-30 21:19:23 +02:00
parent a43f12565d
commit da1aa4c6fc
8 changed files with 92 additions and 26 deletions
+14 -5
View File
@@ -109,6 +109,11 @@ bool Solver::extractSources(bool hfr)
return false;
}
void Solver::abort()
{
_solver->abort();
}
const FITSImage::Solution& Solver::getSolution() const
{
return _solver->getSolution();
@@ -137,13 +142,15 @@ QString Solver::errorMessage() const
return _error;
}
void Solver::updateHeader()
bool Solver::updateHeader(QString &error)
{
if(!_solver->solvingDone())return;
if(!_solver->solvingDone())
{
error = tr("Solving is not finished");
return false;
}
FITSImage::Solution solution = getSolution();
qDebug() << "RA" << solution.ra << "DEC" << solution.dec << "Orient" << solution.orientation << "field wxh" << solution.fieldWidth << solution.fieldHeight << solution.pixscale;
qDebug() << "error" << solution.raError << solution.decError;
double rotationDeg = 360.0 - solution.orientation;
if(rotationDeg > 360)rotationDeg -= 360;
@@ -170,7 +177,9 @@ void Solver::updateHeader()
modify.updateKeyword("CTYPE2", "DEC--TAN", QByteArray("first parameter DEC, projection TANgential"));
modify.updateKeyword("RADESYS", "ICRS", QByteArray("International Celestial Reference System"));
modify.updateKeyword("EQUINOX", 2000, QByteArray("Equinox of coordinates"));
file.modifyFITSRecords(&modify);
bool ret = file.modifyFITSRecords(&modify);
if(!ret)error = tr("Failed to update file header");
return ret;
}
void Solver::setParameters(Parameters::ParametersProfile profile)