/*
         * public RinexNavigationParserGps(EphemerisResponse ephResponse)
         * {
         *  foreach (GnssEphemeris eph in ephResponse.ephList)
         *  {
         *      if (eph is GpsEphemeris)
         *      {
         *          this.eph.Add(new EphGps((GpsEphemeris)eph));
         *      }
         *  }
         *  this.iono = new IonoGps(ephResponse.ionoProto);
         * }
         */
        public SatellitePosition getGpsSatPosition(Observations obs, int satID, char satType, double receiverClockError)
        {
            long   unixTime = obs.getRefTime().getMsec();
            double range    = obs.getSatByIDType(satID, satType).getPseudorange(0);

            if (range == 0)
            {
                return(null);
            }

            EphGps eph = findEph(unixTime, satID, satType);

            if (eph.Equals(EphGps.UnhealthyEph))
            {
                return(SatellitePosition.UnhealthySat);
            }

            if (eph != null)
            {
                //			char satType = eph.getSatType();

                SatellitePosition sp = computePositionGps(obs, satID, satType, eph, receiverClockError);
                //			SatellitePosition sp = computePositionGps(unixTime, satType, satID, eph, range, receiverClockError);
                //if(receiverPosition!=null) earthRotationCorrection(receiverPosition, sp);
                return(sp);// new SatellitePosition(eph, unixTime, satID, range);
            }
            return(null);
        }
        public SatellitePosition getSatPositionAndVelocities(long unixTime, double range, int satID, char satType, double receiverClockError)
        {
            //long unixTime = obs.getRefTime().getMsec();
            //double range = obs.getSatByIDType(satID, satType).getPseudorange(0);

            if (range == 0)
            {
                return(null);
            }

            EphGps eph = findEph(unixTime, satID, satType);

            if (eph == null)
            {
                Log.Error(TAG, "getSatPositionAndVelocities: Ephemeris failed to load...");
                return(null);
            }

            if (eph.Equals(EphGps.UnhealthyEph))
            {
                return(SatellitePosition.UnhealthySat);
            }

            //			char satType = eph.getSatType();

            SatellitePosition sp = computeSatPositionAndVelocities(unixTime, range, satID, satType, eph, receiverClockError);

            //			SatellitePosition sp = computePositionGps(unixTime, satType, satID, eph, range, receiverClockError);
            //if(receiverPosition!=null) earthRotationCorrection(receiverPosition, sp);
            return(sp);// new SatellitePosition(eph, unixTime, satID, range);
        }