Sandaysoft

Support forum for Cumulus weather station software
It is currently Tue Sep 16, 2014 7:25 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation) • Downloads
Please put your approximate location into your profile • Add your personal web site to the Cumulus user map
Read the Announcements and News section regularly!
Do not allow your PC to go into standby mode while Cumulus is running - read the readme.txt!
If you find Cumulus useful, please consider a donation -

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 12:42 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 12:51 pm 
Offline
Cumulus Author
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 20342
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
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
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:03 pm 
Offline
Cumulus Author
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 20342
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
I think the required conversion is (<#MoonPercent> + 100) * 29)/200

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:14 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 3302
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
A first punt...


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

Edit: cross posted with Steve :roll:

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:17 pm 
Offline
Cumulus Author
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 20342
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
Sorry - I think my formula is wrong; I've got 'full' and 'new' reversed. Um...

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:18 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:21 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:24 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:45 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 3302
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
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)

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 1:57 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 2:41 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 5:37 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 2222
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
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 !


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 6:12 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 3302
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
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).

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 6:13 pm 
Offline

Joined: Tue Jan 11, 2011 10:29 pm
Posts: 139
Location: Buckinghamshire, England.
Weather Station: WH1081
Operating System: XpPro32SP3 & 7Home64SP1
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


Top
 Profile  
 
 Post subject: Re: Moon states - I'm stuck
PostPosted: Wed Sep 21, 2011 6:54 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 3302
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
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.

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group