Package dap4.cdm.nc2
Class CDMCompiler
- java.lang.Object
-
- dap4.cdm.nc2.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 Summary
Fields Modifier and Type Field Description protected Map<ucar.nc2.Variable,ucar.ma2.Array>arraymapprotected ucar.nc2.Groupcdmrootstatic booleanDEBUGprotected dap4.core.dmr.DapDatasetdmrprotected dap4.core.data.DSPdspprotected DapNetcdfFilencfileprotected NodeMap<ucar.nc2.CDMNode,dap4.core.dmr.DapNode>nodemap
-
Constructor Summary
Constructors Constructor Description CDMCompiler(DapNetcdfFile ncfile, dap4.core.data.DSP dsp)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompileData()Convert a DataDataset to equivalent CDM data (Array objects).protected voidcompileDMR()Convert a DMR to equivalent CDM meta-databuffer and populate a NetcdfDataset with it.Map<ucar.nc2.Variable,ucar.ma2.Array>getArrayMap()ucar.nc2.NetcdfFilegetNetcdfFile()NodeMap<ucar.nc2.CDMNode,dap4.core.dmr.DapNode>getNodeMap()
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
-
ncfile
protected DapNetcdfFile ncfile
-
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.DapExceptionConvert 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.DapExceptionConvert a DataDataset to equivalent CDM data (Array objects). and populate a NetcdfDataset with it.- Throws:
dap4.core.util.DapException
-
-