|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.talvi.puffinplot.data.Suite
public final class Suite
A suite of data, containing a number of samples. This will usually correspond to a section (for discrete studies) or core (for continuous studies).
Nested Class Summary | |
---|---|
static class |
Suite.AmsCalcType
The type of a statistical calculation on AMS tensors. |
static interface |
Suite.SiteNamer
A SiteNamer turns a sample name into a site name. |
Constructor Summary | |
---|---|
Suite(java.util.List<java.io.File> files)
Creates a new suite from the specified files. |
|
Suite(java.util.List<java.io.File> files,
SensorLengths sensorLengths,
TwoGeeLoader.Protocol protocol,
boolean usePolarMoment,
FileFormat format)
Creates a new suite from the specified files. |
Method Summary | |
---|---|
void |
calculateAmsStatistics(java.util.List<Sample> samples,
Suite.AmsCalcType calcType,
java.lang.String scriptPath)
Calculates and stores AMS statistics using an external script. |
static SuiteCalcs |
calculateMultiSuiteMeans(java.util.List<Suite> suites)
Calculates and returns Fisher statistics on all the calculated PCA directions for samples within supplied suite. |
void |
calculateSiteFishers(Correction correction)
For each site in this suite, calculates Fisher statistics on the sample PCA directions. |
void |
calculateSuiteMeans()
Calculates Fisher statistics on all the calculated PCA directions for samples within the suite. |
void |
clearAmsCalculations()
Clears any AMS calculations on this suite |
boolean |
containsSample(java.lang.String id)
Determine whether this suite contain a same with a specified identifier (name). |
void |
doAllCalculations(Correction correction)
Performs all possible sample and site calculations. |
static java.util.List<FisherValues> |
doReversalTest(java.util.List<Suite> suites)
Performs a reversal test on a list of suites. |
void |
doSampleCalculations(Correction correction)
Performs calculations for each sample in this suite. |
void |
doSiteCalculations(Correction correction)
Calculate mean directions for all suitable sites in the suite. |
void |
exportToFiles(java.io.File directory,
java.util.List<DatumField> fields)
Exports a subset of this suite's data to multiple files, one file per sample. |
void |
fromString(java.lang.String string)
Sets suite data from a string. |
java.util.List<KentParams> |
getAmsBootstrapParams()
Returns the parameters of the last AMS bootstrap statistics (if any) calculated on this suite's data. |
java.util.List<KentParams> |
getAmsHextParams()
Returns the parameters of the last AMS Hext statistics (if any) calculated on this suite's data. |
Sample |
getCurrentSample()
Returns the current sample |
int |
getCurrentSampleIndex()
Returns the index defining the current sample. |
CustomFields<java.lang.String> |
getCustomFlagNames()
Returns the names (titles) of the custom flags for this suite. |
CustomFields<java.lang.String> |
getCustomNoteNames()
Returns the names (titles) of the custom notes for this suite. |
java.util.List<Datum> |
getData()
Returns all the data points in this suite. |
int |
getIndexBySample(Sample sample)
Returns the index of a specified sample within this suite. |
java.util.List<java.lang.String> |
getLoadWarnings()
Get the list of warnings produced when data was being loaded from one or more files. |
double |
getMaxDepth()
For a continuous suite, returns the maximum depth of a sample within the suite. |
MeasType |
getMeasType()
Returns the measurement type of this suite (discrete or continuous) |
double |
getMinDepth()
For a continuous suite, returns the minimum depth of a sample within the suite. |
java.lang.String |
getName()
Returns the name of this suite. |
int |
getNumSamples()
Returns the number of samples in this suite. |
java.io.File |
getPuffinFile()
Returns the name of the PuffinPlot file associated with this suite, if any. |
Sample |
getSampleByIndex(int i)
Returns the sample with the specified index. |
Sample |
getSampleByName(java.lang.String name)
Returns a sample from this suite with the specified name, or null if no such sample exists. |
java.util.List<Sample> |
getSamples()
Returns all the samples in this suite. |
Site |
getSiteByName(java.lang.String siteName)
Returns a site with the given name, or null if
this suite contains no such site. |
java.util.List<FisherValues> |
getSiteFishers()
Returns the results of the per-site Fisher statistics calculated by calculateSiteFishers(net.talvi.puffinplot.data.Correction) . |
java.util.List<Site> |
getSites()
Returns the sites within this suite. |
SuiteCalcs |
getSuiteMeans()
Returns the Fisher parameters calculated on the entire suite. |
Datum |
getTrayCorrection(Datum d)
Returns the tray correction for the specified data point. |
void |
importAmsFromAsc(java.util.List<java.io.File> files,
boolean magneticNorth)
Imports AMS data from ASC files in the format produced by Agico's SAFYR program. |
void |
importAmsFromDelimitedFile(java.util.List<java.io.File> files,
boolean directions)
Imports AMS data from a whitespace-delimited file. |
boolean |
isFilenameSet()
Reports whether a default PuffinPlot file is set for this suite. |
void |
rescaleMagSus(double factor)
Multiplies all magnetic susceptibility measurements in this suite by the specified factor. |
void |
save()
If a default PuffinPlot file is set for this suite, saves the suite data to that file. |
void |
saveAs(java.io.File file)
Saves the data in this suite to a specified file. |
void |
saveCalcsSample(java.io.File file)
Exports sample calculations to a specified file in CSV format. |
void |
saveCalcsSite(java.io.File file)
Exports site calculations to a specified file in CSV format. |
void |
saveCalcsSuite(java.io.File file)
Saves the Fisher mean direction for the whole suite to a file in CSV format |
void |
setCurrentSampleIndex(int value)
Sets the index defining the current sample. |
void |
setNamedSiteForSamples(java.util.Collection<Sample> samples,
java.lang.String siteName)
Explicitly sets a site for the specified samples. |
void |
setSiteNamesByDepth(java.util.Collection<Sample> samples,
double thickness)
Sets site names for a continuous suite according to the depth of the samples. |
void |
setSiteNamesBySubstring(java.util.Collection<Sample> samples,
java.util.BitSet charMask)
Sets site names for samples according to chosen characters from the sample names. |
void |
setSitesForSamples(java.util.Collection<Sample> samples,
Suite.SiteNamer siteNamer)
Sets sites for supplied samples according to a supplied site namer. |
java.lang.String |
toString()
Returns the name of this suite. |
java.util.List<java.lang.String> |
toStrings()
Returns strings representing data about this suite. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Suite(java.util.List<java.io.File> files) throws java.io.IOException
Creates a new suite from the specified files.
The is a convenience method for
Suite(List, SensorLengths, TwoGeeLoader.Protocol)
using the default sensor lengths (1, 1, 1), protocol
(NORMAL
), and Cartesian (X/Y/Z) magnetic moment fields.
files
- the files from which to load the data
java.io.IOException
- if an I/O error occurred while reading the filespublic Suite(java.util.List<java.io.File> files, SensorLengths sensorLengths, TwoGeeLoader.Protocol protocol, boolean usePolarMoment, FileFormat format) throws java.io.IOException
Creates a new suite from the specified files.
Note that this may return an empty suite, in which case it is the caller's responsibility to notice this and deal with it. We can't just throw an exception if the suite's empty, because then we lose the load warnings (which will probably explain to the user why the suite's empty and are thus quite important).
files
- the files from which to load the datasensorLengths
- for 2G long core files only: the effective lengths
of the magnetometer's SQUID sensors,
used to correct Cartesian magnetic moment dataprotocol
- for 2G files only: the measurement protocol usedusePolarMoment
- for 2G files only: use polar (dec/inc/int)
data fields instead of Cartesian ones (X/Y/Z) to determine magnetic momentformat
- explicitly specified file format (null to automatically
guess between 2G, PuffinPlot, and Zplot).
java.io.IOException
- if an I/O error occurred while reading the filesMethod Detail |
---|
public java.util.List<java.lang.String> getLoadWarnings()
public void calculateSuiteMeans()
getSuiteMeans()
.
public static SuiteCalcs calculateMultiSuiteMeans(java.util.List<Suite> suites)
getSuiteMeans()
.
suites
- the suites on which to calculate statistics
public static java.util.List<FisherValues> doReversalTest(java.util.List<Suite> suites)
suites
- the suites on which to perform the test.
public SuiteCalcs getSuiteMeans()
public void calculateSiteFishers(Correction correction)
correction
- the correction to apply to the magnetic moment
measurements when performing the PCA calculationsgetSiteFishers()
,
Site.doFisher(net.talvi.puffinplot.data.Correction)
public java.util.List<FisherValues> getSiteFishers()
calculateSiteFishers(net.talvi.puffinplot.data.Correction)
.
public boolean isFilenameSet()
true
if a default PuffinPlot file is set for this suitepublic void save() throws PuffinUserException
PuffinUserException
- if an error occurred while saving the datapublic void saveAs(java.io.File file) throws PuffinUserException
file
- the file to which to save the suite's data
PuffinUserException
- if an error occurred while saving datapublic void doSampleCalculations(Correction correction)
correction
- the correction to apply to the magnetic moment
data when performing the calculationspublic void doSiteCalculations(Correction correction)
correction
- the correction to apply to the magnetic moment
data when performing the calculationspublic void doAllCalculations(Correction correction)
correction
- the correction to apply to the magnetic moment
data when performing the calculationspublic void saveCalcsSample(java.io.File file) throws PuffinUserException
file
- the file to which to write the sample calculations
PuffinUserException
- if an error occurred while writing the filepublic void saveCalcsSite(java.io.File file) throws PuffinUserException
file
- the file to which to write the site calculations
PuffinUserException
- if an error occurred while writing the filepublic void saveCalcsSuite(java.io.File file) throws PuffinUserException
file
- the file to which to write the mean direction
PuffinUserException
- if an error occurred while writing the filepublic Sample getSampleByName(java.lang.String name)
null
if no such sample exists.
name
- a sample name
null
if no such sample existspublic int getCurrentSampleIndex()
public void setCurrentSampleIndex(int value)
value
- the index defining the current samplepublic Sample getCurrentSample()
public java.util.List<Sample> getSamples()
public java.util.List<Datum> getData()
public MeasType getMeasType()
public java.lang.String getName()
public int getNumSamples()
public Sample getSampleByIndex(int i)
i
- an index number for a sample
public int getIndexBySample(Sample sample)
sample
- a sample in the suite
-1
if not in this suitepublic Datum getTrayCorrection(Datum d)
d
- a data point representing a magnetic measurement
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<java.lang.String> toStrings()
public void fromString(java.lang.String string)
toStrings()
method.
string
- a string from which to read suite datapublic void importAmsFromDelimitedFile(java.util.List<java.io.File> files, boolean directions) throws java.io.IOException
Imports AMS data from a whitespace-delimited file.
If directions==false
, line format is k11 k22 k33 k12 k23 k13
(tensor components) otherwise it's
inc1 dec1 inc2 dec2 inc3 dec3 (axis directions, decreasing magnitude).
If there's no sample in the suite from which to take the sample
and formation corrections, importAmsWithDialog will try to read them as
fields appended to the end of the line.
Not currently used in PuffinPlot.
files
- the files from which to read the datadirections
- true
to read axis directions,
false
to read tensor components
java.io.IOException
- if there was an I/O error reading the filespublic void importAmsFromAsc(java.util.List<java.io.File> files, boolean magneticNorth) throws java.io.IOException
files
- the ASC files to readmagneticNorth
- true
if the sample dip azimuths
in the file are relative to magnetic north; false
if
they are relative to geographic north
java.io.IOException
- if an I/O error occurred while reading the filepublic void exportToFiles(java.io.File directory, java.util.List<DatumField> fields)
directory
- the directory in which to create the filesfields
- the fields to exportpublic CustomFields<java.lang.String> getCustomFlagNames()
public CustomFields<java.lang.String> getCustomNoteNames()
public java.util.List<KentParams> getAmsBootstrapParams()
public java.util.List<KentParams> getAmsHextParams()
public void clearAmsCalculations()
public java.util.List<Site> getSites()
public Site getSiteByName(java.lang.String siteName)
null
if
this suite contains no such site.
siteName
- a site name
null
if
this suite contains no such sitepublic java.io.File getPuffinFile()
public void calculateAmsStatistics(java.util.List<Sample> samples, Suite.AmsCalcType calcType, java.lang.String scriptPath) throws java.io.IOException, java.lang.IllegalArgumentException
samples
- the samples on which to calculate statisticscalcType
- the type of AMS calculation to performscriptPath
- the filesystem path of the script which will perform the calculation
java.io.IOException
- if there was an error running the script or reading its output
java.lang.IllegalArgumentException
- if the samples contain insufficient AMS datapublic double getMinDepth()
public double getMaxDepth()
public void setSitesForSamples(java.util.Collection<Sample> samples, Suite.SiteNamer siteNamer)
samples
- the samples for which to set sitessiteNamer
- the site namer which will produce the site namespublic void setNamedSiteForSamples(java.util.Collection<Sample> samples, java.lang.String siteName)
samples
- the samples for which to set the sitesiteName
- the name of the site into which to put the samplespublic void setSiteNamesBySubstring(java.util.Collection<Sample> samples, java.util.BitSet charMask)
samples
- the samples for which to set sitescharMask
- the mask determining which characters to use for the site namepublic void setSiteNamesByDepth(java.util.Collection<Sample> samples, double thickness)
samples
- the samples for which to set site namesthickness
- the thickness of each sitepublic boolean containsSample(java.lang.String id)
id
- a sample identifier
true
if this suite contains a sample with the
specified identifierpublic void rescaleMagSus(double factor)
factor
- a factor by which to multiply all the magnetic
susceptibility measurements in this suite
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |