public class GEOSgridUtil extends java.lang.Object
Adapted from VisAD's resample
, but realizes
efficiencies when target and source domain sets are both rectilinear,
especially avoiding the expansion of the domain samples (getSamples) for
this special case.
Follows resampling rules outlined in the
GOES-16 ABI ATBD for the Cloud and Moisture Imagery Product when
incoming grids are at the their full resolution.
Should be thought of as a grid transfer operation, to be used in conjunction with,
not necessarily a replacement for, FlatField.resample
.
Modifier and Type | Field and Description |
---|---|
private static float |
accumTolerance |
static RealTupleType |
LambdaTheta |
private static double |
offsetTolerance |
private static int |
uniqueID |
Constructor and Description |
---|
GEOSgridUtil() |
Modifier and Type | Method and Description |
---|---|
static FlatField |
geosResample(FlatField fld,
Linear2DSet targetSet)
Efficiently upscales or downscales between ABI fields with domainSets on the Fixed Grid Frame.
|
static FlatField |
geosResample(FlatField fld,
Linear2DSet targetSet,
int mode)
Efficiently upscales or downscales between ABI fields with domainSets on the Fixed Grid Frame.
|
static FlatField |
geosRGB(FlatField red,
FlatField green,
FlatField blue)
DomainSets of
red , green , blue must be (lambda, theta): the intermediate view angle coordinates (radians)
for the Fixed Grid Frame. |
static FlatField |
geosRGB(FlatField red,
FlatField green,
FlatField blue,
Linear2DSet targetSet) |
static FlatField |
geosRGB(FlatField red,
FlatField green,
FlatField blue,
Linear2DSet targetSet,
boolean copy)
DomainSets of
red , green , blue and targetSet
must be (lambda, theta): the intermediate view angle coordinates (radians)
for the Fixed Grid Frame. |
(package private) static void |
geosUpsample(int[] yidxs,
int[] xidxs,
int lenY,
int lenX,
float[][] values,
int targetLenY,
int targetLenX,
float[][] targetValues,
int mode) |
(package private) static void |
interp(float[] yidxs,
float[] xidxs,
int lenY,
int lenX,
float[][] values,
int targetLenY,
int targetLenX,
float[][] targetValues,
int mode) |
static FlatField |
makeGEOSRadiansDomainField(FlatField fltFld,
double scaleX,
double offsetX,
double scaleY,
double offsetY)
Transforms FlatField with DomainCoordinateSystem
(fgf_x, fgf_y) <-> (Lon,Lat) based on the Geostationary projection
from fixed grid coordinates to intermediate coordinates view angle
coordinates in radians (lambda, theta). |
static float[] |
minmax(float[] values,
int length,
int[] indexes) |
private static float[][] |
valueToGrid(Linear1DSet set,
float[][] value)
Adapted from VisAD except NaN is returned unless:
val >= First and val <= Last, First > Last
val <= First and val >= Last, Last > First
i.e., clamp to inside the interval inclusive
|
public static RealTupleType LambdaTheta
private static int uniqueID
private static double offsetTolerance
private static float accumTolerance
public GEOSgridUtil()
public static FlatField geosRGB(FlatField red, FlatField green, FlatField blue) throws VisADException, java.rmi.RemoteException
red
, green
, blue
must be (lambda, theta): the intermediate view angle coordinates (radians)
for the Fixed Grid Frame. See makeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.
TargetSet is taken as that of the first component field (red
).red
- green
- blue
- VisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
public static FlatField geosRGB(FlatField red, FlatField green, FlatField blue, Linear2DSet targetSet) throws VisADException, java.rmi.RemoteException
red
- green
- blue
- targetSet
- VisADException
java.rmi.RemoteException
public static FlatField geosRGB(FlatField red, FlatField green, FlatField blue, Linear2DSet targetSet, boolean copy) throws VisADException, java.rmi.RemoteException
red
, green
, blue
and targetSet
must be (lambda, theta): the intermediate view angle coordinates (radians)
for the Fixed Grid Frame.
See makeGEOSRadiansDomainField(FlatField, double, double, double, double)
.red
- green
- blue
- targetSet
- the target, or outgoing domaincopy
- to copy range of resulting RGB FlatField (default=true)VisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
public static FlatField makeGEOSRadiansDomainField(FlatField fltFld, double scaleX, double offsetX, double scaleY, double offsetY) throws VisADException, java.rmi.RemoteException
(fgf_x, fgf_y) <-> (Lon,Lat)
based on the Geostationary projection
from fixed grid coordinates to intermediate coordinates view angle
coordinates in radians (lambda, theta).fltFld
- The incoming FlatFieldscaleX
- offsetX
- To transform to fgf_x -> lambda (radians)scaleY
- offsetY
- To transform to fgf_y -> theta (radians)VisADException
java.rmi.RemoteException
public static FlatField geosResample(FlatField fld, Linear2DSet targetSet) throws VisADException, java.rmi.RemoteException
makeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.fld
- targetSet
- VisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
public static FlatField geosResample(FlatField fld, Linear2DSet targetSet, int mode) throws VisADException, java.rmi.RemoteException
makeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.fld
- targetSet
- mode
- VisAD resample modeVisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
static void geosUpsample(int[] yidxs, int[] xidxs, int lenY, int lenX, float[][] values, int targetLenY, int targetLenX, float[][] targetValues, int mode)
static void interp(float[] yidxs, float[] xidxs, int lenY, int lenX, float[][] values, int targetLenY, int targetLenX, float[][] targetValues, int mode)
public static float[] minmax(float[] values, int length, int[] indexes)
private static float[][] valueToGrid(Linear1DSet set, float[][] value) throws VisADException
set
- value
- VisADException