use of org.orekit.gnss.DOP in project Orekit by CS-SI.
the class DOPComputation method run.
private void run(final OneAxisEllipsoid shape, final List<GeodeticPoint> zone, final double meshSize, final double minElevation, final AbsoluteDate tStart, final AbsoluteDate tStop, final double tStep) throws IOException, OrekitException, ParseException {
// Gets the GPS almanacs from the SEM file
final SEMParser reader = new SEMParser(null);
reader.loadData();
final List<GPSAlmanac> almanacs = reader.getAlmanacs();
// Creates the GPS propagators from the almanacs
final List<Propagator> propagators = new ArrayList<Propagator>();
for (GPSAlmanac almanac : almanacs) {
// Only keeps almanac with health status ok
if (almanac.getHealth() == 0) {
propagators.add(new GPSPropagator.Builder(almanac).build());
} else {
System.out.println("GPS PRN " + almanac.getPRN() + " is not OK (Health status = " + almanac.getHealth() + ").");
}
}
// Meshes the area of interest into a grid of geodetic points.
final List<List<GeodeticPoint>> points = sample(shape, zone, meshSize);
// Creates the DOP computers for all the locations of the sampled geographic zone
final List<DOPComputer> computers = new ArrayList<DOPComputer>();
for (List<GeodeticPoint> row : points) {
for (GeodeticPoint point : row) {
computers.add(DOPComputer.create(shape, point).withMinElevation(minElevation));
}
}
// Computes the DOP for each point over the period
final List<List<DOP>> allDop = new ArrayList<List<DOP>>();
// Loops on the period
AbsoluteDate tc = tStart;
while (tc.compareTo(tStop) != 1) {
// Loops on the grid points
final List<DOP> dopAtDate = new ArrayList<DOP>();
for (DOPComputer computer : computers) {
try {
final DOP dop = computer.compute(tc, propagators);
dopAtDate.add(dop);
} catch (OrekitException oe) {
System.out.println(oe.getLocalizedMessage());
}
}
allDop.add(dopAtDate);
tc = tc.shiftedBy(tStep);
}
// Post-processing: gets the statistics of PDOP over the zone at each time
System.out.println(" PDOP");
System.out.println(" Date min max");
for (List<DOP> dopAtDate : allDop) {
final StreamingStatistics pDoP = new StreamingStatistics();
for (DOP dopAtLoc : dopAtDate) {
pDoP.addValue(dopAtLoc.getPdop());
}
final AbsoluteDate date = dopAtDate.get(0).getDate();
System.out.format(Locale.ENGLISH, "%s %.2f %.2f%n", date.toString(), pDoP.getMin(), pDoP.getMax());
}
}
Aggregations