public class CDMDSP
extends dap4.dap4shared.AbstractDSP
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected static java.lang.String |
DAPVERSION |
protected CDMDataDataset |
data |
protected static boolean |
DEBUG |
protected static java.lang.String |
DMRVERSION |
protected static java.util.Set<ucar.nc2.dataset.NetcdfDataset.Enhance> |
ENHANCEMENT |
protected dap4.core.dmr.DapFactory |
factory |
protected static java.lang.Object |
FACTORYKEY |
protected static java.lang.Class |
NC4CLASS |
protected static boolean |
nc4loaded |
protected ucar.nc2.dataset.NetcdfDataset |
ncdfile |
protected dap4.cdmshared.NodeMap |
nodemap |
protected javax.servlet.http.HttpServletRequest |
request |
protected javax.servlet.http.HttpServletResponse |
response |
| Constructor and Description |
|---|
CDMDSP() |
CDMDSP(ucar.nc2.NetcdfFile ncd,
dap4.core.util.DapContext cxt) |
CDMDSP(java.lang.String path,
dap4.core.util.DapContext cxt) |
| Modifier and Type | Method and Description |
|---|---|
void |
build()
Extract the metadata from the NetcdfDataset
and build the DMR.
|
protected dap4.core.dmr.DapAtomicVariable |
buildatomicvar(ucar.nc2.Variable cdmvar) |
protected dap4.core.dmr.DapAttribute |
buildattribute(ucar.nc2.Attribute attr) |
protected void |
buildattributes(dap4.core.dmr.DapNode node,
java.util.List<ucar.nc2.Attribute> attributes) |
protected dap4.core.data.DataVariable |
buildData(dap4.core.dmr.DapVariable dap) |
protected dap4.core.data.DataDataset |
buildDataDataset()
Build a tree of Data objects corresponding
to the DMR.
|
protected dap4.core.dmr.DapDimension |
builddim(ucar.nc2.Dimension cdmdim) |
protected void |
builddimrefs(dap4.core.dmr.DapVariable dapvar,
java.util.List<ucar.nc2.Dimension> cdmdims)
Assign dimensions to a variable
|
protected dap4.core.dmr.DapEnum |
buildenum(ucar.nc2.EnumTypedef cdmenum) |
protected dap4.core.dmr.DapAtomicVariable |
buildenumvar(ucar.nc2.Variable cdmvar) |
protected dap4.core.dmr.DapGroup |
buildgroup(ucar.nc2.Group cdmgroup) |
protected void |
buildmaps(dap4.core.dmr.DapVariable dapvar,
ucar.nc2.Variable var) |
protected dap4.core.dmr.DapAtomicVariable |
buildopaquevar(ucar.nc2.Variable cdmvar) |
protected dap4.core.dmr.DapSequence |
buildsequence(ucar.nc2.Variable cdmbasevar) |
protected dap4.core.dmr.DapAtomicVariable |
buildstringvar(ucar.nc2.Variable cdmvar) |
protected dap4.core.dmr.DapStructure |
buildstructvar(ucar.nc2.Variable cdmvar) |
protected dap4.core.dmr.DapNode |
buildvariable(ucar.nc2.Variable cdmvar,
dap4.core.dmr.DapNode parent) |
protected dap4.core.dmr.DapNode |
buildvariable(ucar.nc2.Variable cdmbasevar,
java.util.List<ucar.nc2.Dimension> cdmdims,
dap4.core.dmr.DapNode parent) |
void |
close() |
protected ucar.nc2.NetcdfFile |
createNetcdfFile(java.lang.String location,
ucar.nc2.util.CancelTask canceltask) |
protected long |
dapsize(ucar.nc2.Dimension cdmdim) |
protected void |
fillgroup(dap4.core.dmr.DapGroup dapgroup,
ucar.nc2.Group cdmgroup) |
protected ucar.nc2.Dimension |
finddimdecl(ucar.nc2.Dimension dimref) |
protected ucar.nc2.EnumTypedef |
findMatchingEnum(ucar.nc2.EnumTypedef varenum)
Unfortunately, the CDM Iosp does not
actually use the declared enums.
|
protected java.lang.Object |
fixvalue(java.lang.Object o,
dap4.core.dmr.DapType datatype) |
ucar.nc2.CDMNode |
getCDMNode(dap4.core.dmr.DapNode dapnode)
Lookup a dapnode in the dap nodemap.
|
dap4.core.data.DataDataset |
getDataDataset() |
ucar.nc2.dataset.NetcdfDataset |
getNetcdfDataset() |
protected void |
init(ucar.nc2.NetcdfFile ncfile) |
protected boolean |
isdeclfor(ucar.nc2.Dimension decl,
ucar.nc2.Dimension ref) |
static void |
loadNc4Iosp()
Make sure that NC4Iosp is registered and library loaded
|
protected dap4.core.dmr.DapNode |
lookupNode(ucar.nc2.CDMNode cdmnode)
Lookup a cdmnode in the cdmnodemap.
|
static boolean |
match(java.lang.String path,
dap4.core.util.DapContext context) |
protected dap4.core.dmr.DapNode |
newNode(dap4.core.util.DapSort sort) |
dap4.dap4shared.DSP |
open(java.lang.String path) |
dap4.dap4shared.DSP |
open(java.lang.String path,
dap4.core.util.DapContext context) |
protected void |
processmappedvariables(ucar.nc2.Group g) |
protected void |
recordNode(ucar.nc2.CDMNode cdmnode,
dap4.core.dmr.DapNode dapnode)
Record a cdmnode+dapnode in the nodemap.
|
void |
setDataDataset(CDMDataDataset data) |
protected void |
setRequestResponse() |
protected boolean |
shadows(ucar.nc2.Group parent,
ucar.nc2.Group child) |
protected boolean |
suppress(java.lang.String attrname)
Some attributes that are added by the NetcdfDataset
need to be kept out of the DMR.
|
protected boolean |
validatecdmtype(ucar.ma2.DataType datatype,
boolean unsigned,
java.lang.Class typeclass) |
protected static final boolean DEBUG
protected static final java.lang.Object FACTORYKEY
protected static final java.lang.String DAPVERSION
protected static final java.lang.String DMRVERSION
protected static final java.lang.Class NC4CLASS
protected static java.util.Set<ucar.nc2.dataset.NetcdfDataset.Enhance> ENHANCEMENT
protected static boolean nc4loaded
protected ucar.nc2.dataset.NetcdfDataset ncdfile
protected dap4.core.dmr.DapFactory factory
protected dap4.cdmshared.NodeMap nodemap
protected boolean closed
protected CDMDataDataset data
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
public CDMDSP()
public CDMDSP(java.lang.String path,
dap4.core.util.DapContext cxt)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionpublic CDMDSP(ucar.nc2.NetcdfFile ncd,
dap4.core.util.DapContext cxt)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionpublic static void loadNc4Iosp()
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void init(ucar.nc2.NetcdfFile ncfile)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void setRequestResponse()
setRequestResponse in class dap4.dap4shared.AbstractDSPpublic static boolean match(java.lang.String path,
dap4.core.util.DapContext context)
public dap4.dap4shared.DSP open(java.lang.String path)
throws dap4.core.util.DapException
open in interface dap4.dap4shared.DSPopen in class dap4.dap4shared.AbstractDSPdap4.core.util.DapExceptionpublic dap4.dap4shared.DSP open(java.lang.String path,
dap4.core.util.DapContext context)
throws dap4.core.util.DapException
open in interface dap4.dap4shared.DSPopen in class dap4.dap4shared.AbstractDSPdap4.core.util.DapExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic dap4.core.data.DataDataset getDataDataset()
getDataDataset in interface dap4.dap4shared.DSPgetDataDataset in class dap4.dap4shared.AbstractDSPpublic ucar.nc2.dataset.NetcdfDataset getNetcdfDataset()
public void setDataDataset(CDMDataDataset data)
public ucar.nc2.CDMNode getCDMNode(dap4.core.dmr.DapNode dapnode)
dapnode - The DapNodeprotected void recordNode(ucar.nc2.CDMNode cdmnode,
dap4.core.dmr.DapNode dapnode)
cdmnode - The CMDNode (variable, dimension, etc) to recorddapnode - The DapNode to which the cdmnode is to be mapped.protected dap4.core.dmr.DapNode lookupNode(ucar.nc2.CDMNode cdmnode)
cdmnode - The CMDNode (variable, dimension, etc) to recordpublic void build()
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void fillgroup(dap4.core.dmr.DapGroup dapgroup,
ucar.nc2.Group cdmgroup)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapDimension builddim(ucar.nc2.Dimension cdmdim)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapEnum buildenum(ucar.nc2.EnumTypedef cdmenum)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapNode buildvariable(ucar.nc2.Variable cdmvar,
dap4.core.dmr.DapNode parent)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapNode buildvariable(ucar.nc2.Variable cdmbasevar,
java.util.List<ucar.nc2.Dimension> cdmdims,
dap4.core.dmr.DapNode parent)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapAtomicVariable buildatomicvar(ucar.nc2.Variable cdmvar)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapAtomicVariable buildopaquevar(ucar.nc2.Variable cdmvar)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapAtomicVariable buildstringvar(ucar.nc2.Variable cdmvar)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapAtomicVariable buildenumvar(ucar.nc2.Variable cdmvar)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected ucar.nc2.EnumTypedef findMatchingEnum(ucar.nc2.EnumTypedef varenum)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected boolean shadows(ucar.nc2.Group parent,
ucar.nc2.Group child)
protected dap4.core.dmr.DapStructure buildstructvar(ucar.nc2.Variable cdmvar)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapSequence buildsequence(ucar.nc2.Variable cdmbasevar)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void buildattributes(dap4.core.dmr.DapNode node,
java.util.List<ucar.nc2.Attribute> attributes)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapAttribute buildattribute(ucar.nc2.Attribute attr)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void builddimrefs(dap4.core.dmr.DapVariable dapvar,
java.util.List<ucar.nc2.Dimension> cdmdims)
throws dap4.core.util.DapException
dapvar - The variable to which we wish to assign dimensionscdmdims - The cdm dimensions from which we will find the dimension infodap4.core.util.DapExceptionprotected void processmappedvariables(ucar.nc2.Group g)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void buildmaps(dap4.core.dmr.DapVariable dapvar,
ucar.nc2.Variable var)
throws dap4.core.util.DapException
dapvar - The variable to which we wish to assign mapsvar - The NetcdfDataset variable from which to extract coord systemdap4.core.util.DapExceptionprotected dap4.core.dmr.DapGroup buildgroup(ucar.nc2.Group cdmgroup)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected dap4.core.dmr.DapNode newNode(dap4.core.util.DapSort sort)
protected long dapsize(ucar.nc2.Dimension cdmdim)
protected boolean validatecdmtype(ucar.ma2.DataType datatype,
boolean unsigned,
java.lang.Class typeclass)
protected ucar.nc2.Dimension finddimdecl(ucar.nc2.Dimension dimref)
protected boolean isdeclfor(ucar.nc2.Dimension decl,
ucar.nc2.Dimension ref)
protected java.lang.Object fixvalue(java.lang.Object o,
dap4.core.dmr.DapType datatype)
protected dap4.core.data.DataDataset buildDataDataset()
throws dap4.core.data.DataException
dap4.core.data.DataExceptionprotected dap4.core.data.DataVariable buildData(dap4.core.dmr.DapVariable dap)
throws dap4.core.data.DataException
dap4.core.data.DataExceptionprotected ucar.nc2.NetcdfFile createNetcdfFile(java.lang.String location,
ucar.nc2.util.CancelTask canceltask)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected boolean suppress(java.lang.String attrname)
suppress in class dap4.dap4shared.AbstractDSPattrname - A non-escaped attribute name to be tested for suppression