Skip to main content

A positive degree day model for glacier surface mass balance

Project description

https://img.shields.io/pypi/v/pypdd.svg https://img.shields.io/pypi/l/pypdd.svg https://zenodo.org/badge/8483394.svg

A Python positive degree day model for glacier surface mass balance.

This module provides a simple model to compute accumulation and melt on a glacier using near-surface air temperature and precipitation time series. The model assumes that melt is proportional to the number of positive degree-days, which corresponds to the integral of temperature above 0°C. Temperature variability is included by assuming a normal temperature distribution around the mean. The model optionally includes refreezing of melted snow and ice at the glacier surface.

PyPDD can be used as a module within Python to operate on Numpy arrays. In addition, it reads and writes netCDF files directly from the command line, and provides a raster module for GRASS GIS. The PDD model is based on an algorithm that was initially developed for the Parallel Ice Sheet Model and adopted here with very few changes.

Installation:

pip install pypdd

The PDDModel class

Requires: NumPy, SciPy.

A PDD model instance can be created by:

from pypdd import PDDModel
pdd = PDDModel()

Several model parameters can be set at initialization. See help(PDDModel) for a list. Provided two arrays temp and prec of shape (t, x, y) containing temperature and precipitation data, the PDD model can be called with:

pdd(temp, prec)

This will return a dictionary containing a number of two- and three-dimensional arrays, including the number of positive degree day 'pdd' and total surface mass balance 'smb'. Temperature variability can be included in a third array stdv containing temperature standard deviation values:

pdd(temp, prec, stdv)

If any of temp, prec, or stdv has shape (x, y), it will be interpreted as constant in time and expanded along the time dimension. Floats with be interpreted as constant in time and space and expanded along all dimensions.

NetCDF interface

Requires: netCDF4-Python.

The PDDModel class holds a netCDF operator, which can be called by:

pdd.nco('input.nc', 'output.nc')

The file 'input.nc' should contain temperatures and precipitation in variables 'temp' and 'prec'. The calculated number of positive degree days and total surface mass balance are stored in variables 'pdd' and 'smb' of 'output.nc'. Keyword argument output_size or output_variables can be used to produce more output.

The netCDF interface can be used directly from the command line by executing the module as a script:

python pypdd.py -i 'input.nc' -o 'output.nc'

If no input file is provided, an artificial climate will be generated under atm.nc and used by the model. By default, output is saved as smb.nc. Many more command-line options are available. For an overview type:

python pypdd.py --help

GRASS GIS interface

Requires: GRASS GIS.

PyPDD can also operate on GRASS raster maps using the attached module r.pdd. Temperature, precipitation and standard deviation maps should be provided as comma-separated lists:

r.pdd.py temp=list,of,temp,maps prec=list,of,prec,maps pdd=pdd_map smb=smb_map

All time-independent PyPDD output variables can currently be exported as raster maps. Alike any other GRASS module, a graphical prompt can be invoked by calling r.pdd without arguments, and a list of options can be obtained with:

r.pdd.py --help

References

Applications of PyPDD:

  • N. Gandy, L. J. Gregoire, J. C. Ely, C. D. Clark, D. M. Hodgson, V. Lee, T. Bradwell, and R. F. Ivanovic. Marine ice sheet instability and ice shelf buttressing of the Minch Ice Stream, northwest Scotland. The Cryosphere, 12(11):3635–3651, https://doi.org/10.5194/tc-12-3635-2018, 2018.

  • A. Plach, K. H. Nisancioglu, S. Le clec’h, A. Born, P. M. Langebroek, C. Guo, M. Imhof, and T. F. Stocker. Eemian Greenland SMB strongly sensitive to model choice. Clim. Past, 14:1463–1485, https://doi.org/10.5194/cp-14-1463-2018, 2018.

  • J. Seguinot. Spatial and seasonal effects of temperature variability in a positive degree-day glacier surface mass-balance model. J. Glaciol., 59(218):1202–1204, http://doi.org/10.3189/2013JoG13J081, 2013.

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

pypdd-0.3.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

pypdd-0.3.1-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file pypdd-0.3.1.tar.gz.

File metadata

  • Download URL: pypdd-0.3.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for pypdd-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a12f3b7cab7d3190c5f9ae72333f6e4402ba9b0d885e6efaf2a512c287da06c0
MD5 a9b8bcbbad33779a2ad839b9e5f2ab3f
BLAKE2b-256 f6836f3c86c30f75d2201a2284bb45b0e7530b0d62c8d65925d2738f86a0a83c

See more details on using hashes here.

File details

Details for the file pypdd-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pypdd-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for pypdd-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61c00f0bd383e715df9e981a877973bc532218b854d0a1488af940e376058690
MD5 23cb8930a4427febf9b8b60250ac0766
BLAKE2b-256 878dc889c703010ddc6b2832ebfffc012db2a1d05c73dadf74ca2a488a5df171

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