Read data from IDL Save Files. This was written using http://www.physics.wisc.edu/~craigm/idl/savefmt/node20.html https://cow.physics.wisc.edu/~craigm/idl/savefmt.pdf and https://github.com/scipy/scipy/blob/master/scipy/io/idl.py for reference, and with no involvement from individuals at Harris Geospacial. No warranties are implied and this must be used at your own risk.
{@code from org.autoplot.idlsupport import ReadIDLSav reader= ReadIDLSav() aFile= File('/tmp/aDataFile.sav') inChannel = aFile.getChannel fileSize = inChannel.size() buffer = ByteBuffer.allocate( inChannel.size() ) bytesRead= 0; while ( bytesReadReadIDLSav( )
TYPECODE_COMPLEX_FLOAT_SCALAR
TYPECODE_BYTE
TYPECODE_INT16
TYPECODE_INT32
TYPECODE_FLOAT
TYPECODE_DOUBLE
TYPECODE_COMPLEX_FLOAT
TYPECODE_STRING
TYPECODE_STRUCT
TYPECODE_COMPLEX_DOUBLE
TYPECODE_INT64
TYPECODE_UINT64
checkMagic
checkMagic( java.nio.channels.FileChannel inChannel ) → booleanParameters
inChannel - a FileChannelReturns:
boolean
[search for examples] [view on GitHub] [view on old javadoc]
decodeTypeCode
decodeTypeCode( int typeCode ) → Stringreturn a string representing the type code, if supported.
Parameters
typeCode - for example 4 which means float or 7 which means string.Returns:
"float" or "string" or whatever the code is, or the numeric code if not supported.
[search for examples] [view on GitHub] [view on old javadoc]
isArray
isArray( java.nio.ByteBuffer in, String name ) → booleanreturn true if the name refers to an array
Parameters
in - ByteBuffer for the entire file
name - the variable nameReturns:
td.isStructure();
[search for examples] [view on GitHub] [view on old javadoc]
isStructure
isStructure( java.nio.ByteBuffer in, String name ) → booleanreturn true if the name refers to a structure
Parameters
in - ByteBuffer for the entire file
name - the variable nameReturns:
true if the name refers to a structure
[search for examples] [view on GitHub] [view on old javadoc]
readArrayDataIntoArrayOfArrays
readArrayDataIntoArrayOfArrays( org.autoplot.idlsupport.ReadIDLSav.ArrayData data ) → Objectread the data into 1-D and 2-D arrays. This is provided for reference, but can be extended to 3-D and higher arrays, if the need arrises.
Parameters
data - a ReadIDLSav.ArrayDataReturns:
an Object
[search for examples] [view on GitHub] [view on old javadoc]
readFileIntoByteBuffer
readFileIntoByteBuffer( java.io.File f ) → java.nio.ByteBufferParameters
f - a FileReturns:
java.nio.ByteBuffer
[search for examples] [view on GitHub] [view on old javadoc]
readFileIntoChannel
readFileIntoChannel( java.io.File f ) → java.nio.channels.FileChannelParameters
f - a FileReturns:
java.nio.channels.FileChannel
[search for examples] [view on GitHub] [view on old javadoc]
readStructDesc
readStructDesc( java.nio.ByteBuffer rec ) → org.autoplot.idlsupport.ReadIDLSav.StructDescParameters
rec - a ByteBufferReturns:
org.autoplot.idlsupport.ReadIDLSav.StructDesc
[search for examples] [view on GitHub] [view on old javadoc]
readTagDesc
readTagDesc( java.nio.ByteBuffer in, String name ) → org.autoplot.idlsupport.ReadIDLSav.TagDescscan through the IDLSav and retrieve information about the array.
Parameters
in - the idlsav loaded into a ByteBuffer.
name - the name of the arrayReturns:
an org.autoplot.idlsupport.ReadIDLSav.TagDesc
[search for examples] [view on GitHub] [view on old javadoc]
readTagDesc( java.nio.channels.FileChannel inch, String name ) → org.autoplot.idlsupport.ReadIDLSav.TagDesc
readVar
readVar( java.nio.ByteBuffer in, String name ) → Objectscan through the IDLSav and return just the one variable.
Parameters
in - the IDLSav mapped into a NIO ByteBuffer.
name - the variable name to look for.Returns:
an Object
[search for examples] [view on GitHub] [view on old javadoc]
readVar( java.nio.channels.FileChannel inch, String name ) → Object
readVarNames
readVarNames( java.nio.ByteBuffer in ) → String[]list the names in the IDLSav file. This is only the supported variable types.
Parameters
in - a ByteBufferReturns:
the names found.
[search for examples] [view on GitHub] [view on old javadoc]
readVarNames( java.nio.channels.FileChannel inChannel ) → String[]
readVars
readVars( java.nio.ByteBuffer in ) → java.util.MapParameters
in - a ByteBufferReturns:
java.util.Map
[search for examples] [view on GitHub] [view on old javadoc]
readVars( java.nio.channels.FileChannel inChannel ) → java.util.Map