Class CFPointObWriter


  • public class CFPointObWriter
    extends Object
    Deprecated.
    use WriterCFPointCollection
    Write point obs data in CF obs format.
    Since:
    Oct 22, 2008
    • Constructor Detail

      • CFPointObWriter

        public CFPointObWriter​(DataOutputStream stream,
                               List<Attribute> globalAtts,
                               String altUnits,
                               List<PointObVar> dataVars,
                               int numrec)
                        throws IOException
        Deprecated.
        Constructor
        Parameters:
        stream - write to this stream
        globalAtts - optional list of global attributes (may be null)
        altUnits - optional altitude units (set to null if no altitude variable)
        dataVars - the set of data variables: first the double values, then the String values
        Throws:
        IOException - if write error
    • Method Detail

      • addPoint

        public void addPoint​(double lat,
                             double lon,
                             double alt,
                             Date time,
                             double[] vals,
                             String[] svals)
                      throws IOException
        Deprecated.
        Add one data point to the file
        Parameters:
        lat - latitude value in units of degrees_north
        lon - longitude value in units of degrees_east
        alt - altitude value in units of altUnits (may be NaN)
        time - time value as a date
        vals - list of data values, matching dataVars in the constructor
        svals - list of String values, matching dataVars in the constructor
        Throws:
        IOException - if write error
      • finish

        public void finish()
                    throws IOException
        Deprecated.
        Call this when all done, output is flushed
        Throws:
        IOException - if write error
      • rewritePointObsDataset

        public static boolean rewritePointObsDataset​(String fileIn,
                                                     String fileOut,
                                                     boolean inMemory)
                                              throws IOException
        Deprecated.
        Open a ucar.nc2.dt.PointObsDataset, write out in CF point format.
        Parameters:
        fileIn - open through TypedDatasetFactory.open(FeatureType.POINT, ..)
        fileOut - write to this netcdf-3 file
        inMemory - if true, read file into memory for efficiency
        Returns:
        true on success
        Throws:
        IOException - on read/write error
      • writePointObsDataset

        public static void writePointObsDataset​(PointObsDataset pobsDataset,
                                                String fileOut)
                                         throws IOException
        Deprecated.
        write data from a ucar.nc2.dt.PointObsDataset into CF point format.
        Parameters:
        pobsDataset - rewrite data from here
        fileOut - write to tehis netcdf-3 file
        Throws:
        IOException - on read/write error
      • rewritePointFeatureDataset

        public static boolean rewritePointFeatureDataset​(String fileIn,
                                                         String fileOut,
                                                         boolean inMemory)
                                                  throws IOException
        Deprecated.
        Open a ucar.nc2.ft.PointFeatureCollection, write out in CF point format.
        Parameters:
        fileIn - open through TypedDatasetFactory.open(FeatureType.POINT, ..)
        fileOut - write to this netcdf-3 file
        inMemory - if true, read file into memory for efficiency
        Returns:
        true on success
        Throws:
        IOException - on read/write error
      • writePointFeatureCollection

        public static int writePointFeatureCollection​(FeatureDatasetPoint pfDataset,
                                                      String fileOut)
                                               throws IOException
        Deprecated.
        Write a ucar.nc2.ft.PointFeatureCollection in CF point format.
        Parameters:
        pfDataset - find the first PointFeatureCollection, and write all data from it
        fileOut - write to this netcdf-3 file
        Returns:
        number of records written
        Throws:
        IOException - on read/write error, or if no PointFeatureCollection in pfDataset