It is currently March 28th, 2024, 6:10 pm

Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am
Contact:

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Mor3bane »

Yincognito wrote: August 23rd, 2020, 9:56 am No point posting your skin(s), because I'll work from 0 - it takes less time and effort to do that than to understand what someone else did in his skin and make tons of adjustments afterwards...
I feel a little foolish, but the code i posted did not even include any kind of moon cycle stuff. :oops:

If I can disseminate the code, examples are great for me - but then I need those. So I am actually glad you'd prefer to work from 0. That way I will only have your style to understand, not that of multiple scripters. Also, I'd have that lua hurdle again as well.

As always, Thanks. :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Yincognito »

Mor3bane wrote: August 23rd, 2020, 4:27 am Ok. The sun portion is my constant, as the values are strictly standard clock, day/night on a 24 hour 'sundial'. The roundlines, for day and night are based on that - well daylight specifically. The night is simply the remainder, on the 'sundial'.

So that would be, to me, the place to start for showing where the moon is in relation to that very same 'sundial'. Or basically, 'up' during the daylight portion, and 'down' during the night time portion. The actual moonrise and moonset would naturally occur with varying times so that exact position would not have to be relative to the 24 hour day/night roundline indicator. Only if 'up' or 'down' generally speaking.
This is what I have so far - it doesn't look good yet and it's a bit different to what you envisioned, since the suntime / moontime:
- are precisely as they should be on a 24h dial (i.e. they're not constrained to a semicircle as in pbutler's skin, it's raw proportional time in my implementation)
- they don't follow the same 'up' path but more like each on its own path based on rise and set times
- the 'now' times are the same for both, it's the suntime and mootime that make the difference (yellow is exclusively suntime, blue is exclusively moontime and grey is where they intersect)
but they're made using Roundlines and Rotators alright, so this part is as it should be.
Dial24H.jpg
The skins are side by side and refreshed at the same time, so you can compare them. The times are hardcoded in my version, the conversion to the actual times or web parsed ones is not something I'm concerned with as it's trivial. Feel free to comment and criticize if you want. :D

Also, do I understand correctly that you in fact want to simply replicate how pbutler's skin looks but using Roundlines and Rotators?

P.S. The code is not relevant at this time, as the job is obviously not finished, but I'll post it if you want (just don't be scared, LMAO).
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Mordasius »

I'm late to the party owing to a ridiculous 21-Hour stint on Escape from Tarkov. I've been playing with this all shapes version of a sun-moon position skin for a couple of years. The sunrise, sunset, moonrise, moonset and twilight times are all done with lua script and are pretty much spot on with the times shown on timeanddate.com.

You can change stuff like the skin size and the skin colours using the Chameleon plugin via a settings link on the clock skin. The location is set using an adapted version of WeatherComCode.ini by J.S.Morley.
ShapelySunMoon.png
Unfortunately the site I was originally using to set the Time Zone and current time got over-loaded and is no longer accepting requests. The new version below gets the Time Difference / Time Zone from Weather.com
Attachments
SunMoonExample_020920.rmskin
(2.01 MiB) Downloaded 417 times
Last edited by Mordasius on September 2nd, 2020, 10:01 am, edited 4 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Yincognito »

So, the semicircle version - still very basic, hardcoded variables and such (in a proper skin these would be the today's timestamps), but maybe easier to understand this way:

Code: Select all

[Variables]
Radius=90
ImageW=32
DialSW=2
Offset=(PI/20)
SRH=6
SRM=20
SRS=47
Sunrise=(#SRH#*60*60+#SRM#*60+#SRS#)
SSH=20
SSM=12
SSS=31
Sunset=(#SSH#*60*60+#SSM#*60+#SSS#)
MRH=11
MRM=31
MRS=56
Moonrise=(#MRH#*60*60+#MRM#*60+#MRS#)
MSH=22
MSM=38
MSS=40
Moonset=(#MSH#*60*60+#MSM#*60+#MSS#)
NTH=17
NTM=22
NTS=35
Nowtime=(#NTH#*60*60+#NTM#*60+#NTS#)

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,80

---Measures---

[Suntime]
Measure=Calc
Formula=(#Sunset#-#Sunrise#)
DynamicVariables=1

[Moontime]
Measure=Calc
Formula=(#Moonset#-#Moonrise#)
DynamicVariables=1

[SinceSunrise]
Measure=Calc
Formula=(#Nowtime#-#Sunrise#)
MaxValue=([Suntime])
DynamicVariables=1

[SinceMoonrise]
Measure=Calc
Formula=(#Nowtime#-#Moonrise#)
MaxValue=([Moontime])
DynamicVariables=1

---Meters---

; Semicircle

[UpArc]
Meter=Roundline
W=(#ImageW#+#Radius#*2)
H=(#ImageW#+#Radius#*2)
StartAngle=(PI+#Offset#)
RotationAngle=(PI-#Offset#*2)
LineStart=(#Radius#-#DialSW#/2)
LineLength=(#Radius#+#DialSW#/2)
LineColor=255,255,255,255
Solid=1
AntiAlias=1
DynamicVariables=1

[DownArc]
Meter=Roundline
W=(#ImageW#+#Radius#*2)
H=(#ImageW#+#Radius#*2)
StartAngle=(0+#Offset#)
RotationAngle=(PI-#Offset#*2)
LineStart=(#Radius#-#DialSW#/2)
LineLength=(#Radius#+#DialSW#/2)
LineColor=128,128,128,255
Solid=1
AntiAlias=1
DynamicVariables=1

[Sun]
Meter=Rotator
MeasureName=SinceSunrise
ImageName=#@#Sun.png
W=(#ImageW#+#Radius#*2)
H=(#ImageW#+#Radius#*2)
OffsetX=(-#Radius#+#ImageW#/2)
OffsetY=(#ImageW#/2)
StartAngle=(PI+#Offset#)
RotationAngle=(PI-#Offset#*2)
DynamicVariables=1

[Moon]
Meter=Rotator
MeasureName=SinceMoonrise
ImageName=#@#Moon.png
W=(#ImageW#+#Radius#*2)
H=(#ImageW#+#Radius#*2)
OffsetX=(-#Radius#+#ImageW#/2)
OffsetY=(#ImageW#/2)
StartAngle=(PI+#Offset#)
RotationAngle=(PI-#Offset#*2)
DynamicVariables=1

[Text]
Meter=String
X=(#CURRENTCONFIGWIDTH#/2)
Y=(#CURRENTCONFIGHEIGHT#/2)
W=(#ImageW#+#Radius#*2)
H=(#ImageW#+#Radius#*2)
FontFace=Tahoma
FontColor=255,255,255,255
FontSize=8
StringAlign=CenterCenter
StringEffect=Shadow
FontEffectColor=0,0,0,255
AntiAlias=1
Text="Sun = #SRH#:#SRM#:#SRS# - #SSH#:#SSM#:#SSS##CRLF#Moon = #MRH#:#MRM#:#MRS# - #MSH#:#MSM#:#MSS##CRLF#Now = #NTH#:#NTM#:#NTS##CRLF#Sun: [SinceSunrise:%,2]%, Moon: [SinceMoonrise:%,2]%"
DynamicVariables=1
Dial24H Semicircles.jpg
Kept the same time values as in the screenshot above, to be able to compare with pbutler skin. As you can see, done using Roundlines and Rotators.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am
Contact:

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Mor3bane »

Hey, it is really interesting seeing your take on this for the round line mod.

However, the idea I was hoping to capture is the geocentric version (which I failed to clarify of) I have been working on.

The version I posted first was my effort to create the image of the sun going around in a full 360 degree arc according to a 24 hour clock dial based on a geocentric model, as if the earth was in the center and the sun going around it.

So too was my hope to achieve that geocentric 360 degree circle that the moon makes around the earth by use of an image in a rotator meter.

The half circle version would have been basic as the math for that was generously provided by pbutler6.

The actual roundline was not a need, but only my attempt to describe what i have been able to do so far, and that the image of the moon going around the geocentric middle of the roundline has been my hurdle all this time.

The sun part is done and works perfectly.

The roundline is done and works nearly perfectly.

The moon part is just messing with my head and I am really trying to describe all of this but every time I seem to fall short and you (Yincognito) have been trying to follow my description, and the outcomes have not been complete. Sorry if that seems needy or greedy, but I have just not been able to accomplish my goal on my own for a really long time.

Oh I might add that the skin has no need at all to be size variable - I should be fixed in size the same as the sun rotator I have working now.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am
Contact:

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Mor3bane »

Capture.PNG
Perhaps this image helps.

If the moon has a rise time, and a set time. The there is definitely a duration for that traversal across the sky - it is not important what phase the moon is actually visible in.

So the moon is only up when it has passed the visual horizon and not yet past the visual horizon on the opposite side of the planet.

Where the sun is, is exactly relative to the nice Time Measures we use for everything.

So there must be an equation that describes these things for the moon - it just isnt the same clock, so to speak. There is a rise time for the moon. So that is when the moon is up. The rotator would follow that arc according to that unique time frame. It would also do the same but on the opposite side of the roundline where it would be night for the specific location where the rise and set times are being parse from.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by SilverAzide »

Mordasius wrote: August 23rd, 2020, 3:34 pm I'm late to the party owing to a ridiculous 21-Hour stint on Escape from Tarkov. I've been playing with this all shapes version of a sun-moon position skin for a couple of years. The sunrise, sunset, moonrise, moonset and twilight times are all done with lua script and are pretty much spot on with the times shown on timeanddate.com.
This is great! I've been using the sun/moon .lua script from your Sunset-Moonrise skin for years as the calcs are dead on (skin is really cool too). The one thing that was missing (as far as I could figure) was the moon view angle, but this new .lua script here has that calc. Thank you very much!
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Yincognito »

Mor3bane wrote: August 23rd, 2020, 6:24 pmSo there must be an equation that describes these things for the moon - it just isnt the same clock, so to speak. There is a rise time for the moon. So that is when the moon is up. The rotator would follow that arc according to that unique time frame. It would also do the same but on the opposite side of the roundline where it would be night for the specific location where the rise and set times are being parse from.
That's almost what my first version does, really (don't mind the appearance, it can be improved). Both the sun and the moon rotate on a 360 degree circle. They do have the same clock and their "now" moment is identical though, so that wouldn't be quite according to your definitions, but according to what their rise and set times really are:
Dial24H (Info).jpg
The way it looks is exactly as it happens in real life, if we talk about a "clock". I really don't understand what you want, sorry about that. I want to understand, but I just can't right now. On one hand, you say they aren't on the same clock, on the other hand you say they should be placed on the same 24h "dial" or ... well, "clock".

For example, in the above screenshot, the "now" moment (i.e. where the sun and moon are placed, to the right of the "circle") is roughly 6 PM, when the sun followed his "arc" (yellow+grey) for about 80% of it, and the moon followed its own "arc" (grey+blue) for about 50% of it. The grey arc is where the sun and the moon "arcs" coincide, in other words the period in which both the sun and the moon have risen.
Mor3bane wrote: August 23rd, 2020, 6:24 pmIt would also do the same but on the opposite side of the roundline where it would be night for the specific location where the rise and set times are being parse from.
Are you talking about the moon here? What has the moon have to do with the night? It can rise in midday and have almost the same rise to set path / arc as the sun, from a chronological (i.e. time based) point of view - like in the image above.

Or, you want to replicate the moon position relative to the sun on the sky? If that's so, I think it's a bit more complicated than just some rotators.

I think it would be best to choose a specific example (say, the rise and set times in my screenshot above) and explain where would you like the sun and moon (and their respective "arcs") to be in various times during the day, on the 360 degrees sundial skin.
Last edited by Yincognito on August 23rd, 2020, 8:35 pm, edited 2 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Yincognito »

SilverAzide wrote: August 23rd, 2020, 7:46 pm This is great! I've been using the sun/moon .lua script from your Sunset-Moonrise skin for years as the calcs are dead on (skin is really cool too). The one thing that was missing (as far as I could figure) was the moon view angle, but this new .lua script here has that calc. Thank you very much!
Mordasius Skin.jpg
It's 23:15 where I live, so the moon should have already set at 22:39. I was hovering over the moon (I think) here, but while I can understand where the sun path / twilights / etc are, I don't get the moon position, as it seems "before" the sunset and dusk (at 20:12 and 20:45) towards the bottom right corner of the skin. What do you think?
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Json [new stuff] Moon Position on a 24 hour Roundline/Rotator ?

Post by Yincognito »

Mor3bane wrote: August 23rd, 2020, 6:24 pmSo there must be an equation that describes these things for the moon - it just isnt the same clock, so to speak. There is a rise time for the moon. So that is when the moon is up. The rotator would follow that arc according to that unique time frame. It would also do the same but on the opposite side of the roundline where it would be night for the specific location where the rise and set times are being parse from.
Ok, I'll make one more attempt at figuring out what you meant, because I think I understand now. Hopefully I am right this time and won't be another misunderstanding. I'll post the code and a screenshot when it's ready.
Post Reply