Package edu.wisc.ssec.mcidasv.util
Class GEOSgridUtil
java.lang.Object
edu.wisc.ssec.mcidasv.util.GEOSgridUtil
Utilities for efficiently upscaling and downscaling data referenced on the
GOES-16 2km, 1km and hkm Fixed Grid Frame (FGF).
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
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static float
static RealTupleType
private static double
private static int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
DomainSets ofred
,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 ofred
,green
,blue
andtargetSet
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 invalid input: '<'= Last, First > Last val invalid input: '<'= First and val >= Last, Last > First i.e., clamp to inside the interval inclusive
-
Field Details
-
LambdaTheta
-
uniqueID
-
offsetTolerance
-
accumTolerance
-
-
Constructor Details
-
GEOSgridUtil
public GEOSgridUtil()
-
-
Method Details
-
geosRGB
public static FlatField geosRGB(FlatField red, FlatField green, FlatField blue) throws VisADException, RemoteException DomainSets ofred
,green
,blue
must be (lambda, theta): the intermediate view angle coordinates (radians) for the Fixed Grid Frame. SeemakeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
. TargetSet is taken as that of the first component field (red
).- Parameters:
red
-green
-blue
-- Returns:
- Throws:
VisADException
RemoteException
- See Also:
-
geosRGB
public static FlatField geosRGB(FlatField red, FlatField green, FlatField blue, Linear2DSet targetSet) throws VisADException, RemoteException - Parameters:
red
-green
-blue
-targetSet
-- Returns:
- Throws:
VisADException
RemoteException
-
geosRGB
public static FlatField geosRGB(FlatField red, FlatField green, FlatField blue, Linear2DSet targetSet, boolean copy) throws VisADException, RemoteException DomainSets ofred
,green
,blue
andtargetSet
must be (lambda, theta): the intermediate view angle coordinates (radians) for the Fixed Grid Frame. SeemakeGEOSRadiansDomainField(FlatField, double, double, double, double)
.- Parameters:
red
-green
-blue
-targetSet
- the target, or outgoing domaincopy
- to copy range of resulting RGB FlatField (default=true)- Returns:
- Throws:
VisADException
RemoteException
- See Also:
-
makeGEOSRadiansDomainField
public static FlatField makeGEOSRadiansDomainField(FlatField fltFld, double scaleX, double offsetX, double scaleY, double offsetY) throws VisADException, RemoteException 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).- Parameters:
fltFld
- The incoming FlatFieldscaleX
-offsetX
- To transform to fgf_x -> lambda (radians)scaleY
-offsetY
- To transform to fgf_y -> theta (radians)- Returns:
- FlatField with transformed Domain and original (not copied) Range
- Throws:
VisADException
RemoteException
-
geosResample
public static FlatField geosResample(FlatField fld, Linear2DSet targetSet) throws VisADException, RemoteException Efficiently upscales or downscales between ABI fields with domainSets on the Fixed Grid Frame. Can be seen as grid transfer process, to be used in conjunction with, not a replacement for, VisAD resample. DomainSets must be (lambda, theta): the intermediate view angle coordinates (radians) for the Fixed Grid Frame. SeemakeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.- Parameters:
fld
-targetSet
-- Returns:
- Result field with targetSet domain.
- Throws:
VisADException
RemoteException
- See Also:
-
geosResample
public static FlatField geosResample(FlatField fld, Linear2DSet targetSet, int mode) throws VisADException, RemoteException Efficiently upscales or downscales between ABI fields with domainSets on the Fixed Grid Frame. Can be seen as grid transfer process, to be used in conjunction with, not a replacement for, VisAD resample. DomainSets must be (lambda, theta): the intermediate view angle coordinates (radians) for the Fixed Grid Frame. SeemakeGEOSRadiansDomainField(visad.FlatField, double, double, double, double)
.- Parameters:
fld
-targetSet
-mode
- VisAD resample mode- Returns:
- Result field with targetSet domain.
- Throws:
VisADException
RemoteException
- See Also:
-
geosUpsample
static void geosUpsample(int[] yidxs, int[] xidxs, int lenY, int lenX, float[][] values, int targetLenY, int targetLenX, float[][] targetValues, int mode) -
interp
static void interp(float[] yidxs, float[] xidxs, int lenY, int lenX, float[][] values, int targetLenY, int targetLenX, float[][] targetValues, int mode) -
minmax
-
valueToGrid
Adapted from VisAD except NaN is returned unless: val >= First and val invalid input: '<'= Last, First > Last val invalid input: '<'= First and val >= Last, Last > First i.e., clamp to inside the interval inclusive- Parameters:
set
-value
-- Returns:
- Throws:
VisADException
-