@NotThreadSafe public class DODSNetcdfFile extends NetcdfFile
NetcdfFile
NetcdfFile.Builder<T extends NetcdfFile.Builder<T>>
Modifier and Type | Field and Description |
---|---|
static boolean |
debugAttributes |
static boolean |
debugCached |
static boolean |
debugCE |
static boolean |
debugCharArray |
static boolean |
debugConstruct |
static boolean |
debugConvertData |
static boolean |
debugDataResult |
static boolean |
debugOpenResult |
static boolean |
debugOpenTime |
static boolean |
debugPreload |
static boolean |
debugServerCall |
static boolean |
debugTime |
static boolean |
showNCfile |
cache, dimensions, gattributes, id, iosp, IOSP_MESSAGE_ADD_RECORD_STRUCTURE, IOSP_MESSAGE_CONVERT_RECORD_STRUCTURE, IOSP_MESSAGE_GET_NETCDF_FILE_FORMAT, IOSP_MESSAGE_RANDOM_ACCESS_FILE, IOSP_MESSAGE_REMOVE_RECORD_STRUCTURE, location, rootGroup, title, variables
Constructor and Description |
---|
DODSNetcdfFile(java.lang.String datasetURL)
Open a DODS file.
|
DODSNetcdfFile(java.lang.String datasetURL,
CancelTask cancelTask)
Open a DODS file, allow user control over preloading string arrays and making structure data
available through netcdf API.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
canonicalURL(java.lang.String urlName)
Create the canonical form of the URL.
|
void |
close()
Close all resources (files, sockets, etc) associated with this file.
|
protected static Attribute |
combineAxesAttrs(Attribute axis1,
Attribute axis2)
Safely combine the multiple axis attributes without duplication
|
static int |
convertToDODSType(DataType dataType)
Get the DODS data class corresponding to the Netcdf data type.
|
static DataType |
convertToNCType(BaseType dtype,
boolean isUnsigned)
Get the Netcdf data type corresponding to the DODS BaseType class.
|
static DataType |
convertToNCType(int dodsDataType,
boolean isUnsigned)
Get the Netcdf data type corresponding to the DODS data type.
|
void |
getDetailInfo(java.util.Formatter f) |
static java.lang.String |
getDODSConstraintName(Variable var)
Return a variable name suitable for use in a DAP constraint expression.
|
java.lang.String |
getFileTypeDescription()
Get a human-readable description for this file type.
|
java.lang.String |
getFileTypeId()
Get the file type id for the underlying data source.
|
static boolean |
isUnsigned(BaseType dtype)
Get whether this is an unsigned type.
|
protected int[] |
makeShape(DArray dodsArray) |
protected Array |
readData(Variable v,
Section section)
Do not call this directly, use Variable.read() !!
Ranges must be filled (no nulls)
|
Array |
readSection(java.lang.String variableSection)
Read a variable using the given section specification.
|
long |
readToByteChannel(Variable v,
Section section,
java.nio.channels.WritableByteChannel channel)
Read data from a top level Variable and send data to a WritableByteChannel.
|
Array |
readWithCE(Variable v,
java.lang.String CE) |
protected void |
reGroup()
Go thru the variables/structure-variables and their attributes
and move to the proper groups.
|
protected void |
reGroupVariable(Group rootgroup,
DODSVariable dodsv)
Deprecated.
|
static void |
setAllowCompression(boolean b)
Set whether to allow messages to be compressed.
|
static void |
setAllowDeflate(boolean b)
Deprecated.
use setAllowCompression
|
static void |
setAllowSessions(boolean b)
Set whether to allow sessions by allowing cookies.
|
static void |
setCoordinateVariablePreloadSize(int size)
If preloading, set maximum size of coordinate variables to be preloaded.
|
static void |
setDebugFlags(DebugFlags debugFlag)
Debugging flags.
|
static void |
setPreload(boolean b)
Set whether small variables are preloaded; only turn off for debugging.
|
addAttribute, addAttribute, addDimension, addGroup, addLocalFieldsToBuilder, addStringVariable, addVariable, addVariable, addVariableAttribute, builder, canonicalizeUriString, canOpen, empty, findAttribute, findAttValueIgnoreCase, findDimension, findGlobalAttribute, findGlobalAttributeIgnoreCase, findGroup, findVariable, findVariable, findVariableByAttribute, finish, getCacheName, getDetailInfo, getDimensions, getFileTypeVersion, getGlobalAttributes, getId, getIosp, getLastModified, getLocation, getRootGroup, getStructureIterator, getTitle, getUnlimitedDimension, getVariables, hasUnlimitedDimension, iospDeRegister, iospRegistered, makeFullName, makeFullName, makeFullNameSectionSpec, makeFullNameWithString, makeNameUnescaped, makeRecordStructure, makeValidCDLName, makeValidCdmObjectName, makeValidPathName, makeValidSectionSpecName, open, open, open, open, open, open, openInMemory, openInMemory, openInMemory, openInMemory, reacquire, read, readArrays, readAttributeDouble, readAttributeInteger, readToOutputStream, registerIOProvider, registerIOProvider, registerIOProvider, registerIOProviderPreferred, release, removeDimension, removeRecordStructure, removeVariable, sendIospMessage, setCacheName, setFileCache, setId, setImmutable, setLocation, setProperty, setRootGroup, setTitle, showCached, showProxies, syncExtend, toBuilder, toNcml, toString, toStringDebug, writeCDL, writeCDL, writeCDL, writeNcml, writeNcml
public static boolean debugCE
public static boolean debugServerCall
public static boolean debugOpenResult
public static boolean debugDataResult
public static boolean debugCharArray
public static boolean debugConvertData
public static boolean debugConstruct
public static boolean debugPreload
public static boolean debugTime
public static boolean showNCfile
public static boolean debugAttributes
public static boolean debugCached
public static boolean debugOpenTime
public DODSNetcdfFile(java.lang.String datasetURL) throws java.io.IOException
datasetURL
- URL of the file. This should start with the protocol "dods:"
It may also start with protocol "http:".java.io.IOException
- on io errorjava.net.MalformedURLException
public DODSNetcdfFile(java.lang.String datasetURL, CancelTask cancelTask) throws java.io.IOException
datasetURL
- URL of the file. This should start with the protocol "dods:" or "http:".cancelTask
- check if task is cancelled. may be null.java.io.IOException
- on io errorjava.net.MalformedURLException
public static void setAllowSessions(boolean b)
b
- true or false. default is false.public static void setAllowDeflate(boolean b)
b
- true or false.public static void setAllowCompression(boolean b)
b
- true or false.public static void setDebugFlags(DebugFlags debugFlag)
debugFlag
- set of debug flags.public static void setPreload(boolean b)
b
- true if small variables are preloaded (default true)public static void setCoordinateVariablePreloadSize(int size)
size
- maximum size of coordinate variables to be preloaded.public static java.lang.String canonicalURL(java.lang.String urlName)
urlName
- the url stringpublic void close() throws java.io.IOException
NetcdfFile
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface FileCacheable
close
in class NetcdfFile
java.io.IOException
- if error when closingprotected void reGroup() throws DAP2Exception
DAP2Exception
@Deprecated protected void reGroupVariable(Group rootgroup, DODSVariable dodsv)
protected static Attribute combineAxesAttrs(Attribute axis1, Attribute axis2)
axis1
- axis attribute 1axis2
- axis attribute 2protected int[] makeShape(DArray dodsArray)
public static java.lang.String getDODSConstraintName(Variable var)
var
- The variable whose name will appear in the CEpublic static int convertToDODSType(DataType dataType)
dataType
- Netcdf data type.public static DataType convertToNCType(int dodsDataType, boolean isUnsigned)
dodsDataType
- DODS type enum, from dods.dap.Attribute.XXXX.isUnsigned(opendap.dap.BaseType)
public static DataType convertToNCType(BaseType dtype, boolean isUnsigned)
dtype
- DODS BaseType.isUnsigned(opendap.dap.BaseType)
public static boolean isUnsigned(BaseType dtype)
dtype
- DODS BaseType.public Array readSection(java.lang.String variableSection) throws java.io.IOException, InvalidRangeException
NetcdfFile
readSection
in class NetcdfFile
variableSection
- the constraint expression.java.io.IOException
- if errorInvalidRangeException
- if variableSection is invalidprotected Array readData(Variable v, Section section) throws java.io.IOException, InvalidRangeException
NetcdfFile
readData
in class NetcdfFile
java.io.IOException
InvalidRangeException
public long readToByteChannel(Variable v, Section section, java.nio.channels.WritableByteChannel channel) throws java.io.IOException, InvalidRangeException
NetcdfFile
readToByteChannel
in class NetcdfFile
v
- a top-level Variablesection
- the section of data to read.
There must be a Range for each Dimension in the variable, in order.
Note: no nulls allowed. IOSP may not modify.channel
- write data to this WritableByteChanneljava.io.IOException
- if read errorInvalidRangeException
- if invalid sectionpublic Array readWithCE(Variable v, java.lang.String CE) throws java.io.IOException
java.io.IOException
public void getDetailInfo(java.util.Formatter f)
getDetailInfo
in class NetcdfFile
public java.lang.String getFileTypeId()
NetcdfFile
getFileTypeId
in class NetcdfFile
public java.lang.String getFileTypeDescription()
NetcdfFile
getFileTypeDescription
in class NetcdfFile