mrhe
October 18, 2023, 8:23pm
1
Hi Community,
first of all thank you for creating and maintaining this great package and the corresponding documentation!
I’m working with gendaymtx.exe
on Windows to get the total solar radiation for sky patches.
gendaymtx -m 1 -O1 south.wea > south.mtx
The resulting mtx
file has the following header:
#?RADIANCE
gendaymtx -m 1 -O1 south.wea
LATLONG= -54.50000000 158.94000000
NROWS=146
NCOLS=8760
NCOMP=3
FORMAT=ascii
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
4 4 4
8.9 8.9 8.9
14.9 14.9 14.9
23.3 23.3 23.3
31.1 31.1 31.1
36.8 36.8 36.8
39.6 39.6 39.6
41.5 41.5 41.5
45.1 45.1 45.1
46.4 46.4 46.4
...
I’d expect 146 * 8760 = 1.278.960 rows with data in this file, but there are 1.279.105 entries.
What do the additional 145 (1.279.105 - 1.278.96) entries correspond to?
If you are just counting lines in the file, there are some blank lines in between rows. Is it possible you are counting those as well?
Otherwise, please upload your .wea file somewhere, so I can figure out what is going on.
Cheers,
-Greg
1 Like
mrhe
October 18, 2023, 9:10pm
3
Thanks for a prompt response @Greg_Ward !
I did count the lines in the output file indeed. Following your tip, I inspected further in Notepad++ and every 8760 entries, there is an empty line which I assume separates values between individual patches.
Thanks again for clarifying this!
A follow-up question on how to convert these values to W/m2. I dug up your old conversation with Mustafa on solid angle values per patch and am trying to get solid angle values per each Tregenza patch.
In Ladybug’s code I can see a reference to solid angles per row but I’d like to understand how these were obtained with rcalc
and the tregenza.cal
file.
mrhe
October 18, 2023, 9:18pm
4
Ah, passing 1 subdivision to the command generates individual values for the default Tregenza sky patches:
cnt 145 | rcalc -e MF:1 -f reinsrc.cal -e Rbin=recno;$1=Romega > rh_sang.txt
1 Like
mrhe
October 18, 2023, 9:29pm
5
My apologies for spamming this topic but I have one more question:
@Mostapha is applying the following weights to each of the RGB bands:
w_val = 0.265074126 * float(R) + 0.670114631 * float(G) + 0.064811243 * float(B)
Where do these values come from?
Here is more context:
mrhe
October 19, 2023, 9:48am
6
Having done more research, I found this:
CIE_x_r*CIE_y_b + CIE_x_b*CIE_y_r ) )
#define CIE_C_bD ( (1./CIE_y_w) * \
( CIE_x_w*(CIE_y_r - CIE_y_g) - \
CIE_y_w*(CIE_x_r - CIE_x_g) + \
CIE_x_r*CIE_y_g - CIE_x_g*CIE_y_r ) )
#define CIE_rf (CIE_y_r*CIE_C_rD/CIE_D)
#define CIE_gf (CIE_y_g*CIE_C_gD/CIE_D)
#define CIE_bf (CIE_y_b*CIE_C_bD/CIE_D)
/* Default CIE_rf=.265074126, CIE_gf=.670114631 and CIE_bf=.064811243 */
/***** The following definitions are valid for RGB colors only... *****/
#define bright(col) (CIE_rf*(col)[RED]+CIE_gf*(col)[GRN]+CIE_bf*(col)[BLU])
#define normbright(c) ( ( (long)(CIE_rf*256.+.5)*(c)[RED] + \
(long)(CIE_gf*256.+.5)*(c)[GRN] + \
(long)(CIE_bf*256.+.5)*(c)[BLU] ) >> 8 )
/* luminous efficacies over visible spectrum */
#define MAXEFFICACY 683. /* defined maximum at 550 nm */
For anyone who was wondering like me: these are the default coefficients to convert from RGB in the CIE color space to a single greyscale value representing radiation.
1 Like