public class PivData
extends java.lang.Object
TITLE = "Example"
VARIABLES = "x", "y", "ux", "uy", "s"
ZONE I=3, J=3, F=POINT
# comment
16 16 +0.4 +0.1 0.94
32 16 +0.9 +0.0 0.92
48 16 +1.2 -0.1 0.93
16 32 +1.7 -0.0 0.97
32 32 +2.1 +0.2 0.89
48 32 +1.6 -0.0 0.92
16 48 +1.2 -0.1 0.91
32 48 +1.0 -0.0 0.91
48 48 +0.1 +0.0 0.94| Constructor and Description |
|---|
PivData(double[][] data)
Construction of PIV-data from a two dimensional array.
|
PivData(int x0,
int y0,
int dx,
int dy,
int nx,
int ny,
double ux,
double uy,
double s)
Construction of PIV-data from initial parameters
|
PivData(java.lang.String pathname)
Construction of a
jpiv2.PivData object from a single file. |
PivData(java.lang.String[] pathnames)
Construction of a
jpiv2.PivData object from a list of files. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(PivData pivDataToAdd)
Adds annother PIV data set to the current data.
|
void |
addRandomNoise(double maxNoise)
Adds the product of a random number (-1 < random number < 1) and maxNoise
to the values of the third and fourth column.
|
void |
appendColumn(double defaultValue)
Appending a column of defaultData.
|
void |
deformation(boolean linReg,
int component)
Calculate components of the deformation tensor.
|
void |
flipY()
Flip sign of y-velocity component.
|
double[] |
getAbsValue(int col1,
int col2)
Calculates the absolute values of two vector components.
|
double[] |
getDataColumn(int col)
Extracts a single data column from the PIV data.
|
int[] |
getDimension()
Returns the width and heigth of the vector field.
|
double[][][] |
getFirstDerivative()
Calculates the first derivatives of the velocity field (central
differences, forward/backward differences at the border).
|
double[][][] |
getFirstDerivativeLinReg()
Calculates the first derivative of the velocity field (linear regression
over five points, forward/backward differences at the border, central
differences along the second row from the border).
|
double[][] |
getFreeProfile(float x1,
float y1,
float x2,
float y2,
float spacing)
Extracting a profile between two points.
|
double[][][] |
getFreeProfiles(float x1,
float y1,
float x2,
float y2,
float spacing,
int numberOf,
int distance)
Extracting and averaging a number of profiles between two points.
|
double[][] |
getHorizontalProfile(int row)
Extracting a horizontal profile.
|
int[] |
getImgSize()
Trys to reconstruct the original image size from the vector field.
|
double[] |
getInterpVectorAt(float x,
float y)
Returns a vector that has been interpolated between the three nearest
neighbours of the position x, y.
|
int |
getInvalidVectorCount()
Counts the number of invalid vecors.
|
int |
getNumOfColumns()
Returns the number of data columns, typically five (x, y, dx, dy, flag).
|
double[][] |
getPivData()
Returns the PIV-data set as a two dimensional array.
|
double[][] |
getPivDataShift()
Returns the PIV-data set as a two dimensional array.
|
double[][][] |
getShearField()
Calculates the shear field (central differences, forward/backward
differences at the border).
|
int[] |
getSpacing()
Returns the horizontal and vertical spacing between two adjacent vectors.
|
double[][] |
getThreeNearestNeighbours(float x,
float y)
Returns the three data points that are closest to x and y and don't lie
on a straight line.
|
double[] |
getVectorAt(int x,
int y)
Returns the data point that is closest to x and y.
|
double[][] |
getVerticalProfile(int col)
Extracting a vertical profile.
|
void |
invalidateIsolatedVectors(int numOfNeighbours)
Invalidates a vector if the number of valid neighbours is less than
specified.
|
void |
normalizedMedianTest(double noiseLevel,
double threshold)
Mark vectors as invalid using the normalized median test proposed by
Jerry Westerweel and Fulvio Scarano (Experiments in Fluids (2005) 39:
1096-1100).
|
void |
print()
Print data to std-out.
|
void |
removeInvalidVectors()
Remove invalid vectors (set velocity components to zero).
|
void |
replaceByMedian(boolean all,
boolean includeInvalid)
Replaces invalid vectors by the median of their surrounding vectors.
|
void |
resample(int x0,
int y0,
int x1,
int y1,
int dx,
int dy)
Resamples the vector field by nearest neighbour interpolation.
|
void |
reverseY()
Flip y-axis.
|
void |
setHeader(java.lang.String header)
Set the header string of the data file.
|
void |
smooth(boolean includeInvalid)
Replaces every vector by the average of the three by three neighbourhood
(inclusive center point).
|
void |
subsRefDisp(double dxRef,
double dyRef)
Substract a constant reference displacement.
|
void |
wallFilterVertical(int xStart,
int yStart,
double threshold)
Delete vectors outside a flow domain.
|
void |
writeDataToFile(java.lang.String pathname,
boolean writeHeader)
Saves a data set as a space delimited unicode (UTF-8) file.
|
public PivData(java.lang.String pathname)
jpiv2.PivData object from a single file.pathname - Absolute pathname of a file containing PIV-data.public PivData(java.lang.String[] pathnames)
jpiv2.PivData object from a list of files.
Only the displacement components (third and fourth column) are averaged.
All other columns are taken from the first file.pathnames - An array containing absolute pathnames of files containing
PIV-data.public PivData(double[][] data)
data - A two dimensional array containing PIV-data.public PivData(int x0,
int y0,
int dx,
int dy,
int nx,
int ny,
double ux,
double uy,
double s)
x0 - x-coordinate of first vector locationy0 - y-coordinate of first vector locationdx - horizontal vector spacingdy - vertical vector spacingnx - number of horizontal nodesny - number of vertical nodesux - initial value for horizontal displacementuy - initial value for vertical displacements - inital value for fifth columnpublic double[][] getPivData()
public double[][] getPivDataShift()
public void add(PivData pivDataToAdd)
pivDataToAdd - The data to add.public void subsRefDisp(double dxRef,
double dyRef)
dxRef - horizontal reference velocitydyRef - vertical reference velocitypublic void removeInvalidVectors()
public void invalidateIsolatedVectors(int numOfNeighbours)
numOfNeighbours - Specify the least number of neighbours to keep the vector.public double[][][] getFirstDerivative()
public double[][][] getFirstDerivativeLinReg()
public double[][][] getShearField()
public int[] getDimension()
public int getNumOfColumns()
public int[] getSpacing()
public int[] getImgSize()
public void writeDataToFile(java.lang.String pathname,
boolean writeHeader)
pathname - The absolute pathname of a destination file.writeHeader - Specifies whether a Tecplot header file should be written
true or not false.public double[] getVectorAt(int x,
int y)
x - The approximate x co-ordinate.y - The approximate y co-ordinate.null if the data point is
outside the vector field.public double[] getInterpVectorAt(float x,
float y)
x - The x co-ordinate.y - The y co-ordinate.public double[][] getThreeNearestNeighbours(float x,
float y)
x - The approximate x co-ordinatey - The approximate y co-ordinatepublic void resample(int x0,
int y0,
int x1,
int y1,
int dx,
int dy)
x0 - horizontal position of first vectory0 - vertical position of first vectorx1 - horizontal positin of last vectory1 - vertical position of last vectordx - horizontal vector spacingdy - vertical vector spacingpublic void normalizedMedianTest(double noiseLevel,
double threshold)
noiseLevel - Noise Level of the velocity data in pixel units.threshold - Data above this threshold will be discarted (the default is
2).public void deformation(boolean linReg,
int component)
linReg - Set true, if derivatives should be calculated by
this.getFirstDerivativeLinReg(). Otherwise,
this.getFirstDerivative() is used.component - Either PivDataFilter.NORMAL_VORTICITY,
PivDataFilter.IN_PLANE_SHEAR, or
PivDataFilter.EXTENSIONAL_STRAINpublic void replaceByMedian(boolean all,
boolean includeInvalid)
all - If all is set true every data-point is replaced
by the median of a 3x3 array inclusive center point (median
filtering).includeInvalid - set false to exclude invalid vectors in the
median calculation.public void reverseY()
public void flipY()
public void smooth(boolean includeInvalid)
includeInvalid - Set to false to exclude invalid vectors in the average
calculation.public void addRandomNoise(double maxNoise)
maxNoise - the scaling factor of the random noisepublic void appendColumn(double defaultValue)
defaultValue - The default data for the new data fields.public double[][] getHorizontalProfile(int row)
row - The row to extract.public double[][] getVerticalProfile(int col)
col - The column to extract.public double[][] getFreeProfile(float x1,
float y1,
float x2,
float y2,
float spacing)
x1 - The x co-ordinate of the first point.y1 - The y co-ordinate of the first point.x2 - The x co-ordinate of the second point.y2 - The y co-ordinate of the second point.spacing - The distance between the data points. If this value is zero,
the smallest spacing of the vector field is used.public double[][][] getFreeProfiles(float x1,
float y1,
float x2,
float y2,
float spacing,
int numberOf,
int distance)
x1 - The x co-ordinate of the first point.y1 - The y co-ordinate of the first point.x2 - The x co-ordinate of the second point.y2 - The y co-ordinate of the second point.numberOf - Total number of profiles.spacing - The distance between the data points. If this value is zero,
the smallest spacing of the vector field is used.distance - The distance between the profiles in pixels.public double[] getDataColumn(int col)
col - The column to extract.public double[] getAbsValue(int col1,
int col2)
col1 - The column that contains the first vector component.col2 - The column that contains the second vector component.public int getInvalidVectorCount()
public void setHeader(java.lang.String header)
header - The header.public void wallFilterVertical(int xStart,
int yStart,
double threshold)
xStart - The horizontal index of a vector grid line. The wall detection
starts from here.yStart - The vertical index of a vector grid line. The wall detection
starts from here.threshold - Consider velocities below this value to be close to a wall.public void print()