Shirley-Chiu sky patches by gendaymtx or genskyvec

Hi all,

I am just wondering if there is any way to produce a matrix of a sky patch by gendaymtx or genskyvec that is based on the Shirley-Chiu disk-to-square mapping formula instead of Reinhart/Tregenza sky?

Best regards,
Majid

Hi Majid,

It’s no problem to create a matrix with rfluxmtx that uses a Shirley-Chiu sky mapping, but we don’t provide sky generators that use this subdivision. Both gendaymtx and genskyvec assume Reinhart or Tregenza sky patches. You could generate your own sky samples using disk2square.cal, similar to the way genskyvec.pl in ray/src/util does it. The handling of the sun is a bit tricky, though.

Cheers,
-Greg

Hi Greg,

Thank you so much for the help. Then I will check the genskyvec.pl and try to find a way to generate sky patches with the help of disk2square.cal.

Best regards,
Majid

Hi Majid,

Look at raytraverse/skycalc.py at release · stephanwaz/raytraverse · GitHub. these functions are used by the class sky/skydata.py. I implemented gendaymtx in python but with shirley-chiu disk to square mapping. The other big difference is I do not distribute the solar energy between three patches, instead it only goes to the nearest patch. In my use case, I am assuming that this patch energy is only used for the indirect calculation (combined with a separate direct source run, eg 5-phase, advanced 2-phase/2-phase DDS. I found that the results are more reliable to use a lower division with one patch rather than a higher division with distributed energy (In each case the apparent size of the solar patch is the same with for example a division of 12x12 vs. 15x15)

-Stephen

1 Like

Hi Stephen,

First of all, I should thank you again for your super interesting works and help me about Shirley-Chiu sky patches.
However, I am not sure how can I write the argument for the skydata if I want to create a npz file with 144 sky patches + 1 for the ground (in total 145) and import the it into the dctimestep.

I wrote a command like this:
raytraverse skydata -loc ‘59.7 -18 -15’ -skyres 12 -wea SWE_Stockholm_Arlanda.wea | dctimestep rac_basic_sample_project.mtx | rmtxop -fa -t -c 47.4 119.9 11.6 - > ill_File
But I got these warnings and error messages:
/usr/local/lib/python3.10/dist-packages/clasp/click_ext.py:169: RemovedInSphinx70Warning: The ‘env’ argument to Builder will be required from Sphinx 7.

  • builder = sphinx.builders.text.TextBuilder(app)*
    Warning! attempting to use skydata from outside scene, make sure scene -outdir is set
    fatal - unexpected EOF in header
    : cannot load matrix

So, I do really appreciate it if you can help me with how to solve it.
It can also help me a lot if you have any links as tutorials for your super interesting app.

Best regards,
Majid

Hi Majid,

The output matrix (.npz) is designed for use within raytraverse, and is not directly compatible with radiance. Sorry, I should have made that more clear. There is a scripted option that gets you close:

import numpy as np
from raytraverse.sky import SkyData

sd = SkyData("SWE_Stockholm_Arlanda.wea", skyres=12)
sd.radiance_sky_matrix("SWE_Stockholm_Arlanda.smx")
# write out skydata mask:
np.savetxt("daymask.txt", sd.daymask, fmt="%d")

the you can use your radiance commands:

dctimestep rac_basic_sample_project.mtx SWE_Stockholm_Arlanda.smx | rmtxop -fa -t -c 47.4 119.9 11.6 - > ill_File

one note, SkyData filters on daylight hours defined by the minalt, mindiff, and mindir parameters, so this matrix will not have 8760 rowa. If you know python, you can then read the ill_File back in and use sd.fill_data(), or you can print out the masking file and use whatever you want to pad the results (see end of script above, 1 is included, 0 is omitted). Sorry this would be a good idea to implement in the radiance_sky_matrix() command, but for now you are second person who has needed it. The documentation (such as it is) is available here (raytraverse (1.3.10) — raytraverse 1.3.10 documentation), note the latest version docs didn’t build correctly.

Hi Stephen,

Your explanation makes everything very clear for me and now it works perfectly.
Thank you so much for all your helps.

Best regards,
Maid