Package clickDetector
Class RainbowFile
java.lang.Object
clickDetector.RainbowFile
- All Implemented Interfaces:
ClickFileStorage
- Author:
- Doug Gillespie
Creates a file in the RainbowClick file format. Required Rainbowclick structures are subclasses of RainbowFile. The class is also responsible for holding the file handle, etc.
Not all RainbowClick structures are implemented since may of them contain no useful data. Parameter settings will be added to other Pam storage as that developes.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
checkStorage
(String dirName) void
long
long
int
Get the next clicks from the file.int
Get the current File objectfloat
boolean
gotoSectionData
(int iSection) boolean
gotoSectionHead
(int iSection) boolean
boolean
openClickStorage
(long sampleOffset) Open a new rainbowFile for storage.boolean
openClickStorage
(File oldFile) Open an old rainbowclick file to reload data for viewing or for batch conversion into binary files.boolean
readClickStructure
(int structId, ClickParameters clickParameters) boolean
readClickStructures
(ClickParameters clickParameters) boolean
readClickStructures
(ClickParameters clickParameters, boolean fromStart) Read click head structures from a rainbowclick file.boolean
readSCSettings
(ClickParameters clickParameters) boolean
reWriteClick
(ClickDetection click) boolean
writeClick
(ClickDetection click) boolean
writeClickHeader
(ClickDetection click) boolean
writeClickStructure
(int structId, ClickParameters clickParameters) boolean
writeClickStructures
(ClickParameters clickParameters) boolean
writeSCSettings
(ClickParameters clickParameters)
-
Field Details
-
HEADER_CLICK
public static final int HEADER_CLICK- See Also:
-
HEADER_SECTION
public static final int HEADER_SECTION- See Also:
-
HEADER_GPSDATA
public static final int HEADER_GPSDATA- See Also:
-
HEADER_NOISE
public static final int HEADER_NOISE- See Also:
-
HEADER_SEISMIC
public static final int HEADER_SEISMIC- See Also:
-
HEADER_NOISEWAVE
public static final int HEADER_NOISEWAVE- See Also:
-
-
Constructor Details
-
RainbowFile
-
-
Method Details
-
openClickStorage
public boolean openClickStorage(long sampleOffset) Open a new rainbowFile for storage.- Specified by:
openClickStorage
in interfaceClickFileStorage
-
openClickStorage
Open an old rainbowclick file to reload data for viewing or for batch conversion into binary files. -
gotoSectionHead
public boolean gotoSectionHead(int iSection) -
gotoSectionData
public boolean gotoSectionData(int iSection) -
closeClickStorage
public void closeClickStorage()- Specified by:
closeClickStorage
in interfaceClickFileStorage
-
getNumSections
public int getNumSections()- Returns:
- the number of sections in an old style RC file.
-
writeClickStructures
- Specified by:
writeClickStructures
in interfaceClickFileStorage
-
readClickStructures
-
readClickStructures
Read click head structures from a rainbowclick file.- Parameters:
clickParameters
-- Returns:
- true if read ok, false otherwise
-
moveToClicks
public boolean moveToClicks() -
getNextClick
Get the next clicks from the file. Assume that the file pointer is in the right place, etc.- Returns:
- next click, or null if EOF.
-
writeClickStructure
-
readClickStructure
-
writeSCSettings
-
readSCSettings
-
writeClickHeader
- Specified by:
writeClickHeader
in interfaceClickFileStorage
-
reWriteClick
-
writeClick
- Specified by:
writeClick
in interfaceClickFileStorage
-
getStorageName
- Specified by:
getStorageName
in interfaceClickFileStorage
-
checkStorage
public boolean checkStorage()- Specified by:
checkStorage
in interfaceClickFileStorage
-
checkStorage
-
getFileStartTime
public long getFileStartTime()- Returns:
- the file start time in standard Java milliseconds
-
getFileEndTime
public long getFileEndTime()- Returns:
- the file end time in standard Java milliseconds
-
getSampleRate
public float getSampleRate()- Returns:
- the files sample rate in Hz
-
getRainbowFile
Get the current File object- Returns:
- File object.
-
getNClicksInFile
public int getNClicksInFile()- Returns:
- the nClicksInFile
-