public class CoreSections extends Object
CoreSection
s, stored as a linked hash map
indexed by a string identifier. The purpose of this class is to
implement useful operations on groups of CoreSection
s.Modifier and Type | Class and Description |
---|---|
static class |
CoreSections.TargetDeclinationType
The declination which should be aligned with a reference alignment
passed to
alignSections(int, double, net.talvi.puffinplot.data.CoreSections.TargetDeclinationType) . |
Modifier and Type | Method and Description |
---|---|
void |
alignSections(int margin,
double targetDeclination,
CoreSections.TargetDeclinationType alignWith)
Aligns the declinations of these core sections from the top down.
|
boolean |
areSectionEndDirectionsDefined(int margin)
Reports whether all samples within section ends have a defined direction.
|
static CoreSections |
fromSampleListByDiscreteId(List<Sample> sampleList)
Split a sample list into core sections according to the discrete
IDs of the samples.
|
Set<Sample> |
getEndSamples(int margin)
Returns a set containing all the samples which are near the end
of any section within this group of sections.
|
LinkedHashMap<String,CoreSection> |
getSections()
Get a linked map of core sections.
|
public static CoreSections fromSampleListByDiscreteId(List<Sample> sampleList)
sampleList
- samples to split (non-null)public LinkedHashMap<String,CoreSection> getSections()
fromSampleListByDiscreteId
, the order corresponds to the original
sample order.public void alignSections(int margin, double targetDeclination, CoreSections.TargetDeclinationType alignWith)
margin
argument. The declinations
of each core section are rotated as a block, in such a way that the top
declination of each section matches the bottom declination of the section
above it, producing a record without discontinuities between the
sections. Additionally, the declinations of the core as a whole are
rotated so that either the top declination of the topmost section or the
mean declination of the entire core match a specified target declination.margin
- number of samples to use in determining top and bottom
declinations. The margin must be at least 1 and may not exceed the
number of samples in any section.targetDeclination
- the target declination to which to align the
core, in degreesalignWith
- core declination which should be aligned with
the target declinationpublic Set<Sample> getEndSamples(int margin)
margin
samples of each section are counted
as being "near the end".margin
- the number of samples from each end of each section
to include in the returned set of samples. The margin must be
at least 0 and may not exceed the number of samples in any
section.margin
samples
of the end of any section within this grouppublic boolean areSectionEndDirectionsDefined(int margin)
margin
- number of samples in a section end. The margin must be at
least 0 and may not exceed the number of samples in any section.true
if and only if every sample in every section end
has a defined directionCopyright © 2022. All rights reserved.