lifewatch / pyhydrophone

Package to make it easier to read different hydrophones' output files
GNU General Public License v3.0
9 stars 3 forks source link

Add support for hydromoth #14

Open cparcerisas opened 1 year ago

cparcerisas commented 1 year ago

It would be nice to have support for the hydromoth hydrophone [https://doi.org/10.1002/rse2.249] maybe metamoth can be directly used? https://github.com/mbsantiago/metamoth

mbsantiago commented 11 months ago

Hi @cparcerisas!

I'm happy to work on implementing the HydroMoth class, but before diving in, I have a few questions regarding its functionalities and requirements.

Understanding of Hydrophone's Usage: My grasp of the Hydrophone class is that it serves three primary purposes:

  1. Store information about a specific hydrophone device, including make, model, and serial number.
  2. Extract the recording datetime from audio files, which is device-dependent, and optionally rename audio files to a standardized format using this datetime.
  3. Manage attributes related to the calibration of the device, along with providing calibration methods.

Comparison with MetaMoth: MetaMoth's primary goal is to extract metadata from AudioMoth files, particularly from the WAV header, containing information about the device (e.g., serial number and preamp gain). AudioMoth also uses the recording datetime to generate filenames, although these filenames may be altered for specific project requirements, and thus I believe it is safer to extract this info from the header.

Proposed Changes to HydroMoth: Considering these aspects, here are my proposed additions to the HydroMoth class:

  1. from_file Class Method: Introduce a class method called from_file to facilitate the creation of a HydroMoth instance by extracting device metadata (serial number and preamp gain) from the file.

  2. Default string_format: Set the default string_format attribute to the format used by AudioMoth. I believe this format to be consistent across different AudioMoth versions.

  3. get_file_datetime Method: Create a method named get_file_datetime to read the datetime from the WAV header instead of relying on the filename. Keeping it as a separate method ensures compatibility with other Hydrophones, allowing users to change the string_format during initialization to alter datetime extraction from the filename.

  4. Calibration Considerations: I'll avoid altering or implementing any calibration-related functionalities, as my familiarity with AudioMoth calibration is limited.

I'd appreciate your insights on these proposed changes. Do you foresee any potential impacts on downstream functionality? Additionally, is there anything crucial that I might have overlooked and should include in the implementation?

Looking forward to your thoughts on this matter!