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
FieldsModifier and TypeFieldDescriptionstatic final intEverything seems finestatic intStreamer id to use if imported data has no streamer id infostatic final intSomething has gone wrong getting the csv filestatic final intSomething has gone wrong loading the matlab structurestatic final intThe number of hydrophones is not the same as the number of hydrophones in the current array manager.static final intThe number of hydrophones is different for different times.static final intThe data is far in the past or in the futurestatic final intNOT 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
Constructors - 
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.booleanisDataFormatOK(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 voidMethods 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:DataImportLoads the file into memory - each element of the output array list is then processed.- Specified by:
 loadDataIntermediatein 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:DataImportReturn the file extensions that can be loaded.- Specified by:
 getExtensionsStringsin classDataImport<Hydrophone>- Returns:
 - an array of file extensions that can be loaded.
 
 - 
isDataFormatOK
Description copied from class:DataImportCheck that a row of imported data is in the correct format.- Specified by:
 isDataFormatOKin 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:
 createDataUnitin 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:DataImportGet the data block to to save data to.- Specified by:
 getDataBlockin classDataImport<Hydrophone>- Returns:
 
 - 
getDataUnitName
Description copied from class:DataImportThe name of the data unit to appear on the dialog boxes.- Overrides:
 getDataUnitNamein classDataImport<Hydrophone>- Returns:
 - name of the data unit to be imported.
 
 - 
main
 
 -