https://github.com/pmeal/beatmap
BET surface area analysis from adsorption data
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 7 committers (14.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.8%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
BET surface area analysis from adsorption data
Basic Info
- Host: GitHub
- Owner: PMEAL
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://pmeal.github.io/BEaTmap/
- Size: 7.82 MB
Statistics
- Stars: 10
- Watchers: 4
- Forks: 3
- Open Issues: 0
- Releases: 5
Topics
Metadata Files
README.md
What is BEaTmap?
Obtaining surface area of a porous sample from the interpretation of gas adsorption isotherms is very widely done using the theory developed by Brunauer, Emmett, and Teller in the 1950s. The BET (or BEaT) theory is so commonly place that the acronym has is synonymous with surface area. The BET theory was derived with several assumptions, and these must be met for the predicted surface area to be valid.
Rouquerol et al have put forth criteria to evaluate whether isothermal adsoprtion data meets the assumptions of BET analysis. Applying these criteria to all relative pressure ranges of an isotherm allows one to eliminate relative pressure ranges that do not adhere to BET theory. Visualizing the results of BET analysis as a heatmap where "invalid" relative pressure ranges are masked provides a quick and comprehensive representation of BET results for an isotherm.
BEaTmap was developed as a conceptulization and vizualization tool for BET analysis utilizing the "Rouquerol criteria".
Capabilities
BEaTmap consists of the following modules:
core: Functions that perform BET analysis, evaluate Rouquerol critieria, and provide a single specific surface area answerio: Functions for import data from .csv files or lists, and exporting processed data to .xlsx filesutils: Various small functions used in other BEaTmap modulesvis: Functions to create heatmaps, BET plots, isotherm plots, tables of BET analysis results, etc
Try It Live
We have created a web-based GUI for BEaTmap using Streamlit. This app is hosted on the Streamlit servers and is available here. If the app is not used for a certain period then Streamlit will hibernate it then wake it up on request, so it may take a few moments to load. The app includes a link to some sample data which you can use to explore the interface. Enjoy.
Installation
BEaTmap depends heavily on the Scipy Stack. The best way to get a fully functional environment is the Anaconda distribution. Be sure to get the Python 3.9+ version.
Once you've installed conda, you can then install BEaTmap. It is available on the Python Package Index and can be installed by typing the following at the conda prompt:
pip install beatmap
On Windows, you should have a shortcut to the "Anaconda Prompt" in the start menu. This will open a Windows command console with access to the Python features added by conda, such as installing things via pip.
On Mac or Linux, you need to open a normal terminal window, then type source activate {env} where you replace {env} with the name of the environment you want to install BEaTmap. If you don't know what this means, then use source activate base, which will install BEaTmap in the base environment which is the default.
If you think you may be interested in contributing to BEaTmap and wish to both use and edit the source code, then you should clone the repository to your local machine, and install it using the following pip command:
pip install -e path/to/beatmap/root/folder
For information about contributing, refer to the contributors guide.
Examples
The following code snippets illustrate how to import data, perform BET analysis, evaluate Rouquerol criteria, and produce figures in BEaTmap. An example is included in this repo, and can be browsed here.
Automated BET analysis
An "envelope" function, that will import data, perform BET analysis, evaluate the Rouquerol criteria, and produce all figures for the user has been built. The file path, information about the data (later used for naming exported files), and the adsorbate cross sectional area in square Angstrom need to be specified. It allows the user to access much of BEaTmap's functionality in one line.
```python import beatmap as bt import matplotlib.pylot as plt
fpath = bt.utils.getdatasetspath() / 'vulcan_chex.csv'
rouqcriteria = { "enforceyinterceptpositive": True, "enforcepressureincreasing": True, "enforceabsorbedamount": True, "enforcerelativepressure": True, "enforceenoughdatapoints": True, "minnumpoints": 5 }
auxparams = { "savefigures": True, "exportdata": False, "ssagradient": "Greens", "err_gradient": "Greys" }
results = bt.runbeatmap( file=fpath, info="chex on vulcan" ao=39, ssacriterion="error", **rouqcriteria, **aux_params ) ```
Manual BET analysis
Alternatively, you can use the individual functions in BEaTmap to perform BET analysis and evaluate the Rouquerol criteria. This allows the user to access more of BEaTmap's functionality, and to customize the analysis.
Import the dataset
The import_data function can be used to import a isotherm data from a .csv file where the first column is relative pressure and the second column is the amount adsorbed.
The function returns a named tuple where the first entry is a dataframe of the imported isotherm, and the 2nd-4th fields are the cross sectional area of the adsorbate, information about the data, and file path, respectively. Indexing of named tuple elements is in order of priority, data used by other function are given priority.
``` python import beatmap as bt import matplotlib.pylot as plt
isothermdata = bt.io.loadvulcan_dataset()
Alternatively, you can manually import the CSV data as shown below
fpath = bt.utils.getdatasetspath() / 'vulcan_chex.csv'
isothermdata = bt.io.importdata(file=fpath, info='vulcan-chex', a_o=39)
```
BET analysis
BET analysis is performed on every relative pressure range within the isotherm data by the bet function. The function accepts the dataframe of isotherm data, cross sectional area of the adsorbate, and information about the data (information stored in the named tuple created by the importdata function). Rather than pass individual parameters, this function can accept *isothermdata (where isotherm_data is a named tuple output by a data import function).
The function returns a named tuple containing the results of BET analysis as well as information about the isotherm (raw data, file path, etc). Again, the indexing of named tuple elements is in order of priority, data used by other function are given priority.
python
bet_results = bt.core.bet(
iso_df=isotherm_data.iso_df,
a_o=isotherm_data.a_o,
info=isotherm_data.info
)
Rouquerol criteria
The Rouquerol criteria, used to mask out results of BET analysis for invalid relative pressure ranges are evaluated by the rouq_mask function. Rather than pass individual parameters, this function can accept *bet_results (where bet_results is a named tuple output by the bet function).
The function returns a named tuple containing a numpy mask array, and individual arrays corresponding to the results of each criterion.
python
mask_results = bt.core.rouq_mask(
intercept=bet_results.intercept,
iso_df=bet_results.iso_df,
nm=bet_results.nm,
slope=bet_results.slope,
enforce_y_intercept_positive=True,
enforce_pressure_increasing=True,
enforce_absorbed_amount=True,
enforce_relative_pressure=True,
enforce_enough_datapoints=True,
min_num_points=5
)
Supplementary analysis
The bet_results and mask_results can used to create a heatmap of specific surface area values for each relative pressure range. This visualization concept is the central idea of BEaTmap. The ssa_heatmap function requires the named tuples produced by the bet function and the rouq_mask function.
Other figures, such as a plot of experimental data and the model isotherm can be created in this manner. See the documentation for a full summary of figures.
python
bt.vis.ssa_heatmap(bet_results, mask_results)
bt.vis.iso_combo_plot(bet_results, mask_results, save_file=True)
Export the results
It might be desireable to have a spreadsheet that contains all results of BET analysis and the Rouquerol criteria. This sheet can be created and saved in the parent directory with the export_processed_data function.
python
bt.io.export_processed_data(bet_results)
Owner
- Name: PMEAL
- Login: PMEAL
- Kind: organization
- Email: jgostick@gmail.com
- Location: Waterloo, ON
- Website: pmeal.com
- Repositories: 9
- Profile: https://github.com/PMEAL
Porous Materials Engineering and Analysis Lab
GitHub Events
Total
- Watch event: 1
- Push event: 47
- Fork event: 1
Last Year
- Watch event: 1
- Push event: 47
- Fork event: 1
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 188
- Total Committers: 7
- Avg Commits per committer: 26.857
- Development Distribution Score (DDS): 0.441
Top Committers
| Name | Commits | |
|---|---|---|
| Amin Sadeghi | a****i@l****m | 105 |
| Ellsworth Bell | 3****l@u****m | 46 |
| jgostick | j****k@u****a | 18 |
| Ellsworth | e****l@g****m | 12 |
| jgostick | j****k@g****m | 4 |
| github-actions[bot] | 4****]@u****m | 2 |
| Ellsworth Bell | e****l@E****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 8
- Total pull requests: 6
- Average time to close issues: 10 months
- Average time to close pull requests: about 2 hours
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.13
- Average comments per pull request: 0.0
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jgostick (6)
- ma-sadeghi (2)
Pull Request Authors
- ma-sadeghi (4)
- github-actions[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 29 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 6
- Total maintainers: 2
pypi.org: beatmap
A tool for determining the valid P/P0 range in BET isotherms
- Homepage: https://github.com/PMEAL/beatmap/
- Documentation: https://beatmap.readthedocs.io/
- License: MIT License
-
Latest release: 0.3.0
published over 2 years ago
Rankings
Maintainers (2)
Dependencies
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- peaceiris/actions-gh-pages v3 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v2 composite
- FantasticFiasco/action-update-license-year v1 composite
- altair *
- matplotlib *
- numpy *
- pandas *
- prettytable *
- scipy *
- seaborn *
- streamlit *
- altair *
- matplotlib *
- numpy *
- pandas *
- prettytable *
- scipy *
- seaborn *
- streamlit *
- streamlit-extras *
- EndBug/add-and-commit v9 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- matplotlib *
- numpy *
- pandas *
- prettytable *
- rich *
- scipy *
- seaborn *
- furo *
- matplotlib *
- myst-parser *
- numpy *
- numpydoc *
- pandas *
- prettytable *
- scipy *
- seaborn *
- sphinx *
- matplotlib *
- numpy *
- pandas *
- prettytable *
- scipy *
- seaborn *
- altair *
- furo *
- matplotlib *
- myst-parser *
- numpy *
- numpydoc *
- pandas *
- prettytable *
- scipy *
- seaborn *
- streamlit *
- codecov * test
- coverage * test
- pytest * test
- pytest-cache * test
- pytest-codestyle * test
- pytest-cov * test
- pytest-pycodestyle * test
- wheel * test