Exemplo n.º 1
0
def getPreviousAntitransit( arg1, arg2, arg3 ):
    validUnitTypes = [ [ 'location', 'datetime', 'body' ] ]
    arguments = matchUnitTypes( [ arg1, arg2, arg3 ], validUnitTypes )

    if not arguments:
        raise ValueError( 'unexpected arguments' )

    result = arguments[ 'body' ].getPreviousAntitransit( arguments[ 'location' ], arguments[ 'datetime' ] )
    return result.getLocalTime( tz.gettz( getTimeZone( arguments[ 'location' ] ) ) )
Exemplo n.º 2
0
def getNextDusk( location, date, horizon = -6 ):
    if isinstance( location, str ):
        location = getLocation( location )

    if not isinstance( location, RPNLocation ) or not isinstance( date, RPNDateTime ):
        raise ValueError( 'expected location and date-time arguments' )

    result = RPNAstronomicalObject( ephem.Sun( ) ).getNextSetting( location, date, horizon=horizon )
    return result.getLocalTime( timezone( getTimeZone( location ) ) )
Exemplo n.º 3
0
def getNextDusk( arg1, arg2, horizon = -6 ):
    validUnitTypes = [ [ 'location', 'datetime' ] ]
    arguments = matchUnitTypes( [ arg1, arg2 ], validUnitTypes )

    if not arguments:
        raise ValueError( 'unexpected arguments' )

    result = RPNAstronomicalObject( ephem.Sun( ) ).getNextSetting( arguments[ 'location' ],
                                                                   arguments[ 'datetime' ], horizon=horizon )
    return result.getLocalTime( tz.gettz( getTimeZone( arguments[ 'location' ] ) ) )
Exemplo n.º 4
0
def getPreviousSetting( arg1, arg2, arg3 ):
    '''Returns the previous setting time for an astronomical object.'''
    validUnitTypes = [ [ 'location', 'datetime', 'body' ] ]
    arguments = matchUnitTypes( [ arg1, arg2, arg3 ], validUnitTypes )

    if not arguments:
        raise ValueError( 'unexpected arguments' )

    result = arguments[ 'body' ].getPreviousSetting( arguments[ 'location' ], arguments[ 'datetime' ] )
    return result.getLocalTime( tz.gettz( getTimeZone( arguments[ 'location' ] ) ) )
Exemplo n.º 5
0
def getPreviousAntitransit( body, location, date ):
    if isinstance( location, str ):
        location = getLocation( location )

    if not isinstance( body, RPNAstronomicalObject ) or not isinstance( location, RPNLocation ) or \
       not isinstance( date, RPNDateTime ):
        raise ValueError( 'expected an astronomical object, a location and a date-time' )

    result = body.getPreviousAntitransit( location, date )
    return result.getLocalTime( timezone( getTimeZone( location ) ) )
Exemplo n.º 6
0
def getNextRising( body, location, date ):
    '''Returns the next rising time for an astronomical object.'''
    if isinstance( location, str ):
        location = getLocation( location )

    if not isinstance( body, RPNAstronomicalObject ) or not isinstance( location, RPNLocation ) or not isinstance( date, RPNDateTime ):
        raise ValueError( 'expected an astronomical object, a location and a date-time' )

    result = body.getNextRising( location, date )
    return result.getLocalTime( timezone( getTimeZone( location ) ) )