summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <[email protected]>2015-04-14 17:11:56 +0300
committerJasem Mutlaq <[email protected]>2015-04-14 17:11:56 +0300
commit077430e8dcfb9124746fd86685ab3dc289d2e8a0 (patch)
tree9b5ce0041d3f3bf27bf17eb97bec656d561a56d0
parent9cabc0ddc47f534189488d63a04f814f0d24f637 (diff)
Get pixel scale and inform user if computed focal length differs from specified focal length
-rw-r--r--kstars/ekos/align.cpp14
-rw-r--r--kstars/ekos/align.h3
-rw-r--r--kstars/ekos/astrometryparser.h2
-rw-r--r--kstars/ekos/offlineastrometryparser.cpp7
-rw-r--r--kstars/ekos/onlineastrometryparser.cpp12
-rw-r--r--kstars/ekos/onlineastrometryparser.h2
6 files changed, 30 insertions, 10 deletions
diff --git a/kstars/ekos/align.cpp b/kstars/ekos/align.cpp
index 4456de7..378c43a 100644
--- a/kstars/ekos/align.cpp
+++ b/kstars/ekos/align.cpp
@@ -140,7 +140,7 @@ Align::Align()
setEnabled(false);
else
{
- connect(parser, SIGNAL(solverFinished(double,double,double)), this, SLOT(solverFinished(double,double,double)));
+ connect(parser, SIGNAL(solverFinished(double,double,double, double)), this, SLOT(solverFinished(double,double,double, double)));
connect(parser, SIGNAL(solverFailed()), this, SLOT(solverFailed()));
}
@@ -202,7 +202,7 @@ void Align::setSolverType(bool useOnline)
parser->setAlign(this);
if (parser->init())
{
- connect(parser, SIGNAL(solverFinished(double,double,double)), this, SLOT(solverFinished(double,double,double)));
+ connect(parser, SIGNAL(solverFinished(double,double,double, double)), this, SLOT(solverFinished(double,double,double, double)));
connect(parser, SIGNAL(solverFailed()), this, SLOT(solverFailed()));
}
else
@@ -647,7 +647,7 @@ void Align::startSovling(const QString &filename, bool isGenerated)
}
-void Align::solverFinished(double orientation, double ra, double dec)
+void Align::solverFinished(double orientation, double ra, double dec, double pixscale)
{
pi->stopAnimation();
stopB->setEnabled(false);
@@ -657,6 +657,14 @@ void Align::solverFinished(double orientation, double ra, double dec)
sRA = ra;
sDEC = dec;
+ if (pixscale > 0)
+ {
+ double solver_focal_length = (206.264 * ccd_hor_pixel) / pixscale;
+ if (fabs(focal_length - solver_focal_length) > 1)
+ appendLogText(xi18n("Current focal length is %1 mm while computed focal length from the solver is %2 mm. Please update the mount focal length to obtain accurate results.",
+ QString::number(focal_length, 'g' , 5), QString::number(solver_focal_length, 'g' , 5)));
+ }
+
solverFOV->setRotation(sOrientation);
alignCoord.setRA0(ra/15.0);
diff --git a/kstars/ekos/align.h b/kstars/ekos/align.h
index 065efbf..a48c0dd 100644
--- a/kstars/ekos/align.h
+++ b/kstars/ekos/align.h
@@ -220,8 +220,9 @@ public slots:
* @param orientation Orientation of image in degrees (East of North)
* @param ra Center RA in solved image, degrees.
* @param dec Center DEC in solved image, degrees.
+ * @param pixscale Image scale is arcsec/pixel
*/
- void solverFinished(double orientation, double ra, double dec);
+ void solverFinished(double orientation, double ra, double dec, double pixscale);
/**
* @brief Process solver failure.
diff --git a/kstars/ekos/astrometryparser.h b/kstars/ekos/astrometryparser.h
index 508a8c9..14e5b85 100644
--- a/kstars/ekos/astrometryparser.h
+++ b/kstars/ekos/astrometryparser.h
@@ -39,7 +39,7 @@ public:
virtual bool stopSolver() = 0;
signals:
- void solverFinished(double orientation, double ra, double dec);
+ void solverFinished(double orientation, double ra, double dec, double pixscale);
void solverFailed();
};
diff --git a/kstars/ekos/offlineastrometryparser.cpp b/kstars/ekos/offlineastrometryparser.cpp
index f6dfa4f..79bc261 100644
--- a/kstars/ekos/offlineastrometryparser.cpp
+++ b/kstars/ekos/offlineastrometryparser.cpp
@@ -243,7 +243,7 @@ void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
QStringList key_value;
- double ra=0, dec=0, orientation=0;
+ double ra=0, dec=0, orientation=0, pixscale=0;
foreach(QString key, wcskeys)
{
@@ -257,11 +257,14 @@ void OfflineAstrometryParser::wcsinfoComplete(int exist_status)
dec = key_value[1].toDouble();
else if (key_value[0] == "orientation_center")
orientation = key_value[1].toDouble();
+ else if (key_value[0] == "pixscale")
+ pixscale = key_value[1].toDouble();
+
}
}
- emit solverFinished(orientation,ra,dec);
+ emit solverFinished(orientation,ra,dec, pixscale);
int elapsed = (int) round(solverTimer.elapsed()/1000.0);
diff --git a/kstars/ekos/onlineastrometryparser.cpp b/kstars/ekos/onlineastrometryparser.cpp
index f8e2c11..28344dd 100644
--- a/kstars/ekos/onlineastrometryparser.cpp
+++ b/kstars/ekos/onlineastrometryparser.cpp
@@ -48,7 +48,7 @@ OnlineAstrometryParser::OnlineAstrometryParser() : AstrometryParser()
connect(this, SIGNAL(jobFinished()), this, SLOT(checkJobCalibration()));
connect(this, SIGNAL(solverFailed()), this, SLOT(resetSolver()));
- connect(this, SIGNAL(solverFinished(double,double,double)), this, SLOT(resetSolver()));
+ connect(this, SIGNAL(solverFinished(double,double,double, double)), this, SLOT(resetSolver()));
apiURL = QString("%1/api/").arg(Options::astrometryAPIURL());
@@ -483,9 +483,17 @@ void OnlineAstrometryParser::onResult(QNetworkReply* reply)
return;
}
+ pixscale = result["pixscale"].toDouble(&ok);
+ if (ok == false)
+ {
+ align->appendLogText(xi18n("Error parsing DEC."));
+ emit solverFailed();
+ return;
+ }
+
elapsed = (int) round(solverTimer.elapsed()/1000.0);
align->appendLogText(xi18np("Solver completed in %1 second.", "Solver completed in %1 seconds.", elapsed));
- emit solverFinished(orientation, ra, dec);
+ emit solverFinished(orientation, ra, dec, pixscale);
break;
diff --git a/kstars/ekos/onlineastrometryparser.h b/kstars/ekos/onlineastrometryparser.h
index 59d9cdc..236185e 100644
--- a/kstars/ekos/onlineastrometryparser.h
+++ b/kstars/ekos/onlineastrometryparser.h
@@ -70,7 +70,7 @@ private:
QTime solverTimer;
QString filename, apiURL;
- double lowerScale, upperScale, center_ra, center_dec, radius;
+ double lowerScale, upperScale, center_ra, center_dec, radius, pixscale;
double parity,ra,dec,orientation;
int downsample_factor;
bool isGenerated;