public XYZCoord GetRinexSVPos(string filename, int svPRN, double TOW, out double ionoError, out double svClkBias, out XYZCoord svVel) { XYZCoord coord = new XYZCoord(); if (this.m_RinexFile.GetNumEphemerides() == 0) { this.m_RinexFile.Read(@"..\scripts\TunnelsMeasAndNav\brdc2140.07n"); } RinexEph eph = this.m_RinexFile.SearchRinexArrayList((byte)svPRN, (int)TOW); if (eph == null) { ionoError = 0.0; svClkBias = 0.0; svVel.X = svVel.Y = svVel.Z = 0.0; return(coord); } tSVD_SVState st = new tSVD_SVState(); tGPSTime gTime = new tGPSTime(); gTime.isTOWValid = true; gTime.isWeekValid = true; gTime.time = TOW; gTime.week = (int)eph.weekNo; new ComputeSVPos().computeSVState(st, (short)svPRN, eph, gTime); coord.X = st.pos[0]; coord.Y = st.pos[1]; coord.Z = st.pos[2]; svVel.X = st.vel[0]; svVel.Y = st.vel[1]; svVel.Z = st.vel[2]; ionoError = st.ionoDelayStd; svClkBias = st.clockBias; return(coord); }
public void CalcAggregate(int x, int y, int z) { if (z > x || z > y) { return; } if (z == 0) { return; } else { power[x, y, z] = power[x - 1, y - 1, z - 1]; for (int X = x - z; X < x; X++) { power[x, y, z] += power[X, y, 0]; } for (int Y = y - z; Y < y; Y++) { power[x, y, z] += power[x, Y, 0]; } power[x, y, z] += power[x, y, 0]; } if (power[x, y, z] > mostPower) { mostPower = power[x, y, z]; mostPowerCoord = new XYZCoord(x + 1, y + 1, z + 1); } }
public XYZCoord GetIMUTruePos(string filename, double TOW) { XYZCoord result = new XYZCoord(); if (this.m_ImuFile.GetNumSamples() == 0) { this.m_ImuFile.LoadFromFile(filename); } this.m_ImuFile.GetPositionAtTime(TOW, out result); return(result); }
public double ComputePRerrorOneSV(int svPRN, double svTOW, double svPseudoRange, double ionoErr, double clkBias, string RinexFileName, string IMUFileName, out string strPRtrue_ClkBiasRange_txTOW) { double num6; double num7; double num = 0.0; strPRtrue_ClkBiasRange_txTOW = "-1.0,-1.0,-1.0"; this.m_SV_PRN = svPRN; this.m_SV_TOW = svTOW; double num2 = svPseudoRange / 299792458.0; this.m_SV_TxTOW = (this.m_SV_TOW - num2) - clkBias; double ionoError = 0.0; double svClkBias = 0.0; XYZCoord svVel = new XYZCoord(); XYZCoord a = this.GetRinexSVPos(RinexFileName, this.m_SV_PRN, this.m_SV_TxTOW, out ionoError, out svClkBias, out svVel); XYZCoord iMUTruePos = this.GetIMUTruePos(IMUFileName, svTOW); XYZCoord coord4 = new XYZCoord(); if ((a == coord4) || (iMUTruePos == coord4)) { return(-1.0); } double num5 = XYZCoord.getDistance(a, iMUTruePos); double[] svPos = new double[] { a.X, a.Y, a.Z }; double[] navPos = new double[] { iMUTruePos.X, iMUTruePos.Y, iMUTruePos.Z }; double[] numArray3 = new double[] { svVel.X, svVel.Y, svVel.Z }; computeTropo tropo = new computeTropo(); GPSUtilsClass.ComputeAzEl(navPos, svPos, out num6, out num7); double alt = GPSUtilsClass.ComputeApproxAltitude(navPos); double num9 = tropo.NL_ComputeTropo(alt, num7); double num10 = computeEarthRotation.earthRotationCorrection(svPos, navPos, numArray3); double num11 = num5 - num10; double num12 = (svPseudoRange - (clkBias * 299792458.0)) + (svClkBias * 299792458.0); strPRtrue_ClkBiasRange_txTOW = string.Format("{0}, {1}, {2}", num5, num12, this.m_SV_TxTOW); num = num5 - num12; return(((num - ionoErr) - num9) - num11); }