Skip to main content

No project description provided

Project description

Documentation Status PyPI version

Positive Matrix Factorization in python

Handle PMF output from various format in handy pandas DataFrame and do lot of stuf with them.

Currently, only data from the EPA PMF5 is handle, from xlsx or sql database output.

History

This project started because I needed to run several PMF for my PhD and also needed to run some computation on these results. The raw output of the EPA PMF5 software is a bit messy and hard to understand at a first glance, and copy/pasting xlsx file is not my taste... So I ended developping this tools for handling the tasks of maping the xlsx output to nice python objects, on which I can easily run some computation.

Since I needed to plot the results afterward, I also added some plot utilities in this package. It then has build in support for ploting :

  • chemical profile (both absolute and normalized)
  • species repartition among factor
  • timeserie contribution (for all species and profiles)
  • uncertainties plots (Bootstrap and DISP)
  • seasonal contribution
  • contribution of sources to polluted and normal days
  • And a lot more!

Examples

The documentation has a lot of examples and figures, but here is a short summary:

from pyPMF.PMF import PMF

pmf = PMF(site="GRE-fr", reader="xlsx", BDIR="./")

# Read various output
pmf.read.read_base_profiles()
pmf.read.read_base_contributions()
pmf.read.read_constrained_profiles()
pmf.read.read_constrained_contributions()
# ... or simply :
pmf.read.read_all()

# The pmf has now different attributes associated
pmf.profiles    # name of the different factors
pmf.species     # name of the different species
pmf.dfcontrib_c # contribution dataframe of factors
pmf.dfprofile_c # chemical profile of factors
# ... and lot more

# plot the results
pmf.plot.plot_stacked_profiles()


# or use some utilities
pmf.to_cubic_meter(specie="Cu") # Contribution timeserie of the different factors to the Cu
pmf.to_relative_mass()
# ... and lot more

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

pyPMF-0.1.11.tar.gz (19.2 kB view details)

Uploaded Source

File details

Details for the file pyPMF-0.1.11.tar.gz.

File metadata

  • Download URL: pyPMF-0.1.11.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.9.7

File hashes

Hashes for pyPMF-0.1.11.tar.gz
Algorithm Hash digest
SHA256 5f5431e46a3481ee83ed3a0d42ca07f9e33a0704790f6b29fdb15f88c1a9a4f2
MD5 24bd08ba5cc5557d1f6f232f332abbcc
BLAKE2b-256 79bfa74656c59ef4a7a465405c62b88c9e99405176638d646d51e797f021073b

See more details on using hashes here.

Supported by

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