public class CoreSections
extends java.lang.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
{@link #alignSections(int, double, net.talvi.puffinplot.data.CoreSections.ReferenceAlignmentType) ).
|
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(java.util.List<Sample> sampleList)
Split a sample list into core sections according to the discrete
IDs of the samples.
|
java.util.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.
|
java.util.LinkedHashMap<java.lang.String,CoreSection> |
getSections()
Get a linked map of core sections.
|
public static CoreSections fromSampleListByDiscreteId(java.util.List<Sample> sampleList)
sampleList
- samples to splitpublic java.util.LinkedHashMap<java.lang.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
declinationstargetDeclination
- the target declination to which to align the
core, in degreesalignWith
- core declination which should be aligned with
the target declinationpublic java.util.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 samplesmargin
samples
of the end of any section within this grouppublic boolean areSectionEndDirectionsDefined(int margin)
margin
- number of samples in a section endtrue
if and only if every sample in every section end
has a defined direction