From 76f29cb7cb3febfe890e47bda37b6951be05b0cd Mon Sep 17 00:00:00 2001 From: Darice L Guittet Date: Fri, 6 Dec 2024 15:56:26 -0700 Subject: [PATCH] Solar interpolation macro (#1956) * fix #1777 * account for header rows in input_data --- deploy/runtime/macros/Solar Resource Interpolation.lk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy/runtime/macros/Solar Resource Interpolation.lk b/deploy/runtime/macros/Solar Resource Interpolation.lk index 866758e176..77e75dc80c 100644 --- a/deploy/runtime/macros/Solar Resource Interpolation.lk +++ b/deploy/runtime/macros/Solar Resource Interpolation.lk @@ -233,7 +233,14 @@ function identify_case(input_data, lat, long, tz){ cols = parse_header(input_data[line]); if (cols[4] == -1){ case[0] = 1; - case[1] = 1; + max_hour = -1; + for (hr=0; hr<48; hr++){ + max_hour = max(max_hour, input_data[hr][cols[3]]); + } + if (max_hour == 23) + case[1] = 0; + else + case[1] = 1; } else{ case[0] = 0;