## visad.data
Class FileFlatField

    java.lang.Object
      visad.ThingImpl
          visad.DataImpl
              visad.FunctionImpl
                  visad.FieldImpl
                      visad.FlatField
                          visad.data.FileFlatField

All Implemented Interfaces:
  Cloneable, Data, Field, FlatFieldIface, Function, Serializable, Thing

public class FileFlatField
extends FlatField

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class visad.DataImpl
`DataImpl.Syncher`

Nested classes inherited from class visad.ThingImpl
``

Field Summary
`(package private) FileAccessor` `fileAccessor`

Fields inherited from class visad.FlatField
`RangeCoordinateSystem, RangeCoordinateSystems, RangeUnits, TupleDimension`

Fields inherited from class visad.FieldImpl
``

Fields inherited from class visad.DataImpl
``

Fields inherited from interface visad.Data

`ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE`

Constructor Summary
`FileFlatField(FileAccessor accessor, CacheStrategy strategy)`

Method Summary
`Data` `adjustSamplingError(Data error, int error_mode)` return a FlatField that clones this, except its ErrorEstimate-s are adjusted for sampling errors in error
`Data` `binary(Data data, int op, int sampling_mode, int error_mode)` Pointwise binary operation between this and data.
`Data` `binary(Data data, int op, MathType new_type, int sampling_mode, int error_mode)` Return new Field with value 'this op data'.
`Object` `clone()` Clones this instance.
`DataShadow` `computeRanges(ShadowType type, DataShadow shadow)` Recursive version of computeRanges(), called down through Data object tree.
`Field` `domainFactor(RealType factor)` factor Field domain into domains of two nested Fields
`Field` `extract(int component)` extract field from this[].component; this is OK, when we get around to it
`Unit[]` `getDefaultRangeUnits()` Get default range Unit-s for 'Flat' components.
`CoordinateSystem` `getDomainCoordinateSystem()` Get the CoordinateSystem associated with the domain RealTuple
`Set` `getDomainSet()` get the domain Set
`Unit[]` `getDomainUnits()` Get the default Units of the Real components of the domain.
`float[][]` `getFloats(boolean copy)` Returns the range values in their default units as floats.
`int` `getLength()` get number of samples
`CoordinateSystem[]` `getRangeCoordinateSystem()` Returns the range CoordinateSystem assuming that the range type is a RealTupleType (and throws a TypeException if its not).
`CoordinateSystem[]` `getRangeCoordinateSystem(int component)` Returns the CoordinateSystem of a component of the range.
`Unit[][]` `getRangeUnits()` return array of Units associated with each RealType component of range; these may differ from default Units of range RealTypes, but must be convertable; the second index has length = 1 (since all samples have the same Units)
`Data` `getSample(int index)` Get the range value at the index-th sample.
`double[][]` `getValues()` Returns the range values in their default units as doubles.
`double[][]` `getValues(boolean copy)` Returns the range values in their default units as doubles.
`double[]` `getValues(int index)` Get values for 'Flat' components in default range Unit-s.
`boolean` `isFlatField()` return true if this a FlatField or a RemoteField adapting a FlatField
`boolean` `isMissing()` Test whether range values are missing
`String` `longString(String pre)`
`Field` `resample(Set set, int sampling_mode, int error_mode)` Resamples the range to domain samples of a given set.
`void` `setSample(int index, Data range)` Set the range value at the index-th sample
`void` `setSample(int index, Data range, boolean copy)` Set the range value at the index-th sample
`void` `setSample(RealTuple domain, Data range)` set the range value at the sample nearest to domain
`String` `toString()`
`Data` `unary(int op, int sampling_mode, int error_mode)` Pointwise unary operation applied to this.
`Data` `unary(int op, MathType new_type, int sampling_mode, int error_mode)` Return new FlatField with value 'this op'.
`float[][]` `unpackFloats()` unpack an array of floats from field sample values according to the RangeSet-s; returns a copy
`double[][]` `unpackValues()` unpack an array of doubles from field sample values according to the RangeSet-s; returns a copy

Methods inherited from class visad.FlatField

`clearMissing, cloneDouble, cloneDouble, cloneFloat, cloneFloat, convertToField, derivative, derivative, derivative, derivative, derivative, equals, fillField, getFloats, getRangeDimension, getRangeErrors, getRangeSets, getSample, getStringValues, grabBytes, main, makeField, makeField1, makeField2, makeRational, makeRational, pr, setRangeErrors, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, setSamples, unpackFloats, unpackFloats, unpackOneRangeComp, unpackValues, unpackValues`

Methods inherited from class visad.FieldImpl
`__getitem__, __len__, __setitem__, __setitem__, combine, combine, combine, combine, combine, domainEnumeration, domainFactor, domainMultiply, domainMultiply, domainMultiply, domainMultiply, extract, extract, setSample, setSample, setSamples`

Methods inherited from class visad.FunctionImpl
`__getitem__, __getitem__, evaluate, evaluate, evaluate, evaluate, getDomainDimension, resample`

Methods inherited from class visad.DataImpl

`__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees`

Methods inherited from class visad.ThingImpl
`addReference, removeReference`

Methods inherited from class java.lang.Object
`finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface visad.Field
`domainEnumeration, domainMultiply, domainMultiply, setSample`

Methods inherited from interface visad.Function
`evaluate, evaluate, evaluate, evaluate, getDomainDimension, resample`

Methods inherited from interface visad.Data

`abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees`

Methods inherited from interface visad.Thing
`addReference, removeReference`

Field Detail

### fileAccessor

    transient FileAccessor fileAccessor

Constructor Detail

### FileFlatField

    public FileFlatField(FileAccessor accessor,
                         CacheStrategy strategy)
                  throws VisADException

Method Detail

### getSample

    public Data getSample(int index)
                   throws VisADException,
                          RemoteException

  Description copied from class: `FlatField`
  Get the range value at the index-th sample. FlatField does not override evaluate, but the correctness of FlatField.evaluate depends on overriding getSample

  Specified by:
    `getSample` in interface `Field`
  Overrides:
    `getSample` in class `FlatField`
  Returns:
    Data object (Real, RealTuple, or Tuple) corresponding to the range at the index-th sample.
  Throws:
    `VisADException` - problem getting data
    `RemoteException` - problem getting data from remote object

### getLength

    public int getLength()

  Description copied from interface: `Field`
  get number of samples

  Specified by:
    `getLength` in interface `Field`
  Overrides:
    `getLength` in class `FieldImpl`

### getDomainUnits

    public Unit[] getDomainUnits()

  Description copied from interface: `Function`
  Get the default Units of the Real components of the domain.

  Specified by:
    `getDomainUnits` in interface `Function`
  Overrides:
    `getDomainUnits` in class `FieldImpl`
  Returns:
    The units of the values in the domain set.

### getDomainCoordinateSystem

    public CoordinateSystem getDomainCoordinateSystem()

  Description copied from interface: `Function`
  Get the CoordinateSystem associated with the domain RealTuple

  Specified by:
    `getDomainCoordinateSystem` in interface `Function`
  Overrides:
    `getDomainCoordinateSystem` in class `FieldImpl`

### getRangeCoordinateSystem

    public CoordinateSystem[] getRangeCoordinateSystem()
                                                throws TypeException

  Description copied from class: `FlatField`
  Returns the range CoordinateSystem assuming that the range type is a RealTupleType (and throws a TypeException if its not). This may differ from default CoordinateSystem of range RealTupleType, but must be convertable; the index has length = 1 (since all samples have the same Units).

  Specified by:
    `getRangeCoordinateSystem` in interface `Field`
  Overrides:
    `getRangeCoordinateSystem` in class `FlatField`
  Returns:
    The CoordinateSystem of the RealTuple range. Will not be `null` and will be of length 1.
  Throws:
    `TypeException` - The type of the range is neither RealType nor RealTupleType.

### getRangeCoordinateSystem

    public CoordinateSystem[] getRangeCoordinateSystem(int component)
                                                throws TypeException

  Description copied from class: `FlatField`
  Returns the CoordinateSystem of a component of the range. The MathType of the range shall be a TupleType.

  Specified by:
    `getRangeCoordinateSystem` in interface `Field`
  Overrides:
    `getRangeCoordinateSystem` in class `FlatField`
  Parameters:
    `component` - The index of the component. The value shall be greater than or equal to zero and less that the number of components in the TupleType of the range.
  Returns:
    The CoordinateSystem of the `i`-th component. Won't be `null` and will be of length 1. The single element might be `null`.
  Throws:
    `TypeException` - The type of the range is either RealType or RealTupleType.

### getRangeUnits

    public Unit[][] getRangeUnits()

  Description copied from class: `FlatField`
  return array of Units associated with each RealType component of range; these may differ from default Units of range RealTypes, but must be convertable; the second index has length = 1 (since all samples have the same Units)

  Specified by:
    `getRangeUnits` in interface `Field`
  Overrides:
    `getRangeUnits` in class `FlatField`

### getDefaultRangeUnits

    public Unit[] getDefaultRangeUnits()

  Description copied from class: `FlatField`
  Get default range Unit-s for 'Flat' components.

  Specified by:
    `getDefaultRangeUnits` in interface `Field`
  Overrides:
    `getDefaultRangeUnits` in class `FlatField`
  Returns:
    array of the default Units for each of the RealTypes components in the flattened range.

### getValues

    public double[][] getValues()
                         throws VisADException

  Description copied from class: `FlatField`
  Returns the range values in their default units as doubles.

  Specified by:
    `getValues` in interface `Field`
  Overrides:
    `getValues` in class `FlatField`
  Returns:
    The range values in their default units as determined by the `MathType` of the range. Element `[i][j]` is the `j`th sample value of the `i`th component of the range.
  Throws:
    `VisADException` - if a VisAD object couldn't be created.

### getValues

    public double[][] getValues(boolean copy)
                         throws VisADException

  Description copied from class: `FlatField`
  Returns the range values in their default units as doubles.

  Specified by:
    `getValues` in interface `Field`
  Overrides:
    `getValues` in class `FlatField`
  Parameters:
    `copy` - Whether or not the returned array might be the actual range array. If `true`, then the returned array will not be the actual range array.
  Returns:
    The range values in their default units as determined by the `MathType` of the range. Element `[i][j]` is the `j`th sample value of the `i`th component of the range.
  Throws:
    `VisADException` - if a VisAD object couldn't be created.

### getValues

    public double[] getValues(int index)
                       throws VisADException

  Description copied from class: `FlatField`
  Get values for 'Flat' components in default range Unit-s.

  Specified by:
    `getValues` in interface `FlatFieldIface`
  Overrides:
    `getValues` in class `FlatField`
  Returns:
    The range values in their default units as determined by the `MathType` of the range. Element `[i]` is the value of the `i`th component of the flattened range.
  Throws:
    `VisADException` - if a VisAD object couldn't be created.

### getFloats

    public float[][] getFloats(boolean copy)
                        throws VisADException

  Description copied from class: `FlatField`
  Returns the range values in their default units as floats.

  Specified by:
    `getFloats` in interface `Field`
  Overrides:
    `getFloats` in class `FlatField`
  Parameters:
    `copy` - Whether or not the returned array might be the actual range array. If `true`, then the returned array will not be the actual range array.
  Returns:
    The range values in their default units as determined by the `MathType` of the range. Element `[i][j]` is the `j`th sample value of the `i`th component of the range.
  Throws:
    `VisADException` - if a VisAD object couldn't be created.

### getDomainSet

    public Set getDomainSet()

  Description copied from interface: `Field`
  get the domain Set

  Specified by:
    `getDomainSet` in interface `Field`
  Overrides:
    `getDomainSet` in class `FieldImpl`
  Returns:
    The actual domain-set of this instance.

### setSample

    public void setSample(int index,
                          Data range)
                   throws VisADException,
                          RemoteException

  Description copied from class: `FlatField`
  Set the range value at the index-th sample

  Specified by:
    `setSample` in interface `Field`
  Overrides:
    `setSample` in class `FlatField`
  Parameters:
    `index` - index to set
    `range` - range value to set
  Throws:
    `VisADException` - if range's MathType is incompatible or some other error.
    `RemoteException` - if the Remote object couldn't be created.

### setSample

    public void setSample(RealTuple domain,
                          Data range)
                   throws VisADException,
                          RemoteException

  Description copied from interface: `Field`
  set the range value at the sample nearest to domain

  Specified by:
    `setSample` in interface `Field`
  Overrides:
    `setSample` in class `FieldImpl`
  Throws:
    `VisADException`
    `RemoteException`

### setSample

    public void setSample(int index,
                          Data range,
                          boolean copy)
                   throws VisADException,
                          RemoteException

  Description copied from class: `FlatField`
  Set the range value at the index-th sample

  Specified by:
    `setSample` in interface `Field`
  Overrides:
    `setSample` in class `FlatField`
  Parameters:
    `index` - index to set
    `range` - range value to set
    `copy` - flag to copy values - meaningless for FlatField
  Throws:
    `VisADException` - if range's MathType is incompatible or some other error.
    `RemoteException` - if the Remote object couldn't be created.

### isMissing

    public boolean isMissing()

  Description copied from class: `FlatField`
  Test whether range values are missing

  Specified by:
    `isMissing` in interface `Data`
  Overrides:
    `isMissing` in class `FlatField`
  Returns:
    true if the range values have not been set

### binary

    public Data binary(Data data,
                       int op,
                       int sampling_mode,
                       int error_mode)
                throws VisADException,
                       RemoteException

  Description copied from interface: `Data`
  Pointwise binary operation between this and data. Applies to Reals, Tuples (recursively to components), and to Field ranges (Field domains implicitly resampled if necessary). Does not apply to Field domains or Sets (regarded as domains of Fields wthout ranges). Data.ADD is only op defined for Text, interpreted as concatenate. MathTypes of this and data must match, or one may match the range of the other if it is a FunctionType.

  Specified by:
    `binary` in interface `Data`
  Overrides:
    `binary` in class `DataImpl`
  Parameters:
    `data` - other Data operand for binary operation
    `op` - may be Data.ADD, Data.SUBTRACT, etc; these include all binary operations defined for Java primitive data types
    `sampling_mode` - may be Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGE
    `error_mode` - may be Data.INDEPENDENT, Data.DEPENDENT or Data.NO_ERRORS;
  Returns:
    result, which takes the MathType of this unless the default Units of that MathType conflict with Units of the result, in which case a generic MathType with appropriate Units is constructed
  Throws:
    `RemoteException` - an RMI error occurred
    `VisADException` - a VisAD error occurred

### binary

    public Data binary(Data data,
                       int op,
                       MathType new_type,
                       int sampling_mode,
                       int error_mode)
                throws VisADException,
                       RemoteException

  Description copied from class: `FlatField`
  Return new Field with value 'this op data'. test for various relations between types of this and data; note return type may not be FlatField, in case data is a Field and this matches its range

  Specified by:
    `binary` in interface `Data`
  Overrides:
    `binary` in class `FlatField`
  Parameters:
    `data` - object to operate on
    `op` - operation to perform (e.g. ADD, SUB, MULT)
    `new_type` - MathType of new object
    `sampling_mode` - sampling mode to use (e.g., NEAREST_NEIGHBOR, WEIGHTED_AVERAGE)
    `error_mode` - error estimate mode (e.g., NO_ERROR, DEPENDENT, independent)
  Returns:
    new Field corresponding to the requested operation
  Throws:
    `RemoteException` - couldn't create new Remote object
    `VisADException` - couldn't create new VisAD object

### unary

    public Data unary(int op,
                      int sampling_mode,
                      int error_mode)
               throws VisADException,
                      RemoteException

  Description copied from interface: `Data`
  Pointwise unary operation applied to this. Applies to Reals, Tuples (recursively to components), and to Field ranges (Field domains implicitly resampled if necessary). Does not apply to Field domains, Sets (regarded as domains of Fields wthout ranges) or Text.

  Specified by:
    `unary` in interface `Data`
  Overrides:
    `unary` in class `DataImpl`
  Parameters:
    `op` - may be Data.ABS, Data.ACOS, etc; these include all unary operations defined for Java primitive data types
    `sampling_mode` - may be Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGE
    `error_mode` - may be Data.INDEPENDENT, Data.DEPENDENT or Data.NO_ERRORS;
  Returns:
    result of operation, which takes the MathType of this unless the default Units of that MathType conflict with Units of the result, in which case a generic MathType with appropriate Units is constructed
  Throws:
    `VisADException` - a VisAD error occurred
    `RemoteException` - an RMI error occurred

### unary

    public Data unary(int op,
                      MathType new_type,
                      int sampling_mode,
                      int error_mode)
               throws VisADException

  Description copied from class: `FlatField`
  Return new FlatField with value 'this op'.

  Specified by:
    `unary` in interface `Data`
  Overrides:
    `unary` in class `FlatField`
  Parameters:
    `op` - operation to perform (e.g., NOP, ABS, COS)
    `new_type` - MathType of new object
    `sampling_mode` - sampling mode to use (e.g., NEAREST_NEIGHBOR, WEIGHTED_AVERAGE)
    `error_mode` - error estimate mode (e.g., NO_ERROR, DEPENDENT, independent)
  Returns:
    new FlatField corresponding to the requested operation
  Throws:
    `VisADException` - couldn't create new VisAD object

### unpackValues

    public double[][] unpackValues()
                            throws VisADException

  unpack an array of doubles from field sample values according to the RangeSet-s; returns a copy

  Overrides:
    `unpackValues` in class `FlatField`
  Throws:
    `VisADException`

### unpackFloats

    public float[][] unpackFloats()
                           throws VisADException

  unpack an array of floats from field sample values according to the RangeSet-s; returns a copy

  Overrides:
    `unpackFloats` in class `FlatField`
  Throws:
    `VisADException`

### extract

    public Field extract(int component)
                  throws VisADException,
                         RemoteException

  Description copied from class: `FlatField`
  extract field from this[].component; this is OK, when we get around to it

  Specified by:
    `extract` in interface `Field`
  Overrides:
    `extract` in class `FlatField`
  Throws:
    `VisADException`
    `RemoteException`

### domainFactor

    public Field domainFactor(RealType factor)
                       throws VisADException,
                              RemoteException

  Description copied from interface: `Field`
  factor Field domain into domains of two nested Fields

  Specified by:
    `domainFactor` in interface `Field`
  Overrides:
    `domainFactor` in class `FieldImpl`
  Parameters:
    `factor` - The type of the domain for the outer field.
  Returns:
    The field-of-fields realization of this instance.
  Throws:
    `VisADException` - VisAD failure.
    `RemoteException` - Java RMI failure.
  See Also:
    `for copy information`

### resample

    public Field resample(Set set,
                          int sampling_mode,
                          int error_mode)
                   throws VisADException,
                          RemoteException

  Description copied from class: `FlatField`
  Resamples the range to domain samples of a given set. Resampling is either by nearest neighbor or mulit-linear interpolation. NOTE: This code is very similar to FieldImpl.resample(Set,int,int).

  Specified by:
    `resample` in interface `Function`
  Overrides:
    `resample` in class `FlatField`
  Parameters:
    `set` - The set of points at which to resample this field.
    `sampling_mode` - Resampling mode: Data.NEAREST_NEIGHBOR or Data.WEIGHTED_AVERAGE
    `error_mode` - Error estimation mode: Data.DEPENDENT, Data.INDEPENDENT, or Data.NO_ERRORS.
  Returns:
    Field of resampled data. RangeSet objects in result are set to DoubleSet. NOTE: May return this (i.e., not a copy).
  Throws:
    `VisADException`
    `RemoteException`

### computeRanges

    public DataShadow computeRanges(ShadowType type,
                                    DataShadow shadow)
                             throws VisADException

  Description copied from interface: `Data`
  Recursive version of computeRanges(), called down through Data object tree.

  Specified by:
    `computeRanges` in interface `Data`
  Overrides:
    `computeRanges` in class `FlatField`
  Throws:
    `VisADException`

### adjustSamplingError

    public Data adjustSamplingError(Data error,
                                    int error_mode)
                             throws VisADException,
                                    RemoteException

  Description copied from class: `FlatField`
  return a FlatField that clones this, except its ErrorEstimate-s are adjusted for sampling errors in error

  Specified by:
    `adjustSamplingError` in interface `Data`
  Overrides:
    `adjustSamplingError` in class `FlatField`
  Throws:
    `VisADException`
    `RemoteException`

### isFlatField

    public boolean isFlatField()

  Description copied from interface: `Field`
  return true if this a FlatField or a RemoteField adapting a FlatField

  Specified by:
    `isFlatField` in interface `Field`
  Overrides:
    `isFlatField` in class `FlatField`

### clone

    public Object clone()

  Clones this instance. This implementation violates the general `clone()` contract in that the returned object will compare unequal to this instance. As such, this method should probably not be invoked.

  Overrides:
    `clone` in class `FlatField`
  Returns:
    A clone of this instance.

### toString

    public String toString()

  Overrides:
    `toString` in class `FlatField`

### longString

    public String longString(String pre)

  Specified by:
    `longString` in interface `Data`
  Overrides:
    `longString` in class `FlatField`