cassis.gui.plot.tools
public final class ToolsUtil extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static double |
convDeltaToFreq(XAxisCassis axis,
double val)
Convert a value of a delta with an UNIT from an axis to a Mhz delta.
|
static XYSpectrumSeries |
createNewSerie(XYSpectrumSeries serie,
double[] xFinal,
double[] yFinalNewSerie,
java.lang.String name,
java.awt.Color colorSpectrum)
Create a new
XYSpectrumSeries. |
static XYSpectrumSeries |
doAverage(XYSpectrumSeries serie,
XYSpectrumSeries serie2,
java.lang.String nameNewCurve,
int number,
java.awt.Color color,
double xMin,
double xMax,
double sampling)
Create a new
XYSpectrumSeries by adding the values of two series then dividing them by 2. |
static XYSpectrumSeries |
doChangeFrequencyFrame(XYSpectrumSeries serie,
java.lang.Double vlsr,
java.lang.String name,
java.awt.Color color)
Create a new
XYSpectrumSeries by changing frequency with the vlsr, then resample it
to the lowest sampling for sampling it to a monotone way. |
static java.util.List<XYSpectrumSeries> |
doOperation(XYSpectrumSeries serie,
XYSpectrumSeries serie2,
java.lang.String name,
int number,
java.util.List<java.awt.Color> colors,
double xMin,
double xMax,
double sampling,
Operation operation)
Create a new
XYSpectrumSeries by doing an operation two XYSpectrumSeries. |
static XYSpectrumSeries |
doOperationWithConstant(XYSpectrumSeries serie,
java.lang.Double constant,
java.lang.String name,
java.awt.Color colorSpectrum,
Operation operation)
Create a new
XYSpectrumSeries by doing an operation (Operation.ADD_CONSTANT
or Operation.MULTIPLY_CONSTANT) with a XYSpectrumSeries and a constant. |
static XYSpectrumSeries |
doResample(XYSpectrumSeries serie,
java.lang.Double sampling,
java.lang.String name,
java.awt.Color color)
Create a new
XYSpectrumSeries by doing a resampling on another one. |
static XYSpectrumSeries |
doRestToSky(XYSpectrumSeries serie,
java.lang.String nameNewCurve,
java.awt.Color color)
Create a new
XYSpectrumSeries by changing the TypeFrequency to SKY from
a serie with a REST TypeFrequency. |
static XYSpectrumSeries |
doSkyToRest(XYSpectrumSeries serie,
java.lang.Double vlsr,
java.lang.String name,
java.awt.Color color)
Create a new
XYSpectrumSeries by changing the TypeFrequency to REST from
a serie with a SKY TypeFrequency. |
static XYSpectrumSeries |
doSmoothBox(XYSpectrumSeries serie,
java.lang.String name,
java.awt.Color color,
int boxSize)
Create a new
XYSpectrumSeries by doing a Smooth Box. |
static XYSpectrumSeries |
doSmoothGauss(XYSpectrumSeries serie,
java.lang.String name,
java.awt.Color color,
double fwhm)
Create a new
XYSpectrumSeries by doing a Smooth Gauss. |
static XYSpectrumSeries |
doTmbTaChange(XYSpectrumSeries serie,
Operation operation,
java.lang.String name,
java.awt.Color color,
java.util.List<java.lang.Double> efficiencyList,
java.util.List<java.lang.Double> frequencyList)
Create a new
XYSpectrumSeries by doing a change Tmb/Ta change. |
static XYSpectrumSeries |
doVlsrChange(XYSpectrumSeries serie,
java.lang.String name,
java.awt.Color color,
double vlsr)
Create a new
XYSpectrumSeries by changing the vlsr. |
static double |
getLowestSampling(XYSpectrumSeries serie,
XYSpectrumSeries serie2)
Get the lowest sampling from two series.
|
static double[] |
getXFinal(XAxisCassis axis,
double xMin,
double xMax,
double sampling)
Compute the values of the x points in Mhz between xMin and xMax with a sampling.
|
static double |
getXMax(XYSpectrumSeries serie,
XYSpectrumSeries serie2)
Compute the X max point between two series.
|
static double |
getXMin(XYSpectrumSeries serie,
XYSpectrumSeries serie2)
Compute the X min point between two series.
|
static boolean |
isRessamplePossible(double xMin,
double xMax)
Check if we two series has joint points based by theirs xMin and xMax
|
static double[] |
resample(double[] xDest,
double[] xSerieToResample,
double[] ySerieToResample)
Resample the points from a serie with the given array of X points.
|
static XYSpectrumSeries |
smoothHanning(XYSpectrumSeries serie,
java.lang.String name,
java.awt.Color color)
Create a new
XYSpectrumSeries by doing a Smooth Hanning on a XYSpectrumSeries. |
public static XYSpectrumSeries createNewSerie(XYSpectrumSeries serie, double[] xFinal, double[] yFinalNewSerie, java.lang.String name, java.awt.Color colorSpectrum)
XYSpectrumSeries.serie - The XYSpectrumSeries used to copy some parameters from.xFinal - The X points of the new XYSpectrumSeries.yFinalNewSerie - The Y point of the new XYSpectrumSeries.name - The name of the new XYSpectrumSeries.colorSpectrum - The color of the new XYSpectrumSeries, if null a new color is generated.XYSpectrumSeries.public static double[] resample(double[] xDest,
double[] xSerieToResample,
double[] ySerieToResample)
xDest - The array used for the news X points.xSerieToResample - The array of X points of the serie to resample.ySerieToResample - The array of Y points of the serie to resample.public static double getXMin(XYSpectrumSeries serie, XYSpectrumSeries serie2)
serie - The first series.serie2 - The second series.public static double getXMax(XYSpectrumSeries serie, XYSpectrumSeries serie2)
serie - The first series.serie2 - The second series.public static double getLowestSampling(XYSpectrumSeries serie, XYSpectrumSeries serie2)
serie - The first series.serie2 - The second series.public static boolean isRessamplePossible(double xMin,
double xMax)
xMin - The xMin value.xMax - The XMax value.public static double[] getXFinal(XAxisCassis axis, double xMin, double xMax, double sampling)
axis - The XAXisCassis of the xMin/xMax/sampling.xMin - The xMin value.xMax - The xMax value.sampling - The sampling to use.public static java.util.List<XYSpectrumSeries> doOperation(XYSpectrumSeries serie, XYSpectrumSeries serie2, java.lang.String name, int number, java.util.List<java.awt.Color> colors, double xMin, double xMax, double sampling, Operation operation)
XYSpectrumSeries by doing an operation two XYSpectrumSeries.serie - The first XYSpectrumSeries (whose data will be subtracted in case of SUBTRACT operation).serie2 - The second XYSpectrumSeries (used to subtract in case of SUBTRACT operation).name - The generic name of the created XYSpectrumSeries.number - The number used for the news series.colors - The Colors used for the three new XYSpectrumSeries.xMin - The value of the minimum x point in the xAxis unit of the series.xMax - The value of the maximum x point in the xAxis unit of the series.sampling - The sampling used for the created XYSpectrumSeries in the xAxis unit of the series.operation - The operation to do. It must be Operation.ADD, Operation.SUBTRACT or Operation.DIVIDE.XYSpectrumSeries or null if there was an error..public static XYSpectrumSeries smoothHanning(XYSpectrumSeries serie, java.lang.String name, java.awt.Color color)
XYSpectrumSeries by doing a Smooth Hanning on a XYSpectrumSeries.serie - The XYSpectrumSeries used for doing the first Smooth Hanning.name - The generic name for the created serie (which is the name without the number).color - The list of colors used for the series.public static XYSpectrumSeries doOperationWithConstant(XYSpectrumSeries serie, java.lang.Double constant, java.lang.String name, java.awt.Color colorSpectrum, Operation operation)
XYSpectrumSeries by doing an operation (Operation.ADD_CONSTANT
or Operation.MULTIPLY_CONSTANT) with a XYSpectrumSeries and a constant.serie - The XYSpectrumSeries.constant - The constant.name - The name of the created XYSpectrumSeries.colorSpectrum - The Color used for the created XYSpectrumSeries.operation - The operation to do. It must be Operation.ADD_CONSTANT or Operation.MULTIPLY_CONSTANT.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doAverage(XYSpectrumSeries serie, XYSpectrumSeries serie2, java.lang.String nameNewCurve, int number, java.awt.Color color, double xMin, double xMax, double sampling)
XYSpectrumSeries by adding the values of two series then dividing them by 2.serie - The first XYSpectrumSeries.serie2 - The second XYSpectrumSeries.nameNewCurve - The generic name of the created XYSpectrumSeries.number - The number used for the news series.color - The Color used for the new XYSpectrumSeries.xMin - The value of the minimum x point in the xAxis unit of the series.xMax - The value of the maximum x point in the xAxis unit of the series.sampling - The sampling used for the created XYSpectrumSeries in the xAxis unit of the series.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doResample(XYSpectrumSeries serie, java.lang.Double sampling, java.lang.String name, java.awt.Color color)
XYSpectrumSeries by doing a resampling on another one.serie - The XYSpectrumSeries on which is base the resampling.sampling - The sampling used for the created XYSpectrumSeries in the xAxis unit of the series.name - The name of the new serie.color - The color of the new serie.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doChangeFrequencyFrame(XYSpectrumSeries serie, java.lang.Double vlsr, java.lang.String name, java.awt.Color color)
XYSpectrumSeries by changing frequency with the vlsr, then resample it
to the lowest sampling for sampling it to a monotone way.serie - The XYSpectrumSeries used a base for the new serie after the operation.vlsr - The new vlsr.name - The name of the new serie.color - The color of the new serie.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doRestToSky(XYSpectrumSeries serie, java.lang.String nameNewCurve, java.awt.Color color)
XYSpectrumSeries by changing the TypeFrequency to SKY from
a serie with a REST TypeFrequency.serie - The XYSpectrumSeries with the REST TypeFrequency.nameNewCurve - The name of the new XYSpectrumSeriescolor - The color of the new serie.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doSkyToRest(XYSpectrumSeries serie, java.lang.Double vlsr, java.lang.String name, java.awt.Color color)
XYSpectrumSeries by changing the TypeFrequency to REST from
a serie with a SKY TypeFrequency.serie - The XYSpectrumSeries with the SKY TypeFrequency.vlsr - The value of the new vlsr.name - The name of the new XYSpectrumSeriescolor - The color of the new serie.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doTmbTaChange(XYSpectrumSeries serie, Operation operation, java.lang.String name, java.awt.Color color, java.util.List<java.lang.Double> efficiencyList, java.util.List<java.lang.Double> frequencyList)
XYSpectrumSeries by doing a change Tmb/Ta change.serie - The XYSpectrumSeries used a base for the new serie after the operation.operation - The Operation todo, must be Operation.TA_TO_TMB or Operation.TMB_TO_TA.name - The name of the new XYSpectrumSeries.color - The color of the new serie.efficiencyList - The efficiency list of the telescope.frequencyList - The frequency list of the telescope.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doSmoothBox(XYSpectrumSeries serie, java.lang.String name, java.awt.Color color, int boxSize)
XYSpectrumSeries by doing a Smooth Box.serie - The XYSpectrumSeries used a base for the new serie after the operation.name - The name of the new XYSpectrumSeries.color - The color of the new serie.boxSize - The size of the box.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doSmoothGauss(XYSpectrumSeries serie, java.lang.String name, java.awt.Color color, double fwhm)
XYSpectrumSeries by doing a Smooth Gauss.serie - The XYSpectrumSeries used a base for the new serie after the operation.name - The name of the new XYSpectrumSeries.color - The color of the new serie.fwhm - The FWHM used for the operation.XYSpectrumSeries or null if there was an error.public static XYSpectrumSeries doVlsrChange(XYSpectrumSeries serie, java.lang.String name, java.awt.Color color, double vlsr)
XYSpectrumSeries by changing the vlsr.serie - The XYSpectrumSeries used a base for the new serie after the operation.name - The name of the new XYSpectrumSeries.color - The color of the new serie.vlsr - The new vlsr.XYSpectrumSeries or null if there was an error.public static double convDeltaToFreq(XAxisCassis axis, double val)
axis - The axis with the unit of the delta.val - The value of the delta.