3

Error: Unexpected End-of-File on EPW Weather file

Hi,

I want to create a weather file with 5 minute data for 2019 weather data. I have processed all the 35 columns of .epw file. I still get the following error when I try to run.

EP: Program terminated: EnergyPlus Terminated--Error(s) Detected.
EP: ExpandObjects Started.
EP: No expanded file generated.
EP: ExpandObjects Finished. Time:     0.281
EP: EnergyPlus Starting
EP: EnergyPlus, Version 9.1.0-08d2e308bb, YMD=2020.12.08 00:07
EP: **FATAL:OpenWeatherFile: Unexpected End-of-File on EPW Weather file, while reading header information, looking for header=LOCATION
EP: EnergyPlus Run Time=00hr 00min  2.15sec
EP: EnergyPlus process stopped.

What am I missing here?

PS: I have added the epw file to google drive: https://drive.google.com/file/d/1YsMH...

cpathir's avatar
31
cpathir
asked 2020-12-07 23:48:11 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2021-03-29 08:54:51 -0500
edit flag offensive 0 remove flag close merge delete

Comments

You should share your EPW. But apparently you are missing the header "LOCATION" ? That should be the first line of your EPW, something in the form LOCATION,CHICAGO,IL,USA,TMY2-94846,725300,41.78,-87.75,-6,190,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Julien Marrec's avatar Julien Marrec (2020-12-09 02:39:55 -0500) edit

I kept the Anderson, SC weather file header and replaced data with 5min data. First two lines of the header are as follows:

LOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0 DESIGN CONDITIONS,1,Climate Design Data 2009 ASHRAE

cpathir's avatar cpathir (2020-12-10 17:14:51 -0500) edit
add a comment see more comments

1 Answer

3

TL;DR: you have a hidden character at the start of your file. I removed the hidden UTF-8 BOM at the start of your file: https://gist.github.com/jmarrec/ddd30...

(You still have problems with the weather file, but that's something else).


Stupid encoding problems. You could look at them all day and you won't find the problem.

Well so, I built E+ in Debug mode, and used a debugger to step through the code at the guilty part, and here https://github.com/NREL/EnergyPlus/bl...

(lldb) p Header(HdLine)
(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) $22 = "LOCATION"
(lldb) p Line.data
(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) $23 = "LOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0"

yet HdPos ends up being 3? WHAAT? It finds "LOCATION" but only at the 3rd char?

Annnnnnnnnnnd here we are, here's what we get when we use python to read your site_4_.epw file in binary mode:

In [1]: with open('site_4_.epw', 'rb') as f:
   ...:     content = f.read()
   ...: print(content.splitlines()[0])
b'\xef\xbb\xbfLOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0'

See that annoying \xef\xbb\xbf? That's called an UTF-8 BOM and apparently you have one at the beginning of your file.

(The only reason I know where to look for that stuff is because I've been bit by it waaaaay too many times, looking at you you awful "non-breaking space").

Julien Marrec's avatar
29.7k
Julien Marrec
answered 2020-12-11 10:35:52 -0500, updated 2020-12-12 09:39:17 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments