I took a look and it looks like a bug in ladybug @chriswmackey.
In the script shared by Amir, if you look at the temperature property of the PsychrometricChart object, you will see Celsius in the header. instead of Fahrenheit.
In my local installation of ladybug-charts, I get ladybug-core version 0.42.8 Which is fairly latest. So not sure if this is already fixed.
This is not a bug in the PsychrometricChart class and it is very much intentional. You see that the description of the dry_bulb_temperature property on the PsychrometricChart docs says that the values are always supposed to be in Celsius and the use_ip is the only thing that should be changed in order to get a colored mesh and axes in Fahrenheit.
We need the data collection of dry_bulb_temperature to remain in Celsius because the PMV model is written in terms of Celsius temperature and we don’t want to convert it back when we plot the polygons.
So the bug is in ladybug-charts if the code there was expecting use_ip to change the units of the dry_bulb_temperature data collection. You’ll see that the use_ip option works as designed in the LBT component where we process the temperature like so:
I see. So @amirtabadkani, ladybug-charts is not designed to deal with unit as Chris has described. I will try to implement this weekend.
@chriswmackey, I don’t see the dry_bulb_temperature property on the PsychrometricChart object. I also see that you are using the z and original_temperature properties on this object that again I see neither on the documentation nor on the code base. What am I missing?
Thanks @devang - FYI, I could find a workaround for use_ip function (replaced with a customized function) to change the legend units but still since the other functions like x_axis_text relies on use_ip function, I dont have the possibility to change the axis titles units and values on the chart - and apparently, the x-dim and y-dim function are not working either - but hopefully if you can fix the use_ip feature, many of these bugs should be fixed too - thanks
If you observe the first error, it is coming out of ladybug library. This error happens before the pointer reaches the ladybug-charts library. Chris might be able to help. For that, I think you should share a minimum script that he will need to reproduce the error.
You’ll see number of hours if you don’t pass data. Since you have passed dry-bulb temperature data, the legend plots that.
I am not able to understand the issue here. And again, we’d appreciate if you can share a minimum script to re-produce the error. This error too is coming from ladybug-comfort library and not ladybug-charts.
You aren’t missing anything here, @devang and sorry if I made things more confusing.
I mistakenly referred to the PsychrometricChart.temperature as dry_bulb_temperature in my previous post. I forgot that I just call it temperature since it can be interpreted either as operative temperature or air (dry bulb) temperature.
As for the properties of z and original_temperature, these are not official properties on the PsychrometricChart class, which is why they don’t appear in the docs. The class in ladybug-core is written purely as a 2D object and so a z property has no meaning. However, in Grasshopper world, I wanted to have some way to pass the Z coordinate of the psychrometric chart base point to the component that plots the PMV or UTCI comfort polygons on the chart. So I just assigned it as an unofficial attribute to the object that gets passed between the two. The same thing is true of original_temperature. Long story short, you shouldn’t be expecting these properties to exist anywhere else other than Grasshopper since they are things that I added specifically to help with GH workflows.
The primary issue with your sample code is that you are trying to plot a temperature value of 24C on a chart that has default min/max temperatures of -20F to 50F. Since 24C is equal to 72.5F, this temperature value does not fit on the chart and so you end up with a chart that has nothing on it. Hence, the exception being thrown.
Change your code to something like this where the min and max temperatures are specified in terms of Farenheit:
import ladybug.psychrometrics
import ladybug_comfort
from ladybug.psychchart import PsychrometricChart
from ladybug_comfort.chart.polygonpmv import PolygonPMV
import ladybug.psychrometrics
import ladybug_comfort
from ladybug.psychchart import PsychrometricChart
from ladybug_comfort.chart.polygonpmv import PolygonPMV
lb_psy_ext = PsychrometricChart(
24, 45, min_temperature=0, max_temperature=120, use_ip=True)
figure = lb_psy_ext.plot(title='PSYCHROMETRIC CHART', show_title=True)
Thanks @chriswmackey - you re right I was confused with units as you keep the main dbt and rh inputs in C while you change the min/max temps based on F unit - can you also please advise on the 3rd issue above when you get the chance?
Yea, I realize some decisions I made about how to support IP may make perfect sense from inside the class but can be confusing from the outside. I tried to document in the docstings what units are supposed to be used where for the different input arguments.
Issue 3 is a bug in your code. pmv.fan_use_polygon(1) returns None for your case, perhaps because it does not fit on the chart. The docstring is clear that this is a possible outcome:
So I recommend checking that the result is not None before you go to evaluate_polygon.