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.

Test

-24.2707801024

-24.2707801024

-24.2707801024

-24.2707801024

-24.2707801024

-24.2707801024

-24.2707801024

Test

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.


Am Freitag, 20. September 2019 17:30:53 UTC+2 schrieb Thomas Keffer:
>
> 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"?
>
> On Fri, Sep 20, 2019 at 7:11 AM Bernhard Walser <[email protected] 
> <javascript:>> wrote:
>
>> 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 <http://www.weewx.com/docs/customizing.htm#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 <[email protected]> 
>>> 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 [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/weewx-user/935f39d9-c6fe-4ef4-ba98-7b3217348521%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/weewx-user/935f39d9-c6fe-4ef4-ba98-7b3217348521%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/b03248c4-9a3d-4dd2-831e-c7ba40944349%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/b03248c4-9a3d-4dd2-831e-c7ba40944349%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a4dace3a-3d16-4636-a33b-d27babab97e0%40googlegroups.com.
import ephem

D = '2019/9/13 20:00:00'
De = 1
We = 20       # anzahl widerhoungen

while De < We:
    
    #print('start')
    
    #start obsever
    
    gatech = ephem.Observer()
    gatech.lon = '10.289'
    gatech.lat = '47.0145'
    gatech.elevation = 1373
    gatech.date = D
    v = ephem.Moon(gatech)
    
    S = gatech.date
    R = gatech.previous_rising(v)
    
    #aktuelle mondzyklus aufgang observer
    
    gatechr = ephem.Observer()
    gatechr.lon = gatech.lon
    gatechr.lat = gatech.lat
    gatechr.elevation = 1373
    gatechr.date = R
    r = ephem.Moon(gatechr)
    
    
    T = gatechr.next_transit(r)
    
    # aktuelle mondzyklus hochststand
    
    
    gatech0 = ephem.Observer()
    gatech0.lon = gatech.lon
    gatech0.lat = gatech.lat
    gatech0.elevation = 1373
    gatech0.date = T
    v0 = ephem.Moon(gatech0)
    #print(str(T) + ' zeit Transit Referenztag')
    #print(str('%f' % (v0.alt)) + ' altitude Referenztag')
    
    alti = ('%f' % (v0.alt))
    alti = float(alti) * 57.2957795
    
    Tv = gatech0.previous_transit(v0)

    # vorheriger mondzyklus hochststand

    gatech1 = ephem.Observer()
    gatech1.lon = gatech.lon
    gatech1.lat = gatech.lat
    gatech1.elevation = 1373
    gatech1.date = Tv
    v1 = ephem.Moon(gatech1)
    #print(str(Tv) + ' zeit Transit Vortag')
    #print(str('%f' % (v1.alt)) + ' altitude Vortag')


    altiV = ('%f' % (v1.alt))
    altiV = float(altiV) * 57.2957795
    #print(r)
    #print(str((e - r) * 57.2957795) + ' Diferenz Hoehenwinkel Vortag')
    


    D = S + 1
    De = De + 1

    if alti > altiV: # uebersich
        print(str(gatech.date) +'+ zeit Refernztag+' + '+ UEBER SICH GEHEND +' + str(alti - altiV) + '+ grad Differenz Hoehenwinkel zum Vortag +' + str(R) + '+ Mondaufgang Referenztag +')
        
    else:  # untersicht
        print(str(gatech.date) + '+ zeit Refernztag+' + '+ unter sich gehend +'+ str(alti - altiV) + '+ grad Differenz Hoehenwinkel zum Vortag +' + str(R) + '+ Mondaufgang Referenztag +')
        
        
print('end')

Reply via email to