Quickstart#
A general Python package with a wide variety of miscellaneous utility functions.
About pyjams#
pyjams
is a general Python package offering a wide variety of
miscellaneous functions in different categories, such as reading
different file formats, date conversion routines, or meteorology. It
has several subpackages offering constants, special functions, or
objective functions to be used with mod:scipy.optimize.
The package modernises and makes available routines of the JAMS Python library, which was created 2009 by Matthias Cuntz while at the Department of Computational Hydrosystems, Helmholtz Centre for Environmental Research - UFZ, Leipzig, Germany, and continued while at Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement (INRAE), Nancy, France.
The complete documentation of pyjams
is available at:
Installation#
The easiest way to install is via pip:
pip install pyjams
or via conda:
conda install -c conda-forge pyjams
- Requirements
Content#
- Modules and functions are currently provided in the following categories:
Functions and modules (alphabetical)#
Function/module |
Short description |
---|---|
Deprecated, moved to package mcplot. Write a, B, iii), … on a plot |
|
Equilibrium fractionation between liquid water and vapour |
|
Kinetic fractionation of molecular diffusion of water vapour |
|
Wrapper for numpy.argmax, numpy.ma.argmax, and max for Python iterables |
|
Wrapper for numpy.argmin, numpy.ma.argmin, and min for Python iterables |
|
Wrapper for numpy.argsort, numpy.ma.argsort, and sorted for Python iterables |
|
Index in array which entry is closest to a given number |
|
Deprecated, moved to package mcplot. Collection of color palettes and continuous color maps |
|
Physical, mathematical, computational, isotope, and material constants |
|
Convert date representations between different regional variants |
|
Return numeric time values given datetime objects or strings, same as date2num |
|
Convert date strings to English date format YYYY-MM-DD hh:mm:ss |
|
Convert date strings to French date format DD/MM/YYYY hh:mm:ss |
|
Return numeric time values given datetime objects or strings |
|
Convert date strings to American date format MM/DD/YYYY hh:mm:ss |
|
Class as cftime.datetime for non-CF-conform calendars |
|
Return datetime objects given numeric time values, same as num2date |
|
Open dialog to select one directory |
|
Open dialog to select several directories |
|
Divide two arrays, return ‘otherwise’ if division by 0 |
|
Divide two arrays, return ‘otherwise’ if division by 0, same as division |
|
Mixing ratio from partial pressure of water vapour and total pressure |
|
Relative humidity from partial pressure of water vapour and temperature |
|
Specific humidity from partial pressure of water vapour and total pressure |
|
Air vapour pressure deficit from partial pressure and temperature |
|
Deprecated, moved to package pyeee. Parameter screening using Morris’ method of Elementary Effects, same as screening |
|
Deprecated, moved to package pyeee. Morris measures mu, stddev and mu* |
|
Convert date strings to standard date format DD.MM.YYYY hh:mm:ss |
|
Convert date strings to French date format DD/MM/YYYY hh:mm:ss |
|
Convert date strings to American date format MM/DD/YYYY hh:mm:ss |
|
Saturation vapour pressure over water and ice |
|
Convert French date strings to standard date format DD.MM.YYYY hh:mm:ss |
|
Convert French date strings to English date format YYYY-MM-DD hh:mm:ss |
|
Convert French date strings to American date format MM/DD/YYYY hh:mm:ss |
|
Open dialog to select one file |
|
Open dialog to select one or several files |
|
Read numbers from a file into 2D float array |
|
Read numbers and strings from a file into 2D float and string arrays |
|
Special functions for testing optimisations, sensitivity
analysis, several forms of the logistic function and its
derivatives, and other functions to be used with
|
|
Area of grid cells on Earth |
|
Deprecated, moved to package ncio. Extract information from
netCDF file, same as |
|
Integer to Roman numeral conversion |
|
Multi-dimensional non-parametric kernel regression |
|
Determination of bandwidth for kernel regression |
|
Median absolute deviation test |
|
Deprecated, moved to package mcplot. Matthias Cuntz’ standard plotting class |
|
Calculate daily, monthly, yearly, etc. means of data |
|
Deprecated, moved to package pyeee. Sampling of optimised trajectories for Morris measures / Elementary Effects |
|
Partial pressure of water vapour from mixing ratio and total pressure |
|
Deprecated, moved to package ncio. Extract information from netCDF file |
|
Deprecated, moved to package ncio. netCDF4 functions to copy a netcdf file while doing some transformations on variables and dimensions |
|
Deprecated, moved to package ncio. Read variables from netCDF file |
|
Return datetime objects given numeric time values |
|
Pack array with mask like Fortran intrinsic pack |
|
Deprecated, moved to package mcplot. Position arrays of subplots to be used with add_axes |
|
Deprecated, moved to package ncio. Read variables from netCDF file, same as ncread |
|
Partial pressure of water vapour from relative humidity and temperature |
|
Air vapour pressure deficit from relative humidity and temperature |
|
Roman numeral to integer conversion |
|
Shuffled-Complex-Evolution algorithm for function min(max)imisation |
|
Deprecated, moved to package pyeee. Parameter screening using Morris’ method of Elementary Effects |
|
Partial pressure of water vapour from specific humidity and total pressure |
|
Deprecated, moved to package mcplot. Write a copyright notice on a plot |
|
Read strings from a file into 2D string array |
|
Deprecated, moved to package mcplot. Convert strings to LaTeX strings in math environment used by matplotlib’s usetex |
|
Prints arguments on screen and in file, like Unix/Linux tee utility |
|
Deprecated, moved to package mcplot. Write text on a plot |
|
Unpack array using mask like Fortran intrinsic unpack |
|
Update arrays in uncompressed numpy .npz format |
|
Update arrays in compressed numpy .npz format |
|
Convert date strings to standard date format DD.MM.YYYY hh:mm:ss |
|
Convert date strings to English date format YYYY-MM-DD hh:mm:ss |
|
Convert date strings to French date format DD/MM/YYYY hh:mm:ss |
|
Partial pressure of water vapour from air vapour pressure deficit and temperature |
|
Relative humidity from air vapour pressure deficit and temperature |
|
Read numbers and strings from Excel file into 2D float and string arrays, same as xread |
|
Read numbers and strings from Excel file into 2D float and string arrays, same as xread |
|
Read numbers and strings from Excel file into 2D float and string arrays |
Functions and modules per category#
- Array Manipulation
Function/module
Short description
Wrapper for numpy.argmax, numpy.ma.argmax, and max for Python iterables
Wrapper for numpy.argmin, numpy.ma.argmin, and min for Python iterables
Wrapper for numpy.argsort, numpy.ma.argsort, and sorted for Python iterables
Index in array which entry is closest to a given number
Pack array with mask like Fortran intrinsic pack
Unpack array using mask like Fortran intrinsic unpack
- Ascii Files
- Data Processing
Function/module
Short description
Multi-dimensional non-parametric kernel regression
Determination of bandwidth for kernel regression
Median absolute deviation test
Calculate daily, monthly, yearly, etc. means of data
- Date and Time
Function/module
Short description
Convert date representations between different regional variants
Return numeric time values given datetime objects or strings, same as date2num
Convert date strings to English date format YYYY-MM-DD hh:mm:ss
Convert date strings to French date format DD/MM/YYYY hh:mm:ss
Return numeric time values given datetime objects or strings
Convert date strings to American date format MM/DD/YYYY hh:mm:ss
Class as cftime.datetime for non-CF-conform calendars
Return datetime objects given numeric time values, same as num2date
Convert date strings to standard date format DD.MM.YYYY hh:mm:ss
Convert date strings to French date format DD/MM/YYYY hh:mm:ss
Convert date strings to American date format MM/DD/YYYY hh:mm:ss
Convert French date strings to standard date format DD.MM.YYYY hh:mm:ss
Convert French date strings to English date format YYYY-MM-DD hh:mm:ss
Convert French date strings to American date format MM/DD/YYYY hh:mm:ss
Convert date strings to standard date format DD.MM.YYYY hh:mm:ss
Convert date strings to English date format YYYY-MM-DD hh:mm:ss
Convert date strings to French date format DD/MM/YYYY hh:mm:ss
Return datetime objects given numeric time values
- Grids and Polygons
Function/module
Short description
Area of grid cells on Earth
- Isotopes
Function/module
Short description
Equilibrium fractionation between liquid water and vapour
Kinetic fractionation of molecular diffusion of water vapour
- Math
Function/module
Short description
Divide two arrays, return ‘otherwise’ if division by 0
Divide two arrays, return ‘otherwise’ if division by 0, same as division
Deprecated, moved to package pyeee. Parameter screening using Morris’ method of Elementary Effects, same as screening
Deprecated, moved to package pyeee. Morris measures mu, stddev and mu*
Special functions for testing optimisations, sensitivity analysis, several forms of the logistic function and its derivatives, and other functions to be used with
scipy.optimize
Deprecated, moved to package pyeee. Sampling of optimised trajectories for Morris measures / Elementary Effects
Shuffled-Complex-Evolution algorithm for function min(max)imisation
Deprecated, moved to package pyeee. Parameter screening using Morris’ method of Elementary Effects
- Meteorology
Function/module
Short description
Mixing ratio from partial pressure of water vapour and total pressure
Relative humidity from partial pressure of water vapour and temperature
Specific humidity from partial pressure of water vapour and total pressure
Air vapour pressure deficit from partial pressure and temperature
Saturation vapour pressure over water and ice
Partial pressure of water vapour from mixing ratio and total pressure
Partial pressure of water vapour from relative humidity and temperature
Air vapour pressure deficit from relative humidity and temperature
Partial pressure of water vapour from specific humidity and total pressure
Partial pressure of water vapour from air vapour pressure deficit and temperature
Relative humidity from air vapour pressure deficit and temperature
- Miscellaneous
Function/module
Short description
Physical, mathematical, computational, isotope, and material constants
Open dialog to select one directory
Open dialog to select several directories
Open dialog to select one file
Open dialog to select one or several files
Integer to Roman numeral conversion
Roman numeral to integer conversion
Prints arguments on screen and in file, like Unix/Linux tee utility
- Plotting
Function/module
Short description
Deprecated, moved to package mcplot. Write a, B, iii), … on a plot
Deprecated, moved to package mcplot. Collection of color palettes and continuous color maps
Integer to Roman numeral conversion
Deprecated, moved to package mcplot. Matthias Cuntz’ standard plotting class
Deprecated, moved to package mcplot. Position arrays of subplots to be used with add_axes
Roman numeral to integer conversion
Deprecated, moved to package mcplot. Write a copyright notice on a plot
Deprecated, moved to package mcplot. Convert strings to LaTeX strings in math environment used by matplotlib’s usetex
Deprecated, moved to package mcplot. Write text on a plot
- Special Files
Function/module
Short description
Deprecated, moved to package ncio. Extract information from netCDF file, same as ncinfo
Deprecated, moved to package ncio. Extract information from netCDF file
Deprecated, moved to package ncio. netCDF4 functions to copy a netcdf file while doing some transformations on variables and dimensions
Deprecated, moved to package ncio. Read variables from netCDF file
Deprecated, moved to package ncio. Read variables from netCDF file, same as ncread
Update arrays in uncompressed numpy .npz format
Update arrays in compressed numpy .npz format
Read numbers and strings from Excel file into 2D float and string arrays, same as xread
Read numbers and strings from Excel file into 2D float and string arrays, same as xread
Read numbers and strings from Excel file into 2D float and string arrays
License#
pyjams
is distributed under the MIT License. See the LICENSE file
for details.
Copyright (c) 2012- Matthias Cuntz, Juliane Mai, Stephan Thober, and Arndt Piayda
The project structure of pyjams
has borrowed heavily from
welltestpy by Sebastian Müller.