Guide to the iSPEX 2 app
===

This section describes how to use the iSPEX 2 app to collect image data, which is then used to derive aquatic reflectance. On opening the iSPEX 2 app the following options are available:

 1. **Positioning Guide**. This option selects a testing mode which tests for the correct alignment of the iSPEX device by the user.
 2. **iSPEX Water**. This option selects the measurement mode where sets of card, water and sky images are collected by the user.
 3. **Free Mode**. This option selects a mode where the user can visualise Red-Green-Bue spectral radiance curves from the image pixels.
 4. **Files**. This option selects a mode where previously collected files can be browsed or uploaded to cloud storage (Dropbox as default).

<img src= "https://mfr.de-1.osf.io/export?url=https://osf.io/download/52nvc/?direct%26mode=render&format=2400x2400.jpeg" width=30% />

*The main options screen in the ISPEX 2 app.*


(i) Positioning Guide
===

The physical positioner will help place the iSPEX correctly on your mobile phone camera. However, the Positioning Guide app mode should also be used to verify the correct placement before taking measurements.

The projection of light through iSPEX 2 results in a slit pattern toward the top of camera image, and a visible spectrum for each polarization mode toward the bottom of the image. In the Positioning Guide mode there are bounding boxes which are used to help align the device.


The iSPEX is placed correctly when:
1. The background is black across the whole image
2. The slit is visible in both sides (L+R) and not overexposed
3. The spectrum is visible on both sides and equally lit (L+R)
4. The slit and spectrum are positioned so that the vertical divider line is in the middle between them and the left and right sides of both the slit and the spectrum are aligned with it!
a. If you are unable to position the ispex perfectly centered this may not be a problem as we use a decent margin cutting out both sides of the spectrum. However, please check that the iSPEX tube is still properly positioned in front of the camera and hasn't become damaged. 
5. The spectrum is clearly but not brightly visible in the bottom part.

<img src="https://mfr.de-1.osf.io/export?url=https://osf.io/download/6gbez/?direct%26mode=render&format=2400x2400.jpeg" width=100% />
*An example of a correctly placed iSPEX unit is shown in the left panel. Examples of incorrectly placed units are shown in the centre and right panels, some of which illustrate the effects of overexposure.*

(ii) iSPEX Water
---
**Overview**. iSPEX Water is the main mode of the app and it is used to collect `Sets' of card, water, and sky images, which are then processed to derived aquatic reflectance. Collaborators should also refer to the measurement protocols section of the wiki: https://osf.io/357bk/wiki/Measurement%20protocols/ which describes the optics, whereas this section is intended as a practical guide to data collection using the app.

As part of the app development we are investigating what exposure settings are optimal. The iSPEX Water section of the app currently (September 2025) takes five exposures of each target (card, sky, water), resulting in 15 images per measurement set. The sequence of five exposures takes approximately 5 seconds for each target.


**Measurement sequence**.  In the iSPEX Water mode, the user takes card images, followed by water, then sky. On entering the iSPEX Water mode, the user will see the screen below which indicates that the app is ready for the user to take an image of the grey card.
<img src= "https://mfr.de-1.osf.io/export?url=https://osf.io/download/wrkxh/?direct%26mode=render&format=2400x2400.jpeg" width=30% />
*App screen ready to collect grey card data within azimuth and elevation tolerances*


The grey card image sequence is then initiated if the user clicks on the *Grey* button. A *Starting Grey* message then appears on the screen, and the sequence 5 of images of different exposure length is then taken, taking approximately 5 seconds. 

The app screen will then automatically proceed to having the Water button highlighted. A user then presses that button to initiate the water image sequence, with a similar on screen message appearing. Finally, the sky data is captured in a similar way and an on screen message appears at the end indicating that the measurement set has been save (see section (iv) for more details on he file structure). The app then reverts back to the grey card data collection screen again.


**Phone orientation during measurements**. Much of iSPEX Water mode screen is similar to the Positioning Guide: the top of the screen shows the slits whilst the bottom of the screen shows the spectra. In addition, the iSPEX Water mode screen contains *angular orientation guides* to help the user point the phone at the correct elevation and azimuth angles. 

The *elevation information* is displayed numerically as an offset angle between the target angle (40 degrees relative to the downwards or upwards vertical) and the true angle of the phone. Users should aim to have this elevation offset angle as close to zero as possible. To aid the user, the phone vibrates when it is within +/- 5 degrees of this target angle. 

The *azimuth information* is displayed graphically as a positioning bar containing the solar azimuth (red line), the optimium target aziumths (green lines, +/- 135 degrees relative to the solar azimuth), and the phone azimuth (white line). When taking images the user should select the green azimuth line which is aligned with (or closest to) their reference systems azimuth

Examples of water and sky images collected at target elevation and are azimuth are shown below.
<img src="https://mfr.de-1.osf.io/export?url=https://osf.io/download/khdrq/?direct%26mode=render&format=2400x2400.jpeg" width=30% />
<img src="https://mfr.de-1.osf.io/export?url=https://osf.io/download/s7cy3/?direct%26mode=render&format=2400x2400.jpeg" width=30% />
*App screen ready to collect water and sky data, within elevation and azimuth tolerances.*


(iii) Free mode
---

This option selects a mode where the user can visualise Red-Green-Bue spectral radiance curves from the image pixels.

(iv) Files
---
On opening the Files mode of the app there are two options: Browse and Export. The Browse option allows users to see the iSPEX 2 measurement sets that have been collected within the iSPEX Water
section of the app. The Export option allows users to upload iSPEX 2 measurement sets to cloud storage (Dropbox). 

**Measurement Sets**. Each set of 15 measurements (5 card, 5 water, 5 sky) has its own folder with name format: iSPEX_Set_YYYYMMDD_hhmm_UUID where Y is year, M is month, D is day, h is hour and m is minute. UUID is a 4-digit random identifier, which is automatically generated, and used to distinguish between measurements completed in the same minute and/or made by different phones at the same time. For example, iSPEX_Set_20250806_1055_9681 is data collected at 10:55 AM on 6th August 2025.

**Image files**. Each folder contains 15 image files (.DNG format), whose names contain the Set ID above, whether the image was card, water or sky (C, W, S), and the image exposure number (E0,E1,E2,E3, E4). For example, IMG_20250806_1055_9681_C_E0.DNG is a card image for the zeroth exposure setting belonging to the example set on 6th August.

**Metadata files**. Each folder contains 15 corresponding metadata files (.JSON format) which contains GPS (lat, lon, UTC time), phone orientation (azimuth and elevation angles), and phone settings (exposure and ISO). These files have similar names to the corresponding images files - e.g. META_20250806_1055_9681_C_E0.JSON, corresponds to the example above.

**Exporting Files**. 
When a user selects this option, they will be given a list of dates and times of iSPEX 2 measurement sets that have been collected (see screenshot below). To upload data, a measurement set should then be selected from this list.
<img src="https://mfr.de-1.osf.io/export?url=https://osf.io/download/3ra7b/?direct%26mode=render&format=2400x2400.jpeg" width=30% />


The Dropbox option should then be selected, which takes the user to the Dropbox upload screen (example below). iPSEX measurement sets can then be uploaded as a zip file. At present, (NOTE - TO BE FIXED?) multiple sets cannot be uploaded at once, so the user has to return to the previous menu to select each set in turn. 
<img src="https://mfr.de-1.osf.io/export?url=https://osf.io/download/uxbzk/?direct%26mode=render&format=2400x2400.jpeg" width=30% />


Once data is uploaded to Dropbox, the collaborator can then share the data with the rest of the project via the OSF File storage, as explained here:
https://osf.io/357bk/wiki/Sharing%20data%20through%20OSF/.




  [1]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dd315320522b29cc0db36f?mode=render
  [2]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dab2aea9eff0682ab8f75d?mode=render
  [3]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dd54b0b9696157d0d6c730?mode=render
  [4]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dd422f13e6a75bbbfd05f1?mode=render
  [5]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dd54359f71e8245ed6c76e?mode=render
  [6]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dd05a064075ebb360db335?mode=render
  [7]: https://files.osf.io/v1/resources/357bk/providers/osfstorage/68dd07a11cf56f1290aa5481?mode=render