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 visad.RealTupleType |
LambdaTheta |
private static double |
offsetTolerance |
private static int |
uniqueID |
Constructor and Description |
---|
GEOSgridUtil() |
Modifier and Type | Method and Description |
---|---|
static visad.FlatField |
geosResample(visad.FlatField fld,
visad.Linear2DSet targetSet)
Efficiently upscales or downscales between ABI fields with domainSets on the Fixed Grid Frame.
|
static visad.FlatField |
geosResample(visad.FlatField fld,
visad.Linear2DSet targetSet,
int mode)
Efficiently upscales or downscales between ABI fields with domainSets on the Fixed Grid Frame.
|
static visad.FlatField |
geosRGB(visad.FlatField red,
visad.FlatField green,
visad.FlatField blue)
DomainSets of
red , green , blue must be (lambda, theta): the intermediate view angle coordinates (radians)
for the Fixed Grid Frame. |
static visad.FlatField |
geosRGB(visad.FlatField red,
visad.FlatField green,
visad.FlatField blue,
visad.Linear2DSet targetSet) |
static visad.FlatField |
geosRGB(visad.FlatField red,
visad.FlatField green,
visad.FlatField blue,
visad.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 visad.FlatField |
makeGEOSRadiansDomainField(visad.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(visad.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 visad.RealTupleType LambdaTheta
private static int uniqueID
private static double offsetTolerance
private static float accumTolerance
public GEOSgridUtil()
public static visad.FlatField geosRGB(visad.FlatField red, visad.FlatField green, visad.FlatField blue) throws visad.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
- visad.VisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
public static visad.FlatField geosRGB(visad.FlatField red, visad.FlatField green, visad.FlatField blue, visad.Linear2DSet targetSet) throws visad.VisADException, java.rmi.RemoteException
red
- green
- blue
- targetSet
- visad.VisADException
java.rmi.RemoteException
public static visad.FlatField geosRGB(visad.FlatField red, visad.FlatField green, visad.FlatField blue, visad.Linear2DSet targetSet, boolean copy) throws visad.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)visad.VisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
public static visad.FlatField makeGEOSRadiansDomainField(visad.FlatField fltFld, double scaleX, double offsetX, double scaleY, double offsetY) throws visad.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)visad.VisADException
java.rmi.RemoteException
public static visad.FlatField geosResample(visad.FlatField fld, visad.Linear2DSet targetSet) throws visad.VisADException, java.rmi.RemoteException
makeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.fld
- targetSet
- visad.VisADException
java.rmi.RemoteException
makeGEOSRadiansDomainField(FlatField, double, double, double, double)
public static visad.FlatField geosResample(visad.FlatField fld, visad.Linear2DSet targetSet, int mode) throws visad.VisADException, java.rmi.RemoteException
makeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.fld
- targetSet
- mode
- VisAD resample modevisad.VisADException
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(visad.Linear1DSet set, float[][] value) throws visad.VisADException
set
- value
- visad.VisADException