/** * Creates a {@link DefaultCategoryDataset} for rendering a graph from a set of {@link * MultiStageTimeSeries}. */ protected DefaultCategoryDataset createDataset() { float[][] dataPoints = new float[series.size()][]; for (int i = 0; i < series.size(); i++) dataPoints[i] = series.get(i).pick(timeScale).getHistory(); int dataLength = dataPoints[0].length; for (float[] dataPoint : dataPoints) assert dataLength == dataPoint.length; DefaultCategoryDataset ds = new DefaultCategoryDataset(); DateFormat format = timeScale.createDateFormat(); Date dt = new Date(System.currentTimeMillis() - timeScale.tick * dataLength); for (int i = dataLength - 1; i >= 0; i--) { dt = new Date(dt.getTime() + timeScale.tick); String l = format.format(dt); for (int j = 0; j < dataPoints.length; j++) ds.addValue(dataPoints[j][i], series.get(j).title.toString(), l); } return ds; }
private void checkOffset(int year, int month, int day, double offset) throws OrekitException { TimeScale utc = TimeScalesFactory.getUTC(); AbsoluteDate date = new AbsoluteDate(year, month, day, utc); Assert.assertEquals(offset, utc.offsetFromTAI(date), 1.0e-10); }