public class CDMRadarAdapter extends java.lang.Object implements RadarAdapter
Modifier and Type | Class and Description |
---|---|
static class |
CDMRadarAdapter.levelThredds |
static class |
CDMRadarAdapter.Neighbors
Neighbors is the class used to store values of 8 points near any grid point.
|
static class |
CDMRadarAdapter.SearchPoint
SearchPoint is the class used to store all information associated with each ray.
|
AZIMUTH_ANGLE_TYPE, AZIMUTH_TYPE, ELEVATION_ANGLE_TYPE, RANGE_TYPE
AZIMUTH, AZIMUTH_ANGLE, ELEVATION_ANGLE, PROP_2DOR3D, PROP_ANGLE, PROP_ANGLES, PROP_AZIMUTH, PROP_AZIMUTHS, PROP_CAPPI_LEVEL, PROP_CAPPI_LEVELS, PROP_TIMEHEIGHT, PROP_VCS, PROP_VCS_END, PROP_VCS_START, PROP_VOLUMEORSWEEP, PROP_VWP, RADAR_MOST_RECENT, RADIAL_VELOCITY_NAME, RANGE, REFLECTIVITY, REFLECTIVITY_NAME, SPECTRUM_WIDTH, SPECTRUM_WIDTH_NAME, STATION_LOCATION, VALUE_2D, VALUE_3D, VALUE_SWEEP, VALUE_VOLUME, VELOCITY
Constructor and Description |
---|
CDMRadarAdapter()
Zero-argument constructor for construction via unpersistence.
|
CDMRadarAdapter(DataSourceImpl source,
java.lang.String fileName)
Construct a new DORADE adapter.
|
Modifier and Type | Method and Description |
---|---|
static double |
angDist(double deltaEl,
double deltaAz)
angDist calculate sqrt of deltaEL and AZ
|
static void |
calAccumInterp(ucar.unidata.data.radar.CDMRadarAdapter.Ray ray,
int igateInner,
int igateOuter,
double wtInner,
double wtOuter,
double[] sumVals,
double[] sumWts,
int[] nContrib) |
static void |
calculateNearest(ucar.unidata.data.radar.CDMRadarAdapter.Ray ray,
int igateInner,
int igateOuter,
double wtInner,
double wtOuter,
double[] closestVal,
double[] maxWt,
int[] nContrib) |
void |
clearCachedData()
Clear the rds data
|
ucar.unidata.data.radar.CDMRadarAdapter.GridLoc[][][] |
computeGridRow(int numCols,
int numRows,
int numLevels,
float[] latRows,
float[] lonCols,
float[] altLevels)
computeGridRow calculate gridloc for each grid point
|
void |
doRemove()
Clean up whatever we need to when we are removed.
|
boolean |
equals(java.lang.Object o)
Check to see if this
CDMDataSource is equal to the object
in question. |
static int |
findInsertIndex(double[] sortedArray,
double value) |
static double |
fmod(double a,
double b)
fmod calculate modulus for float/double
|
protected double[] |
getAngles(java.lang.String vname)
Get the angles for this parameter
|
visad.DateTime |
getBaseTime()
Get the base time for this sweep
|
ucar.unidata.geoloc.Bearing |
getBearing(double lat,
double lon)
calculate the bearing of one location to the radar location
|
visad.FieldImpl |
getCAPPI(int moment,
java.lang.String varName,
visad.Real level)
This api is based on the rsl c library from TRMM Office Radar Software Library.
|
java.lang.Object[] |
getCutIdx(ucar.nc2.dt.RadialDatasetSweep.RadialVariable sweepVar)
get radar sweep index
|
visad.DataImpl |
getData(DataChoice dataChoice,
DataSelection subset,
java.util.Hashtable requestProperties)
Get the data for the given DataChoice and selection criteria.
|
java.lang.String |
getDataFormatName()
Get the data format name (e.g.
|
float[] |
getFloatNaN(int n)
get float array init with NaN
|
visad.FieldImpl |
getGridVolume(int moment,
java.lang.String varName)
Makes a field of all data from one common data model radar adapter;
|
float[] |
getIntersectionOfRayAndLine(visad.georef.EarthLocation radarCenter,
float azi,
float lat3,
float lon3,
float lat4,
float lon4)
calculate the intersection of ray and a line
|
float[] |
getIntersectionOfTwoLines(float lat1,
float lon1,
float lat2,
float lon2,
float lat3,
float lon3,
float lat4,
float lon4)
alculate the intersection of two lines
|
java.lang.String |
getName()
Return the name of the file
|
static int[][] |
getNeighborRays(double az,
double elev,
double[] elevs,
double[][] azims,
int[][] azidx) |
protected visad.RealType[] |
getParams()
Get the parameters for this adapter
|
visad.FieldImpl |
getRadarCrossSection(int moment,
java.lang.String varName,
visad.georef.LatLonPoint p1,
visad.georef.LatLonPoint p2)
Makes a field of all data from one common data model radar adapter;
|
visad.georef.EarthLocation |
getRadarStationInFile()
Get the radar location from the dataset.
|
visad.FlatField |
getRaster(int moment,
java.lang.String varName)
Create the initial spatial domain
|
visad.FieldImpl |
getRHI(int moment,
java.lang.String varName,
double rhiAz)
Makes a field of all data from one common data model radar adapter;
|
visad.FieldImpl |
getRHIOld(int moment,
java.lang.String varName,
double rhiAz)
Makes a field of all data from one common data model radar adapter;
|
visad.FieldImpl |
getRHISweep(int moment,
double azimus,
java.lang.String varName,
int idx,
boolean want3D)
Makes a field of all data from one common data model radar adapter;
|
visad.FlatField |
getRHIVolume(int moment,
java.lang.String varName)
Makes a field of all data from one common data model radar adapter;
|
java.lang.String |
getStationID()
Get the station ID
|
visad.georef.EarthLocation |
getStationLocation()
Get the parameters for this adapter
|
java.lang.String |
getStationName()
Get the parameters for this adapter
|
visad.FlatField |
getSweep(int moment,
double elevation,
java.lang.String varName,
int idx,
boolean want3D)
Makes a field of all data from one common data model radar adapter;
|
int |
getSweepNumber(java.lang.String vname,
double angle)
Get the sweep number for the particular variable and elevation angle
|
protected double |
getVCPAngle(double angle,
short id)
Find the closest angle to the given VCP angles
|
protected double[] |
getVCPAngles(short id,
double[] origAngles)
Get the parameters for this adapter
|
protected short |
getVCPid(java.lang.String vname)
Get the parameters for this adapter
|
visad.FlatField |
getVolume(int moment,
java.lang.String varName)
Makes a field of all data from one common data model radar adapter;
|
visad.FlatField |
getVolumeG(int moment,
java.lang.String varName)
Makes a field of all data from one common data model radar adapter;
|
static CDMRadarAdapter.Neighbors |
getWtsFor2ValidRays(ucar.unidata.data.radar.CDMRadarAdapter.GridLoc loc,
CDMRadarAdapter.SearchPoint ll,
CDMRadarAdapter.SearchPoint ul,
CDMRadarAdapter.SearchPoint lr,
CDMRadarAdapter.SearchPoint ur,
double wtInner,
double wtOuter)
loadWtsFor2ValidRays calculate neighbour values
|
static CDMRadarAdapter.Neighbors |
getWtsFor3Or4ValidRays(ucar.unidata.data.radar.CDMRadarAdapter.GridLoc loc,
CDMRadarAdapter.SearchPoint ll,
CDMRadarAdapter.SearchPoint ul,
CDMRadarAdapter.SearchPoint lr,
CDMRadarAdapter.SearchPoint ur,
double wtInner,
double wtOuter)
getWtsFor3Or4ValidRays calculate neighbour values
|
int |
hashCode()
Get the hash code for this object.
|
static double[] |
interpGridRow(int iz,
int iy,
ucar.unidata.data.radar.CDMRadarAdapter.GridLoc[][][] loc,
ucar.unidata.data.radar.CDMRadarAdapter.Ray[][] rays,
double[] elevs,
double[][] azims,
int[][] azidx) |
boolean |
isRaster()
Get the parameters for this adapter
|
boolean |
isRHI()
Get the parameters for this adapter
|
boolean |
isVolume()
Get the parameters for this adapter
|
void |
latLon2RTheta(double lat1,
double lon1,
double lat2,
double lon2,
double[] r,
double[] theta)
latLon2RTheta calculate r and theta of two latlon points
|
static double |
loadInterpGridPt(int igateInner,
int igateOuter,
CDMRadarAdapter.SearchPoint ll,
CDMRadarAdapter.SearchPoint ul,
CDMRadarAdapter.SearchPoint lr,
CDMRadarAdapter.SearchPoint ur,
CDMRadarAdapter.Neighbors wts) |
static double |
loadNearestGridPt(int igateInner,
int igateOuter,
CDMRadarAdapter.SearchPoint ll,
CDMRadarAdapter.SearchPoint ul,
CDMRadarAdapter.SearchPoint lr,
CDMRadarAdapter.SearchPoint ur,
CDMRadarAdapter.Neighbors wts)
loadNearestGridPt return the nearest radial point
|
static void |
main(java.lang.String[] args)
main
|
static void |
mainDorade(java.lang.String[] args)
Test main
|
static double[] |
removeNaNfromSortedArray(double[] sortedArr)
the sorted array may have some NaN at the end of the array
|
visad.georef.LatLonPoint |
setCrossSectionLinePosition(float azi)
setting the init crosssection line position with azimuth angle
|
void |
setStationLocation(visad.georef.EarthLocation el)
Set the station location
|
static int[] |
sortFloatArrayWithNaNAndIndices(double[] arr)
This is api by chatgpt to sort an array and put the NaN at its end
|
java.lang.String |
toString()
to String.
|
public CDMRadarAdapter()
public CDMRadarAdapter(DataSourceImpl source, java.lang.String fileName) throws visad.VisADException
source
- DataSource (may be null)fileName
- name of the DORADE file to readvisad.VisADException
- problem creating datapublic boolean equals(java.lang.Object o)
CDMDataSource
is equal to the object
in question.equals
in class java.lang.Object
o
- object in questionpublic int hashCode()
hashCode
in class java.lang.Object
public visad.georef.EarthLocation getRadarStationInFile()
public java.lang.String toString()
toString
in class java.lang.Object
protected double[] getAngles(java.lang.String vname)
vname
- variable namepublic visad.DateTime getBaseTime()
getBaseTime
in interface RadarAdapter
protected short getVCPid(java.lang.String vname)
vname
- variable nameprotected double[] getVCPAngles(short id, double[] origAngles)
id
- vcp id numberorigAngles
- The original anglesprotected double getVCPAngle(double angle, short id)
angle
- to findid
- of VCPpublic visad.FieldImpl getCAPPI(int moment, java.lang.String varName, visad.Real level) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- the momentvarName
- variable namelevel
- the leveljava.io.IOException
- problem reading the filejava.rmi.RemoteException
- problem with Java RMIvisad.VisADException
- problem creating VisAD objectpublic visad.DataImpl getData(DataChoice dataChoice, DataSelection subset, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException
getData
in interface RadarAdapter
dataChoice
- DataChoice for selectionsubset
- subsetting criteriarequestProperties
- extra request propertiesjava.rmi.RemoteException
- couldn't create a remote data objectvisad.VisADException
- couldn't create the datapublic void clearCachedData()
clearCachedData
in interface RadarAdapter
public java.lang.String getName()
getName
in interface RadarAdapter
protected visad.RealType[] getParams()
public visad.FieldImpl getRHIOld(int moment, java.lang.String varName, double rhiAz) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- momentvarName
- variable namerhiAz
- azimuth for RHIjava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic visad.FieldImpl getRadarCrossSection(int moment, java.lang.String varName, visad.georef.LatLonPoint p1, visad.georef.LatLonPoint p2) throws visad.VisADException, java.io.IOException
moment
- momentvarName
- variable namep1
- cross lint start pointp2
- cross lint end pointjava.io.IOException
- Problem reading datavisad.VisADException
- Couldn't create VisAD Objectpublic ucar.unidata.geoloc.Bearing getBearing(double lat, double lon)
lat
- input latitudelon
- input longitudepublic visad.georef.LatLonPoint setCrossSectionLinePosition(float azi) throws visad.VisADException, java.rmi.RemoteException
azi
- input azimuth anglejava.rmi.RemoteException
- for badvisad.VisADException
- for badpublic float[] getIntersectionOfRayAndLine(visad.georef.EarthLocation radarCenter, float azi, float lat3, float lon3, float lat4, float lon4)
radarCenter
- earthlocation of radarazi
- ray azimuthlat3
- line latitude of one endlon3
- line longitude of one endlat4
- line latitude of another endlon4
- _more_public float[] getIntersectionOfTwoLines(float lat1, float lon1, float lat2, float lon2, float lat3, float lon3, float lat4, float lon4)
lat1
- latitude of line 1lon1
- longitude of line 1lat2
- latitude of line 1lon2
- longitude of line 1lat3
- latitude of line 2lon3
- longitude of line 2lat4
- latitude of line 2lon4
- longitude of line 2public visad.FieldImpl getRHI(int moment, java.lang.String varName, double rhiAz) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- momentvarName
- variable namerhiAz
- azimuth for RHIjava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic java.lang.String getStationID()
public visad.georef.EarthLocation getStationLocation()
public void setStationLocation(visad.georef.EarthLocation el) throws visad.VisADException, java.rmi.RemoteException
el
- location of the radarvisad.VisADException
- couldn't create VisAD objectjava.rmi.RemoteException
- couldn't create remote objectpublic java.lang.String getStationName()
public java.lang.String getDataFormatName()
public visad.FlatField getRaster(int moment, java.lang.String varName) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException, ucar.ma2.InvalidRangeException
moment
- idxvarName
- variable namejava.io.IOException
- Problem reading dataucar.ma2.InvalidRangeException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- problem creating domainpublic visad.FieldImpl getRHISweep(int moment, double azimus, java.lang.String varName, int idx, boolean want3D) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- momentazimus
- azimuth anglevarName
- variable nameidx
- indexwant3D
- true if should return a 3D fieldjava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic visad.FlatField getSweep(int moment, double elevation, java.lang.String varName, int idx, boolean want3D) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- momentelevation
- elevation anglevarName
- variable nameidx
- _more_want3D
- true if should return a 3D fieldjava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic int getSweepNumber(java.lang.String vname, double angle)
vname
- variable nameangle
- elevation anglepublic java.lang.Object[] getCutIdx(ucar.nc2.dt.RadialDatasetSweep.RadialVariable sweepVar)
sweepVar
- radar variablepublic visad.FlatField getVolume(int moment, java.lang.String varName) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- momentvarName
- variable namejava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic visad.FieldImpl getGridVolume(int moment, java.lang.String varName) throws visad.VisADException, java.io.IOException
moment
- momentvarName
- variable namejava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic visad.FlatField getVolumeG(int moment, java.lang.String varName) throws visad.VisADException, java.io.IOException
moment
- momentvarName
- variable namejava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic static double[] removeNaNfromSortedArray(double[] sortedArr)
sortedArr
- _more_public static int[] sortFloatArrayWithNaNAndIndices(double[] arr)
arr
- _more_public visad.FlatField getRHIVolume(int moment, java.lang.String varName) throws visad.VisADException, java.rmi.RemoteException, java.io.IOException
moment
- momentvarName
- variable namejava.io.IOException
- Problem reading datajava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- Couldn't create VisAD Objectpublic float[] getFloatNaN(int n)
n
- 1 D array lengthpublic boolean isRaster()
public boolean isVolume()
public boolean isRHI()
public static void mainDorade(java.lang.String[] args) throws java.lang.Exception
args
- cmd line argsjava.lang.Exception
- when bad things happenpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- argsjava.lang.Exception
- On badnesspublic void doRemove()
doRemove
in interface RadarAdapter
public void latLon2RTheta(double lat1, double lon1, double lat2, double lon2, double[] r, double[] theta)
lat1
- latitudelat2
- latitudelon1
- longitudelon2
- longituder
- radiustheta
- anglepublic static double fmod(double a, double b)
a
- any doubleb
- any doublepublic ucar.unidata.data.radar.CDMRadarAdapter.GridLoc[][][] computeGridRow(int numCols, int numRows, int numLevels, float[] latRows, float[] lonCols, float[] altLevels)
numCols
- columnnumRows
- rownumLevels
- levellatRows
- latitudelonCols
- longitudealtLevels
- altitudepublic static double angDist(double deltaEl, double deltaAz)
deltaAz
- azimuth diffdeltaEl
- elevation diffpublic static CDMRadarAdapter.Neighbors getWtsFor2ValidRays(ucar.unidata.data.radar.CDMRadarAdapter.GridLoc loc, CDMRadarAdapter.SearchPoint ll, CDMRadarAdapter.SearchPoint ul, CDMRadarAdapter.SearchPoint lr, CDMRadarAdapter.SearchPoint ur, double wtInner, double wtOuter)
loc
- grid locationll
- pointul
- pointlr
- pointur
- pointwtInner
- inner weightwtOuter
- outer weightpublic static CDMRadarAdapter.Neighbors getWtsFor3Or4ValidRays(ucar.unidata.data.radar.CDMRadarAdapter.GridLoc loc, CDMRadarAdapter.SearchPoint ll, CDMRadarAdapter.SearchPoint ul, CDMRadarAdapter.SearchPoint lr, CDMRadarAdapter.SearchPoint ur, double wtInner, double wtOuter)
loc
- grid locationll
- pointul
- pointlr
- pointur
- pointwtInner
- neighborswtOuter
- neighborspublic static double loadNearestGridPt(int igateInner, int igateOuter, CDMRadarAdapter.SearchPoint ll, CDMRadarAdapter.SearchPoint ul, CDMRadarAdapter.SearchPoint lr, CDMRadarAdapter.SearchPoint ur, CDMRadarAdapter.Neighbors wts)
igateInner
- gateigateOuter
- garell
- pointul
- pointlr
- pointur
- pointwts
- neighborspublic static void calculateNearest(ucar.unidata.data.radar.CDMRadarAdapter.Ray ray, int igateInner, int igateOuter, double wtInner, double wtOuter, double[] closestVal, double[] maxWt, int[] nContrib)
ray
- _more_igateOuter
- _more_igateInner
- _more_wtInner
- _more_wtOuter
- _more_closestVal
- _more_maxWt
- _more_nContrib
- _more_public static double loadInterpGridPt(int igateInner, int igateOuter, CDMRadarAdapter.SearchPoint ll, CDMRadarAdapter.SearchPoint ul, CDMRadarAdapter.SearchPoint lr, CDMRadarAdapter.SearchPoint ur, CDMRadarAdapter.Neighbors wts)
igateOuter
- _more_igateInner
- _more_ll
- _more_ul
- _more_ur
- _more_lr
- _more_wts
- _more_public static void calAccumInterp(ucar.unidata.data.radar.CDMRadarAdapter.Ray ray, int igateInner, int igateOuter, double wtInner, double wtOuter, double[] sumVals, double[] sumWts, int[] nContrib)
ray
- _more_igateInner
- _more_igateOuter
- _more_wtInner
- _more_wtOuter
- _more_sumVals
- _more_sumWts
- _more_nContrib
- _more_
calAccumInterp return the interporate grid point value with
the nearby radial points on the same raypublic static double[] interpGridRow(int iz, int iy, ucar.unidata.data.radar.CDMRadarAdapter.GridLoc[][][] loc, ucar.unidata.data.radar.CDMRadarAdapter.Ray[][] rays, double[] elevs, double[][] azims, int[][] azidx)
iy
- _more_iz
- _more_loc
- _more_rays
- _more_elevs
- _more_azidx
- _more_azims
- _more_public static int[][] getNeighborRays(double az, double elev, double[] elevs, double[][] azims, int[][] azidx)
az
- _more_elev
- _more_elevs
- _more_azidx
- _more_azims
- _more_azims
- is sorted azimuths with original idex in azidxpublic static int findInsertIndex(double[] sortedArray, double value)
sortedArray
- _more_value
- _more_