Package dap4.cdm.nc2

Class CDMCompiler


  • public class CDMCompiler
    extends Object
    The goal for the CDM compiler is produce a NetcdfDataset whose content comes from a DSP. In a sense it is the inverse of CDMDSP. Compilation implies two translations/wraps. 1. Create a set of CDMNodes corresponding to the relevant nodes in the DMR. 2. Create a set of CDM ucar.ma2.array objects that wrap the DataDataset object. Note that this compiler has nothing to do with D4DataCompiler.
    • Field Detail

      • DEBUG

        public static boolean DEBUG
      • dsp

        protected dap4.core.data.DSP dsp
      • dmr

        protected dap4.core.dmr.DapDataset dmr
      • cdmroot

        protected ucar.nc2.Group cdmroot
      • nodemap

        protected NodeMap<ucar.nc2.CDMNode,​dap4.core.dmr.DapNode> nodemap
      • arraymap

        protected Map<ucar.nc2.Variable,​ucar.ma2.Array> arraymap
    • Constructor Detail

      • CDMCompiler

        public CDMCompiler​(DapNetcdfFile ncfile,
                           dap4.core.data.DSP dsp)
                    throws dap4.core.util.DapException
        Constructor
        Parameters:
        ncfile - the target NetcdfDataset (as yet empty)
        dsp - the DSP to be wrapped
        Throws:
        dap4.core.util.DapException
    • Method Detail

      • getNodeMap

        public NodeMap<ucar.nc2.CDMNode,​dap4.core.dmr.DapNode> getNodeMap()
      • getArrayMap

        public Map<ucar.nc2.Variable,​ucar.ma2.Array> getArrayMap()
      • getNetcdfFile

        public ucar.nc2.NetcdfFile getNetcdfFile()
      • compileDMR

        protected void compileDMR()
                           throws dap4.core.util.DapException
        Convert a DMR to equivalent CDM meta-databuffer and populate a NetcdfDataset with it.
        Throws:
        dap4.core.util.DapException
      • compileData

        protected void compileData()
                            throws dap4.core.util.DapException
        Convert a DataDataset to equivalent CDM data (Array objects). and populate a NetcdfDataset with it.
        Throws:
        dap4.core.util.DapException