HydrophoneDownloader¶
User-facing downloader for ONC hydrophone data.
This class bundles the most common workflows: - Range downloads for spectrograms and audio - Sampling and event-based downloads - JSON/CSV request files - Custom spectrogram generation
Initialize the downloader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ONC_token
|
ONC API token. |
required | |
parent_dir
|
Root directory for downloads. |
required | |
use_logging
|
bool
|
If True, use module logger; otherwise print to stdout. |
True
|
spectral_downsample
|
int
|
Default HSD downsample setting (0=full, 1=1‑min, 2=plotRes). |
2
|
**kwargs
|
Reserved for future options. |
{}
|
_cache_timestamp = None
instance-attribute
¶
_deployment_cache = None
instance-attribute
¶
_onc_token = ONC_token
instance-attribute
¶
_path_lock = Lock()
instance-attribute
¶
audio_path = os.path.join(self.parent_dir, 'audio', '')
instance-attribute
¶
deployment_checker = DeploymentChecker(self._onc_token)
instance-attribute
¶
flac_path = self.audio_path
instance-attribute
¶
input_path = self.spectrogram_path
instance-attribute
¶
logger = logger if use_logging else PrintLogger()
instance-attribute
¶
max_workers = 4
instance-attribute
¶
onc = hd.ONC(ONC_token)
instance-attribute
¶
parent_dir = parent_dir
instance-attribute
¶
request_manager = ONCRequestManager(ONC_token, parent_dir, self.logger, spectral_downsample=spectral_downsample, spectrogram_concatenation='None')
instance-attribute
¶
spectral_downsample = spectral_downsample
instance-attribute
¶
spectrogram_path = os.path.join(self.parent_dir, 'onc_spectrograms', '')
instance-attribute
¶
set_spectral_downsample(value)
¶
Override default downsample option (0=fullRes, 1=one-minute, 2=plotRes, etc.).