Almanac Date

67 views
Skip to first unread message

Bernhard Walser

unread,
Sep 20, 2019, 7:38:32 AM9/20/19
to weewx-user
Hello

I want to write a code witch calculatetes the difference between, the moon altiude at transit today, and altitude at transit yesterday.
this would give me the "übergehende Mond" or "untergehende Mond".

a code like this don't work:

$almanac(date=($almanac.moon.next_transit)).moon.alt
$almanac(date=($almanac.moon.previous_transit)).moon.alt

it seems i cant manipulate the time of the ethem observer.

Thomas Keffer

unread,
Sep 20, 2019, 8:05:12 AM9/20/19
to weewx-user
A tag like $almanac.moon.next_transit returns an object of type ValueHelper, not a floating point number. ValueHelpers contain not only the floating point number, but also formatting and labeling information. To get the embedded number, use the ".raw" suffix. See the section Formatting options in the Customizing Guide. Your expression becomes (NOT TESTED):

$almanac(date=($almanac.moon.next_transit.raw)).moon.alt

-tk


--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/935f39d9-c6fe-4ef4-ba98-7b3217348521%40googlegroups.com.

Bernhard Walser

unread,
Sep 20, 2019, 10:11:43 AM9/20/19
to weewx-user
thank you for your fast answer!

I have tested to change the date format, also .raw. But doesn't work.

    <p>$almanac(date=($almanac.moon.next_transit.format("%Y/%m/%d %H:%M"))).moon.alt</p>

    <p>$almanac(date=($almanac.moon.previous_transit.format("%z"))).moon.alt</p>

    <p>$almanac(date='2019/1/1 00:00:00').moon.alt</p>   

    <p>$almanac(date=1568985086).moon.alt</p> #Unix epoch

    <p>$almanac(date=36517.5).moon.alt</p>  #Dublin Julian date

None of them worked, no error in syslog.
 

Am Freitag, 20. September 2019 14:05:12 UTC+2 schrieb Thomas Keffer:
A tag like $almanac.moon.next_transit returns an object of type ValueHelper, not a floating point number. ValueHelpers contain not only the floating point number, but also formatting and labeling information. To get the embedded number, use the ".raw" suffix. See the section Formatting options in the Customizing Guide. Your expression becomes (NOT TESTED):

$almanac(date=($almanac.moon.next_transit.raw)).moon.alt

-tk


On Fri, Sep 20, 2019 at 4:38 AM Bernhard Walser <bwal...@gmail.com> wrote:
Hello

I want to write a code witch calculatetes the difference between, the moon altiude at transit today, and altitude at transit yesterday.
this would give me the "übergehende Mond" or "untergehende Mond".

a code like this don't work:

$almanac(date=($almanac.moon.next_transit)).moon.alt
$almanac(date=($almanac.moon.previous_transit)).moon.alt

it seems i cant manipulate the time of the ethem observer.

--
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 weewx...@googlegroups.com.

Thomas Keffer

unread,
Sep 20, 2019, 11:30:53 AM9/20/19
to weewx-user
I'm not seeing .raw in any of the tags you posted. What exactly did you try?

Perhaps you could show us the error, rather than just "doesn't work"?

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b03248c4-9a3d-4dd2-831e-c7ba40944349%40googlegroups.com.

Bernhard Walser

unread,
Sep 20, 2019, 12:48:03 PM9/20/19
to weewx-user
ok i write for testing in my html file these exalple:

    <p>Test</p>

    <p>$almanac.moon.alt</p>

    <p>$almanac(date=($almanac.moon.next_transit.raw)).moon.alt</p>   

    <p>$almanac(date=($almanac.moon.next_transit.format("%Y/%m/%d %H:%M"))).moon.alt</p>   

    <p>$almanac(date=($almanac.moon.previous_transit.format("%z"))).moon.alt</p>

    <p>$almanac(date='2019/1/1 00:00:00').moon.alt</p>

    <p>$almanac(date='1568985086').moon.alt</p>

    <p>$almanac(date='36517.5').moon.alt</p>

    <p>Test</p>

The output in the file was always the same altitude. so my guess is i don't change date atribute or it's overwritten. my pyhton skills are not so god to understand what exakly happen in almanac.py.


I do also write an easy python code and tryed to put in almanay.py and extensions.py.
but din't figgred out how to call it from an html.tmp.
rasis_kalender.py

Thomas Keffer

unread,
Sep 20, 2019, 1:30:16 PM9/20/19
to weewx-user
Now I see what the problem is. Use "almanac_time", instead of "date":

$almanac(almanac_time=($almanac.moon.next_transit.raw)).moon.alt

My apologies for not documenting these. Done in commit e98c52d

-tk



To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a4dace3a-3d16-4636-a33b-d27babab97e0%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages