Skip to content

Commit

Permalink
Refactoring to remove unused Lat parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hjd1964 committed Jan 28, 2019
1 parent 3973a04 commit 1503006
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions Align.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class TGeoAlign
void writeCoe();
bool isReady();
bool addStar(int I, int N, double RA, double Dec);
void equToInstr(double Lat, double HA, double Dec, double *HA1, double *Dec1, int PierSide);
void instrToEqu(double Lat, double HA, double Dec, double *HA1, double *Dec1, int PierSide);
void equToInstr(double HA, double Dec, double *HA1, double *Dec1, int PierSide);
void instrToEqu(double HA, double Dec, double *HA1, double *Dec1, int PierSide);
void autoModel(int n);
void model(int n);

Expand Down Expand Up @@ -151,4 +151,3 @@ boolean alignStar() {

return true;
}

4 changes: 2 additions & 2 deletions AlignEq.ino
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void TGeoAlign::autoModel(int n) {
}

// takes the topocentric refracted coordinates and applies corrections to arrive at instrument equatorial coordinates
void TGeoAlign::equToInstr(double Lat, double HA, double Dec, double *HA1, double *Dec1, int PierSide) {
void TGeoAlign::equToInstr(double HA, double Dec, double *HA1, double *Dec1, int PierSide) {
double p=1.0; if (PierSide==PierSideWest) p=-1.0;

if (Dec>90.0) Dec=90.0;
Expand Down Expand Up @@ -403,7 +403,7 @@ void TGeoAlign::equToInstr(double Lat, double HA, double Dec, double *HA1, doubl
}

// takes the instrument equatorial coordinates and applies corrections to arrive at topocentric refracted coordinates
void TGeoAlign::instrToEqu(double Lat, double HA, double Dec, double *HA1, double *Dec1, int PierSide) {
void TGeoAlign::instrToEqu(double HA, double Dec, double *HA1, double *Dec1, int PierSide) {
double p=1.0; if (PierSide==PierSideWest) p=-1.0;

HA =HA +ax1Cor;
Expand Down
2 changes: 1 addition & 1 deletion Astro.ino
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ boolean doRefractionRateCalc() {
// get the instrument coordinates
if ((rr_step==10) || (rr_step==110)) {
if ((rateCompensation==RC_FULL_RA) || (rateCompensation==RC_FULL_BOTH)) {
Align.equToInstr(latitude,rr_HA,rr_Dec,&rr_HA,&rr_Dec,getInstrPierSide());
Align.equToInstr(rr_HA,rr_Dec,&rr_HA,&rr_Dec,getInstrPierSide());
}
}

Expand Down
8 changes: 4 additions & 4 deletions Goto.ino
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ GotoErrors syncEqu(double RA, double Dec) {
Align.horToInstr(Axis2,Axis1,&Axis2,&Axis1,getInstrPierSide());
Axis1=haRange(Axis1);
#else
Align.equToInstr(latitude,HA,Dec,&Axis1,&Axis2,getInstrPierSide());
Align.equToInstr(HA,Dec,&Axis1,&Axis2,getInstrPierSide());
#endif

// just turn on tracking
Expand Down Expand Up @@ -139,7 +139,7 @@ boolean getEqu(double *RA, double *Dec, boolean returnHA) {
HA=getInstrAxis1();
*Dec=getInstrAxis2();
// apply pointing model
Align.instrToEqu(latitude,HA,*Dec,&HA,Dec,getInstrPierSide());
Align.instrToEqu(HA,*Dec,&HA,Dec,getInstrPierSide());
#else
double Z=getInstrAxis1();
double A=getInstrAxis2();
Expand Down Expand Up @@ -255,11 +255,11 @@ GotoErrors goToEqu(double RA, double Dec) {
Axis2Alt=a;
#else
// correct for polar offset, refraction, coordinate systems, operation past pole, etc. as required
Align.equToInstr(latitude,HA,Dec,&Axis1,&Axis2,getInstrPierSide());
Align.equToInstr(HA,Dec,&Axis1,&Axis2,getInstrPierSide());

// as above... for the opposite pier side just incase we need to do a meridian flip
int p=PierSideNone; if (getInstrPierSide()==PierSideEast) p=PierSideWest; else if (getInstrPierSide()==PierSideWest) p=PierSideEast;
Align.equToInstr(latitude,HA,Dec,&Axis1Alt,&Axis2Alt,p);
Align.equToInstr(HA,Dec,&Axis1Alt,&Axis2Alt,p);
#endif

// goto function takes HA and Dec in steps
Expand Down

0 comments on commit 1503006

Please sign in to comment.