Page 2 of 2

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Sun 05 Apr 2020 6:09 am
by HansR
The actual visual of the light of the moon is a complex issue but by the visualisation I include makes it a bit more comprehensible. Point is, that the angle, and as such the actual position of the moon defines what you see. Moonage is more difficult because of the difference between the actual rotation and that we observe with the rotation of the earth. The angle can be calculated though so that should be your driving parameter.
200405 Moon.png
You can deduct an equation but that quickly becomes very complex (though it can be done). However after some research, the projection of the moonlight fraction as seen by us can be fairly approximated by an elliptic part (where light and darkness meet). That ellipse is defined by the radius of the moon (vertical) and the radius of the lighted part (horizontal). The horizontal part is defined by 'ellipse x-radius' = 'Moon radius' * cos( theta ). At least, that is what I use in a continuous simulation (visual here).

So in summary: I think you should use angle (or percentage) i.s.o. moon age.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Sun 05 Apr 2020 2:20 pm
by beteljuice
the beteljuice again states the obvious !!!

Moonage is time count from New Moon .. simple :)

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Sun 05 Apr 2020 5:03 pm
by mcrossley
beteljuice wrote: Sun 05 Apr 2020 2:20 pm the beteljuice again states the obvious !!!

Moonage is time count from New Moon .. simple :)
Yep! Nothing to do with phase - well only loosely, the only time you can guarantee they match is when age = 0 :D

Anyway, I've sorted it, the CMX moon phase/illumination calculation is already accurate*. The moon age is not, it will be out by a constant value for each lunar cycle. How far out? Approximately +/- 6.5 hours.

The next release will have accurate an moon age. It will also have the ability to generate an accurate phase image, so hopefully that will resolve all the issues.

* Accurate enough for a weather program anyway!

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Sun 05 Apr 2020 10:07 pm
by BCJKiwi
Good news,

Saves me the effort of reworking all the images I have from a days to a % basis.
I was going to rework the cloudbase images based on the above images and also convert them to %.
The present UI based website images are .png files 96 x 96 px on a transparent background.
The cloudbase images are .gif files 25 x 25 px on a dark blue background.
I think I will be stuck with a set of fixed images based on % for cloudbase as I presume you will have no interest in generating those and I would not expect you to. There is an additional issue with them in that they must be gifs and gifs do not support a transparent background which is why they are on a dark blue background to match the night images background.

I presume the images generated:-
1. Will have a transparent background so it looks OK on any website theme?
2. Are generated at every interval
3. Are at least around 100 x 100 px so they can be readily scaled as required.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 8:28 am
by mcrossley
Responded off-line.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 11:18 am
by water01
Is it a secret then Mark?

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 1:15 pm
by mcrossley
Hi David, no Brian emailed me with this and other aspects he would like to see implemented, it was easier to reply to the email.

As above, the next version of CMX will support image output, it's customisable too, so you can use whatever base image and output size you want.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 3:55 pm
by beteljuice
@BGJK ..
they must be gifs and gifs do not support a transparent background
??? gifs were the first graphic to allow transparency !

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 8:30 pm
by BCJKiwi
@ beteljuice
Hmmm,
None of the tools I have will save an image with a transparent background as a .gif

Have since managed to modify the cloudbase file to use a .png moon image file.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 8:39 pm
by Mapantz
BCJKiwi wrote: Mon 06 Apr 2020 8:30 pm @ beteljuice
Hmmm,
None of the tools I have will save an image with a transparent background as a .gif

Have since managed to modify the cloudbase file to use a .png moon image file.
I use GIMP for transparency in GIFS. Although, you can do pretty much everything to a PNG and more.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Mon 06 Apr 2020 8:54 pm
by laulau
BCJKiwi wrote: Mon 06 Apr 2020 8:30 pm @ beteljuice
Hmmm,
None of the tools I have will save an image with a transparent background as a .gif

Have since managed to modify the cloudbase file to use a .png moon image file.
Sorry to have started it all :oops:

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Tue 07 Apr 2020 9:05 pm
by BCJKiwi
@laulau
No problem, something good is coming in build 3071 as a result (or maybe it was coming anyway?) - Moon images generated by CumulusMX, updated hourly and based on the real situation, not on moonage.

Working on updates to MX templates - Sorry C1 users this is not for you - go on update to MX, I dare you! ;) ;)
Hope to have this ready for release of build 3071
Requires changes to index, cloudbase and possibly other files to cope with different versions of MX that users may be running.

Re: Moon phases Cumulus 1 v CumulusMX

Posted: Thu 09 Apr 2020 9:55 pm
by BCJKiwi
MX UI Style websites
MX build 3071 moon image
index.php and
cloudbaseCUmx.php

Updated 2020 Apr 10
See first post main thread viewtopic.php?f=18&t=17845#p138283