API Reference

Contents

API Reference#

pyjams is a general Python package with a wide variety of miscellaneous utility functions. It is offering miscellaneous functions in different categories, such as reading different file formats, date conversion routines, or meteorological functions. It has several subpackages offering constants, special functions as well as objective functions to be used with scipy.optimize.fmin or scipy.optimize.curvefit, and much more.

The package has evolved from its predecessor the JAMS Python package mcuntz/jams_python

copyright:

Copyright 2021-2022 Matthias Cuntz, see AUTHORS.rst for details.

license:

MIT License, see LICENSE for details.

Subpackages#

air_humidity

Air humidity calculations

alpha_equ_h2o(temp[, isotope, undef, eps, ...])

Isotopic fractionation factors during liquid-water vapour equilibration.

alpha_kin_h2o([isotope, eps, greater1, ...])

Kinetic fractionation factors for molecular diffusion of water isotopologues.

argsort(a, *args, **kwargs)

Wrapper for numpy.argsort, numpy.ma.argsort, and sorted for Python iterables

gridcellarea(lat, lon[, globe, rearth])

Area of grid cells on a spherical Earth in square metre

closest(arr, num[, value])

Index in array which entry is closest to a given number.

color

Collection of color palettes and continuous color maps

const

Provides physical, mathematical, computational, isotope, and material constants, such as Pi = 3.141592653589793238462643383279502884197.

date2date(edate[, fr, format, timesep, full])

Convert date representations between different regional variants

class_datetime

Conversion of datetime formats

division(a, b[, otherwise, prec])

Divide two arrays, return otherwise if division by 0.

fgui

GUI dialogs to choose files and directories using Tkinter

fsread(infile[, nc, cname, snc, sname, ...])

Read numbers and strings from a file into 2D float and string arrays

functions

Provides a variety of special functions, including common test functions for parameter estimations such as Rosenbrock and Griewank, test functions for parameter sensitivity analysis such as the Ishigami and Homma function, several forms of the logistic function and its first and second derivatives, and a variety of other functions together with robust and square cost functions to use with the scipy.optimize package.

jams

JAMS Python Utilities

kernel_regression(x, y[, h, silverman, xout])

Multi-dimensional non-parametric kernel regression

mad(datin[, z, deriv, nozero, prepend, append])

Median absolute deviation test

mcplot

Standard plotting class of Matthias Cuntz.

means(date, dat[, year, month, day, hour, ...])

Calculate daily, monthly, yearly, etc.

morris_method

Morris' Method of Elementary Effects.

ncinfo(ncfile[, var, code, variables, ...])

Get information on variables in a netcdf file

ncio

netCDF4 functions to copy a netcdf file while doing some transformations on variables and dimensions.

ncread(ncfile[, var, code, squeeze, ...])

Gets variables of a netcdf file

npyio

Update arrays in a single file in numpy's npz format

pack(array, mask)

Mimics Fortran intrinsic pack (without optional vector)

position([row, col, num, left, right, ...])

Gives positions of subplots, to be used with add_axes instead of subplot

romanliterals

Convert integer to and from Roman numerals

sce(func, x0, lb[, ub, mask, args, kwargs, ...])

Shuffled Complex Evolution algorithm for finding the minimum of a multivariate function

screening(func, lb, ub, nt[, x0, mask, ...])

Parameter screening using Morris' method of Elementary Effects.

str2tex(strin[, space2linebreak, bold, ...])

Convert strings to LaTeX strings in math environment used by matplotlib's usetex

tee(*args, **kwargs)

Prints arguments on screen and in file, like Unix/Linux tee utility.

text2plot(handle, dx, dy, itext[, small, ...])

Write text on plot

History
  • Written Oct 2021 by Matthias Cuntz (mc (at) macu (dot) de)

  • v1.0, initial Github, PyPI, Zenodo commit, Oct 2021, Matthias Cuntz

  • v1.1, automatic versioning, zenodo defaults, Oct 2021, Matthias Cuntz

  • v1.2, added closest, Oct 2021, Matthias Cuntz

  • v1.3, added argsort, Oct 2021, Matthias Cuntz

  • v1.4, added division, Oct 2021, Matthias Cuntz

  • v1.5, added alpha_equ_h2o, Oct 2021, Matthias Cuntz

  • v1.6, added alpha_kin_h2o, Nov 2021, Matthias Cuntz

  • v1.7, added mcPlot, Nov 2021, Matthias Cuntz

  • v1.8, added str2tex and color, Nov 2021, Matthias Cuntz

  • v1.9, added position, Nov 2021, Matthias Cuntz

  • v1.10, added sron colors, Nov 2021, Matthias Cuntz

  • v1.11, added text2plot, abc2plot, signature2plot, Nov 2021, Matthias Cuntz

  • v1.12, added date2dec and all its wrappers, Dec 2021, Matthias Cuntz

  • v1.13, added fsread, fread, sread, Dec 2021, Matthias Cuntz

  • v1.14, added GUI dialogs to choose files and directories using Tkinter, Jan 2022, Matthias Cuntz

  • v1.15, added esat, Jan 2022, Matthias Cuntz

  • v1.16, added mad, Jan 2022, Matthias Cuntz

  • v1.17, added xread, xlsread, and xlsxread, Jan 2022, Matthias Cuntz

  • v1.18, helper module to preserve input types, Mar 2022, Matthias Cuntz

  • v1.19, added readnetcdf, Mar 2022, Matthias Cuntz

  • v1.20, added gridcellarea and kernel_regression, Apr 2022, Matthias Cuntz

  • v1.21, enhancements in color and kernel_regression, Apr 2022, Matthias Cuntz

  • v1.22, added ncio, May 2022, Matthias Cuntz

  • v1.23, added datetime module, Jun 2022, Matthias Cuntz

  • v1.24, moved docu to Github Pages, Jun 2022, Matthias Cuntz

  • v1.25, Microseconds and negative years in date2date and datetime, Jun 2022, Matthias Cuntz

  • v1.26, added means, Jul 2022, Matthias Cuntz

  • v1.27, added sce, Dec 2022, Matthias Cuntz

  • v1.28, added updatez, Jan 2023, Matthias Cuntz

  • v1.29, added functions for converting humidity in air, Jan 2023, Matthias Cuntz

  • v1.30, hvplot in mcplot, May 2023, Matthias Cuntz

  • v1.31, added pack and unpack, Jun 2023, Matthias Cuntz

  • v1.32, added jams, Jun 2023, Matthias Cuntz

  • v1.33, start supporting pandas Series and DataFrames, Jul 2023, Matthias Cuntz

  • v2.0, full pandas support, Sep 2023, Matthias Cuntz

  • v2.1, ncread and ncinfo in individual files, Nov 2023, Matthias Cuntz

  • v2.2, enhancements of plotting routines, ncio, fsread, and datetime, Aug 2024, Matthias Cuntz