# gendaymtx returns -1.#J -1.#J -1.#J

**URL:** <https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463>\
**Category:** radiance-general\
**Created:** [October 2, 2013, 8:37pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463 "2013-10-02T20:37:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mostapha](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/mostapha/32/801_2.png) [@Mostapha](https://discourse.radiance-online.org/u/Mostapha)\
**Post date:** [October 2, 2013, 8:37pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/1 "2013-10-02T20:37:49Z")

</div>

Hi all,

I tried to read the results of the gendaymtx with a custom script and I  
noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does  
anybody know why this is happening?

I'm trying to get the total solar radiation for sky patches (-O1). I'm  
running RADIANCE on Windows and here is the line:

gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\>  
.\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx

Thanks in advance,  
Mostapha

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [October 3, 2013, 3:37pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/2 "2013-10-03T15:37:15Z")

</div>

Hi Mostapha,

This sounds like a bug in gendaymtx. Some versions of the standard library print out "-1.#J" for NaN (Not a Number), which can result from a divide-by-zero or similar illegal math operation. If you send me your weather file in a separate message (not to the mailing list), I will see if I can reproduce the problem. There may be a corner case or two that gendaymtx still doesn't deal with gracefully.

Cheers,  
-Greg

> **···**
>
> > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > Date: October 2, 2013 1:37:49 PM PDT
> > 
> > Hi all,
> > 
> > I tried to read the results of the gendaymtx with a custom script and I noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does anybody know why this is happening?
> > 
> > I'm trying to get the total solar radiation for sky patches (-O1). I'm running RADIANCE on Windows and here is the line:
> > 
> > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\> .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > 
> > Thanks in advance,  
> > Mostapha

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [October 3, 2013, 4:21pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/3 "2013-10-03T16:21:30Z")

</div>

Hi Mostapha,

Thanks for sending your files. For some reason, your WEA file has the month and day columns swapped, which is the source of your error. What did you use to translate the EPW file? The latest HEAD includes Christoph Reinharts epw2wea program, which does the correct translation. With the correct input, gendaymtx seems to produce appropriate output.

Best,  
-Greg

> **···**
>
> > From: Greg Ward \<gward@lmi.net\>  
> > Date: October 3, 2013 8:37:15 AM PDT
> > 
> > Hi Mostapha,
> > 
> > This sounds like a bug in gendaymtx. Some versions of the standard library print out "-1.#J" for NaN (Not a Number), which can result from a divide-by-zero or similar illegal math operation. If you send me your weather file in a separate message (not to the mailing list), I will see if I can reproduce the problem. There may be a corner case or two that gendaymtx still doesn't deal with gracefully.
> > 
> > Cheers,  
> > -Greg
> > 
> > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > Date: October 2, 2013 1:37:49 PM PDT
> > > 
> > > Hi all,
> > > 
> > > I tried to read the results of the gendaymtx with a custom script and I noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does anybody know why this is happening?
> > > 
> > > I'm trying to get the total solar radiation for sky patches (-O1). I'm running RADIANCE on Windows and here is the line:
> > > 
> > > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\> .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > > 
> > > Thanks in advance,  
> > > Mostapha

---

<div class="post-metadata">

**Author:** ![Mostapha](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/mostapha/32/801_2.png) [@Mostapha](https://discourse.radiance-online.org/u/Mostapha)\
**Post date:** [October 3, 2013, 5:21pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/4 "2013-10-03T17:21:55Z")

</div>

Hi Greg,

Thank you for checking. My bad! I use my own written epw2wea convertor so  
the user don't need to download epw2wea file separately. That was a bug  
indeed. Sorry about that.

One more question about conversion of the results of gendaymtx. Where can I  
find solid angle subtended for each patch of Reinhart sky? I already have  
the values for Tregenza sky as (0.0435, 0.0416, 0.0474, 0.0407, 0.0429,  
0.0445, 0.0455, 0.0344) for the 8 rows. Is it fine to use the same numbers  
for every two rows?

Thanks again,  
Mostapha

> **···**
>
> On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \<gregoryjward@gmail.com\>wrote:
> 
> > Hi Mostapha,
> > 
> > Thanks for sending your files. For some reason, your WEA file has the  
> > month and day columns swapped, which is the source of your error. What did  
> > you use to translate the EPW file? The latest HEAD includes Christoph  
> > Reinharts epw2wea program, which does the correct translation. With the  
> > correct input, gendaymtx seems to produce appropriate output.
> > 
> > Best,  
> > -Greg
> > 
> > \*From: \*Greg Ward \<gward@lmi.net\>
> > 
> > \*Date: \*October 3, 2013 8:37:15 AM PDT
> > 
> > \*  
> > \*
> > 
> > Hi Mostapha,
> > 
> > This sounds like a bug in gendaymtx. Some versions of the standard  
> > library print out "-1.#J" for NaN (Not a Number), which can result from a  
> > divide-by-zero or similar illegal math operation. If you send me your  
> > weather file in a separate message (not to the mailing list), I will see if  
> > I can reproduce the problem. There may be a corner case or two that  
> > gendaymtx still doesn't deal with gracefully.
> > 
> > Cheers,  
> > -Greg
> > 
> > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com\>
> > 
> > \*Date: \*October 2, 2013 1:37:49 PM PDT
> > 
> > \*  
> > \*
> > 
> > Hi all,
> > 
> > I tried to read the results of the gendaymtx with a custom script and I  
> > noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does  
> > anybody know why this is happening?
> > 
> > I'm trying to get the total solar radiation for sky patches (-O1). I'm  
> > running RADIANCE on Windows and here is the line:
> > 
> > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\>  
> > .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > 
> > Thanks in advance,  
> > Mostapha
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Radiance-general mailing list  
> > Radiance-general@radiance-online.org  
> > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [October 4, 2013, 2:43am UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/5 "2013-10-04T02:43:15Z")

</div>

Here are the solid angles (in steradians) for the full Klems rows:

0.023909417  
0.0237731163  
0.0234119493  
0.0273807841  
0.0293333813  
0.0349581625  
0.0478687897  
0.051801754  
0.135517335

Note that we start at the zenith in the Klems subdivision, not at the horizon the way Tregenza's goes.

-Greg

P.S. I used the command:

&nbsp;&nbsp;cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq

> **···**
>
> > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > Date: October 3, 2013 10:21:55 AM PDT
> > 
> > Hi Greg,
> > 
> > Thank you for checking. My bad! I use my own written epw2wea convertor so the user don't need to download epw2wea file separately. That was a bug indeed. Sorry about that.
> > 
> > One more question about conversion of the results of gendaymtx. Where can I find solid angle subtended for each patch of Reinhart sky? I already have the values for Tregenza sky as (0.0435, 0.0416, 0.0474, 0.0407, 0.0429, 0.0445, 0.0455, 0.0344) for the 8 rows. Is it fine to use the same numbers for every two rows?
> > 
> > Thanks again,  
> > Mostapha
> > 
> > On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \<gregoryjward@gmail.com\> wrote:  
> > Hi Mostapha,
> > 
> > Thanks for sending your files. For some reason, your WEA file has the month and day columns swapped, which is the source of your error. What did you use to translate the EPW file? The latest HEAD includes Christoph Reinharts epw2wea program, which does the correct translation. With the correct input, gendaymtx seems to produce appropriate output.
> > 
> > Best,  
> > -Greg
> > 
> > > From: Greg Ward \<gward@lmi.net\>  
> > > Date: October 3, 2013 8:37:15 AM PDT
> > > 
> > > Hi Mostapha,
> > > 
> > > This sounds like a bug in gendaymtx. Some versions of the standard library print out "-1.#J" for NaN (Not a Number), which can result from a divide-by-zero or similar illegal math operation. If you send me your weather file in a separate message (not to the mailing list), I will see if I can reproduce the problem. There may be a corner case or two that gendaymtx still doesn't deal with gracefully.
> > > 
> > > Cheers,  
> > > -Greg
> > > 
> > > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > > Date: October 2, 2013 1:37:49 PM PDT
> > > > 
> > > > Hi all,
> > > > 
> > > > I tried to read the results of the gendaymtx with a custom script and I noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does anybody know why this is happening?
> > > > 
> > > > I'm trying to get the total solar radiation for sky patches (-O1). I'm running RADIANCE on Windows and here is the line:
> > > > 
> > > > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\> .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > > > 
> > > > Thanks in advance,  
> > > > Mostapha

---

<div class="post-metadata">

**Author:** ![Mostapha](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/mostapha/32/801_2.png) [@Mostapha](https://discourse.radiance-online.org/u/Mostapha)\
**Post date:** [October 4, 2013, 2:07pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/6 "2013-10-04T14:07:24Z")

</div>

Hi Greg,

I know it may not be the normal use of gendaymtx but I'm not using it to  
run 5Phase or 3Phase method.

What I'm looking for is the values for each sky patch itself (e.g. 577  
numbers for each time step for Reinhart sky). The numbers are already  
generated from gendaymtx and I just want to multiply them with stradian  
angles to have the values in w/m2.

I assume it should be 15 numbers for 14 rows + zenith patch.

Cheers,  
Mostapha

PS: I wish I knew how to write a line like this on Windows then I could run  
it for reinhart.cal I assume. :-\

> **···**
>
> On Thu, Oct 3, 2013 at 10:43 PM, Greg Ward \<gregoryjward@gmail.com\> wrote:
> 
> > Here are the solid angles (in steradians) for the full Klems rows:
> > 
> > 0.023909417  
> > 0.0237731163  
> > 0.0234119493  
> > 0.0273807841  
> > 0.0293333813  
> > 0.0349581625  
> > 0.0478687897  
> > 0.051801754  
> > 0.135517335
> > 
> > Note that we start at the zenith in the Klems subdivision, not at the  
> > horizon the way Tregenza's goes.
> > 
> > -Greg
> > 
> > P.S. I used the command:
> > 
> > cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq
> > 
> > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com\>
> > 
> > \*Date: \*October 3, 2013 10:21:55 AM PDT
> > 
> > \*  
> > \*
> > 
> > Hi Greg,
> > 
> > Thank you for checking. My bad! I use my own written epw2wea convertor so  
> > the user don't need to download epw2wea file separately. That was a bug  
> > indeed. Sorry about that.
> > 
> > One more question about conversion of the results of gendaymtx. Where can  
> > I find solid angle subtended for each patch of Reinhart sky? I already  
> > have the values for Tregenza sky as (0.0435, 0.0416, 0.0474, 0.0407,  
> > 0.0429, 0.0445, 0.0455, 0.0344) for the 8 rows. Is it fine to use the same  
> > numbers for every two rows?
> > 
> > Thanks again,  
> > Mostapha
> > 
> > On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \<gregoryjward@gmail.com\>wrote:
> > 
> > > Hi Mostapha,
> > > 
> > > Thanks for sending your files. For some reason, your WEA file has the  
> > > month and day columns swapped, which is the source of your error. What did  
> > > you use to translate the EPW file? The latest HEAD includes Christoph  
> > > Reinharts epw2wea program, which does the correct translation. With the  
> > > correct input, gendaymtx seems to produce appropriate output.
> > > 
> > > Best,  
> > > -Greg
> > > 
> > > \*From: \*Greg Ward \<gward@lmi.net\>
> > > 
> > > \*Date: \*October 3, 2013 8:37:15 AM PDT
> > > 
> > > \*  
> > > \*
> > > 
> > > Hi Mostapha,
> > > 
> > > This sounds like a bug in gendaymtx. Some versions of the standard  
> > > library print out "-1.#J" for NaN (Not a Number), which can result from a  
> > > divide-by-zero or similar illegal math operation. If you send me your  
> > > weather file in a separate message (not to the mailing list), I will see if  
> > > I can reproduce the problem. There may be a corner case or two that  
> > > gendaymtx still doesn't deal with gracefully.
> > > 
> > > Cheers,  
> > > -Greg
> > > 
> > > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com\>
> > > 
> > > \*Date: \*October 2, 2013 1:37:49 PM PDT
> > > 
> > > \*  
> > > \*
> > > 
> > > Hi all,
> > > 
> > > I tried to read the results of the gendaymtx with a custom script and I  
> > > noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does  
> > > anybody know why this is happening?
> > > 
> > > I'm trying to get the total solar radiation for sky patches (-O1). I'm  
> > > running RADIANCE on Windows and here is the line:
> > > 
> > > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\>  
> > > .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > > 
> > > Thanks in advance,  
> > > Mostapha
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Radiance-general mailing list  
> > Radiance-general@radiance-online.org  
> > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [October 4, 2013, 3:16pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/7 "2013-10-04T15:16:27Z")

</div>

Hi Mostapha,

If you run the command I gave you at the end of my e-mail, minus the "uniq" function that takes out the repeated values, you will get 145 solid angles for the 145 patches, starting as I said from the ZENITH patch. You just need to find the klems\_ang.cal file, which comes in the ray/src/cal/cal directory with the distribution.

The Reinhart sky source generator is called reinsrc.cal, and you can use it like this:

&nbsp;&nbsp;cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e 'Rbin=recno;$1=Romega' \> rh\_sang.txt

You will 2305 values, get one solid angle for each patch. If you change the MF setting, you will need to use a different number in cnt according to (using an example subdivision of 2):

&nbsp;&nbsp;rcalc -n -e MF:2 -f reinhart.cal -e '$1=Nrbins'

The output of gendaymtx has 145 rows of 8760 values each for a full year, which may be less convenient for you. You may swap rows and columns using the new rcollate command if you have it in your installation:

&nbsp;&nbsp;gendaymtx year.wea | rcollate -i \> transpose.txt

Cheers,  
-Greg

> **···**
>
> > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > Date: October 4, 2013 7:07:24 AM PDT
> > 
> > Hi Greg,
> > 
> > I know it may not be the normal use of gendaymtx but I'm not using it to run 5Phase or 3Phase method.
> > 
> > What I'm looking for is the values for each sky patch itself (e.g. 577 numbers for each time step for Reinhart sky). The numbers are already generated from gendaymtx and I just want to multiply them with stradian angles to have the values in w/m2.
> > 
> > I assume it should be 15 numbers for 14 rows + zenith patch.
> > 
> > Cheers,  
> > Mostapha
> > 
> > PS: I wish I knew how to write a line like this on Windows then I could run it for reinhart.cal I assume. :-\
> > 
> > On Thu, Oct 3, 2013 at 10:43 PM, Greg Ward \<gregoryjward@gmail.com\> wrote:  
> > Here are the solid angles (in steradians) for the full Klems rows:
> > 
> > 0.023909417  
> > 0.0237731163  
> > 0.0234119493  
> > 0.0273807841  
> > 0.0293333813  
> > 0.0349581625  
> > 0.0478687897  
> > 0.051801754  
> > 0.135517335
> > 
> > Note that we start at the zenith in the Klems subdivision, not at the horizon the way Tregenza's goes.
> > 
> > -Greg
> > 
> > P.S. I used the command:
> > 
> > &nbsp;&nbsp;cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq
> > 
> > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > Date: October 3, 2013 10:21:55 AM PDT
> > > 
> > > Hi Greg,
> > > 
> > > Thank you for checking. My bad! I use my own written epw2wea convertor so the user don't need to download epw2wea file separately. That was a bug indeed. Sorry about that.
> > > 
> > > One more question about conversion of the results of gendaymtx. Where can I find solid angle subtended for each patch of Reinhart sky? I already have the values for Tregenza sky as (0.0435, 0.0416, 0.0474, 0.0407, 0.0429, 0.0445, 0.0455, 0.0344) for the 8 rows. Is it fine to use the same numbers for every two rows?
> > > 
> > > Thanks again,  
> > > Mostapha
> > > 
> > > On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \<gregoryjward@gmail.com\> wrote:  
> > > Hi Mostapha,
> > > 
> > > Thanks for sending your files. For some reason, your WEA file has the month and day columns swapped, which is the source of your error. What did you use to translate the EPW file? The latest HEAD includes Christoph Reinharts epw2wea program, which does the correct translation. With the correct input, gendaymtx seems to produce appropriate output.
> > > 
> > > Best,  
> > > -Greg
> > > 
> > > > From: Greg Ward \<gward@lmi.net\>  
> > > > Date: October 3, 2013 8:37:15 AM PDT
> > > > 
> > > > Hi Mostapha,
> > > > 
> > > > This sounds like a bug in gendaymtx. Some versions of the standard library print out "-1.#J" for NaN (Not a Number), which can result from a divide-by-zero or similar illegal math operation. If you send me your weather file in a separate message (not to the mailing list), I will see if I can reproduce the problem. There may be a corner case or two that gendaymtx still doesn't deal with gracefully.
> > > > 
> > > > Cheers,  
> > > > -Greg
> > > > 
> > > > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > > > Date: October 2, 2013 1:37:49 PM PDT
> > > > > 
> > > > > Hi all,
> > > > > 
> > > > > I tried to read the results of the gendaymtx with a custom script and I noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does anybody know why this is happening?
> > > > > 
> > > > > I'm trying to get the total solar radiation for sky patches (-O1). I'm running RADIANCE on Windows and here is the line:
> > > > > 
> > > > > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\> .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > > > > 
> > > > > Thanks in advance,  
> > > > > Mostapha
> > 
> > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)

---

<div class="post-metadata">

**Author:** ![Mostapha](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/mostapha/32/801_2.png) [@Mostapha](https://discourse.radiance-online.org/u/Mostapha)\
**Post date:** [October 4, 2013, 4:02pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/8 "2013-10-04T16:02:02Z")

</div>

Hi Greg,

Perfect! I think I have all I need now. Thank you so much for your help.

Cheers,  
Mostapha

PS: Just in case there are other Windows users here who want to use the  
same commands. You need to remove single quotes. Something like this works  
on Windows:

cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e Rbin=recno;$1=Romega \>  
rh\_sang.txt

> **···**
>
> On Fri, Oct 4, 2013 at 11:16 AM, Greg Ward \<gregoryjward@gmail.com\> wrote:
> 
> > Hi Mostapha,
> > 
> > If you run the command I gave you at the end of my e-mail, minus the  
> > "uniq" function that takes out the repeated values, you will get 145 solid  
> > angles for the 145 patches, starting as I said from the ZENITH patch. You  
> > just need to find the klems\_ang.cal file, which comes in the  
> > ray/src/cal/cal directory with the distribution.
> > 
> > The Reinhart sky source generator is called reinsrc.cal, and you can use  
> > it like this:
> > 
> > cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e 'Rbin=recno;$1=Romega' \>  
> > rh\_sang.txt
> > 
> > You will 2305 values, get one solid angle for each patch. If you change  
> > the MF setting, you will need to use a different number in cnt according to  
> > (using an example subdivision of 2):
> > 
> > rcalc -n -e MF:2 -f reinhart.cal -e '$1=Nrbins'
> > 
> > The output of gendaymtx has 145 rows of 8760 values each for a full year,  
> > which may be less convenient for you. You may swap rows and columns using  
> > the new rcollate command if you have it in your installation:
> > 
> > gendaymtx year.wea | rcollate -i \> transpose.txt
> > 
> > Cheers,  
> > -Greg
> > 
> > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com\>
> > 
> > \*Date: \*October 4, 2013 7:07:24 AM PDT
> > 
> > \*  
> > \*
> > 
> > Hi Greg,
> > 
> > I know it may not be the normal use of gendaymtx but I'm not using it to  
> > run 5Phase or 3Phase method.
> > 
> > What I'm looking for is the values for each sky patch itself (e.g. 577  
> > numbers for each time step for Reinhart sky). The numbers are already  
> > generated from gendaymtx and I just want to multiply them with stradian  
> > angles to have the values in w/m2.
> > 
> > I assume it should be 15 numbers for 14 rows + zenith patch.
> > 
> > Cheers,  
> > Mostapha
> > 
> > PS: I wish I knew how to write a line like this on Windows then I could  
> > run it for reinhart.cal I assume. :-\
> > 
> > On Thu, Oct 3, 2013 at 10:43 PM, Greg Ward \<gregoryjward@gmail.com\> wrote:
> > 
> > > Here are the solid angles (in steradians) for the full Klems rows:
> > > 
> > > 0.023909417  
> > > 0.0237731163  
> > > 0.0234119493  
> > > 0.0273807841  
> > > 0.0293333813  
> > > 0.0349581625  
> > > 0.0478687897  
> > > 0.051801754  
> > > 0.135517335
> > > 
> > > Note that we start at the zenith in the Klems subdivision, not at the  
> > > horizon the way Tregenza's goes.
> > > 
> > > -Greg
> > > 
> > > P.S. I used the command:
> > > 
> > > cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq
> > > 
> > > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com\>
> > > 
> > > \*Date: \*October 3, 2013 10:21:55 AM PDT
> > > 
> > > \*  
> > > \*
> > > 
> > > Hi Greg,
> > > 
> > > Thank you for checking. My bad! I use my own written epw2wea convertor so  
> > > the user don't need to download epw2wea file separately. That was a bug  
> > > indeed. Sorry about that.
> > > 
> > > One more question about conversion of the results of gendaymtx. Where can  
> > > I find solid angle subtended for each patch of Reinhart sky? I already  
> > > have the values for Tregenza sky as (0.0435, 0.0416, 0.0474, 0.0407,  
> > > 0.0429, 0.0445, 0.0455, 0.0344) for the 8 rows. Is it fine to use the same  
> > > numbers for every two rows?
> > > 
> > > Thanks again,  
> > > Mostapha
> > > 
> > > On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \<gregoryjward@gmail.com\>wrote:
> > > 
> > > > Hi Mostapha,
> > > > 
> > > > Thanks for sending your files. For some reason, your WEA file has the  
> > > > month and day columns swapped, which is the source of your error. What did  
> > > > you use to translate the EPW file? The latest HEAD includes Christoph  
> > > > Reinharts epw2wea program, which does the correct translation. With the  
> > > > correct input, gendaymtx seems to produce appropriate output.
> > > > 
> > > > Best,  
> > > > -Greg
> > > > 
> > > > \*From: \*Greg Ward \<gward@lmi.net\>
> > > > 
> > > > \*Date: \*October 3, 2013 8:37:15 AM PDT
> > > > 
> > > > \*  
> > > > \*
> > > > 
> > > > Hi Mostapha,
> > > > 
> > > > This sounds like a bug in gendaymtx. Some versions of the standard  
> > > > library print out "-1.#J" for NaN (Not a Number), which can result from a  
> > > > divide-by-zero or similar illegal math operation. If you send me your  
> > > > weather file in a separate message (not to the mailing list), I will see if  
> > > > I can reproduce the problem. There may be a corner case or two that  
> > > > gendaymtx still doesn't deal with gracefully.
> > > > 
> > > > Cheers,  
> > > > -Greg
> > > > 
> > > > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com\>
> > > > 
> > > > \*Date: \*October 2, 2013 1:37:49 PM PDT
> > > > 
> > > > \*  
> > > > \*
> > > > 
> > > > Hi all,
> > > > 
> > > > I tried to read the results of the gendaymtx with a custom script and I  
> > > > noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does  
> > > > anybody know why this is happening?
> > > > 
> > > > I'm trying to get the total solar radiation for sky patches (-O1). I'm  
> > > > running RADIANCE on Windows and here is the line:
> > > > 
> > > > gendaymtx -m 1 -O1 .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\>  
> > > > .\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > > > 
> > > > Thanks in advance,  
> > > > Mostapha
> > > > 
> > > > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Radiance-general mailing list  
> > Radiance-general@radiance-online.org  
> > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [October 4, 2013, 4:20pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/9 "2013-10-04T16:20:51Z")

</div>

Right. In general, you need to replace single-quotes on the command line with double-quotes under Windows.

-Greg

> **···**
>
> > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > Date: October 4, 2013 9:02:02 AM PDT
> > 
> > Hi Greg,
> > 
> > Perfect! I think I have all I need now. Thank you so much for your help.
> > 
> > Cheers,  
> > Mostapha
> > 
> > PS: Just in case there are other Windows users here who want to use the same commands. You need to remove single quotes. Something like this works on Windows:
> > 
> > cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e Rbin=recno;$1=Romega \> rh\_sang.txt
> > 
> > On Fri, Oct 4, 2013 at 11:16 AM, Greg Ward \<gregoryjward@gmail.com\> wrote:  
> > Hi Mostapha,
> > 
> > If you run the command I gave you at the end of my e-mail, minus the "uniq" function that takes out the repeated values, you will get 145 solid angles for the 145 patches, starting as I said from the ZENITH patch. You just need to find the klems\_ang.cal file, which comes in the ray/src/cal/cal directory with the distribution.
> > 
> > The Reinhart sky source generator is called reinsrc.cal, and you can use it like this:
> > 
> > &nbsp;&nbsp;cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e 'Rbin=recno;$1=Romega' \> rh\_sang.txt
> > 
> > You will 2305 values, get one solid angle for each patch. If you change the MF setting, you will need to use a different number in cnt according to (using an example subdivision of 2):
> > 
> > &nbsp;&nbsp;rcalc -n -e MF:2 -f reinhart.cal -e '$1=Nrbins'
> > 
> > The output of gendaymtx has 145 rows of 8760 values each for a full year, which may be less convenient for you. You may swap rows and columns using the new rcollate command if you have it in your installation:
> > 
> > &nbsp;&nbsp;gendaymtx year.wea | rcollate -i \> transpose.txt
> > 
> > Cheers,  
> > -Greg
> > 
> > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > Date: October 4, 2013 7:07:24 AM PDT
> > > 
> > > Hi Greg,
> > > 
> > > I know it may not be the normal use of gendaymtx but I'm not using it to run 5Phase or 3Phase method.
> > > 
> > > What I'm looking for is the values for each sky patch itself (e.g. 577 numbers for each time step for Reinhart sky). The numbers are already generated from gendaymtx and I just want to multiply them with stradian angles to have the values in w/m2.
> > > 
> > > I assume it should be 15 numbers for 14 rows + zenith patch.
> > > 
> > > Cheers,  
> > > Mostapha
> > > 
> > > PS: I wish I knew how to write a line like this on Windows then I could run it for reinhart.cal I assume. :-\
> > > 
> > > On Thu, Oct 3, 2013 at 10:43 PM, Greg Ward \<gregoryjward@gmail.com\> wrote:  
> > > Here are the solid angles (in steradians) for the full Klems rows:
> > > 
> > > 0.023909417  
> > > 0.0237731163  
> > > 0.0234119493  
> > > 0.0273807841  
> > > 0.0293333813  
> > > 0.0349581625  
> > > 0.0478687897  
> > > 0.051801754  
> > > 0.135517335
> > > 
> > > Note that we start at the zenith in the Klems subdivision, not at the horizon the way Tregenza's goes.
> > > 
> > > -Greg
> > > 
> > > P.S. I used the command:
> > > 
> > > &nbsp;&nbsp;cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq

---

<div class="post-metadata">

**Author:** ![Jack\_de\_Valpine](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@Jack\_de\_Valpine](https://discourse.radiance-online.org/u/Jack_de_Valpine)\
**Post date:** [October 4, 2013, 4:25pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/10 "2013-10-04T16:25:14Z")

</div>

Hi Mostapha,

Just a quick note, I think that Greg means:

&nbsp;&nbsp;&nbsp;&nbsp;gendaymtx year.wea | rcollate -t \> transpose.txt

to transpose.

-Jack

> **···**
>
> --  
> Jack de Valpine  
> President
> 
> Visarc Incorporated
> 
> > **[VISARC 3D Modeling, Rendering and Architectural Visualization](http://www.visarc.com)**
> >
> > VISARC provides 3D computer modeling, architectural visualization and performance simulation services to architects, engineers, developers and owners.
> 
> channeling technology for superior design and construction
> 
> On 10/4/2013 11:16 AM, Greg Ward wrote:
> 
> > Hi Mostapha,
> > 
> > If you run the command I gave you at the end of my e-mail, minus the "uniq" function that takes out the repeated values, you will get 145 solid angles for the 145 patches, starting as I said from the ZENITH patch. You just need to find the klems\_ang.cal file, which comes in the ray/src/cal/cal directory with the distribution.
> > 
> > The Reinhart sky source generator is called reinsrc.cal, and you can use it like this:
> > 
> > cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e 'Rbin=recno;$1=Romega' \> rh\_sang.txt
> > 
> > You will 2305 values, get one solid angle for each patch. If you change the MF setting, you will need to use a different number in cnt according to (using an example subdivision of 2):
> > 
> > rcalc -n -e MF:2 -f reinhart.cal -e '$1=Nrbins'
> > 
> > The output of gendaymtx has 145 rows of 8760 values each for a full year, which may be less convenient for you. You may swap rows and columns using the new rcollate command if you have it in your installation:
> > 
> > gendaymtx year.wea | rcollate -i \> transpose.txt
> > 
> > Cheers,  
> > -Greg
> > 
> > > \*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com \<mailto:sadeghipour@gmail.com\>\>
> > > 
> > > \*Date: \*October 4, 2013 7:07:24 AM PDT
> > > 
> > > \*
> > > 
> > > Hi Greg,
> > > 
> > > I know it may not be the normal use of gendaymtx but I'm not using it to run 5Phase or 3Phase method.
> > > 
> > > What I'm looking for is the values for each sky patch itself (e.g. 577 numbers for each time step for Reinhart sky). The numbers are already generated from gendaymtx and I just want to multiply them with stradian angles to have the values in w/m2.
> > > 
> > > I assume it should be 15 numbers for 14 rows + zenith patch.
> > > 
> > > Cheers,  
> > > Mostapha
> > > 
> > > PS: I wish I knew how to write a line like this on Windows then I could run it for reinhart.cal I assume. :-\
> > > 
> > > On Thu, Oct 3, 2013 at 10:43 PM, Greg Ward \<gregoryjward@gmail.com \>\> \<mailto:gregoryjward@gmail.com\>\> wrote:
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;Here are the solid angles (in steradians) for the full Klems rows:
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.023909417  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.0237731163  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.0234119493  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.0273807841  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.0293333813  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.0349581625  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.0478687897  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.051801754  
> > > &nbsp;&nbsp;&nbsp;&nbsp;0.135517335
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;Note that we start at the zenith in the Klems subdivision, not at  
> > > &nbsp;&nbsp;&nbsp;&nbsp;the horizon the way Tregenza's goes.
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;-Greg
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;P.S. I used the command:
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq
> > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;\*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;\<mailto:sadeghipour@gmail.com\>\>
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;\*Date: \*October 3, 2013 10:21:55 AM PDT
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;\*
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Hi Greg,
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Thank you for checking. My bad! I use my own written epw2wea  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;convertor so the user don't need to download epw2wea file  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;separately. That was a bug indeed. Sorry about that.
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;One more question about conversion of the results of gendaymtx.  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Where can I find solid angle subtended for each patch of  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Reinhart sky? I already have the values for Tregenza sky as  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;(0.0435, 0.0416, 0.0474, 0.0407, 0.0429, 0.0445, 0.0455, 0.0344)  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;for the 8 rows. Is it fine to use the same numbers for every two  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;rows?
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Thanks again,  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Mostapha
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \>\>\> \<gregoryjward@gmail.com \<mailto:gregoryjward@gmail.com\>\> wrote:
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi Mostapha,
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks for sending your files. For some reason, your WEA  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file has the month and day columns swapped, which is the  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;source of your error. What did you use to translate the EPW  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file? The latest HEAD includes Christoph Reinharts epw2wea  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;program, which does the correct translation. With the  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;correct input, gendaymtx seems to produce appropriate output.
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Best,  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-Greg
> > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*From: \*Greg Ward \<gward@lmi.net \<mailto:gward@lmi.net\>\>
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*Date: \*October 3, 2013 8:37:15 AM PDT
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi Mostapha,
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This sounds like a bug in gendaymtx. Some versions of the  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;standard library print out "-1.#J" for NaN (Not a Number),  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which can result from a divide-by-zero or similar illegal  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;math operation. If you send me your weather file in a  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;separate message (not to the mailing list), I will see if I  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can reproduce the problem. There may be a corner case or  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two that gendaymtx still doesn't deal with gracefully.
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cheers,  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-Greg
> > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*From: \*Mostapha Sadeghipour \<sadeghipour@gmail.com  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<mailto:sadeghipour@gmail.com\>\>
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*Date: \*October 2, 2013 1:37:49 PM PDT
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\*
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi all,
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I tried to read the results of the gendaymtx with a custom  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;script and I noticed that there are multiple values of -1.#J -1.#J -1.#J for RGB. Does anybody know why this is  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;happening?
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I'm trying to get the total solar radiation for sky  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;patches (-O1). I'm running RADIANCE on Windows and here is  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the line:
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gendaymtx -m 1 -O1  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.wea\>  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.\USA\_AK\_Anchorage.Intl.AP.702730\_TMY3.mtx
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks in advance,  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mostapha
> > > 
> > > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Radiance-general mailing list  
> > Radiance-general@radiance-online.org  
> > [http://www.radiance-online.org/mailman/listinfo/radiance-general](http://www.radiance-online.org/mailman/listinfo/radiance-general)

---

<div class="post-metadata">

**Author:** ![Greg\_Ward](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/greg_ward/32/471_2.png) [@Greg\_Ward](https://discourse.radiance-online.org/u/Greg_Ward)\
**Post date:** [October 4, 2013, 4:39pm UTC](https://discourse.radiance-online.org/t/gendaymtx-returns-1-j-1-j-1-j/3463/11 "2013-10-04T16:39:32Z")

</div>

Indeed, I did. Good catch, Jack! Under Unix, it's more efficient to use:

gendaymtx year.wea \> temp.txt  
rcollate -t temp.txt \> transpose.txt  
rm temp.txt

Maybe not enough to really matter, but if you use a Reinhart sky then it can start to make a difference.

-G

> **···**
>
> > From: Jack de Valpine \<jedev@visarc.com\>  
> > Date: October 4, 2013 9:25:14 AM PDT
> > 
> > Hi Mostapha,
> > 
> > Just a quick note, I think that Greg means:  
> > gendaymtx year.wea | rcollate -t \> transpose.txt  
> > to transpose.
> > 
> > -Jack  
> > --  
> > Jack de Valpine  
> > President
> > 
> > Visarc Incorporated  
> > [www.visarc.com](http://www.visarc.com)
> > 
> > channeling technology for superior design and construction  
> > On 10/4/2013 11:16 AM, Greg Ward wrote:
> > 
> > > Hi Mostapha,
> > > 
> > > If you run the command I gave you at the end of my e-mail, minus the "uniq" function that takes out the repeated values, you will get 145 solid angles for the 145 patches, starting as I said from the ZENITH patch. You just need to find the klems\_ang.cal file, which comes in the ray/src/cal/cal directory with the distribution.
> > > 
> > > The Reinhart sky source generator is called reinsrc.cal, and you can use it like this:
> > > 
> > > cnt 2305 | rcalc -e MF:4 -f reinsrc.cal -e 'Rbin=recno;$1=Romega' \> rh\_sang.txt
> > > 
> > > You will 2305 values, get one solid angle for each patch. If you change the MF setting, you will need to use a different number in cnt according to (using an example subdivision of 2):
> > > 
> > > rcalc -n -e MF:2 -f reinhart.cal -e '$1=Nrbins'
> > > 
> > > The output of gendaymtx has 145 rows of 8760 values each for a full year, which may be less convenient for you. You may swap rows and columns using the new rcollate command if you have it in your installation:
> > > 
> > > gendaymtx year.wea | rcollate -i \> transpose.txt
> > > 
> > > Cheers,  
> > > -Greg
> > > 
> > > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > > Date: October 4, 2013 7:07:24 AM PDT
> > > > 
> > > > Hi Greg,
> > > > 
> > > > I know it may not be the normal use of gendaymtx but I'm not using it to run 5Phase or 3Phase method.
> > > > 
> > > > What I'm looking for is the values for each sky patch itself (e.g. 577 numbers for each time step for Reinhart sky). The numbers are already generated from gendaymtx and I just want to multiply them with stradian angles to have the values in w/m2.
> > > > 
> > > > I assume it should be 15 numbers for 14 rows + zenith patch.
> > > > 
> > > > Cheers,  
> > > > Mostapha
> > > > 
> > > > PS: I wish I knew how to write a line like this on Windows then I could run it for reinhart.cal I assume. :-\
> > > > 
> > > > On Thu, Oct 3, 2013 at 10:43 PM, Greg Ward \<gregoryjward@gmail.com\> wrote:  
> > > > Here are the solid angles (in steradians) for the full Klems rows:
> > > > 
> > > > 0.023909417  
> > > > 0.0237731163  
> > > > 0.0234119493  
> > > > 0.0273807841  
> > > > 0.0293333813  
> > > > 0.0349581625  
> > > > 0.0478687897  
> > > > 0.051801754  
> > > > 0.135517335
> > > > 
> > > > Note that we start at the zenith in the Klems subdivision, not at the horizon the way Tregenza's goes.
> > > > 
> > > > -Greg
> > > > 
> > > > P.S. I used the command:
> > > > 
> > > > cnt 145 | rcalc -f klems\_ang.cal -e 'kbin=recno;$1=omega' | uniq
> > > > 
> > > > > From: Mostapha Sadeghipour \<sadeghipour@gmail.com\>  
> > > > > Date: October 3, 2013 10:21:55 AM PDT
> > > > > 
> > > > > Hi Greg,
> > > > > 
> > > > > Thank you for checking. My bad! I use my own written epw2wea convertor so the user don't need to download epw2wea file separately. That was a bug indeed. Sorry about that.
> > > > > 
> > > > > One more question about conversion of the results of gendaymtx. Where can I find solid angle subtended for each patch of Reinhart sky? I already have the values for Tregenza sky as (0.0435, 0.0416, 0.0474, 0.0407, 0.0429, 0.0445, 0.0455, 0.0344) for the 8 rows. Is it fine to use the same numbers for every two rows?
> > > > > 
> > > > > Thanks again,  
> > > > > Mostapha
> > > > > 
> > > > > On Thu, Oct 3, 2013 at 12:21 PM, Gregory J. Ward \<gregoryjward@gmail.com\> wrote:  
> > > > > Hi Mostapha,
> > > > > 
> > > > > Thanks for sending your files. For some reason, your WEA file has the month and day columns swapped, which is the source of your error. What did you use to translate the EPW file? The latest HEAD includes Christoph Reinharts epw2wea program, which does the correct translation. With the correct input, gendaymtx seems to produce appropriate output.
> > > > > 
> > > > > Best,  
> > > > > -Greg
