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' ] ) ) )
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 ) ) )
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' ] ) ) )
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' ] ) ) )
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 ) ) )
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 ) ) )