private CoordinateAxis1DTime makeTimeAxisForRun(int run_index) { VariableDS section; try { section = (VariableDS) tAxis.slice(0, run_index); return CoordinateAxis1DTime.factory(ds, section, null); } catch (InvalidRangeException | IOException e) { e.printStackTrace(); } return null; }
private CoordinateAxis1DTime makeTimeAxisForRun(int run_index) { VariableDS section; try { section = (VariableDS) tAxis.slice(0, run_index); return CoordinateAxis1DTime.factory(ds, section, null); } catch (InvalidRangeException | IOException e) { e.printStackTrace(); } return null; }
void makeTimeAxis() { if ((tAxis != null) && (tAxis instanceof CoordinateAxis1D) && !(tAxis instanceof CoordinateAxis1DTime)) { Formatter err = new Formatter(); try { CoordinateAxis1DTime timeAxis = CoordinateAxis1DTime.factory(ds, tAxis, err); coordAxes.remove(tAxis); coordAxes.add(timeAxis); tAxis = timeAxis; ds.addCoordinateAxis(timeAxis); // will remove old one } catch (Exception e) { log.error(tAxis.getDatasetLocation() + ": Error reading time coord= " + err, e); } } }
void makeTimeAxis() { if ((tAxis != null) && (tAxis instanceof CoordinateAxis1D) && !(tAxis instanceof CoordinateAxis1DTime)) { Formatter err = new Formatter(); try { CoordinateAxis1DTime timeAxis = CoordinateAxis1DTime.factory(ds, tAxis, err); coordAxes.remove(tAxis); coordAxes.add(timeAxis); tAxis = timeAxis; ds.addCoordinateAxis(timeAxis); // will remove old one } catch (Exception e) { log.error(tAxis.getDatasetLocation() + ": Error reading time coord= " + err, e); } } }
private CoordinateAxis1DTime makeTimeAxisForRun(int run_index) { VariableDS section; try { section = (VariableDS) tAxis.slice(0, run_index); return CoordinateAxis1DTime.factory(ds, section, null); } catch (InvalidRangeException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; }
private CoordinateAxis1DTime makeTimeAxisForRun(int run_index) { CoordinateAxis tAxis = getTimeAxis(); VariableDS section; try { section = (VariableDS) tAxis.slice(0, run_index); return CoordinateAxis1DTime.factory(ds, section, null); } catch (InvalidRangeException | IOException e) { e.printStackTrace(); } return null; }
/** * If the given axis is not an instance of {@link CoordinateAxis1DTime}, tries to build * a {@code CoordinateAxis1DTime} now. Otherwise returns the axis unchanged. This method * can be invoked before to pass the axis to the constructor, if desired. * * @param axis the axis to check. * @param file the originating dataset, or {@code null} if none. * @param logger an optional object where to log warnings, or {@code null} if none. * @return the axis as an (@link CoordinateAxis1DTime} if possible. * @throws IOException if an I/O operation was needed and failed. */ static CoordinateAxis complete(CoordinateAxis axis, final NetcdfDataset file, final Logger logger) throws IOException { if (!(axis instanceof CoordinateAxis1DTime) && file != null) { final Formatter formatter = (logger != null) ? new Formatter() : null; axis = CoordinateAxis1DTime.factory(file, axis, formatter); if (formatter != null) { final StringBuilder buffer = (StringBuilder) formatter.out(); if (buffer.length() != 0) { logger.logp(Level.WARNING, NetcdfCRS.class.getName(), "wrap", buffer.toString()); } } } return axis; }
private CoordinateAxis1DTime makeTimeAxisForRun(int run_index) { CoordinateAxis tAxis = getTimeAxis(); VariableDS section; try { section = (VariableDS) tAxis.slice(0, run_index); return CoordinateAxis1DTime.factory(ds, section, null); } catch (InvalidRangeException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; }
timeAxis = t; else { t = timeAxis = CoordinateAxis1DTime.factory(ds, t, errlog);
rtAxis = CoordinateAxis1DTime.factory(ds, rt, errlog); int index = allAxes.indexOf(rt); // replace allAxes.set(index, rtAxis); if (t instanceof CoordinateAxis1D && !(t instanceof CoordinateAxis1DTime)) { // convert time axis into CoordinateAxis1DTime if possible try { timeAxis = CoordinateAxis1DTime.factory(ds, t, errlog); int index = allAxes.indexOf(t); // replace allAxes.set(index, timeAxis);
timeAxis = t; else { t = timeAxis = CoordinateAxis1DTime.factory(ds, t, errlog);
CoordinateAxis1DTime timeCoordVar = CoordinateAxis1DTime.factory(ncDataset, vds, null); dateList.addAll(timeCoordVar.getCalendarDates());
CoordinateAxis1DTime timeCoordVar = CoordinateAxis1DTime.factory(ncDataset, vds, null); dateList.addAll(timeCoordVar.getCalendarDates());
CoordinateAxis1DTime timeCoordVar = CoordinateAxis1DTime.factory(ncDataset, vds, null); dateList.addAll(timeCoordVar.getCalendarDates());
NetcdfDataset ds = new NetcdfDataset(nf); CoordinateAxis1DTime tAxis = CoordinateAxis1DTime.factory(ds, ds.findCoordinateAxis("time"), null); List<CalendarDate> dates = tAxis.getCalendarDates(); assert dates != null;