Quick fix of calibration data for ST Click detector.

Was getting a 5V input from it's bespoke acquisition, whereas needs 2.
This commit is contained in:
Douglas Gillespie 2022-11-16 09:12:55 +00:00
parent 3f5e4e4a79
commit 5b1cc760d8
2 changed files with 11 additions and 38 deletions

View File

@ -38,6 +38,13 @@ public class STAcquisitionControl extends AcquisitionControl {
public static final String STUNITTYPE = "SoundTrap Data Acquisition"; public static final String STUNITTYPE = "SoundTrap Data Acquisition";
private STAcquisitionProcess stAcquisitionProcess; private STAcquisitionProcess stAcquisitionProcess;
private STDaqSystem stDaqSystem; private STDaqSystem stDaqSystem;
/*
* Standard voltage for soundtrap data. note that ST calibration is only
* provided as end to end peak input, so the correct thing to do is set the peak to peak as 2
* (0-peak = 1) and then put the hydrophone sensitivity as - the end to end and all will be well.
*/
public static final double SOUNDTRAPVP2P = 2.0;
/** /**
* @param name * @param name
@ -45,47 +52,12 @@ public class STAcquisitionControl extends AcquisitionControl {
public STAcquisitionControl(String name) { public STAcquisitionControl(String name) {
super(name); super(name);
// super(STUNITTYPE, name);
//
// acquisitionControl = this;
//
// fileDate = new StandardFileDate(this);
//
// pamController = PamController.getInstance();
//
// registerDaqSystem(new FileInputSystem(this));
// registerDaqSystem(folderSystem = new FolderInputSystem(this));
//
// daqChannelListManager = new DAQChannelListManager(this);
//
// PamSettingManager.getInstance().registerSettings(this);
//
// addPamProcess(acquisitionProcess = new STAcquisitionProcess(this));
//
// daqMenuEnabler = new MenuItemEnabler();
//
// statusBarComponent = getStatusBarComponent();
//
// if (isViewer) {
// offlineFileServer = new OfflineFileServer(this, fileDate);
// }
// else {
// PamStatusBar statusBar = PamStatusBar.getStatusBar();
//
// if (statusBar != null) {
// statusBar.getToolBar().add(statusBarComponent);
// statusBar.getToolBar().addSeparator();
// setupStatusBar();
// }
// }
// setSelectedSystem();
//
// TDDataProviderRegisterFX.getInstance().registerDataInfo(new RawSoundProviderFX(this));
// add a second PAM process, for the click data // add a second PAM process, for the click data
registerDaqSystem(stDaqSystem = new STDaqSystem()); registerDaqSystem(stDaqSystem = new STDaqSystem());
addPamProcess(stAcquisitionProcess = new STAcquisitionProcess(this)); addPamProcess(stAcquisitionProcess = new STAcquisitionProcess(this));
acquisitionParameters.voltsPeak2Peak = SOUNDTRAPVP2P;
} }
@Override @Override

View File

@ -19,6 +19,7 @@ import PamUtils.PamCalendar;
import clickDetector.ClickDetection; import clickDetector.ClickDetection;
import clickDetector.ClickDetector; import clickDetector.ClickDetector;
import clickDetector.ClickDetector.ChannelGroupDetector; import clickDetector.ClickDetector.ChannelGroupDetector;
import soundtrap.STAcquisitionControl;
import soundtrap.STClickControl; import soundtrap.STClickControl;
import wavFiles.ByteConverter; import wavFiles.ByteConverter;
@ -77,8 +78,8 @@ public class SudFileDWVHandler implements SUDNotificationHandler {
stClickControl.findRawDataBlock().setChannelMap(1); stClickControl.findRawDataBlock().setChannelMap(1);
stClickControl.findRawDataBlock().setSampleRate((float) sampleRate, true); stClickControl.findRawDataBlock().setSampleRate((float) sampleRate, true);
stClickControl.getSTAcquisition().acquisitionParameters.sampleRate = (float) sampleRate; stClickControl.getSTAcquisition().acquisitionParameters.sampleRate = (float) sampleRate;
stClickControl.getSTAcquisition().acquisitionParameters.voltsPeak2Peak = STAcquisitionControl.SOUNDTRAPVP2P;
stClickControl.getSTAcquisition().getAcquisitionProcess().setSampleRate((float) sampleRate, true); stClickControl.getSTAcquisition().getAcquisitionProcess().setSampleRate((float) sampleRate, true);
// stClickControl.getSTAcquisition().getS().setSampleRate((float) sampleRate, true);
// System.out.printf("Open input stream fs = %3.1f\n", sampleRate); // System.out.printf("Open input stream fs = %3.1f\n", sampleRate);
} }