|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.data.point.Barnes
public class Barnes
Title: Barnes Objective Analysis (BOA) Scheme
Description: The BOA is implemented as the static method "point2grid" and is for converting irregularly spaced data defined by (longitude, latitude, value) to a regular, but not neccessarily evenly spaced, grid whose coordinates are also defined by longitude and latitude. Other methods useful to the BOA are also included in this package, such as scinex (an interpolation/extrapolation scheme).
References:
Barnes, S.L., 1994a: Applications of the Barnes objective analysis scheme Part I: Effects of undersampling, wave position, and station randomness. J. Atmos. Oceanic Technol. 11, 1433-1448.
Barnes, S.L., 1994b: Applications of the Barnes objective analysis scheme Part II: Improving derivative estimates. J. Atmos. Oceanic Technol. 11, 1449-1458.
Barnes, S.L., 1994c: Applications of the Barnes objective analysis scheme Part III: Tuning for minimum error. J. Atmos. Oceanic Technol. 11, 1459-1479.
| Nested Class Summary | |
|---|---|
static class |
Barnes.AnalysisParameters
Inner class for use of getRecommendedParameters, to allow it to return multiple values such as: gridX, gridY, scaleLengthGU, randomDataSpacing, faGridX, faGridY |
| Constructor Summary | |
|---|---|
Barnes()
_more_ |
|
| Method Summary | |
|---|---|
static double[] |
deg2km(float fLon1,
float fLat1,
float fLon2,
float fLat2)
Calculate the number of kms between 2 locations specified by longitude and latutide: (fLon1, fLat1) and (fLon2, fLat2) The return value is provided as a 2 element array, giving km in the x direction and km in the y direction between the 2 points: daKm[0] = dKmx daKm[1] = dKmy |
static float[] |
getRecommendedGridX(float fLonMin,
float fLonMax,
float gridX)
_more_ |
static float[] |
getRecommendedGridY(float fLatMin,
float fLatMax,
float gridY)
_more_ |
static Barnes.AnalysisParameters |
getRecommendedParameters(float fLonMin,
float fLatMin,
float fLonMax,
float fLatMax,
float[][] faa3DData)
One of the hardest things about objective analysis is choosing the correct parameters for the analysis, and this routine provides sensible recommendations on these parameters. |
static void |
main(String[] args)
_more_ |
static double[][] |
point2grid(float[] lon,
float[] lat,
float[][] data3D,
float scaleLength,
float gain,
int iNumPasses)
Description: point2grid is for converting irregularly spaced data defined by (longitude, latitude, value) to a regular, but not neccessarily evenly spaced, grid whose coordinates are also defined by longitude and latitude inputs lon : the longitudes on the grid where interpolated values are desired (in degrees) lat : the latitudes on the grid where interpolated values are desired (in degrees) data3D : 3D array of data values where data3D[0][*] = longitudes of data values data3D[1][*] = latitudes of data values data3D[2][*] = data values scaleLength : the Gaussian scale length (in grid units) should be approximately equal to the average data spacing a suggested default: 10.0f (no scientific reason here) gain: factor by which scaleLength is reduced for the second pass. |
static double[][] |
point2grid(float fLonMin,
float fLatMin,
float fLonMax,
float fLatMax,
float[][] data3D)
Simplest possible version of point2grid where the number of passes is fixed at 3 (most common case, as recommended by Barnes) |
static double[][] |
point2grid(float fLonMin,
float fLatMin,
float fLonMax,
float fLatMax,
float[][] data3D,
int iNumPasses)
Simplified version of point2grid which calculates or assigns as many of the analysis parameters as possible All the user needs to provide is the data to be analysed, and the domain over which the analysis is to be carried out INPUT: faa3DData: An array (3,ndata) where ndata is the number of data points, and can be any number larger than N. |
static double[] |
pointDifferences(float[] lon,
float[] lat,
float[][] data3D,
double[][] daaGrid)
calculate the differences between the input irregular data and the analysed grid at each data point (ie "How bad is the analysis?"). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Barnes()
| Method Detail |
|---|
public static double[][] point2grid(float[] lon,
float[] lat,
float[][] data3D,
float scaleLength,
float gain,
int iNumPasses)
lon - _more_lat - _more_data3D - _more_scaleLength - _more_gain - _more_iNumPasses - _more_
public static double[][] point2grid(float fLonMin,
float fLatMin,
float fLonMax,
float fLatMax,
float[][] data3D)
fLonMin - _more_fLatMin - _more_fLonMax - _more_fLatMax - _more_data3D - _more_
public static double[][] point2grid(float fLonMin,
float fLatMin,
float fLonMax,
float fLatMax,
float[][] data3D,
int iNumPasses)
fLonMin - _more_fLatMin - _more_fLonMax - _more_fLatMax - _more_data3D - _more_iNumPasses - _more_
public static double[] pointDifferences(float[] lon,
float[] lat,
float[][] data3D,
double[][] daaGrid)
lon - _more_lat - _more_data3D - _more_daaGrid - _more_
public static float[] getRecommendedGridX(float fLonMin,
float fLonMax,
float gridX)
fLonMin - _more_fLonMax - _more_gridX - _more_
public static float[] getRecommendedGridY(float fLatMin,
float fLatMax,
float gridY)
fLatMin - _more_fLatMax - _more_gridY - _more_
public static void main(String[] args)
args - _more_
public static Barnes.AnalysisParameters getRecommendedParameters(float fLonMin,
float fLatMin,
float fLonMax,
float fLatMax,
float[][] faa3DData)
The literature (eg Barnes 1994 a,b,c) contains a lot of guidance on how to select these parameters, all of which can be derived directly from the average station spacing.
Strictly speaking the actual spacing between each station and its nearest neighbours should be used (Barnes used the 6 nearest neighbours), but the routine below uses the simpler approach of assuming a random spacing of the stations, and calculates the random data spacing via a simple formula.
INPUT:
faa3DData: An array (3,ndata) where ndata is the number of data points. Each row of data should contain a longitude, a latitude, and a value to be interpolated.
fLonMin: Minimum Longitude of analysis area (eg 140.0 = 140.0 E)
fLatMin : Minimum Latitude of analysis area (eg -40.0 = 40.0 S)
fLonMax: Maximum Longitude of analysis area (eg 150.0 = 150.0 E)
fLatMax : Maximum Latitude of analysis area (eg -30.0 = 30.0 S)
OUTPUTS:
gridX: the length of 1 grid space in the X direction (degrees) (set to 0.3 * random data spacing)
gridY: the length of 1 grid space in the Y direction (degrees) (set to 0.3 * random data spacing)
scaleLengthGU: Recommended Gaussian length scale (in grid units). (set to random data spacing)
randomDataSpacing: Average spacing between station if stations were randomly distributed (km)
faGridX: the array of recommended grid points along the x axis
faGridY: the array of recommended grid points along the y axis
actualStationSpacing (Not implemented): The average distance between each station and its nearest neighbour
NUR (Not implemented): Non Uniformity Ratio Indicates how uniform data distribution is 0 = perfectly regular data grid >= 1.1 indicates a pseudo random distribution author James Kelly j.kelly@bom.gov.au author Robert Dahni rrd@bom.gov.au 30/01/97 Original Code (IDL) round grid spacings to nearest 0.05 degrees 29/3/97 R.Dahni & J.Kelly round grid spacings to nearest 0.01 degrees 15/4/97 R.Dahni & J.Kelly convert to Java 24/1/2001 J.Kelly
fLonMin - _more_fLatMin - _more_fLonMax - _more_fLatMax - _more_faa3DData - _more_
public static double[] deg2km(float fLon1,
float fLat1,
float fLon2,
float fLat2)
fLon1 - _more_fLat1 - _more_fLon2 - _more_fLat2 - _more_
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||