|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.nc2.ncml.NcMLReader
public class NcMLReader
Read NcML and create NetcdfDataset. Note that this is thread-safe.
NetcdfFile| Field Summary | |
|---|---|
static org.jdom.Namespace |
ncNS
|
| Constructor Summary | |
|---|---|
NcMLReader()
|
|
| Method Summary | |
|---|---|
protected void |
addAttribute(java.lang.Object parent,
Attribute att)
|
protected Attribute |
findAttribute(java.lang.Object parent,
java.lang.String name)
|
static void |
main(java.lang.String[] arg)
|
static org.jdom.Element |
readAggregation(java.lang.String filename)
Read an Aggregation element from a filename and return the root element. |
protected void |
readAtt(java.lang.Object parent,
java.lang.Object refParent,
org.jdom.Element attElem)
Read an NcML attribute element. |
protected void |
readDim(Group g,
Group refg,
org.jdom.Element dimElem)
Read an NcML dimension element. |
protected void |
readGroup(NetcdfDataset newds,
NetcdfDataset refds,
Group parent,
Group refParent,
org.jdom.Element groupElem)
Read the NcML group element, and nested elements. |
static NetcdfDataset |
readNcML(java.io.InputStream ins,
CancelTask cancelTask)
Read NcML doc from an InputStream, and construct a NetcdfDataset. |
static NetcdfDataset |
readNcML(java.lang.String ncmlLocation,
CancelTask cancelTask)
Read an NcML file from a URL location, and construct a NetcdfDataset. |
static NetcdfDataset |
readNcML(java.lang.String ncmlLocation,
org.jdom.Element netcdfElem,
CancelTask cancelTask)
Read NcML a JDOM Element, and construct a NetcdfDataset. |
static NetcdfDataset |
readNcML(java.lang.String ncmlLocation,
java.lang.String referencedDatasetUri,
CancelTask cancelTask)
Read an NcML file from a URL location, and construct a NetcdfDataset. |
void |
readNetcdf(java.lang.String ncmlLocation,
NetcdfDataset newds,
NetcdfDataset refds,
org.jdom.Element netcdfElem,
CancelTask cancelTask)
parse a netcdf JDOM Element, and add contents to the newds NetcdfDataset. |
protected void |
readValues(NetcdfDataset ds,
Variable v,
org.jdom.Element varElem,
org.jdom.Element valuesElem)
|
protected void |
readVariable(NetcdfDataset ds,
Group g,
Group refg,
org.jdom.Element varElem)
Read the NcML variable element, and nested elements. |
protected void |
readVariableNested(NetcdfDataset ds,
Structure parentS,
Structure refStruct,
org.jdom.Element varElem)
Read the NcML variable element, and nested elements. |
protected Variable |
readVariableNew(NetcdfDataset ds,
Group g,
Structure parentS,
org.jdom.Element varElem)
Read a NcML variable element, and nested elements, when it creates a new Variable. |
static void |
setDebugFlags(DebugFlags debugFlag)
|
static void |
transferDataset(NetcdfFile src,
NetcdfDataset target,
ReplaceVariableCheck replaceCheck)
Copy contents of "from" to "to", as long as "to" doesnt already have an elements of that name. |
static void |
transferGroupAttributes(Group src,
Group target)
|
static void |
wrapNcML(NetcdfDataset ncDataset,
java.lang.String ncmlLocation,
CancelTask cancelTask)
Use NCML to modify the dataset, getting NcML from a URL |
static void |
wrapNcMLresource(NetcdfDataset ncDataset,
java.lang.String ncmlResourceLocation,
CancelTask cancelTask)
Use NCML to modify a dataset, getting NcML as a resource stream |
static void |
writeNcMLToFile(java.io.InputStream ncml,
java.lang.String fileOutName)
Read an NcML and write an equivilent NetcdfFile to a physical file, using Netcdf-3 file format. |
static void |
writeNcMLToFile(java.lang.String ncmlLocation,
java.lang.String fileOutName)
Read an NcML file and write an equivilent NetcdfFile to a physical file, using Netcdf-3 file format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.jdom.Namespace ncNS
| Constructor Detail |
|---|
public NcMLReader()
| Method Detail |
|---|
public static void setDebugFlags(DebugFlags debugFlag)
public static void wrapNcMLresource(NetcdfDataset ncDataset,
java.lang.String ncmlResourceLocation,
CancelTask cancelTask)
throws java.io.IOException
ncDataset - modify this datasetncmlResourceLocation - resource location of NcMLcancelTask - allow user to cancel task; may be null
java.io.IOException
public static void wrapNcML(NetcdfDataset ncDataset,
java.lang.String ncmlLocation,
CancelTask cancelTask)
throws java.io.IOException
ncDataset - modify this datasetncmlLocation - URL location of NcMLcancelTask - allow user to cancel task; may be null
java.io.IOException
public static NetcdfDataset readNcML(java.lang.String ncmlLocation,
CancelTask cancelTask)
throws java.io.IOException,
java.net.MalformedURLException
ncmlLocation - the URL location string of the NcML documentcancelTask - allow user to cancel the task; may be null
java.io.IOException
java.net.MalformedURLException
public static NetcdfDataset readNcML(java.lang.String ncmlLocation,
java.lang.String referencedDatasetUri,
CancelTask cancelTask)
throws java.io.IOException,
java.net.MalformedURLException
ncmlLocation - the URL location string of the NcML documentreferencedDatasetUri - if null (usual case) get this from NcML, otherwise use this as the location.cancelTask - allow user to cancel the task; may be null
java.io.IOException
java.net.MalformedURLException
public static NetcdfDataset readNcML(java.io.InputStream ins,
CancelTask cancelTask)
throws java.io.IOException,
java.net.MalformedURLException
ins - the InputStream containing the NcML documentcancelTask - allow user to cancel the task; may be null
java.io.IOException
java.net.MalformedURLException
public static NetcdfDataset readNcML(java.lang.String ncmlLocation,
org.jdom.Element netcdfElem,
CancelTask cancelTask)
throws java.io.IOException,
java.net.MalformedURLException
ncmlLocation - the location of the NcML, or may be just a unique name for caching purposes.netcdfElem - the NcML as a JDOM elementcancelTask - allow user to cancel the task; may be null
java.io.IOException
java.net.MalformedURLException
public static org.jdom.Element readAggregation(java.lang.String filename)
throws java.io.IOException
filename - the file location
java.io.IOException
public void readNetcdf(java.lang.String ncmlLocation,
NetcdfDataset newds,
NetcdfDataset refds,
org.jdom.Element netcdfElem,
CancelTask cancelTask)
throws java.io.IOException
ncmlLocation - NcML URL location, or may be just a unique name for caching purposes.newds - add the info to this onerefds - the referenced datset; may equal newdsnetcdfElem - JDOM netcdf elementcancelTask - allow user to cancel the task; may be null
java.io.IOException
protected void readAtt(java.lang.Object parent,
java.lang.Object refParent,
org.jdom.Element attElem)
parent - Group or VariablerefParent - Group or Variable in reference datasetattElem - ncml attribute element
protected Attribute findAttribute(java.lang.Object parent,
java.lang.String name)
protected void addAttribute(java.lang.Object parent,
Attribute att)
protected void readDim(Group g,
Group refg,
org.jdom.Element dimElem)
g - put dimension into this grouprefg - parent Group in referenced datasetdimElem - ncml dimension element
protected void readGroup(NetcdfDataset newds,
NetcdfDataset refds,
Group parent,
Group refParent,
org.jdom.Element groupElem)
newds - new datasetrefds - referenced datasetparent - GrouprefParent - parent Group in referenced datasetgroupElem - ncml group element
protected void readVariable(NetcdfDataset ds,
Group g,
Group refg,
org.jdom.Element varElem)
g - parent Grouprefg - referenced dataset parent Group - may be same (modify) or different (explicit)varElem - ncml variable element
protected Variable readVariableNew(NetcdfDataset ds,
Group g,
Structure parentS,
org.jdom.Element varElem)
g - parent GroupparentS - parent StructurevarElem - ncml variable element
protected void readVariableNested(NetcdfDataset ds,
Structure parentS,
Structure refStruct,
org.jdom.Element varElem)
parentS - parent StructurevarElem - ncml variable element
protected void readValues(NetcdfDataset ds,
Variable v,
org.jdom.Element varElem,
org.jdom.Element valuesElem)
public static void transferDataset(NetcdfFile src,
NetcdfDataset target,
ReplaceVariableCheck replaceCheck)
src - target - replaceCheck - if null, only add if a Variable of the same name doesnt already exist, otherwise
public static void transferGroupAttributes(Group src,
Group target)
public static void writeNcMLToFile(java.lang.String ncmlLocation,
java.lang.String fileOutName)
throws java.io.IOException
ncmlLocation - read this NcML filefileOutName - write to this local file
java.io.IOExceptionFileWriter.writeToFile(ucar.nc2.NetcdfFile, java.lang.String)
public static void writeNcMLToFile(java.io.InputStream ncml,
java.lang.String fileOutName)
throws java.io.IOException
ncml - read NcML from this input streamfileOutName - write to this local file
java.io.IOExceptionFileWriter.writeToFile(ucar.nc2.NetcdfFile, java.lang.String)public static void main(java.lang.String[] arg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||