public class FHX2FileReader extends AbstractFireHistoryReader
Class for reading FHX format fire history data files. For more information about the FHX file format see the FHAES manual.
Instantiate this class by passing a java.io.File referred to a FHX file. Data and information from the file can then be extracted using a variety of methods. The most commonly used are:
Many methods in the class were deprecated in July 2014. These should be replaced by the corresponding new methods indicated in the comments for each.
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<java.lang.Integer> |
badDataLines |
private int[] |
barkPerTree |
private java.util.ArrayList<java.util.ArrayList<java.lang.Character>> |
calosperSample2d |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
calosYearperSample2d |
private java.util.ArrayList<java.util.ArrayList<java.lang.Character>> |
capsperSample2d |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
capsYearperSample2d |
private java.util.ArrayList<java.lang.Integer> |
climate1dI |
private java.util.ArrayList<java.lang.Integer> |
climate1dII |
private java.util.ArrayList<java.lang.Integer> |
climate1dIII |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
climate2dI |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
climate2dII |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
climate2dIII |
private java.util.ArrayList<java.lang.String> |
dataBlock |
private java.util.ArrayList<java.lang.String> |
dataByRow |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
DecompSyb2d |
private int[] |
FFyearperTree |
private int[] |
fIIIYearPerTree |
private int[] |
fIIYearPerTree |
private java.io.File |
file |
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
filters2dI |
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
filters2dII |
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
filters2dIII |
private java.lang.Integer |
firstFireYear |
private java.lang.Integer |
firstIndicatorYear |
private java.lang.Integer |
firstInjuryYear |
private java.lang.Integer |
firstYear |
private int[] |
fIYearPerTree |
private java.lang.String |
format |
private boolean |
hitBadline |
private boolean |
hitBlankline |
private int[] |
innerMostPerTree |
private boolean |
isClimate1dIIIinit |
private boolean |
isClimate1dIIinit |
private boolean |
isClimate1dIinit |
private boolean |
isClimate2dIIIinit |
private boolean |
isClimate2dIIinit |
private boolean |
isClimate2dIinit |
private boolean |
isFilterse2dIIIinit |
private boolean |
isFilterse2dIIinit |
private boolean |
isFilterse2dIinit |
private boolean |
isFormatInfoSet |
private boolean |
isRecorderYears2DArrayInit |
private int[] |
lastFirePerSample |
private int[] |
lastInjuryPerSample |
private int[] |
lastYearIndexPerSample |
private java.lang.Integer |
lengthOfSeriesName |
private static org.slf4j.Logger |
log |
private java.util.ArrayList<java.util.ArrayList<java.lang.Character>> |
lowsperSample2d |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
lowsYearperSample2d |
private java.lang.Integer |
numberOfSeries |
private int[] |
outerMostPerTree |
private int[] |
pithIndexPerSample |
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
recorderYears2DArray |
private java.util.ArrayList<java.lang.String> |
seriesName |
private java.util.ArrayList<java.lang.String> |
seriesNameLine |
private int[] |
startYearIndexPerSample |
private int[] |
totalRecordYearsPerSample |
private int[] |
totals |
private java.util.ArrayList<java.lang.Integer> |
yearArray |
seriesList
Constructor and Description |
---|
FHX2FileReader(java.io.File file)
Constructor for reading FHX2 format fire history data files
|
Modifier and Type | Method and Description |
---|---|
private void |
generate1DEventsI()
Generates the standard fireEventsArray
|
private void |
generate1DEventsII()
Generates the otherInjuriesArray for storing lowercase events
|
private void |
generate1DEventsIII()
Generate the firesAndInjuriesArray
|
void |
generate2DEventsI()
Generates most of the basic arrays of data including climate2D.
|
private void |
generate2DEventsII()
Generates the basic injuries arrays including climate2dII and fIIYearPerTree
|
private void |
generate2DEventsIII()
Generates the basic fire events and injuries arrays including climate2dIII
|
private void |
generate2DFiltersI()
Generates the filters2d array
|
private void |
generate2DFiltersII()
Generate the filters2dII array
|
private void |
generate2DFiltersIII()
Generates the filters2dIII array
|
private void |
generateRecorderYearsArray()
Generate multi-dimensional ArrayList of recorder years.
|
private void |
generateSeriesName()
Generate the ArrayList of series names present in this file
|
java.util.ArrayList<java.lang.Integer> |
getBadDataLineNumbers()
Get ArrayList of line numbers for all data lines that contain errors
|
int[] |
getBarkIndexPerTree()
Returns an int[] with one entry per sample in the file with each int containing the index to the year in which the bark for the
sample is found.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Character>> |
getCalosperSample2d()
TODO Documentation needed
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getCalosYearperSample2d()
TODO Documentation needed
|
java.util.ArrayList<java.util.ArrayList<java.lang.Character>> |
getCapsperSample2d()
TODO Documentation needed
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getCapsYearperSample2d()
TODO Documentation needed
|
java.util.ArrayList<java.lang.Integer> |
getClimate()
Deprecated.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getClimate2d()
Deprecated.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getClimate2dII()
Deprecated.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getClimate2dIII()
Deprecated.
|
java.util.ArrayList<java.lang.Integer> |
getClimateI()
Deprecated.
|
java.util.ArrayList<java.lang.Integer> |
getClimateIII()
Deprecated.
|
java.util.ArrayList<java.lang.String> |
getData()
Returns an array of strings, each containing the data portion of the FHX file minus any year value on the end.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getEventDataArrays(EventTypeToProcess eventType)
Get a multi-dimensional array with rows = number of years, and columns = number of samples.
|
java.io.File |
getFile()
Get the file being read
|
java.lang.String |
getFileFormat()
Get the style of file being read.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
getFilterArrays(EventTypeToProcess eventType)
Get a multi-dimensional array with rows = number of years, and columns = 3.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
getfilters2d()
Deprecated.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
getfilters2dII()
Deprecated.
|
java.util.ArrayList<java.util.ArrayList<java.lang.Double>> |
getfilters2dIII()
Deprecated.
|
java.util.ArrayList<java.lang.Integer> |
getFireEventsArray()
Get an ArrayList with length equal to number of years in file, containing Integer codes meaning
|
java.util.ArrayList<java.lang.Integer> |
getFiresAndInjuriesArray()
Get an ArrayList with length equal to number of years in file, containing Integer codes meaning
|
java.lang.Integer |
getFirstFireYear()
Get the first year where a file was recorded in any series within this file
|
java.lang.Integer |
getFirstIndicatorYear()
Get the first year in which an indicator is found within this file
|
java.lang.Integer |
getFirstInjuryYear()
Get the year in which the first injury is found
|
java.lang.Integer |
getFirstYear()
Get the first year in the file as indicated by the file header
|
int[] |
getInnerMostperTree()
Get an array containing the index (not year) of the innermost (earliest) ring for each sample where the sample has no pith.
|
int[] |
getInnerMostYearPerTree()
Get an array containing the year (not index) of the innermost (earliest) ring for each sample.
|
java.lang.Integer |
getLastYear()
Get the last (most recent) year in the file.
|
int[] |
getLastYearIndexPerSample()
Returns an int[] with one entry per sample in the file with each int containing the index to the last year for the sample.
|
int[] |
getLastYearPerSample()
Returns an int[] with one entry per sample in the file with each int containing the year number for the last year in the sample.
|
java.lang.Integer |
getLengthOfSeriesName()
Get the maximum length of the series names specified in the file header
|
java.lang.String |
getName()
Returns the name of the file being read.
|
java.lang.Integer |
getNumberOfSeries()
Get the number of series contained in this file
|
java.util.ArrayList<java.lang.Integer> |
getOtherInjuriesArray()
Get an ArrayList with length equal to number of years in file, containing Integer codes meaning
|
int[] |
getOuterMostYearPerTree()
Get an array containing the year (not index) of the outermost (most recent) ring for each sample.
|
int[] |
getOutterMostperTree()
Get an array containing the index (not year) of the outermost (most recent) ring for each sample.
|
int[] |
getPithIndexPerSample()
Returns an int[] with one entry per sample in the file with each int containing the index to the year in which the pith for the
sample is found.
|
java.util.ArrayList<java.lang.String> |
getRawRowData()
Returns an array of rows containing the raw character data extracted from the data block of the FHX file
|
java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
getRecorderYears2DArray()
TODO
|
java.util.ArrayList<java.lang.String> |
getSeriesNameArray()
Get an ArrayList of the series names from this file
|
java.util.ArrayList<java.lang.String> |
getSeriesNameLine()
Deprecated.
|
int[] |
getStartYearIndexPerSample()
Returns an int[] with one entry per sample in the file with each int containing the index to the earliest year for the sample.
|
int[] |
getStartYearPerSample()
Returns an int[] with one entry per sample in the file with each int containing the year number for the sample.
|
int[] |
getTotalRecorderYearsPerSample()
Get an int array with one entry per sample in the file with each int containing the count of the number of recorder years
|
int[] |
getTotals()
TODO Documentation needed
|
java.util.ArrayList<java.lang.Integer> |
getYear()
Deprecated.
|
java.util.ArrayList<java.lang.Integer> |
getYearArray()
Get an ArrayList of years contained within this file
|
boolean |
hasFireEvents()
Whether this file contains any fire events
|
boolean |
hasFireEventsOrInjuries()
Whether this file contains any fire events or injuries
|
boolean |
hasInjuryEvents()
Whether this file contains any injury events
|
private void |
init()
Initialise the FHX2FileReader
|
boolean |
isFormatInfoSet()
Deprecated.
|
void |
makeClimate()
Deprecated.
|
void |
makeClimate2d()
Deprecated.
|
void |
makeClimate2dII()
Deprecated.
|
void |
makeClimate2dIII()
Deprecated.
|
void |
makeClimateI()
Deprecated.
|
void |
makeClimateIII()
Deprecated.
|
void |
makeDecompSyb2d()
TODO Documentation needed
|
void |
makeFilters2d()
Deprecated.
|
void |
makefilters2dII()
Deprecated.
|
void |
makefilters2dIII()
Deprecated.
|
boolean |
passesBasicSyntaxCheck()
Whether the file passes rudimentary syntax checks.
|
protected void |
populateSeriesList()
Construct a list of FHSeries, one for each series in the file.
|
getCompositeFireYears, getPercentScarred, getRecordingDepths, getSampleDepths, getSeriesList, replaceSeriesList
private static final org.slf4j.Logger log
private final java.io.File file
private java.lang.String format
private java.lang.Integer firstYear
private java.lang.Integer firstFireYear
private java.lang.Integer firstInjuryYear
private java.lang.Integer firstIndicatorYear
private java.lang.Integer numberOfSeries
private java.lang.Integer lengthOfSeriesName
private boolean isFormatInfoSet
private boolean hitBlankline
private boolean hitBadline
private java.util.ArrayList<java.lang.String> seriesNameLine
private java.util.ArrayList<java.lang.String> seriesName
private java.util.ArrayList<java.lang.String> dataBlock
private java.util.ArrayList<java.lang.String> dataByRow
private java.util.ArrayList<java.lang.Integer> badDataLines
private java.util.ArrayList<java.lang.Integer> climate1dI
private java.util.ArrayList<java.lang.Integer> climate1dII
private java.util.ArrayList<java.lang.Integer> climate1dIII
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> climate2dI
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> climate2dII
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> climate2dIII
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> filters2dI
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> filters2dII
private java.util.ArrayList<java.util.ArrayList<java.lang.Double>> filters2dIII
private boolean isClimate1dIinit
private boolean isClimate1dIIinit
private boolean isClimate1dIIIinit
private boolean isClimate2dIinit
private final boolean isClimate2dIIinit
private boolean isClimate2dIIIinit
private boolean isFilterse2dIinit
private boolean isFilterse2dIIinit
private boolean isFilterse2dIIIinit
private java.util.ArrayList<java.util.ArrayList<java.lang.Character>> capsperSample2d
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> capsYearperSample2d
private java.util.ArrayList<java.util.ArrayList<java.lang.Character>> lowsperSample2d
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> lowsYearperSample2d
private java.util.ArrayList<java.util.ArrayList<java.lang.Character>> calosperSample2d
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> calosYearperSample2d
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> recorderYears2DArray
private boolean isRecorderYears2DArrayInit
private java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> DecompSyb2d
private int[] lastFirePerSample
private int[] lastInjuryPerSample
private int[] pithIndexPerSample
private int[] totalRecordYearsPerSample
private int[] totals
private java.util.ArrayList<java.lang.Integer> yearArray
private int[] FFyearperTree
private int[] startYearIndexPerSample
private int[] lastYearIndexPerSample
private int[] innerMostPerTree
private int[] outerMostPerTree
private int[] barkPerTree
private int[] fIYearPerTree
private int[] fIIYearPerTree
private int[] fIIIYearPerTree
public FHX2FileReader(java.io.File file)
file
- - File to readprivate void generateSeriesName()
private void generate1DEventsI()
private void generate1DEventsII()
public void generate2DEventsI()
private void generateRecorderYearsArray()
private void generate2DEventsII()
private void generate2DFiltersI()
private void generate2DFiltersII()
private void generate2DFiltersIII()
public void makeDecompSyb2d()
private void generate1DEventsIII()
private void generate2DEventsIII()
private void init()
public java.lang.Integer getFirstIndicatorYear()
public java.lang.Integer getFirstInjuryYear()
public boolean passesBasicSyntaxCheck()
IFHAESReader
public java.util.ArrayList<java.lang.Integer> getFireEventsArray()
Get an ArrayList with length equal to number of years in file, containing Integer codes meaning
public java.util.ArrayList<java.lang.Integer> getOtherInjuriesArray()
Get an ArrayList with length equal to number of years in file, containing Integer codes meaning
public java.util.ArrayList<java.lang.Integer> getFiresAndInjuriesArray()
Get an ArrayList with length equal to number of years in file, containing Integer codes meaning
public java.util.ArrayList<java.lang.Integer> getYearArray()
public java.util.ArrayList<java.lang.String> getData()
IFHAESReader.getRawRowData()
public java.util.ArrayList<java.lang.String> getRawRowData()
IFHAESReader.getData()
public java.util.ArrayList<java.lang.Integer> getBadDataLineNumbers()
public int[] getTotals()
public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getEventDataArrays(EventTypeToProcess eventType)
Get a multi-dimensional array with rows = number of years, and columns = number of samples. The integer values within the arrays mean the following:
eventType
- public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getCapsYearperSample2d()
public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getCalosYearperSample2d()
public java.util.ArrayList<java.util.ArrayList<java.lang.Character>> getCapsperSample2d()
public java.util.ArrayList<java.util.ArrayList<java.lang.Character>> getCalosperSample2d()
public java.util.ArrayList<java.util.ArrayList<java.lang.Double>> getFilterArrays(EventTypeToProcess eventType)
Get a multi-dimensional array with rows = number of years, and columns = 3.
This array is typically used when wanting to filter the data by number of percentage of events
eventType
- public int[] getStartYearIndexPerSample()
IFHAESReader.getStartYearPerSample()
public int[] getStartYearPerSample()
IFHAESReader.getStartYearIndexPerSample()
public int[] getLastYearIndexPerSample()
IFHAESReader.getLastYearPerSample()
public int[] getLastYearPerSample()
IFHAESReader.getLastYearIndexPerSample()
public int[] getPithIndexPerSample()
public int[] getTotalRecorderYearsPerSample()
public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getRecorderYears2DArray()
public int[] getInnerMostperTree()
IFHAESReader.getInnerMostYearPerTree()
public int[] getInnerMostYearPerTree()
public int[] getOutterMostperTree()
public int[] getOuterMostYearPerTree()
public int[] getBarkIndexPerTree()
public java.lang.Integer getFirstYear()
public java.util.ArrayList<java.lang.String> getSeriesNameArray()
public boolean hasFireEventsOrInjuries()
public boolean hasFireEvents()
public boolean hasInjuryEvents()
public java.io.File getFile()
public java.lang.Integer getFirstFireYear()
public java.lang.String getName()
public java.lang.Integer getNumberOfSeries()
public java.lang.Integer getLengthOfSeriesName()
public java.lang.Integer getLastYear()
@Deprecated public java.util.ArrayList<java.lang.Integer> getClimate()
@Deprecated public java.util.ArrayList<java.lang.Integer> getClimateI()
@Deprecated public java.util.ArrayList<java.lang.Integer> getClimateIII()
@Deprecated public void makeClimate()
@Deprecated public void makeClimateI()
@Deprecated public void makeClimateIII()
@Deprecated public java.util.ArrayList<java.lang.Integer> getYear()
@Deprecated public java.util.ArrayList<java.lang.String> getSeriesNameLine()
@Deprecated public boolean isFormatInfoSet()
public java.lang.String getFileFormat()
@Deprecated public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getClimate2d()
@Deprecated public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getClimate2dII()
@Deprecated public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getClimate2dIII()
@Deprecated public void makeClimate2d()
@Deprecated public void makeClimate2dII()
@Deprecated public void makeClimate2dIII()
@Deprecated public java.util.ArrayList<java.util.ArrayList<java.lang.Double>> getfilters2d()
@Deprecated public java.util.ArrayList<java.util.ArrayList<java.lang.Double>> getfilters2dII()
@Deprecated public java.util.ArrayList<java.util.ArrayList<java.lang.Double>> getfilters2dIII()
@Deprecated public void makeFilters2d()
@Deprecated public void makefilters2dII()
@Deprecated public void makefilters2dIII()
protected void populateSeriesList()
AbstractFireHistoryReader
populateSeriesList
in class AbstractFireHistoryReader