Class DapperDataset

    • Field Detail

      • dodsFile

        protected ucar.nc2.dods.DODSNetcdfFile dodsFile
      • latVar

        protected ucar.nc2.Variable latVar
      • lonVar

        protected ucar.nc2.Variable lonVar
      • altVar

        protected ucar.nc2.Variable altVar
      • timeVar

        protected ucar.nc2.Variable timeVar
      • innerSequence

        protected ucar.nc2.dataset.StructureDS innerSequence
      • outerSequence

        protected ucar.nc2.dataset.StructureDS outerSequence
      • isProfile

        protected boolean isProfile
      • fatal

        protected boolean fatal
    • Constructor Detail

      • DapperDataset

        public DapperDataset()
      • DapperDataset

        public DapperDataset​(ucar.nc2.dataset.NetcdfDataset ds)
                      throws IOException
        Throws:
        IOException
    • Method Detail

      • isValidFile

        public static boolean isValidFile​(ucar.nc2.NetcdfFile ds)
      • isMine

        public boolean isMine​(ucar.nc2.dataset.NetcdfDataset ds)
        Description copied from interface: TypedDatasetFactoryIF
        Determine if this dataset belongs to you
        Specified by:
        isMine in interface TypedDatasetFactoryIF
        Parameters:
        ds - examine this NetcdfDataset to see if it belongs to this class.
        Returns:
        true if this class knows how to create a TypedDataset out of this NetcdfDataset.
      • open

        public TypedDataset open​(ucar.nc2.dataset.NetcdfDataset ncd,
                                 ucar.nc2.util.CancelTask task,
                                 StringBuilder errlog)
                          throws IOException
        Description copied from interface: TypedDatasetFactoryIF
        Open a NetcdfDataset as a TypedDataset.
        Specified by:
        open in interface TypedDatasetFactoryIF
        Parameters:
        ncd - already opened NetcdfDataset.
        task - use may cancel
        errlog - place errors here
        Returns:
        a subclass of TypedDataset
        Throws:
        IOException - on error
      • getDataCount

        public int getDataCount()
        Description copied from interface: PointCollection
        Get estimate of number of data records (may not be exact). Return -1 if not able to estimate.
        Specified by:
        getDataCount in interface PointCollection
        Returns:
        number of data records or -1
      • getData

        public List getData​(ucar.nc2.util.CancelTask cancel)
                     throws IOException
        Description copied from interface: PointCollection
        Get all data, allow user to cancel. Return null if too expensive to implement. Call getDataCount() to get estimate of size. This will return a list of getDataClass(), but the actual data may or may not already be read in to memory. In any case, you call dataType.getData() to get the data.
        Specified by:
        getData in interface PointCollection
        Parameters:
        cancel - allow user to cancel. Implementors should return ASAP.
        Returns:
        List of type getDataClass()
        Throws:
        IOException - on io error
        See Also:
        as a (possibly) more efficient alternative
      • getData

        public List getData​(ucar.unidata.geoloc.LatLonRect boundingBox,
                            ucar.nc2.util.CancelTask cancel)
                     throws IOException
        Description copied from interface: PointCollection
        Get all data within the specified bounding box, allow user to cancel.
        Specified by:
        getData in interface PointCollection
        Parameters:
        boundingBox - restrict data to this bounding nox
        cancel - allow user to cancel. Implementors should return ASAP.
        Returns:
        List of type getDataClass()
        Throws:
        IOException - on io error
        See Also:
        as a (possibly) more efficient alternative
      • getData

        public List getData​(ucar.unidata.geoloc.LatLonRect boundingBox,
                            Date start,
                            Date end,
                            ucar.nc2.util.CancelTask cancel)
                     throws IOException
        Description copied from interface: PointCollection
        Get all data within the specified bounding box and date range, allow user to cancel.
        Specified by:
        getData in interface PointCollection
        Parameters:
        boundingBox - restrict data to this bounding nox
        start - restrict data to after this time
        end - restrict data to before this time
        cancel - allow user to cancel. Implementors should return ASAP.
        Returns:
        List of type getDataClass()
        Throws:
        IOException - on io error
        See Also:
        as a (possibly) more efficient alternative
      • readStationData

        public List readStationData​(ucar.unidata.geoloc.Station s,
                                    ucar.nc2.util.CancelTask cancel)
                             throws IOException
        Throws:
        IOException
      • getDataIterator

        public DataIterator getDataIterator​(int bufferSize)
                                     throws IOException
        Description copied from interface: PointCollection
        Get an efficient iterator over all the data in the Collection. You must fully process the data, or copy it out of the StructureData, as you iterate over it. DO NOT KEEP ANY REFERENCES to the dataType object or the StructureData object.

        This is the efficient way to get all the data, it can be 100 times faster than getData(). This will return an iterator over type getDataClass(), and the actual data has already been read into memory, that is, dataType.getData() will not incur any I/O. This is accomplished by buffering bufferSize amount of data at once.

        We dont need a cancelTask, just stop the iteration if the user want to cancel.

         Example for point observations:
         

        Iterator iter = pointObsDataset.getDataIterator(); while (iter.hasNext()) { PointObsDatatype pobs = (PointObsDatatype) iter.next(); StructureData sdata = pobs.getData(); // process fully }

        Specified by:
        getDataIterator in interface PointCollection
        Parameters:
        bufferSize - if > 0, the internal buffer size, else use the default. Typically 100k - 1M for best results.
        Returns:
        iterator over type getDataClass(), no guarenteed order.
        Throws:
        IOException - on io error