FW Astronomy Moon Phase States

Posted on
Mon Dec 30, 2019 8:59 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

FW Astronomy Moon Phase States

Hey,

I’m setting up some moon images to use with the moon phase states in FW Astronomy.
Appreciate knowing what the range of states are, e.g. 0-20, 1-100 etc.

Thanks,

Carl
Last edited by ckeyes888 on Wed Jan 01, 2020 10:04 am, edited 2 times in total.

Posted on
Mon Dec 30, 2019 9:24 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astrology Moon Phase States

Hi Carl - it's the Astronomy device (not Astrology) :D

Moon Phase:
The fractional part of the lunation number during the given day: a value of 0 corresponds to a new moon, 0.25 to a first quarter moon, 0.5 to a full moon, and 0.75 to a last quarter moon. (The ranges in between these represent waxing crescent, waxing gibbous, waning gibbous, and waning crescent moons, respectively.)


The plugin multiplies this value by 100. So a lunation value of 0.56 is presented as 56.0 in the plugin. (You may sometimes see the value presented by the plugin as 56.0000001 which is an affectation of storing values as a float.) I do this because the Indigo image heuristics don't like decimals that much. So:

0 = new moon
25 = first quarter
50 = full
75 = last quarter
etc.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Dec 30, 2019 9:30 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: FW Astrology Moon Phase States

Doh! Sorry about the astrology. :oops:

Great, thanks...and thanks for the awesome plugin!

Carl

Posted on
Mon Dec 30, 2019 9:32 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astrology Moon Phase States

You're most welcome! I have it on my to do list to add an additional state to the device which provides a text-based description of the current moon phase. But please don't wait for me as I can't guarantee how soon I'll get that done. :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 31, 2019 11:48 am
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: FW Astrology Moon Phase States

I was under the impression that the way image heuristics worked was always finding the next highest, or lowest available numbered image.
I have 20 images spanning the 0-75 range of moon phase possibilities. They’re not exact but are 4 numbers apart, moonPhase+0.png, moonPhase+4.png etc.

The only images that are displayed are the exact number matches, nothing in between.
Guessing I missed something?

Thanks,

Carl

Posted on
Tue Dec 31, 2019 2:37 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astrology Moon Phase States

According to the docs (https://wiki.indigodomo.com/doku.php?id=cp_custom_images), variables require an exact match. If you link to the plugin device's state for the moon phase, then the heuristics should work as you expect. The issue with decimals (like 0.75) is that Indigo's matching doesn't like those very much. That's why I multiply them by a factor of 100. In fact, if you link to the device state, then converting to an integer should also not be needed.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 31, 2019 3:47 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: FW Astrology Moon Phase States

Just tried using the device state with no joy. The device state had the decimal, which I assume may be the problem?

edit: Odd when viewing the states on the device itself the decimal doesn’t show.

Thanks,

Carl

Posted on
Tue Dec 31, 2019 4:04 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astrology Moon Phase States

Hmmm. Indigo should handle a float no problem. I’m not in a position to test it out right now, but I’ll look into it.


Sent from my iPhone using Tapatalk Pro

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 31, 2019 8:31 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astrology Moon Phase States

Carl -- Looks like you're right. It seems that the device state isn't matching. I'll have to add a moon phase icon value (integer) in addition to the text based one. You'll need to create your own value for now.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 31, 2019 10:51 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: FW Astrology Moon Phase States

Thanks a bunch for looking into it.
Happy New Year!

Carl

Posted on
Sat Jan 04, 2020 4:38 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astronomy Moon Phase States

I have uploaded a new build of the plugin which enhances support for moon phases. It provides a 'moonPhaseIcon' state to use for custom control page images, and a moonPhaseText' state which is a text-based representation of the current moon phase.

See the Indigo plugin store for the latest version.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Jan 06, 2020 2:15 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: FW Astronomy Moon Phase States

Strange thing. I made a new set of moon phase images spaced about 4 numbers apart, moonPhase+1.png - moonPhase+5.png,
and now the heuristics seem to be working. If the variable they’re based on is in between any of my numbered images it’s displaying the nearest number.

Carl

Posted on
Mon Jan 06, 2020 3:17 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: FW Astronomy Moon Phase States

Great. As long as it's working, I'm good, too!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Mar 12, 2020 11:50 am
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: FW Astronomy Moon Phase States

I am trying to understand this image heuristics. In my case I made a bunch of moon phase images roughly spaced 4 apart. So for instance I have images ending in 50, 54, 58, 62, 68, 72, 75.
Yesterday's moon phase state was 62 and the image displayed was 50. Today's moon phase state is 63 and the image displayed is 75. So Indigo does not seem to pick the nearest image as suggested by ckeyes888 but rather the next image that is a multiple of 5 away. This is sort of the explanation given in the Wiki https://wiki.indigodomo.com/doku.php?id=cp_custom_images.
But it is not very useful in my case. I think I would have to rename all images to end in 50, 55, 60, 65 etc.

Posted on
Thu Mar 12, 2020 12:33 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: FW Astronomy Moon Phase States

The wiki page is correct - if there isn't an exact match, then we look for increments of 5, 10, 25 in that order.

So, you'd either need to rename images so they match increments of 5, or if you want the more granular images, you can duplicate an image to make exact matches work. So for instance, use the same image you use for 50 for 51, 52, and 53, then 54 would be the next exact match, etc.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 2 guests