A Python package for calculating psychrometric properties of moist air and plotting psychrometric charts.
Project description
shimeri
A Python package for calculating psychrometric properties of moist air and plotting psychrometric charts based on plotly.
shimeri means "moisture" or "humidity" in Japanese.
Installation
pip install shimeri
Quick Usage
Usage example below.
import shimeri as sh
import numpy as np
if __name__ == "__main__":
# instantiate psychrometric calculator
pc = sh.PsychrometricCalculator()
# calculate psychrometric properties at 25degC dry-bulb temperature and 50% relative humidity
db, wb, rh, hr, en = pc.get_all(db=25, rh=50)
print(
f"DB={db:.1f}degC, WB={wb:.1f}degC, RH={rh:.1f}%, HR={hr:.1f}g/kg, EN={en:.1f}kJ/kg"
)
# initialize a psychrometric chart
fig = sh.PsychrometricChart()
# plot random points
rng = np.random.default_rng()
dbs = rng.normal(25, 5, 30)
rhs = rng.normal(50, 5, 30)
dbs, wbs, rhs, hrs, ens = pc.get_all(db=dbs, rh=rhs)
fig.add_points(
en=ens,
hr=hrs,
name="random points",
mode="markers",
)
# add a line from points
dbs = np.array([26.0, 35.0])
rhs = np.array([50.0, 60.0])
hrs = pc.get_hr_from_db_rh(dbs, rhs)
ens = pc.get_en_from_db_hr(dbs, hrs)
fig.add_points(
en=ens,
hr=hrs,
name="line",
mode="lines",
)
# draw constant humidity ratio line from half-mixed point to rh=90%
hr_mixed = (hrs[0] + hrs[1]) * 0.5
db_mixed = (dbs[0] + dbs[1]) * 0.5
db_90, wb_90, rh_90, hr_90, en_90 = pc.get_all(hr=hr_mixed, rh=90)
fig.draw_iso_hr_line(
hr=hr_mixed,
db_range=np.array([db_mixed, db_90]),
mode="lines+markers",
)
# draw a line of constant relative humidity
fig.draw_iso_rh_line(
rh=90,
db_range=np.array([db_90, 15.0]),
mode="lines",
)
fig.show()
Sample Result:
Attention
The PsychrometricCalculator.get_all()
method uses convergence calculations. Especially when calculating from wet-bulb temperature and enthalpy, convergence can be poor, potentially leading to inaccurate results. (The poor convergence can be understood from the fact that the slopes of wet-bulb temperature and enthalpy lines are similar on the psychrometric chart.
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
Built Distribution
File details
Details for the file shimeri-0.1.2.tar.gz
.
File metadata
- Download URL: shimeri-0.1.2.tar.gz
- Upload date:
- Size: 787.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7a298f438847fdb7d7fbffe3fe835bd87ffcab17ec089668dca5b3f424bb39a |
|
MD5 | f5da502b0d27005aa1318892ff5db45c |
|
BLAKE2b-256 | 328f39932badba134c7cbd0249676309d5fed628ffdd10d06442ee8c04a736b0 |
File details
Details for the file shimeri-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: shimeri-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bd1aa644d0b9ef50fb0d02ab0841c6ce99f365a50e282d6be8e1a0b9d8ae062 |
|
MD5 | b4cca19ea96dc8b41ed63a61ba2e1fa5 |
|
BLAKE2b-256 | 4e10e62aa750c462845913e9983691cc6ea35815297b57c1832c221776393d16 |