@Test public void testDatumPointWithOneSurfarceDriftPoint(){ SAROperation operation = new SAROperation(SAR_TYPE.DATUM_POINT); double allowedUncertainty = 0.00005; DateTime now = DateTime.now(); DateTime lastKnowPositionTs = now.minusHours(1); Position lastKnowPosition = Position.create(61, -51); DateTime css = now; double xError = 1.0; double yError = 0.1; double safetyFactor = 1.0; DatumPointData data = new DatumPointData("1", lastKnowPositionTs, css, lastKnowPosition, xError, yError, safetyFactor, 0) ; List<SARWeatherData> surfaceDriftData = new ArrayList<>(); surfaceDriftData.add(new SARWeatherData(45.0, 5.0, 15.0, 30.0, lastKnowPositionTs)); data.setWeatherPoints(surfaceDriftData); operation.startDatumPointCalculations(data); assertEquals("61 03.328N", data.getDatumDownWind().getLatitudeAsString()); assertEquals("050 52.939W", data.getDatumDownWind().getLongitudeAsString()); assertEquals(45.780030, data.getRdvDirectionDownWind(), allowedUncertainty); assertEquals(4.7754450213160355, data.getRdvDistanceDownWind(), allowedUncertainty); assertEquals(4.7754450213160355, data.getRdvSpeedDownWind(), allowedUncertainty); assertEquals(2.5326335063948107, data.getRadiusDownWind(), allowedUncertainty); assertEquals("61 03.413N", data.getDatumMax().getLatitudeAsString()); assertEquals("050 53.115W", data.getDatumMax().getLongitudeAsString()); assertEquals(44.331598, data.getRdvDirectionMax(), allowedUncertainty); assertEquals(4.7752103, data.getRdvDistanceMax(), allowedUncertainty); assertEquals(4.7752103, data.getRdvSpeedMax(), allowedUncertainty); assertEquals(2.5325631, data.getRadiusMax(), allowedUncertainty); assertEquals("61 03.297N", data.getDatumMin().getLatitudeAsString()); assertEquals("050 52.699W", data.getDatumMin().getLongitudeAsString()); assertEquals(47.008245, data.getRdvDirectionMin(), allowedUncertainty); assertEquals(4.8383743, data.getRdvDistanceMin(), allowedUncertainty); assertEquals(4.8383743, data.getRdvSpeedMin(), allowedUncertainty); assertEquals(2.5515123, data.getRadiusMin(), allowedUncertainty); assertEquals("60 59.801N", data.getA().getLatitudeAsString()); assertEquals("050 50.788W", data.getA().getLongitudeAsString()); assertEquals("61 02.460N", data.getB().getLatitudeAsString()); assertEquals("051 00.292W", data.getB().getLongitudeAsString()); assertEquals("61 06.878N", data.getC().getLatitudeAsString()); assertEquals("050 55.017W", data.getC().getLongitudeAsString()); assertEquals("61 04.229N", data.getD().getLatitudeAsString()); assertEquals("050 45.497W", data.getD().getLongitudeAsString()); }
public DatumPointData startDatumPointCalculations(DatumPointData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return datumPoint(data); }
SAROperation { public DatumPointData startDatumPointCalculations(DatumPointData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return datumPoint(data); } }
SAROperation { public DatumPointData startDatumPointCalculations(DatumPointData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return datumPoint(data); } SAROperation(SAR_TYPE operationType); }
SAROperation { public DatumPointData startDatumPointCalculations(DatumPointData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return datumPoint(data); } SAROperation(SAR_TYPE operationType); DatumLineData startDatumLineCalculations(DatumLineData data); RapidResponseData startRapidResponseCalculations(RapidResponseData data); DatumPointData startDatumPointCalculations(DatumPointData data); List<SARData> sarFutureCalculations(SARData data); DatumPointData datumPoint(DatumPointData data); Position applyDriftToPoint(SARData data, Position point, double timeElapsed); static void findRapidResponseBox(Position datum, double radius, RapidResponseData data); SAR_TYPE getOperationType(); void calculateEffortAllocation(SARData data); }
SAROperation { public DatumPointData startDatumPointCalculations(DatumPointData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return datumPoint(data); } SAROperation(SAR_TYPE operationType); DatumLineData startDatumLineCalculations(DatumLineData data); RapidResponseData startRapidResponseCalculations(RapidResponseData data); DatumPointData startDatumPointCalculations(DatumPointData data); List<SARData> sarFutureCalculations(SARData data); DatumPointData datumPoint(DatumPointData data); Position applyDriftToPoint(SARData data, Position point, double timeElapsed); static void findRapidResponseBox(Position datum, double radius, RapidResponseData data); SAR_TYPE getOperationType(); void calculateEffortAllocation(SARData data);  }