Am Freitag, 2. November 2018 14:34:00 UTC+1 schrieb Thomas Keffer: > I can think of two ways of doing this. > Use the text in $almanac.moon_phase > Use the undocumented tag $almanac.moon_index. It is the index into moon_phase > and varies from 0 to 7. > > Here's their relationship: > > > $almanac.moon_index $almanac.moon_phase > > 0 New > 1 Waxing crescent > 2 First quarter > 3 Waxing gibbous > 4 Full > 5 Waning gibbous > 6 Last quarter > 7 Waning crescent > > > Approach #1 has the advantage of being documented. It has the disadvantage > that it would be sensitive to localization. For example, you would have to > change it if you changed language to French. > > > #if $almanac.moon_phase == "Waxing crescent" > <img href="increasing_crescent.png"/> > #elif $almanac.moon_phase == "Waning crescent" > <img href="decreasing_crescent.png"/> > ... > > > Approach #2 is similar, but you just use the index. It is undocumented, but > unlikely to change. > > > > #if $almanac.moon_index == 1 > <img href="increasing_crescent.png"/> > #elif $almanac.moon_index == 7 > <img href="decreasing_crescent.png"/> > ... > > Hope this helps. > > > -tk > > > On Fri, Nov 2, 2018 at 3:57 AM Thomas Sch <[email protected]> wrote: > I am working on a template that shows a picture of the moon for every percent > of moon fullness. My Problem: for example: when I say > > > > #if $almanac.moon_fullness = 50 > > ... > > > > > > I will get 2 pictures of the moon. One of the increasing and one of the > decreasing moon. > > > > Is there a solution that ephem shows me the trend of the moon "crescent" or > "wanning" or something else. > > > > for example: > > > > If $almanac.moon_fullness = 50 and $almanac.moon_trend = "crescent" > > ... > > > > I Hope anyone can help me. And sorry for my bad English. > > > > -- > > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > For more options, visit https://groups.google.com/d/optout.
Thanks for your answer. Your First solution is my current solution. But I want it for every percent. When I use #if $almanac.moon_fullness == 1 and $almanac.moon_index == 0 it shows the 1 percent Image before New Moon and after new moon. (Same at fullmoon with 99%) #if $almanac.moon_fullness == 50 and $almanac.moon_index == 2 works perfectly. -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
