Class Downsample
java.lang.Object
org.eclipse.dawnsci.analysis.dataset.function.Downsample
- All Implemented Interfaces:
IDownsampleService,DatasetToDatasetFunction
Down-sample a dataset by a given bin. Also is the implementation of a service
so instead of using this class directly, one can consume the IDownsampleService
from OSGi thus not making a hard dependency on uk.ac.diamond.scisoft.analysis
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default Downsample set to MAXIMUM with a 2x2 bin.Downsample(DownsampleMode mode, int... binShape) This class down-samples (or subsamples) datasets according to given mode and sample bin shapemodecan be POINT, MEAN, MAXIMUM -
Method Summary
Modifier and TypeMethodDescriptionstatic DownsampleList<org.eclipse.january.dataset.Dataset> downsample(String enc, org.eclipse.january.dataset.IDataset... data) Downsample As in Downsample.fromString(...) In DAWN source code the implementation of this service is:List<org.eclipse.january.dataset.Dataset> downsample(DownsampleMode mode, int[] binShape, org.eclipse.january.dataset.IDataset... data) Same as the downsample with a string argument but instead of encoding the types in the string, they are provided directly.static Stringencode(Downsample s) booleanint[]getMode()inthashCode()List<org.eclipse.january.dataset.Dataset> value(org.eclipse.january.dataset.IDataset... datasets) The class implements down-sampling of datasets
-
Constructor Details
-
Downsample
public Downsample()Creates a default Downsample set to MAXIMUM with a 2x2 bin. Called by OSGi when contributing the IDownsampleService -
Downsample
This class down-samples (or subsamples) datasets according to given mode and sample bin shapemodecan be POINT, MEAN, MAXIMUM- Parameters:
mode-binShape-
-
-
Method Details
-
downsample
public List<org.eclipse.january.dataset.Dataset> downsample(String enc, org.eclipse.january.dataset.IDataset... data) throws Exception Description copied from interface:IDownsampleServiceDownsample As in Downsample.fromString(...) In DAWN source code the implementation of this service is:- Specified by:
downsamplein interfaceIDownsampleService- Parameters:
enc-: examples: 'MEAN:2', 'MEAN:2x3', 'MAXIMUM:2x2', 'MINIMUM:4x4', 'POINT:2x3x4' data- - the datasets to downsample- Throws:
Exception- if downsample encoding is incorrect- See Also:
-
downsample
public List<org.eclipse.january.dataset.Dataset> downsample(DownsampleMode mode, int[] binShape, org.eclipse.january.dataset.IDataset... data) throws Exception Description copied from interface:IDownsampleServiceSame as the downsample with a string argument but instead of encoding the types in the string, they are provided directly.- Specified by:
downsamplein interfaceIDownsampleService- Parameters:
mode-binShape-data-- Returns:
- list of downsampled datasets
- Throws:
Exception
-
value
public List<org.eclipse.january.dataset.Dataset> value(org.eclipse.january.dataset.IDataset... datasets) The class implements down-sampling of datasets- Specified by:
valuein interfaceDatasetToDatasetFunction- Parameters:
datasets-- Returns:
- a list of down-sampled datasets
-
getMode
-
getBshape
public int[] getBshape() -
encode
-
decode
-
hashCode
public int hashCode() -
equals
-