/**
     * Make point obs from a single timestep of a grid
     *
     * @param timeStep     the grid
     * @param dt           the timestep for the grid
     *
     * @return   a Field of PointObs
     *
     * @throws RemoteException   Java RMI problem
     * @throws VisADException    VisAD problem
     */
private static FieldImpl makePointObs(FlatField timeStep, DateTime dt, double min, double max)
            throws VisADException, RemoteException {
        if (timeStep == null) {
            return null;
        }
        SampledSet domain    = getSpatialDomain(timeStep);
        int        numPoints = domain.getLength();
        Integer1DSet points = new Integer1DSet(RealType.getRealType("index"),
                numPoints);
        TupleType tt = getParamType(timeStep);
        TupleType rangeType = new TupleType(new MathType[] {
                RealTupleType.LatitudeLongitudeAltitude,
                RealType.Time,
                tt });
        FieldImpl ff = new FieldImpl(
                new FunctionType(
                        ((SetType) points.getType()).getDomain(),
                        rangeType), points);
        float[][] samples  = timeStep.getFloats(false);
        float[][] geoVals  = getEarthLocationPoints((GriddedSet) domain);
        boolean   isLatLon = isLatLonOrder(domain);
        int       latIndex = isLatLon
                ? 0
                : 1;
        int       lonIndex = isLatLon
                ? 1
                : 0;
        boolean   haveAlt  = geoVals.length > 2;
        for (int i = 0; i < numPoints; i++) {
            float lat = geoVals[latIndex][i];
            float lon = geoVals[lonIndex][i];
            float alt = haveAlt
                    ? geoVals[2][i]
                    : 0;
            if ((lat == lat) && (lon == lon)) {
                if ( !(alt == alt)) {
                    alt = 0;
                }
                if(timeStep.getValues(i)[0] >= min && timeStep.getValues(i)[0] < max) {
                    EarthLocation el = new EarthLocationLite(lat, lon, alt);
                    // TODO:  make this  more efficient
                    PointObTuple pot = new PointObTuple(el, dt,
                            timeStep.getSample(i), rangeType);
                    ff.setSample(i, pot, false, false);
                }
            }
        }
        return ff;
    }
private static FieldImpl makePointObs(FlatField timeStep, DateTime dt, double min, double max)
throws VisADException, RemoteException {
if (timeStep == null) {
return null;
}
SampledSet domain = getSpatialDomain(timeStep);
int numPoints = domain.getLength();
Integer1DSet points = new Integer1DSet(RealType.getRealType("index"),
numPoints);
TupleType tt = getParamType(timeStep);
TupleType rangeType = new TupleType(new MathType[] {
RealTupleType.LatitudeLongitudeAltitude,
RealType.Time,
tt });
FieldImpl ff = new FieldImpl(
new FunctionType(
((SetType) points.getType()).getDomain(),
rangeType), points);
float[][] samples = timeStep.getFloats(false);
float[][] geoVals = getEarthLocationPoints((GriddedSet) domain);
boolean isLatLon = isLatLonOrder(domain);
int latIndex = isLatLon
? 0
: 1;
int lonIndex = isLatLon
? 1
: 0;
boolean haveAlt = geoVals.length > 2;
for (int i = 0; i < numPoints; i++) {
float lat = geoVals[latIndex][i];
float lon = geoVals[lonIndex][i];
float alt = haveAlt
? geoVals[2][i]
: 0;
if ((lat == lat) && (lon == lon)) {
if ( !(alt == alt)) {
alt = 0;
}
if(timeStep.getValues(i)[0] >= min && timeStep.getValues(i)[0] < max) {
EarthLocation el = new EarthLocationLite(lat, lon, alt);
// TODO: make this more efficient
PointObTuple pot = new PointObTuple(el, dt,
timeStep.getSample(i), rangeType);
ff.setSample(i, pot, false, false);
}
}
}
return ff;
}
private static FieldImpl makePointObs(FlatField timeStep, DateTime dt, double min, double max)
throws VisADException, RemoteException {
if (timeStep == null) {
return null;
}
SampledSet domain = getSpatialDomain(timeStep);
int numPoints = domain.getLength();
Integer1DSet points = new Integer1DSet(RealType.getRealType("index"),
numPoints);
TupleType tt = getParamType(timeStep);
TupleType rangeType = new TupleType(new MathType[] {
RealTupleType.LatitudeLongitudeAltitude,
RealType.Time,
tt });
FieldImpl ff = new FieldImpl(
new FunctionType(
((SetType) points.getType()).getDomain(),
rangeType), points);
float[][] samples = timeStep.getFloats(false);
float[][] geoVals = getEarthLocationPoints((GriddedSet) domain);
boolean isLatLon = isLatLonOrder(domain);
int latIndex = isLatLon
? 0
: 1;
int lonIndex = isLatLon
? 1
: 0;
boolean haveAlt = geoVals.length > 2;
for (int i = 0; i < numPoints; i++) {
float lat = geoVals[latIndex][i];
float lon = geoVals[lonIndex][i];
float alt = haveAlt
? geoVals[2][i]
: 0;
if ((lat == lat) && (lon == lon)) {
if ( !(alt == alt)) {
alt = 0;
}
if(timeStep.getValues(i)[0] >= min && timeStep.getValues(i)[0] < max) {
EarthLocation el = new EarthLocationLite(lat, lon, alt);
// TODO: make this more efficient
PointObTuple pot = new PointObTuple(el, dt,
timeStep.getSample(i), rangeType);
ff.setSample(i, pot, false, false);
}
}
}
return ff;
}
private static FieldImpl makePointObs(FlatField timeStep, DateTime dt, double min, double max)
throws VisADException, RemoteException {
if (timeStep == null) {
return null;
}
SampledSet domain = getSpatialDomain(timeStep);
int numPoints = domain.getLength();
Integer1DSet points = new Integer1DSet(RealType.getRealType("index"),
numPoints);
TupleType tt = getParamType(timeStep);
TupleType rangeType = new TupleType(new MathType[] {
RealTupleType.LatitudeLongitudeAltitude,
RealType.Time,
tt });
FieldImpl ff = new FieldImpl(
new FunctionType(
((SetType) points.getType()).getDomain(),
rangeType), points);
float[][] samples = timeStep.getFloats(false);
float[][] geoVals = getEarthLocationPoints((GriddedSet) domain);
boolean isLatLon = isLatLonOrder(domain);
int latIndex = isLatLon
? 0
: 1;
int lonIndex = isLatLon
? 1
: 0;
boolean haveAlt = geoVals.length > 2;
for (int i = 0; i < numPoints; i++) {
float lat = geoVals[latIndex][i];
float lon = geoVals[lonIndex][i];
float alt = haveAlt
? geoVals[2][i]
: 0;
if ((lat == lat) && (lon == lon)) {
if ( !(alt == alt)) {
alt = 0;
}
if(timeStep.getValues(i)[0] >= min && timeStep.getValues(i)[0] < max) {
EarthLocation el = new EarthLocationLite(lat, lon, alt);
// TODO: make this more efficient
PointObTuple pot = new PointObTuple(el, dt,
timeStep.getSample(i), rangeType);
ff.setSample(i, pot, false, false);
}
}
}
return ff;
}