|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wisc.ssec.mcidasv.data.FlatFileReader
public class FlatFileReader
Field Summary | |
---|---|
private int |
band
|
private int |
bandCount
|
private boolean |
bigEndian
|
private int |
dataScale
|
private String |
delimiter
|
private boolean |
eastPositive
|
private int |
elements
|
private float[] |
floatData
the actual floats read from the file |
private String |
interleave
The data parameters |
private String |
latFile
|
private int |
latlonScale
|
private int |
lines
The dimensions |
private String |
lonFile
|
private double |
lrLat
|
private double |
lrLon
|
private int |
myFormat
which format this object is representing |
private int |
myNavigation
|
private int |
navElements
|
(package private) CoordinateSystem |
navigationCoords
|
(package private) Gridded2DSet |
navigationSet
cache the nav info when possible |
private int |
navLines
The nav dimensions |
private int |
offset
|
private int |
stride
|
private int |
strideElements
|
private int |
strideLines
|
private double |
ulLat
The nav parameters |
private double |
ulLon
|
private String |
unit
|
private String |
url
The url |
Constructor Summary | |
---|---|
FlatFileReader()
Ctor for xml encoding |
|
FlatFileReader(String filename)
CTOR |
|
FlatFileReader(String filename,
int lines,
int elements)
CTOR |
Method Summary | |
---|---|
private static int |
bytesTo1ByteUInt(byte[] bytes,
int offset)
|
private static int |
bytesTo2ByteSInt(byte[] bytes,
int offset)
|
private static int |
bytesTo2ByteUInt(byte[] bytes,
int offset)
|
private static float |
bytesTo4ByteFloat(byte[] bytes,
int offset)
|
private static int |
bytesTo4ByteSInt(byte[] bytes,
int offset)
|
private static double |
bytesToDouble(byte[] bytes)
|
private static long |
bytesToLong(byte[] bytes)
|
Data |
getData()
Return a valid data object for a DataSource |
private Data |
getDataFromImage()
Make a FlatField from an Image |
private FlatField |
getFlatField()
float array -> flatfield |
float[] |
getFloats()
Return the array of floats making up the data |
private Gridded2DSet |
getNavigationSetFromBounds()
Make a Gridded2DSet from bounds |
private Gridded2DSet |
getNavigationSetFromFiles()
Make a Gridded2DSet from files |
private void |
makeCoordinateSystem()
Create navigation info if it hasn't been built |
private void |
readFloatsFromAscii()
Read floats from an ASCII file |
private void |
readFloatsFromBinary()
Read floats from a binary file |
void |
setAsciiInfo(String delimiter,
int dataScale)
|
void |
setBinaryInfo(int format,
String interleave,
boolean bigEndian,
int offset,
int band,
int bandCount)
|
void |
setEastPositive(boolean eastPositive)
|
void |
setImageInfo()
|
void |
setNavBounds(double ulLat,
double ulLon,
double lrLat,
double lrLon)
|
void |
setNavFiles(String latFile,
String lonFile,
int latlonScale)
|
void |
setStride(int stride)
|
void |
setUnit(String unit)
|
String |
toString()
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String url
private int lines
private int elements
private int strideLines
private int strideElements
private int band
private int bandCount
private String unit
private int stride
private int navLines
private int navElements
private String interleave
private boolean bigEndian
private int offset
private String delimiter
private int dataScale
private double ulLat
private double ulLon
private double lrLat
private double lrLon
private String latFile
private String lonFile
private int latlonScale
private boolean eastPositive
private int myFormat
private int myNavigation
private float[] floatData
Gridded2DSet navigationSet
CoordinateSystem navigationCoords
Constructor Detail |
---|
public FlatFileReader()
public FlatFileReader(String filename)
filename
- The filenamepublic FlatFileReader(String filename, int lines, int elements)
filename
- The filenamelines
- The number of lineselements
- The number of elementsband
- The bandMethod Detail |
---|
public void setBinaryInfo(int format, String interleave, boolean bigEndian, int offset, int band, int bandCount)
delimiter
- The data value delimiterdataScale
- The data scale factorpublic void setAsciiInfo(String delimiter, int dataScale)
delimiter
- The data value delimiterdataScale
- The data scale factorpublic void setImageInfo()
delimiter
- The data value delimiterdataScale
- The data scale factorpublic void setNavBounds(double ulLat, double ulLon, double lrLat, double lrLon)
ulLat
- The upper left latitudeulLon
- The upper left longitudelrLat
- The lower right latitudelrLon
- The lower right longitudepublic void setNavFiles(String latFile, String lonFile, int latlonScale)
ulLat
- The latitude fileulLon
- The longitude filelatlonScale
- The navigation value scalingpublic void setEastPositive(boolean eastPositive)
eastPositive
- public void setStride(int stride)
stride
- public void setUnit(String unit)
unit
- private void readFloatsFromBinary()
private void readFloatsFromAscii()
private Data getDataFromImage()
private Gridded2DSet getNavigationSetFromBounds()
private Gridded2DSet getNavigationSetFromFiles()
private void makeCoordinateSystem()
public Data getData()
public float[] getFloats()
private FlatField getFlatField() throws IOException, VisADException
IOException
VisADException
public String toString()
toString
in class Object
private static int bytesTo1ByteUInt(byte[] bytes, int offset)
private static int bytesTo2ByteUInt(byte[] bytes, int offset)
private static int bytesTo2ByteSInt(byte[] bytes, int offset)
private static int bytesTo4ByteSInt(byte[] bytes, int offset)
private static float bytesTo4ByteFloat(byte[] bytes, int offset)
private static long bytesToLong(byte[] bytes)
private static double bytesToDouble(byte[] bytes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |