|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.NetcdfFile
ucar.nc2.dods.DODSNetcdfFile
public class DODSNetcdfFile
Access to DODS datasets through the Netcdf API.
NetcdfFile
Field Summary | |
---|---|
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
|
Fields inherited from class ucar.nc2.NetcdfFile |
---|
cache, cacheName, debugCompress, debugSPI, dimensions, gattributes, id, IOSP_MESSAGE_ADD_RECORD_STRUCTURE, IOSP_MESSAGE_CONVERT_RECORD_STRUCTURE, IOSP_MESSAGE_RANDOM_ACCESS_FILE, IOSP_MESSAGE_REMOVE_RECORD_STRUCTURE, location, reserved, reservedCdl, reservedSectionSpec, rootGroup, showRequest, spi, title, unlocked, variables |
Constructor Summary | |
---|---|
DODSNetcdfFile(String datasetURL)
Open a DODS file. |
|
DODSNetcdfFile(String datasetURL,
CancelTask cancelTask)
Open a DODS file, allow user control over preloading string arrays and making structure data available through netcdf API. |
Method Summary | |
---|---|
static String |
canonicalURL(String urlName)
Create the canonical form of the URL. |
void |
close()
Close all resources (files, sockets, etc) associated with this file. |
static int |
convertToDODSType(DataType dataType,
boolean isUnsigned)
Get the DODS data class corresponding to the Netcdf data type. |
static DataType |
convertToNCType(BaseType dtype)
Get the Netcdf data type corresponding to the DODS BaseType class. |
static DataType |
convertToNCType(int dodsDataType)
Get the Netcdf data type corresponding to the DODS data type. |
void |
getDetailInfo(Formatter f)
|
static String |
getDODSshortName(Variable var)
|
String |
getFileTypeDescription()
Get a human-readable description for this file type. |
String |
getFileTypeId()
Get the file type id for the underlying data source. |
static boolean |
isUnsigned(BaseType dtype)
Get whether this is an unsigned type. |
static boolean |
isUnsigned(int dodsDataType)
Get whether this is an unsigned type. |
static void |
main(String[] arg)
|
protected int[] |
makeShape(DArray dodsArray)
|
List<Array> |
readArrays(List<Variable> preloadVariables)
Make a single call to the DODS Server to read all the named variable's data in one client/server roundtrip. |
protected Array |
readData(Variable v,
Section section)
|
Array |
readSection(String variableSection)
Read a variable using the given section specification. |
long |
readToByteChannel(Variable v,
Section section,
WritableByteChannel channel)
Read data from a top level Variable and send data to a WritableByteChannel. |
Array |
readWithCE(Variable v,
String CE)
|
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. |
boolean |
sync()
Check if file has changed, and reread metadata if needed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public DODSNetcdfFile(String datasetURL) throws IOException
datasetURL
- URL of the file. This should start with the protocol "dods:"
It may also start with protocol "http:".
IOException
- on io error
MalformedURLException
public DODSNetcdfFile(String datasetURL, CancelTask cancelTask) throws IOException
datasetURL
- URL of the file. This should start with the protocol "dods:" or "http:".cancelTask
- check if task is cancelled. may be null.
IOException
- on io error
MalformedURLException
Method Detail |
---|
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 String canonicalURL(String urlName)
urlName
- the url string
public void close() throws IOException
NetcdfFile
close
in interface FileCacheable
close
in class NetcdfFile
IOException
public boolean sync() throws IOException
NetcdfFile
sync
in interface FileCacheable
sync
in class NetcdfFile
IOException
- if errorprotected int[] makeShape(DArray dodsArray)
public static String getDODSshortName(Variable var)
public static int convertToDODSType(DataType dataType, boolean isUnsigned)
dataType
- Netcdf data type.isUnsigned
- if its unsigned
public static DataType convertToNCType(int dodsDataType)
dodsDataType
- DODS type enum, from dods.dap.Attribute.XXXX.
isUnsigned(int)
public static boolean isUnsigned(int dodsDataType)
dodsDataType
- DODS type enum, from dods.dap.Attribute.XXXX.
public static DataType convertToNCType(BaseType dtype)
dtype
- DODS BaseType.
isUnsigned(int)
public static boolean isUnsigned(BaseType dtype)
dtype
- DODS BaseType.
public List<Array> readArrays(List<Variable> preloadVariables) throws IOException
readArrays
in class NetcdfFile
preloadVariables
- list of type Variable
IOException
- on errorpublic Array readSection(String variableSection) throws IOException, InvalidRangeException
NetcdfFile
readSection
in class NetcdfFile
variableSection
- the constraint expression.
IOException
- if error
InvalidRangeException
- if variableSection is invalidprotected Array readData(Variable v, Section section) throws IOException, InvalidRangeException
readData
in class NetcdfFile
IOException
InvalidRangeException
public long readToByteChannel(Variable v, Section section, WritableByteChannel channel) throws 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 WritableByteChannel
IOException
- if read error
InvalidRangeException
- if invalid sectionpublic Array readWithCE(Variable v, String CE) throws IOException
IOException
public void getDetailInfo(Formatter f)
getDetailInfo
in class NetcdfFile
public String getFileTypeId()
NetcdfFile
getFileTypeId
in class NetcdfFile
public String getFileTypeDescription()
NetcdfFile
getFileTypeDescription
in class NetcdfFile
public static void main(String[] arg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |