azogue / psychrochart

A Python 3 library to make psychrometric charts and overlay information on them.
MIT License
104 stars 27 forks source link

PsychroDefault #19

Closed vitthal1 closed 1 year ago

vitthal1 commented 2 years ago

More Defaults Needed

azogue commented 1 year ago

Hi @vitthal1,

There are 4 presets for psychrocharts for the SI (metric) unit system ('ashrae_ip', 'default', 'interior', 'minimal'), and one more for imperial units ('ashrae_ip'); and they are easily editable, to generate new ones as variants:

from pathlib import Path
from psychrochart import PsychroChart

# evolve chart config from preset
custom_config = PsychroChart.create('ashrae').config
custom_config.limits.range_temp_c = (15.0, 35.0)
custom_config.limits.range_humidity_g_kg = (5.0, 37.0)
custom_config.limits.pressure_kpa = 102.4

custom_config.chart_params.constant_humid_label_step = 5
custom_config.chart_params.constant_temp_label_step = 2
custom_config.chart_params.with_constant_h = False
custom_config.constant_v.color = "darkgreen"
custom_config.chart_params.constant_v_labels = [0.82, 0.84, 0.86, 0.88, 0.9]
custom_config.saturation.color = "red"
custom_config.saturation.linewidth = 2
custom_config.constant_wet_temp.color = "orange"
custom_config.constant_rh.color = "lightblue"

# use the custom config to generate a chart image
chart = PsychroChart.create(custom_config)
chart.save('custom-ashrae-chart.png')

# store the config for other usages
Path('custom-ashrae-config.json').write_text(custom_config.json(indent=2))

# load custom config from JSON file and re-gen chart
custom_chart = PsychroChart.create('custom-ashrae-config.json')
chart.save('custom-ashrae-chart.svg')

Could you elaborate?