Package Array.importHydrophoneData
Class HydrophoneImport
Class for importing hydrophone data from external file and saving to database.
.csv import formats
List Format: One hydrophone data unit per row (rows have ten columns). Format is: [0]=timeExcelSerial [1]=x [2]=y [3]=z [4]=xErr [5]=yErr [6]=zErr [7]=streamerId [8]=hydrophoneId [9]=sensitivity [10]=gain . Note that sensitivity and gain info doesn't need to be included.
2D List Format (Legacy) Multiple hydrophones per row. Each row of the input array must have the following format. timeExcelSerial, x0, y0,z0, x0Error, y0Error, z0Error,x1, y1,z1, x1Error, y1Error, z1Error,,..... and so on depending on the number of hydrophones.
.mat format Not yet implemented.
- Author:
- Jamie Macaulay
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Everything seems finestatic int
Streamer id to use if imported data has no streamer id infostatic final int
Something has gone wrong getting the csv filestatic final int
Something has gone wrong loading the matlab structurestatic final int
The number of hydrophones is not the same as the number of hydrophones in the current array manager.static final int
The number of hydrophones is different for different times.static final int
The data is far in the past or in the futurestatic final int
NOT IMPLEMENTED YET************* Loads from a matlab structure with following format structure(i).time =time structure(i).hydrophones= Npositionsx3 array structure(i).hydrophoneErrors= Npositionsx3 array -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertToHydrophoneList
(ArrayList<ArrayList<Double>> importData) Converts a 2D List of hydrophones into a 1D list of hydrophone objecys.createDataUnit
(Hydrophone hydrophone) For hydrophone data imported [0]=timeMilliss [1]=x [2]=y [3]=z [4]=xErr [5]=yErr [6]=zErr [7]=streamerId [8]=hydrophoneId [9]=sensitivity [10]=gainGet the data block to to save data to.The name of the data unit to appear on the dialog boxes.String[]
Return the file extensions that can be loaded.boolean
isDataFormatOK
(Hydrophone hydrophone) Check that a row of imported data is in the correct format.loadDataIntermediate
(String filePath) Loads the file into memory - each element of the output array list is then processed.static void
Methods inherited from class PamView.importData.DataImport
performPreChecks
-
Field Details
-
defaultStreamerID
public static int defaultStreamerIDStreamer id to use if imported data has no streamer id info -
MATLAB_STRUCT_FORMAT
public static final int MATLAB_STRUCT_FORMATNOT IMPLEMENTED YET************* Loads from a matlab structure with following format structure(i).time =time structure(i).hydrophones= Npositionsx3 array structure(i).hydrophoneErrors= Npositionsx3 array- See Also:
-
DATA_OK
public static final int DATA_OKEverything seems fine- See Also:
-
ERROR_YEARS
public static final int ERROR_YEARSThe data is far in the past or in the future- See Also:
-
ERROR_LOADING_CSV
public static final int ERROR_LOADING_CSVSomething has gone wrong getting the csv file- See Also:
-
ERROR_LOADING_MATLAB_STRUCT
public static final int ERROR_LOADING_MATLAB_STRUCTSomething has gone wrong loading the matlab structure- See Also:
-
ERROR_NUMBER_OF_HYDROPHONES_ARRAY
public static final int ERROR_NUMBER_OF_HYDROPHONES_ARRAYThe number of hydrophones is not the same as the number of hydrophones in the current array manager.- See Also:
-
ERROR_NUMBER_OF_HYDROPHONES_INCONSISTANT
public static final int ERROR_NUMBER_OF_HYDROPHONES_INCONSISTANTThe number of hydrophones is different for different times.- See Also:
-
-
Constructor Details
-
HydrophoneImport
-
-
Method Details
-
loadDataIntermediate
Description copied from class:DataImport
Loads the file into memory - each element of the output array list is then processed.- Specified by:
loadDataIntermediate
in classDataImport<Hydrophone>
- Parameters:
filePath
- - the filepath.- Returns:
- a list of imported objects.
-
convertToHydrophoneList
Converts a 2D List of hydrophones into a 1D list of hydrophone objecys.- Parameters:
importData
- . Each row of the input array must have the following format. time, x0, y0,z0, x0Error, y0Error, z0Error,x1, y1,z1, x1Error, y1Error, z1Error,,..... and so on depending on the number of hydrophones.- Returns:
- a list of hydrophone objects.
-
getExtensionsStrings
Description copied from class:DataImport
Return the file extensions that can be loaded.- Specified by:
getExtensionsStrings
in classDataImport<Hydrophone>
- Returns:
- an array of file extensions that can be loaded.
-
isDataFormatOK
Description copied from class:DataImport
Check that a row of imported data is in the correct format.- Specified by:
isDataFormatOK
in classDataImport<Hydrophone>
- Parameters:
hydrophone
- -a row of data loaded from file- Returns:
- true if the format is OK.
-
createDataUnit
For hydrophone data imported [0]=timeMilliss [1]=x [2]=y [3]=z [4]=xErr [5]=yErr [6]=zErr [7]=streamerId [8]=hydrophoneId [9]=sensitivity [10]=gain- Specified by:
createDataUnit
in classDataImport<Hydrophone>
- Parameters:
hydrophone
- -a row of data loaded from file- Returns:
- a data unit to be saved to the datablock.
-
getDataBlock
Description copied from class:DataImport
Get the data block to to save data to.- Specified by:
getDataBlock
in classDataImport<Hydrophone>
- Returns:
-
getDataUnitName
Description copied from class:DataImport
The name of the data unit to appear on the dialog boxes.- Overrides:
getDataUnitName
in classDataImport<Hydrophone>
- Returns:
- name of the data unit to be imported.
-
main
-