It is currently December 4th, 2022, 1:06 pm

Sunrise-Moonset

Weather skins
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sunrise-Moonset

Post by balala »

Stone wrote:- I have found this:
Sun.zip
This indeed is a better solution. Thanks a lot.
User avatar
Mordasius
Posts: 1099
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Sunrise-Moonset

Post by Mordasius »

Stone wrote:Note: The moonphase is implemented after the description in Wikipedia (<1% illumination is a New Moon, and so on). This means that the skin may show 'New Moon' on two days, or 'First Quarter' for only a few hours (49%<Illumination<51%).
Thanks for this update Stone. It won't take much to adapt your translation to make my soon to be completed "Geocentric Tellurion" skin work without access to http://iohelix.net that I'd relied upon to provide information on the percentage illumination and days to the next phase of the moon.
telurion.jpg
Finished skin on Deviant Art
You do not have the required permissions to view the files attached to this post.
Last edited by Mordasius on August 17th, 2022, 2:28 am, edited 1 time in total.
User avatar
Mirage
Posts: 23
Joined: September 11th, 2012, 3:36 am

Re: Sunrise-Moonset

Post by Mirage »

Mordasius, your pic of the Geocentric Tellurion, is exactly what I was going to create using the data from your LUA script when complete. But looks like you beat me to it. The graphics look very good.

Been following this thread with great interest. Learning a lot along the way. Thanks to all.
User avatar
Mordasius
Posts: 1099
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Sunrise-Moonset

Post by Mordasius »

I doubt that my Geocentric Tellurion is exactly what you were gong to produce so carry on and don't feel you have to hold back. Please go ahead and show us whatever it was you were working on. The Geocentric Tellurion thingee I'm working on plots the current sun and moon positions on elliptical orbits around an off-center image of the Earth. Perhaps I should re-title it as an Offest-Geocentric-Tellurion.
Stone
Posts: 25
Joined: March 12th, 2013, 8:51 am
Location: Copenhagen / Denmark

Re: Sunrise-Moonset

Post by Stone »

- you're welcome.

That skin really looks promising Mordasius - looking forward to see it in action.

By the way: I'm writing a Moon skin that shows phase (like the one in Enigma or Omnimo).
Moshi has a formula to rotate the Moon icon as a function of latitude, and Xanci has
a transformationmatrix to rotate an image and those two things works fine combined (and I will
probably keep the skin like this).
- But if anyone knows of a formula that also depends on the time of day (and year? or longitude?)
it would be great.
(unless it's too complicated, and I have a feeling that it is - i'm not an astronomer :D ).
- Stone
User avatar
Mordasius
Posts: 1099
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Sunrise-Moonset

Post by Mordasius »

Stone wrote:Moshi has a formula to rotate the Moon icon as a function of latitude
I also noted Mohsi's comment about rotating the moon shadow depending on latitude but couldn't get it to work. Perhaps he will find time away from tweaking Evi to tell us more.
User avatar
Mirage
Posts: 23
Joined: September 11th, 2012, 3:36 am

Re: Sunrise-Moonset

Post by Mirage »

Well, Ok, I concede that it is not "exactly" what I had in mind, but the orbiting of the sun and moon around a central point, moon showing phase, and depicting day/night, was what I was thinking. I had thought of putting earth in the center of it all, highlighting the current Lat/Long, but I hadn't figured out in my head how I would do that part without having the Sun/Moon covering the ppoint I was trying to highlight on Earth.

Anyway, as I figure more of this out I will probably submit it to you for ideas and help with the coding. Thanks much.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Sunrise-Moonset

Post by moshi »

Mordasius wrote: I also noted Mohsi's comment about rotating the moon shadow depending on latitude but couldn't get it to work. Perhaps he will find time away from tweaking Evi to tell us more.

how the moon looks depends not only on the position of the viewer, but also on time of the day and time of the year. it's pretty confusing actually. in short: the crescent of the moon is rotated 180 between a viewer at the North Pole and one at the South Pole.
http://alvyray.com/Memos/misc/Moon1.pdf

so the normal display of the moon phase you can see everywhere would be plain wrong for anybody living in the southern hemisphere. you can compare this here:
http://www.calculatorcat.com/moon_phases/phasenow.php
http://www.aussiesky.net/weather/weather3.html

if you want a realistic display of the moon. ignore what i am doing. mine is just a "good enough" approach.

basically what i am doing is rotating a regular north pole view image with a Rotator meter:

Code: Select all

[MeterAppClockMoon2]
MeasureName=MeasureMoonRotate
Meter=ROTATOR
W=57
H=57
ImageName="#@#Addons\xplanet-1.3.0\moon[MeasureDayNight2].png"
StartAngle=(RAD(360))
RotationAngle=(RAD(360))
OffsetX=28.5
OffsetY=28.5
DynamicVariables=1
note: my image is 58x58 pixels sized. just imagine it would be one pixel smaller, this will fix the distortion problem Rainmeter has with Rotator meters.

it uses MeasureMoonRotate for the rotation. this is value between 0 and 1 obviously. the highest number it will ever have is 0.5 (180° rotation - South Pole).

Code: Select all

[MeasureMoonRotate]
Measure=Calc
DynamicVariables=1
Formula=(((([MeasureWeatherLat])-90)*(-1))/360)
this will take the latitude [MeasureWeatherLat] (range 90 to -90), subtract 90 (range 0 to -180), multiply that with -1 and divide it by 360 (range 0 to 0.5).

you could use a number (latitude) variable here. this would probably confuse the user. you can also use a plain text variable for the location and use a geocoding service here.
i listed some services here: http://rainmeter.net/forum/viewtopic.php?f=15&t=14613
i think the best quality is Google and Nominatim (Yahoo! is pretty US-centric sometimes, try Moscow). Google is faster.
User avatar
Mordasius
Posts: 1099
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Sunrise-Moonset

Post by Mordasius »

Thanks very much for the explanation and examples moshi.

My initial problem was combining imagecrop and rotateimage in an image meter or using imagecrop in a rotator meter. With either method imagecrop is applied to the original image before the rotation which made a mess of the rising/setting moon effect. The only solution I could come up with was to slap a copy of the background on top of the rotated moon image instead of using imagecrop.
moshi wrote:you could use a number (latitude) variable here. this would probably confuse the user. you can also use a plain text variable for the location and use a geocoding service
I'll be adding an 'AutoDetect' skin to the front end of the Geocentric Tellurion skin to set latitude and longitude on the basis of the user's IP address. We all know that IP address location detectors can be +/- 500 km but that is probably close enough for this sort of skin.
User avatar
Mordasius
Posts: 1099
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Sunrise-Moonset

Post by Mordasius »

I've taken Stone's script and tweaked it a little so that it now displays the moon shade images by Benjam Welker ( http://iohelix.net/moon ) without an internet connection. The values for elongation to the sun and percentage illumination are not exactly the same as those on http://iohelix.net/moon/moonlite.php but they're close enough for a rainmeter skin.

I also took moshi's advice on using a Rotator meter to adjust the moon according to latitude. For this I used values from an Adobe Flash model on The World MOON Project which has it rotating through 180 degrees from 49 North to 24 South.
StonesMoonIII.jpg
The attached skin uses 260x260 pixel moon shade images. The slight offset of the shade image all but disappears if you re-size to 100 pixels or less.

P.S. As it's full moon on the day of posting you're not going to be able to check the angle of shadow until the first few days of April. Your view of features on the full moon should however give you some idea if it's working properly.

Updated 31 March: Fixed the skin to use local date rather than utc date for the updates - thanks for reporting that Mirage
You do not have the required permissions to view the files attached to this post.