Skip to main content

A package for processing data from the Autonomous phase-sensitive Radio-Echo Sounder (ApRES) using xarray.

Project description

xapres

A package for processing data from the Autonomous phase-sensitive Radio-Echo Sounder (ApRES) using xarray. The core ApRES processing code is adapted from code written by Keith Nicholls, British Antarctic Survey, UK. This package uses Keith's code to process the raw ApRES data from ApRES surveys. It then restructures the data into a convenient format using xarray. This simplifies the challenge of dealing with multiple attenuator and gain settings, makes stacking a straight-forward xarray operation, and allows us to store the large datasets in efficient zarr format in cloud storage.

The structure of the resulting xarray depends on if the ApRES data were collected in attended or unattended mode.

Installation

pip install xapres

Usage

See the notebooks/guides directory for examples of how to use both the core processing code and how to restructure the resulting profiles and chirps into an xarray.

The most useful guide is notebooks/guides/UsingXaPRES.ipynb.

The package includes the capability to write data to zarr stores, which can be accessed efficiently without immediately loading all the data to disk. This is particularly useful when performing analysis in the cloud, but can be useful when inspecting the data locally too.

For example, to lazily access (meaning that no data is downloaded immediately) some recent ApRES data from Greenland, use:

import xarray as xr
def reload(site):
    filename = f'gs://ldeo-glaciology/apres/greenland/2022/single_zarrs_noencode/{site}'
    ds = xr.open_dataset(filename,
        engine='zarr', 
        chunks={}) 
    return ds
A101 = reload("A101")
A103 = reload("A103")
A104 = reload("A104")

Alternatively, you can use a function built-in to the package which loads these data, and also adds some functionality to the xarray it returns:

import xapres as xa
ds = xa.load.load_zarr(site="A101")
ds

The dataset ds containing various variables, include the complex depth profile. You can compute decibels from complex depth profiles using

ds.profile.dB().compute()

You can also sonify the chirp. Because the frequencies contained in the chirps largely in the audible range, you can play them through the computer's speakers and hear what the ApRES data sound like:

ds.chirp.isel(time=300, chirp_num=0, attenuator_setting_pair=0).sonify()

This plays the chirp and if you set save = True as an input it will save the audio file as a .wav file.

Contributions to this project are very welcome! Please feel free to contact us through github issues.


Project based on the cookiecutter science project template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xapres-0.2.1.tar.gz (102.9 MB view details)

Uploaded Source

Built Distribution

xapres-0.2.1-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file xapres-0.2.1.tar.gz.

File metadata

  • Download URL: xapres-0.2.1.tar.gz
  • Upload date:
  • Size: 102.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for xapres-0.2.1.tar.gz
Algorithm Hash digest
SHA256 955719d8a68fa741430c191aed341537d44005e53dc31b0bf26798cf2aba9eeb
MD5 002634164241a2a690503f079bf6e3e6
BLAKE2b-256 6aab8f42d9a88485fbdfc4d615c2042e8c9efbbcf3014fe5bd289e0a58a2850b

See more details on using hashes here.

File details

Details for the file xapres-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: xapres-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for xapres-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 887001611fdcc659303b30d34713ebf4a49aa8845122a52a29aee3c4cedb9288
MD5 78fb865c5d444e8e8f8b436a6e2ee63f
BLAKE2b-256 addc6335dc6c37650ce2b67ba3f7a50e25c09f861d4756683be1aa9f4bf23de6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page