Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Moon states - I'm stuck

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Moon states - I'm stuck

Post by Flying Eye »

Hi all,

I'm stuck. I have a set of icons that cover the moon phase, they number 0-29, 0 being dark and 29 approaching dark again, with 15 as full moon.

I've seen a few sets that use that numbering and it makes sense after reading what they had to say about moon phases at wikipedia.

I need to find a way to get a number from 0-29 or 1-30 out of cumulus.

I'm using (Serious) Samurize to make an info panel on my desktop (yes, it does work on Win764 bitSP1!, installer has an issue but using vista SP2 compatability mode sorts the installer out.)

It looks like this so far:

Image

I can grab my data for it all from my website by using a Samurize plugin called page scraper, and it was all going pretty well until I hit this problem (well, that and the Zambretti descriptions).

I don't think there is a a webtag to produce the 0-29 or 1-30 number as far as I could discover.

Right now I don't code any more, and I'd quite like it to stay that way, as I seriously burned out on that stuff more than a decade ago.

What's the easiest way to get that 30 integer range I need?

It's so so with 8 icons used and named suitably, but it could be so much better if I could use the whole lot.

Ideas anyone?
Cheers,
Ian
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Moon states - I'm stuck

Post by steve »

There's a web tag <#MoonPercent> which goes from -100 to +100 where -100 and +100 are both 'full moon', zero is 'new moon', and the sign indicates waxing (positive) or waning (negative), so you could map that range onto 0 to 29 with javascript. I'm sure beteljuice will be along in a minute with the code ;)
Steve
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Moon states - I'm stuck

Post by steve »

I think the required conversion is (<#MoonPercent> + 100) * 29)/200
Steve
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Moon states - I'm stuck

Post by mcrossley »

A first punt...


phaseNo = floor((<#MoonPercent>+100)/200*29);

Edit: cross posted with Steve :roll:
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Moon states - I'm stuck

Post by steve »

Sorry - I think my formula is wrong; I've got 'full' and 'new' reversed. Um...
Steve
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Re: Moon states - I'm stuck

Post by Flying Eye »

steve wrote:I think the required conversion is (<#MoonPercent> + 100) * 29)/200
I guess <#moonday> where it chucks out a value between 1 and 30, is out of the question? :P

I would have imagined serving up the day the current moon is on might be a valid thing to want from a program dealing with moon phase, even if one was just wanting to know by way of it being a hobby. ;)

Would be a great addition in my view. :)

Then I could set about figuring out the mapping of zambretti to icons, which is a rather bigger ball of wax.

I'm using icons as I find ones I like for now, but eventually I'll probably make 3D models and do some rendering.

It's nice having an info bar handy at the screen top, or wherever suits you best really. Easy to spot sensor outages too! 8-)
Cheers,
Ian
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Re: Moon states - I'm stuck

Post by Flying Eye »

mcrossley wrote:A first punt...


phaseNo = floor((<#MoonPercent>+100)/200*29);

Edit: cross posted with Steve :roll:
OK, thanks, but what language is that first punt in? I mean I'd have to install and learn some new language for this wouldn't I? Cumulus and Samurize don't do math, and Samurize says it can take scripts, but I'd have to look into that. I'm not sure how I'd feed the result to pagescraper, so the script would have to work on a file somewhere or other. <shrug> :lol:
Cheers,
Ian
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Re: Moon states - I'm stuck

Post by Flying Eye »

steve wrote:Sorry - I think my formula is wrong; I've got 'full' and 'new' reversed. Um...
Hehe, I tried this most of this with a calculator morning, and it made my head hurt in the end! Never did get the right result either! :lol:

Not quite as easy as it looks at first glance is this one! :?
Cheers,
Ian
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Moon states - I'm stuck

Post by mcrossley »

The code is in JavaScript for insertion into a web page.

The output is a value 0-29 (0=new, 7=1st Q, 14=full, 21=last Q, 29=new)
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Re: Moon states - I'm stuck

Post by Flying Eye »

mcrossley wrote:The code is in JavaScript for insertion into a web page.

The output is a value 0-29 (0=new, 7=1st Q, 14=full, 21=last Q, 29=new)
I need to ask a daft question - from what I read above this has 2 new moons in one lunation or synodic period? :o

Can that be right? :? I'm not expert enough to say, but it feels wrong at this point.

I've also now spotted a bug in the icon set, it's got image 15 as the full moon, even if I rename image 0 to become image 30 that's going to be off! I know that's somewhat another problem but it's probably worth a mention! :)
I could probably just nudge them all down by one and make 0 into 29, if you see what I mean.
Cheers,
Ian
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Re: Moon states - I'm stuck

Post by Flying Eye »

steve wrote:Sorry - I think my formula is wrong; I've got 'full' and 'new' reversed. Um...
I've just fallen in; what is needed is the day number in the cycle, what the numeric tags give us is the percentage of the disc visible. That would rise then fall. Calculating "proportionally in reverse" for the second half of the cycle being needed too!

Sadly the basic numbers do not really tell us how many days though the overall lunar cycle we are at. The numeric tags are reading 41 and -41.

Since they can vary in length, then just having the day number in each cycle's case would work best.

The full horror of it hit me when I just tried put this into a spreadsheet! :lol:

Given each cycle can vary, dare we safely assume each lunar day in that cycle are the same length for calculation purposes? We are just trying to get the right day here, nothing more closely accurate than that.
Cheers,
Ian
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Moon states - I'm stuck

Post by beteljuice »

It's even more interesting than that !

There are many 'stand alone' bits of script that can give you your lunar day number.

Using Cumulus makes things a bit more interesting:

To consider -

-100 > 100, but -100 and 100 are the same !
You want to take it to a 'real' fraction (ie. 30 images = 3.33333333333333 ......... %)
An image 'period' will begin 1/2 period before the event and end immediately before 1/2 period after the event.

... BTW did we mention it was cyclic ?

I might be back ;)
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Moon states - I'm stuck

Post by mcrossley »

and do you take the phase at midnight - start of the day, or end of the day, or mid-day, or mid-evening when perhaps most people will see the Moon :shock: A simple approximation can be obtained just using the cycles which repeat over 14 years (if you do not require great accuracy, or predict too far into the future or past which is the case here).
Flying Eye
Posts: 139
Joined: Tue 11 Jan 2011 10:29 pm
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
Location: Buckinghamshire, England.
Contact:

Re: Moon states - I'm stuck

Post by Flying Eye »

beteljuice wrote:It's even more interesting than that !
[snip]
I might be back ;)
Hehe, that's the first time I ever witnessed any sort of doubt from you! :lol:

I've had some seriously daft fun with a spreadsheet this afternoon, I'm roughly in the right area, but I've had to make far too many guesses and broad assumptions, and even stooped to =ROUNDUP() a couple of times - but I only got within +/- 1 image numbers. Now that's all downright nasty! ;) Working it out from the data we already have is very tricky, and almost impossible to validate with any certainty.

The more I think of this the more I would like to see a <#moonday> web tag, because that would actually be useful in the same way the others are, however I'm not copping out, I'm perfectly happy to try and help reason out how one might get there! :) Having one of them would be a pretty darn neat feature just for it's own sake! :ugeek:
Cheers,
Ian
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Moon states - I'm stuck

Post by mcrossley »

I'm not convinced that a <#moonday> tag will solve every thing, because the length of a lunation varies by a day or two. Better to create a series of images at set illumination percentages, and use the existing percentage tag. Otherwise things get slightly more complex.
Post Reply