Building your own EPW file

Hi I also want to change my file from excel to EPW so I can import it to ladybug but I try to use https://bigladdersoftware.com/projects/elements/?fbclid=IwAR1DaXWmjkOesVORfIqoQC5jT8s3zdQYEZw3-K3e_pn30G6V0rxoxUfVGnU
and it didn’t worked.
this is the file
https://drive.google.com/file/d/19Nr4VUMhafxZdrl6QnuH5HBx-dhCE-7A/view?usp=sharing

Hello everyone! :hugs:

I am trying to create an .epw file.

I collected the data using this amazing tool “rokka.shinyapps.io/shinyweatherdata/

After what I am searching for the typical months as @chris mentioned above.
I made a weird gh definition using custom nodes :smiley: (you can find it bellow if you wanna check)ConstructEPW.gh (424.2 KB)
Cannot attach the parsed .csv file as it is too heavy, so I just provide a screenshot on how it looks like, in case someone is interested:

However I have a data-related question.

The cluster to create a custom .epw file needs inputs for: Direct normal radiation, diffuse horizontal radiation, horizontal infrared radiation, direct normal illumination, diffuse horizontal illumination.
image

If I collect the solar data from ERA5, it provides “Diffuse horizontal irradiance” and “Diffuse horizontal irradiance

If I get the data using CAMS, it gives me these values: Diffuse horizontal irradiance, Direct normal (beam) irradiance, Irradiation on horizontal plane at the top of atmosphere, Clear sky global irradiation on horizontal plane at ground level, Clear sky beam irradiation on horizontal plane at ground level, Clear sky beam irradiation on horizontal plane at ground level, Clear sky beam irradiation on horizontal plane at ground level, Clear sky beam irradiation on horizontal plane at ground level, Clear sky beam irradiation on horizontal plane at ground level, Clear sky beam irradiation on horizontal plane at ground level.

This may seems odd, but I experience difficulties even with translations of terminologies to my native language (such as irradiance VS illuminance. Weather both means the same in case of daylighting).
Thus, I wanted to ask if anyone could illuminate me upon the received data.
Which of the columns should I use to create an appropriate .epw file?

Given the way this question is phrased, I don’t think people will be able to answer it well unless they are already familiar with the specific data set you are working with. Here are some answers to more general questions, which may or may not be what you’re looking for but we can helpfully answer them:

  1. What’s the difference between irradiance and radiation?
    When reported on an hourly basis, there’s virtually no difference between these two. Irradiance is usually reported in Watts/m2 and is a unit of power while Radiation is reported in Watt-hours/m2 and is a unit of energy. But 1 Watt of power supplied over an hour is equal to 1 Watt-hour of energy. So you can use hourly solar irradiance data as input for the EPW radiation data.

  2. What’s the difference between solar irradiance and illuminance?
    Solar irradiance is the total amount of power that comes from the sun on a given area. So it includes both the portion of the sun that is visible AND the portion of the sun that is infrared + ultraviolet, which cannot be seen by humans but can still be experienced as “heat”. Illuminance is also a measure of solar intensity but is only for the human-visible part of the spectrum. The units for irradiance (W/m2) and illuminance (lux) are completely different from one another and, while these two metrics have a (more-or-less) direct relationship, they CANNOT be used interchangeably. However, EPW illuminance is not used in E+ calculations so you can still make a E+ simulate-able EPW without illuminance data (radiation is required, though).

Hope that helps.

1 Like

Than you Chris for such a clear response! This actually explained everything :slight_smile:

1 Like

Hi again :slight_smile:

I am trying to conduct a parametric study for LEED sDA and ASE measure. So I believe I need the data for Solar Illuminance… Unfortunately, @Lukas told me that the Shinny Weather Data have no illuminance data. However, he pointed out a strategy towards the conversion of Irradiance to Illuminance on Unment Hours forum:

‘’
7.2.5 Direct Normal Solar Illuminance
For purposes of calculating daylight factors associated with beam solar illuminance, the direct normal solar illuminance is taken to be 1.0 W/m2. The actual direct normal solar illuminance, determined from direct normal solar irradiance from the weather file and empirically-determined luminious efficacy, is used in the time-step calculation.
‘’

So that means that I can empirically use Direct Solar Irradiance as Direct Solar Illuminance for lighting calculations. But how do I get the Diffuse Horizontal Illuminance? :sweat_smile:

The IWEC2 weather files by ASHRAE include solar Illuminance. However, they are also derived empirically, and the path is unclear.

Because the ISH database contains no measured solar radiation, the hourly total horizontal solar radiation is calculated using an empirical Zhang-Huang Model based on the sun-earth geometry, reported cloud cover, temperature difference from three hours previously, relative humidity, and wind speed, which is then adjusted on an hourly basis using the new ASHRAE Clear Sky Model to correct for statistical noise in the hourly profile. A second empirical Gompertz Function Model is used to calculate the direct normal solar radiation based on the solar angle and the ratio of the derived total global horizontal compared to the extraterrestrial solar radiation. Other models then use these derived solar radiation values to calculate various illuminances (global horizontal, direct normal, diffuse horizontal) and zenith luminance that are useful for daylighting studies.

The “Other models” is the tricky part…

Despite the fact that:

perhaps I still can convert Irradiance values to Illuminance?

If so, how could it be done?

Or maybe there is a known source of solar illuminance database?

I would really appreciate your help.

I leave the dataset from ShinyWeatherData bellow.
lat=49_lng=24.75_period=2019(CAMS).epw|attachment (1.2 MB)

Here in this post, there is a Python script from @chris to create illuminance parameters from ERA5 data.

1 Like

@josephyang has the right idea. While irradiance and illuminance are not interchangeable, ladybug-core has a luminous efficacy model in, which can convert irradiance to estimated illuminance given a few other parameters. You can see the documentation of the method here:

And the script in the post that Joseph linked to is probably the best sample for how to apply it.

1 Like

Illuminance is seldom metered and in practice we need to empirically derive it from irradiance data. The most accepted method seems to be the “Perez luminous efficacy model”, which is used for example for the IWEC2 files and tools like Radiance. Generally, the uncertainty in the method of deriving the irradiance data is larger than going from irradiance -> illuminance (Comparative Analysis of All-Sky Luminous Efficacy Models …)

I’ve not included the calculation of illuminance variables in my tool, as I had the impression that it is not really needed as most tools already have implemented luminous efficacy modeling. But I can of course consider adding them if there are use cases for it? But I don’t think I could do any better than the Perez methods already in use by most tools. (Well, reanalysis data sources do have more variables on the atmospheric composition than what was available when the Perez luminous efficacy was developed in the 1990, so I guess you could create a more accurate model today…)

1 Like

Thank you everyone for such advanced responses!

I saw the python script, but I dont know how to implement it in GH… Would be really cool to have a component like that or a GHpython file. I dont understand how to use that Python file, what library is “import requests” calling…

It would be also very helpful to include this data. I personally still don’t know how to do Daylight modeling out of that data :frowning:

Hi @Lukas - Perez method is the one that’s implemented in Ladybug module I believe (https://github.com/ladybug-tools/ladybug/blob/master/ladybug/skymodel.py). As you can see, it’s fairly straightforward and quick to compute so should be relatively easy to implement for your code as well.

Thanks. Yes, that seems straightforward

Does Ladybug use this script to calculate the illuminance values or should these be supplied by the EPW files?

@mrbro, for some compliance work (but I’m not familiar with LEED) it is sufficient to use the constant 115 lm/W as suggested in the ISO 52010-1:2017 standard. Making use of an empirical luminance efficacy model will result in this relationship to vary in the range of roughly 105-125 lm/W.

1 Like

There’s one in Dragonfly. “DF Luminous Efficacy”. You’ll see it’s just a couple of lines of python that call that method.

1 Like

I’m not sure if Ladybug calculates these on the fly but normally these should be provided in the EPW file.

Hi @chris and @Lukas :slight_smile:

The component “DF Luminous Efficacy” requires the _dew_point data, which is not included in .csv file generated by ShinyWeatherData.

Also, the .epw file for 2019 generated by ShinyWeatherData cannot be processed by the “WEA from EPW” component.

  1. Solution exception:Length of values does not match that expected by the header analysis_period. 8760 != 8784

However, this component works fine with 2018 .epw file.

There is also an issue with the “DF_create_EPW” component.

  1. Solution exception:dry_bulb_temp must be an hourly continuous data collection. Got <type ‘float’>…

I supply number values for 8760 hours, but still this error…
:sleepy:

Hi @mrbro. There seems to be a dew_point_from_db_rh python script as well, maybe you can use that get the dew point from relative humidity and dry bulb temperature.

The epw files do contain the dew point temperature and information about location and leap year, maybe you can read that instead of the csv file.

You can delete 29th of February in the csv file if there is no way to specify that 2019 is a leap year.

I looked into implementing the Luminous Efficacy model, but there was some disagreement between the estimate_illuminance_from_irradiance python code, the orginal Perez article and the ISO 52010 standard so it will require more effort than I first imagened so not sure I’ll have the time for it anytime soon.

1 Like

@mrbro ,

EPW weather files for leap years are supposed to have a value set to “Yes” in the header of the EPW. You probably have it set to “No”. You can see that the ladybug code parses this leap year value here:

If you set that to “Yes” you should be able to import it to Ladybug fine.

FYI, the reason that the “DF Create EPW” isn’t working is that you need to create DataCollections and not just plug in the values.

Hi all,

I am getting some odd results with the ImportNOAA component.
For air temperature, it looks like the daily value is more or less constant rather than displaying the expected diurnal variation.
Strangely, this happens for all hourly data sets that i download from the NOAA site, but not for the Paris .csv file that is included with LBT 1.2. So my guess is that the issue is with the csv files. I check them, and they do include some periods with more that one observation per hour, but my understanding is that the component filters these out so it grabs only one observation per hour. Initially i though it was a leap year issue, but the error occurs for non leap year years as well. For leap years, i get the added error of “Solution exception:Length of values does not match that expected by the header analysis_period. 8760 != 8784”

Two NOAA .csv downloads are attached, one is 2020 data, the other is 2017. Really curious what is going on here! Thanks!

LA_USC_2020_72287493134.csv.zip (544.6 KB) 72297603166(1).csv.zip (576.4 KB) Really curious what is going on here and thanks!

2021 04 07 v1.2 alternative_weather.gh (57.9 KB)

1 Like

Hi, I have the same question since I create the epw file with Meteonorm. Maybe you can check the data with Excel for the superfluous data and modify your epw file. Or you can export it again by doing which I got my job done.

Hi @Octagon26 ,

Oftentimes the data NOAA distributes from the NCDC does not include many data points that fall exactly on the hour. You can see the data points between which you are interpolating by looking at the hourly plots in the sample file:

And you can see that the values in the CSV are coming at all different times:

So you’re trying to construct an hourly profile of temperature data using only ~30 hours.

If you want to construct an EPW file using all of the data in the CSV, then you may need to import the data from the CSV with a timestep of 60. Then, when you use the LB Convert To Timestep component, you convert the data back to an interpolated data collection at a timestep of 1 like so:

Then, you’ll be constructing your data collection using more data points and the result will look more like what you expect:

Note that it takes a while to import all of the data from the CSV when it is at a timestep of 60 so you’ll have to be patient opening this file:
alternative_weather_CWM.gh (23.7 KB)

Hi Chris,

Thank you for the useful information.
I have xlsx file that contain measured meteorological data of a location called Adama in Eutopia per 15 minutes, The data includes precipitation, solar irradiation on horizontal surface, relative humidity, temperature, wind direction and wind speed. I need to generate a EPW file for simulating a building in OpenStudio. Would that be possible and what are the steps?
Thanks