getUnitClass() {
return ConnectedRegionDataUnit.class;
diff --git a/src/export/exporter_help.md b/src/export/exporter_help.md
new file mode 100644
index 00000000..df85fc41
--- /dev/null
+++ b/src/export/exporter_help.md
@@ -0,0 +1,94 @@
+# PAMGuard exporter
+## Introduction
+
+The PAMGuard exporter allows users to export PAMGuard data, such as detections, to a variety of different formats. The exporter is a convenient solution for exporting sections or large chunks of a PAMGuard datasets without requiring any code. For more bespoke data management please see the [PAMGuard-MATLAB](https://github.com/PAMGuard/PAMGuardMatlab) library and [PAMBinaries package](https://github.com/TaikiSan21/PamBinaries) which can be used for more bespoke data management. Note that the exporter only exports a sub set of data types - this will expand in future releases.
+
+## Exporting
+The PAMGuard exporter can be accessed from *File->Export*. This brings up the Export dialog. The export dialog allows users to select which data to export, where to export it and the file format to export as. Each data block also has a settings icon which opens the data block's unique data selector. So for example, users can export only specific types of clicks or whistles between certain frequencies.
+
+
+
+
+
+ Diagram of the exporter dialog. The dialog allows users to select which part of the dataset to export, how to export it and which type of data to export
+
+The main parts of the dialog are as follows.
+### Data Options
+Select which part of the dataset to export
+- Loaded Data : the data currently loaded into memory i.e. usually what you can see in the displays - may be different time oeriods depending on the data type.
+- All data : the entire dataset.
+- Select data : manually enter a period between two times.
+- Specify time chunks : import a csv file with a list of time chunks.
+
+### Export Options
+Select where to export the data to using _Browse..._ and select the maximum allowed file size using the _Maximum file size_ selector. Select the format by toggling one of the data format buttons. Hover over each button to see more info.
+
+### Export Data
+Select which data to export. If a data type has a cog icon next to it then it has a data selector. The data selector settings can be used to filter which detections are exported. For example you may wish only to export clicks of a certain type or perhaps deep learning detections with a prediction value above a certain threshold. Each data selector is unique to the type of data. Note that the exporter only exports a sub set of data types - this will expand in future.
+
+### Progress
+Once _Start_ is selected then the progress bars show progress in exporting the selected data.
+
+## Export formats
+Currently the exporter has three possible output formats.
+
+### MAT files
+MAT files are files which can be opened easily in MATLAB and Python. They can store multiple different data formats e.g. tables, arrays, structures. Each PAMGuard detection is saved as a single structure and then the file contains an array of these structures for each data type. The fields within the structure contains the relevant data unique to each data unit. Whilst data units have unique fields depending on their type e.g. a click or a whistle, there are some fields that are shared between almost all data units - an example of a click detection structure is shown below
+
+*General fields shared by most data units in PAMGuard*
+- *millis*: the unix*1000 start time of the click, whistle, clip etc. in milliseconds; this number can be converted to a date/time with millisecond accuracy.
+- *date*: the start time of the click in MATLAB datenum format. Use datastr(date) to show a time string.
+- *UID*: a unique serial number for the detection. Within a processed dataset no other detection will have this number.
+- *startSample*: The first sample of this detection - often used for finer scale time delay measurements. Samples refers to the number of samples in total the sound card has taken since processing begun or a new file has been created.
+- *channelMap*: The channel map for this detection. One number which represents which channels this detection is from: To get the true channels use the getChannels(channelMap) function.
+
+*Unique to clicks*
+- *triggerMap*: which channel triggered the detection.
+- *type*: Classification type. Must use database or settings to see what species this refers to.
+- *duration*: Duration of this click detection in samples.
+- *nChan*: Number of channels the detection was made on.
+- *wave*: Waveform data for each channel.
+
+Note that the format of each struct is the same as the format if extracting data using the [PAMGuard-MATLAB](https://github.com/PAMGuard/PAMGuardMatlab) library.
+
+To open an exported .mat file simply drag it into **MATLAB** or use the function;
+```Matlab
+ load(/my/path/to/file.mat)
+```
+
+To open a .mat file in **Python** use
+
+```Python
+import scipy.io
+mat = scipy.io.loadmat('/my/path/to/file.mat')
+clkstruct = mat['det_20170704_204536_580'] #The name of the struct array within the file
+
+#Extract the third waveform from a click example
+nwaves = len(clkstruct[0]) #Number of clicks
+thirdwaveform = clkstruct[0, 2]['wave'] #Waveform from third click in samples between -1 and 1.
+```
+
+### R
+Data can be exported to an RData frame. The data are exported as R structs with the same fields as in MATLAB (and PAMBinaries package). To open a an RData frame open RStudio and import the file or use;
+
+```R
+load("/my/path/to/file.RData")
+```
+
+### Wav files
+Any detection which contains raw sound data, for example a click, clip or deep learning detection, can be exported as a wav file. When wav files are selected three options are presented for saving files.
+
+
+
+
+
+ When wav files are selected additional options are presented on how to save the file
+
+- *Zero pad* : Here detections are saved as wav files with the time in between detections zero padded. The resulting files will be as large as the initial wav files processed to create the data. This can be useful if for example opening the files in another acoustic analysis program.
+
+- *Concatenate* : The detections are saved to a wav file without any zero padding. This saves storage space but temporal information is lost within the wav file. The sample positions of each detection are saved in a text file along with the wav file so that temporal info is available if needed. This is same format as SoundTrap click detection data.
+
+- *Individual* : Each detection is saved in it's own time stamped individual sound file.
+
+## After export
+Once data are exported, the exported files are not part of PAMGuard's data management system i.e. PAMGuard has no record they exist and they are not shown in the data model etc. If you export the same data again to the same location, then previous exported files may be overwritten without warning.
\ No newline at end of file
diff --git a/src/export/layoutFX/ExporterPane.java b/src/export/layoutFX/ExporterPane.java
index 5c923a61..c55534cf 100644
--- a/src/export/layoutFX/ExporterPane.java
+++ b/src/export/layoutFX/ExporterPane.java
@@ -1,6 +1,7 @@
package export.layoutFX;
import PamController.SettingsPane;
+import export.ExportParams;
import javafx.scene.Node;
import javafx.scene.control.Label;
import pamViewFX.fxNodes.PamBorderPane;
diff --git a/src/export/resources/PAMGuard_exporter_dialog.png b/src/export/resources/PAMGuard_exporter_dialog.png
new file mode 100644
index 00000000..8ce97115
Binary files /dev/null and b/src/export/resources/PAMGuard_exporter_dialog.png differ
diff --git a/src/export/resources/PAMGuard_exporter_dialog_annotated.png b/src/export/resources/PAMGuard_exporter_dialog_annotated.png
new file mode 100644
index 00000000..2a27c8af
Binary files /dev/null and b/src/export/resources/PAMGuard_exporter_dialog_annotated.png differ
diff --git a/src/export/resources/PAMGuard_exporter_dialog_annotated.pptx b/src/export/resources/PAMGuard_exporter_dialog_annotated.pptx
new file mode 100644
index 00000000..87c8d4b9
Binary files /dev/null and b/src/export/resources/PAMGuard_exporter_dialog_annotated.pptx differ
diff --git a/src/export/resources/PAMGuard_exporter_dialog_wav.png b/src/export/resources/PAMGuard_exporter_dialog_wav.png
new file mode 100644
index 00000000..72299302
Binary files /dev/null and b/src/export/resources/PAMGuard_exporter_dialog_wav.png differ
diff --git a/src/export/wavExport/WavFileExportManager.java b/src/export/wavExport/WavDetExport.java
similarity index 100%
rename from src/export/wavExport/WavFileExportManager.java
rename to src/export/wavExport/WavDetExport.java
diff --git a/src/export/wavExport/WavDetExportManager.java b/src/export/wavExport/WavDetExportManager.java
new file mode 100644
index 00000000..b6f8f9c3
--- /dev/null
+++ b/src/export/wavExport/WavDetExportManager.java
@@ -0,0 +1,252 @@
+package export.wavExport;
+
+import java.awt.Component;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.sound.sampled.AudioFormat;
+import javax.swing.filechooser.FileSystemView;
+
+import PamController.PamController;
+import PamDetection.RawDataUnit;
+import PamUtils.PamCalendar;
+import PamUtils.PamUtils;
+import PamView.paneloverlay.overlaymark.OverlayMark;
+import PamguardMVC.LoadObserver;
+import PamguardMVC.PamDataUnit;
+import PamguardMVC.PamObservable;
+import PamguardMVC.PamObserver;
+import PamguardMVC.PamObserverAdapter;
+import PamguardMVC.PamRawDataBlock;
+import PamguardMVC.RawDataHolder;
+import PamguardMVC.dataOffline.OfflineDataLoading;
+import dataMap.OfflineDataMapPoint;
+import detectiongrouplocaliser.DetectionGroupSummary;
+import export.PamDataUnitExporter;
+import javafx.scene.layout.Pane;
+import wavFiles.Wav16AudioFormat;
+import wavFiles.WavFileWriter;
+
+/**
+ * Writes data units and/or ordered raw data to a wav file. Has functions to
+ * handle .wav file writing based on overlay marks and detection groups with
+ * functions to make decisions based on what type of data unit is selected and
+ * whether raw data is available.
+ *
+ * There are two primary use cases;
+ * 1) Order raw data from an overlay mark and save as a wav file
+ * 2) Save a list of data units to wav files - either a single file with zero
+ * pads, a concatenated file or separate files.
+ *
+ * @author Jamie Macaulay
+ *
+ */
+public class WavDetExportManager implements PamDataUnitExporter {
+
+ /**
+ * Options for exporting wav files.
+ */
+ private WavExportOptions wavFileoptions = new WavExportOptions();
+
+ /**
+ * Settings panel for wav file exporting
+ */
+ private WavOptionsPanel wavOptionsPanel;
+
+ /**
+ * Exporter of wav files.
+ */
+ private WavDetExport wavDetExport = new WavDetExport();
+
+ private File currentFile;
+
+ public WavDetExportManager() {
+
+ }
+
+ @Override
+ public boolean hasCompatibleUnits(Class dataUnitType) {
+ // boolean implementsInterface = Arrays.stream(dataUnitType.getInterfaces()).anyMatch(i -> i == RawDataHolder.class);
+ if ( RawDataHolder.class.isAssignableFrom(dataUnitType)) return true;
+ return false;
+ }
+
+
+
+ @Override
+ public boolean exportData(File fileName,
+ List dataUnits, boolean append) {
+
+ if (fileName==null) return false;
+
+
+ if (this.currentFile==null || this.currentFile.compareTo(fileName)!=0) {
+ //we have a new .wav file to create.
+ if (fileName.exists()) {
+ //we need to delete it
+ System.out.println("PAMGuard export: wav file already existed and has been deleted: " + fileName.getName());
+ fileName.delete();
+ }
+ }
+
+ this.currentFile = fileName;
+
+
+ //make sure we have the latest options.
+ if (wavOptionsPanel!=null) {
+ //means the options panel has been opened.
+ wavFileoptions = wavOptionsPanel.getParams(wavFileoptions);
+ }
+
+ //should we zeropad?
+ //saveDataUnitWav(dataUnits);
+ switch (wavFileoptions.wavSaveChoice) {
+ case WavExportOptions.SAVEWAV_CONCAT:
+ wavDetExport.writeDataUnitWav(dataUnits, fileName, false);
+ break;
+ case WavExportOptions.SAVEWAV_INDIVIDUAL:
+ //here the filename will not be used but the parent folder will be used instead to write
+ //lots of wav files to.
+ wavDetExport.writeDataUnitWavs(dataUnits, fileName);
+ break;
+ case WavExportOptions.SAVEWAV_ZERO_PAD:
+ wavDetExport.writeDataUnitWav(dataUnits, fileName, true);
+ break;
+ }
+
+ return true;
+ }
+
+
+
+ @Override
+ public String getFileExtension() {
+ return "wav";
+ }
+
+
+
+ @Override
+ public String getIconString() {
+ return "mdi2f-file-music";
+ }
+
+
+
+ @Override
+ public String getName() {
+ return "raw sound";
+ }
+
+
+
+ @Override
+ public void close() {
+ // TODO Auto-generated method stub
+ }
+
+
+
+ @Override
+ public boolean isNeedsNewFile() {
+ return false;
+ }
+
+
+
+ @Override
+ public Component getOptionsPanel() {
+ if (this.wavOptionsPanel==null) {
+ this.wavOptionsPanel = new WavOptionsPanel();
+ }
+ wavOptionsPanel.setParams(this.wavFileoptions) ;
+ return wavOptionsPanel;
+ }
+
+
+
+ @Override
+ public Pane getOptionsPane() {
+ // TODO - make FX version of settings.
+ return null;
+ }
+
+ @Override
+ public void prepareExport() {
+ this.currentFile = null;
+
+ }
+
+
+
+
+
+ // hello(){
+ //
+ //
+ // if (mark==null) {
+ // start= foundDataUnits.getFirstTimeMillis();
+ // end= foundDataUnits.getLastTimeMillis();
+ // }
+ //
+ // File folder = new File(currentFolder);
+ //
+ // //save a .wav file clip.
+ // if (!folder.exists()){
+ // if (!folder.mkdir()){
+ // //TODO- warning message.
+ // return;
+ // }
+ // }
+ //
+ // String currentPath = PamCalendar.formatFileDateTime();
+ // //add data types to the filen,ae
+ // for (int i=0 ;i"
+ + "Concatonate detections within wav files. If selected, then the wav files are concatenated"
+ + "
"
+ + "and a seperate text file encodes the detection times - this saves a lot of storage space!"
+ + "