Package: pyjams
A general Python package with a wide variety of miscellaneous utility functions.About pyjamspyjamsis a general Python package offering a wide variety of miscellaneous
functions in different categories, such as reading different file formats, date
conversion routines, or calculating Elementary Effects. It has several
subpackages offering constants, special functions, or objective functions to be
used with scipy.optimize.The package modernises and makes available routines of theJAMS 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 ofpyjamsis available at:https://mcuntz.github.io/pyjams/InstallationThe easiest way to install is viapip:pipinstallpyjamsor viaconda:condainstall-cconda-forgepyjamsRequirementsnumpyscipymatplotlibcftimenetCDF4openpyxlschwimmbadContentModules and functions are currently provided in the following categories:Array ManipulationAscii FilesData ProcessingDate and TimeGrids and PolygonsIsotopesMathMeteorologyMiscellaneousPlottingSpecial FilesFunctions and modules (alphabetical)Function/moduleShort descriptionabc2plotWrite a, B, iii), … on a plotalpha_equ_h2oEquilibrium fractionation between liquid water and vapouralpha_kin_h2oKinetic fractionation of molecular diffusion of water vapourargmaxWrapper for numpy.argmax, numpy.ma.argmax, and max for Python iterablesargminWrapper for numpy.argmin, numpy.ma.argmin, and min for Python iterablesargsortWrapper for numpy.argsort, numpy.ma.argsort, and sorted for Python
iterablesclosestIndex in array which entry is closest to a given numbercolorCollection of color palettes and continuous color mapsconstPhysical, mathematical, computational, isotope, and material constantsdate2dateConvert date representations between different regional variantsdate2decReturn numeric time values given datetime objects or strings,
same asdate2numdate2enConvert dates to English date format YYYY-MM-DD hh:mm:ssdate2frConvert dates to French date format DD/MM/YYYY hh:mm:ssdate2numReturn numeric time values given datetime objects or stringsdate2usConvert dates to American date format MM/DD/YYYY hh:mm:ssdatetimeClass as cftime.datetime for non-CF-conform calendarsdec2dateReturn datetime objects given numeric time values, same asnum2datedirectories_from_guiOpen dialog to select one directorydirectory_from_guiOpen dialog to select several directoriesdivisionDivide two arrays, return ‘otherwise’ if division by 0divDivide two arrays, return ‘otherwise’ if division by 0,
same asdivisioneair2mrairMixing ratio from partial pressure of water vapour and total pressureeair2rhairRelative humidity from partial pressure of water vapour and temperatureeair2shairSpecific humidity from partial pressure of water vapour and total pressureeair2vpdAir vapour pressure deficit from partial pressure and temperatureeeParameter screening using Morris’ method of Elementary Effects,
same asscreeningelementary_effectsMorris measures mu, stddev and mu*en2dateConvert dates to standard date format DD.MM.YYYY hh:mm:ssen2frConvert dates to French date format DD/MM/YYYY hh:mm:ssen2usConvert dates to American date format MM/DD/YYYY hh:mm:ssesatSaturation vapour pressure over water and icefile_from_guiOpen dialog to select one filefiles_from_guiOpen dialog to select one or several filesfr2dateConvert French dates to standard date format DD.MM.YYYY hh:mm:ssfr2enConvert French dates to English date format YYYY-MM-DD hh:mm:ssfr2usConvert French dates to American date format MM/DD/YYYY hh:mm:ssfreadRead numbers from a file into 2D float arrayfsreadRead numbers and strings from a file into 2D float and string arraysfunctionsSpecial functions for testing optimisations, sensitivity analysis,
several forms of the logistic function and its derivatives, and other
functions to be used with scipy.optimizegridcellareaArea of grid cells on EarthinfonetcdfExtract information from netCDF file, same asncinfoint2romanInteger to Roman numeral conversionkernel_regressionMulti-dimensional non-parametric kernel regressionkernel_regression_hDetermination of bandwidth for kernel regressionmadMedian absolute deviation testmcPlotMatthias Cuntz’ standard plotting classmeansCalculate daily, monthly, yearly, etc. means of datamorris_samplingSampling of optimised trajectories for Morris measures / Elementary
Effectsmrair2eairPartial pressure of water vapour from mixing ratio and total pressurencinfoExtract information from netCDF filencionetCDF4 functions to copy a netcdf file while doing some
transformations on variables and dimensionsncreadRead variables from netCDF filenum2dateReturn datetime objects given numeric time valuespackPack array with mask like Fortran intrinsic packpositionPosition arrays of subplots to be used with add_axesreadnetcdfRead variables from netCDF file, same asncreadrhair2eairPartial pressure of water vapour from relative humidity and temperaturerhair2vpdAir vapour pressure deficit from relative humidity and temperatureroman2intRoman numeral to integer conversionsceShuffled-Complex-Evolution algorithm for function min(max)imisationscreeningParameter screening using Morris’ method of Elementary Effectsshair2eairPartial pressure of water vapour from specific humidity and total pressuresignature2plotWrite a copyright notice on a plotsreadRead strings from a file into 2D string arraystr2texConvert strings to LaTeX strings in math environment used by matplotlib’s
usetexteePrints arguments on screen and in file, like Unix/Linux tee utilitytext2plotWrite text on a plotunpackUnpack array using mask like Fortran intrinsic unpackupdatezUpdate arrays in uncompressed numpy .npz formatupdatez_compressedUpdate arrays in compressed numpy .npz formatus2dateConvert dates to standard date format DD.MM.YYYY hh:mm:ssus2enConvert dates to English date format YYYY-MM-DD hh:mm:ssus2frConvert dates to French date format DD/MM/YYYY hh:mm:ssvpd2eairPartial pressure of water vapour from air vapour pressure deficit and temperaturevpd2rhairRelative humidity from air vapour pressure deficit and temperaturexlsreadRead numbers and strings from Excel file into 2D float and string arrays,
same asxreadxlsxreadRead numbers and strings from Excel file into 2D float and string arrays,
same asxreadxreadRead numbers and strings from Excel file into 2D float and string arraysFunctions and modules per categoryArray ManipulationFunction/moduleShort descriptionargmaxWrapper for numpy.argmax, numpy.ma.argmax, and max for Python
iterables.argminWrapper for numpy.argmin, numpy.ma.argmin, and min for Python
iterables.argsortWrapper for numpy.argsort, numpy.ma.argsort, and sorted for
Python iterables.closestIndex in array which entry is closest to a given number.packPack array with mask like Fortran intrinsic packunpackUnpack array using mask like Fortran intrinsic unpackAscii FilesFunction/moduleShort descriptionfreadRead numbers from a file into 2D float arrayfsreadRead numbers and strings from a file into 2D float and string arrayssreadRead strings from a file into 2D string arrayData ProcessingFunction/moduleShort descriptionkernel_regressionMulti-dimensional non-parametric kernel regressionkernel_regression_hDetermination of bandwidth for kernel regressionmadMedian absolute deviation testmeansCalculate daily, monthly, yearly, etc. means of dataDate and TimeFunction/moduleShort descriptiondate2dateConvert date representations between different regional variantsdate2decReturn numeric time values given datetime objects or strings,
same asdate2numdate2enConvert dates to English date format YYYY-MM-DD hh:mm:ssdate2frConvert dates to French date format DD/MM/YYYY hh:mm:ssdate2numReturn numeric time values given datetime objects or stringsdate2usConvert dates to American date format MM/DD/YYYY hh:mm:ssdatetimeClass as cftime.datetime for non-CF-conform calendarsdec2dateReturn datetime objects given numeric time values,
same asnum2dateen2dateConvert dates to standard date format DD.MM.YYYY hh:mm:ssen2frConvert dates to French date format DD/MM/YYYY hh:mm:ssen2usConvert dates to American date format MM/DD/YYYY hh:mm:ssfr2dateConvert French dates to standard date format DD.MM.YYYY hh:mm:ssfr2enConvert French dates to English date format YYYY-MM-DD hh:mm:ssfr2usConvert French dates to American date format MM/DD/YYYY hh:mm:ssnum2dateReturn datetime objects given numeric time valuesus2dateConvert dates to standard date format DD.MM.YYYY hh:mm:ssus2enConvert dates to English date format YYYY-MM-DD hh:mm:ssus2frConvert dates to French date format DD/MM/YYYY hh:mm:ssGrids and PolygonsFunction/moduleShort descriptiongridcellareaArea of grid cells on EarthIsotopesFunction/moduleShort descriptionalpha_equ_h2oEquilibrium fractionation between liquid water and vapouralpha_kin_h2oKinetic fractionation of molecular diffusion of water vapourMathFunction/moduleShort descriptiondivisionDivide two arrays, return ‘otherwise’ if division by 0divDivide two arrays, return ‘otherwise’ if division by 0,
same asdivisioneeParameter screening using Morris’ method of Elementary Effects,
same asscreeningelementary_effectsMorris measures mu, stddev and mu*functionsSpecial functions for testing optimisations, sensitivity analysis,
several forms of the logistic function and its derivatives, and other
functions to be used with scipy.optimizemorris_samplingSampling of optimised trajectories for Morris measures / Elementary
EffectssceShuffled-Complex-Evolution algorithm for function min(max)imisationscreeningParameter screening using Morris’ method of Elementary EffectsMeteorologyFunction/moduleShort descriptioneair2mrairMixing ratio from partial pressure of water vapour and total pressureeair2rhairRelative humidity from partial pressure of water vapour and temperatureeair2shairSpecific humidity from partial pressure of water vapour and total pressureeair2vpdAir vapour pressure deficit from partial pressure and temperatureesatSaturation vapour pressure over water and icemrair2eairPartial pressure of water vapour from mixing ratio and total pressurerhair2eairPartial pressure of water vapour from relative humidity and temperaturerhair2vpdAir vapour pressure deficit from relative humidity and temperatureshair2eairPartial pressure of water vapour from specific humidity and total pressurevpd2eairPartial pressure of water vapour from air vapour pressure deficit and temperaturevpd2rhairRelative humidity from air vapour pressure deficit and temperatureMiscellaneousFunction/moduleShort descriptionconstPhysical, mathematical, computational, isotope, and material
constantsdirectories_from_guiOpen dialog to select one directorydirectory_from_guiOpen dialog to select several directoriesfile_from_guiOpen dialog to select one filefiles_from_guiOpen dialog to select one or several filesint2romanInteger to Roman numeral conversionroman2intRoman numeral to integer conversionteePrints arguments on screen and in file, like Unix/Linux tee utilityPlottingFunction/moduleShort descriptionabc2plotWrite a, B, iii), … on a plotcolorCollection of color palettes and continuous color mapsint2romanInteger to Roman numeral conversionmcPlotMatthias Cuntz’ standard plotting classpositionPosition arrays of subplots to be used with add_axesroman2intRoman numeral to integer conversionsignature2plotWrite a copyright notice on a plotstr2texConvert strings to LaTeX strings in math environment used by
matplotlib’s usetextext2plotWrite text on a plotSpecial FilesFunction/moduleShort descriptioninfonetcdfExtract information from netCDF file, same asncinfoncinfoExtract information from netCDF filencionetCDF4 functions to copy a netcdf file while doing some
transformations on variables and dimensionsncreadRead variables from netCDF filereadnetcdfRead variables from netCDF file, same asncreadupdatezUpdate arrays in uncompressed numpy .npz formatupdatez_compressedUpdate arrays in compressed numpy .npz formatxlsreadRead numbers and strings from Excel file into 2D float and string arrays,
same asxreadxlsxreadRead numbers and strings from Excel file into 2D float and string arrays,
same asxreadxreadRead numbers and strings from Excel file into 2D float and string arraysLicensepyjamsis distributed under the MIT License. See theLICENSEfile for
details.Copyright (c) 2012-2022 Matthias Cuntz, Juliane Mai, Stephan Thober, and Arndt
PiaydaThe project structure ofpyjamshas borrowed heavily fromwelltestpybySebastian Müller.