当前位置: 首页>>代码示例>>Python>>正文


Python Ephemeris.isAscmcPlanetName方法代码示例

本文整理汇总了Python中ephemeris.Ephemeris.isAscmcPlanetName方法的典型用法代码示例。如果您正苦于以下问题:Python Ephemeris.isAscmcPlanetName方法的具体用法?Python Ephemeris.isAscmcPlanetName怎么用?Python Ephemeris.isAscmcPlanetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ephemeris.Ephemeris的用法示例。


在下文中一共展示了Ephemeris.isAscmcPlanetName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getLongitudeAspectTimestamps

# 需要导入模块: from ephemeris import Ephemeris [as 别名]
# 或者: from ephemeris.Ephemeris import isAscmcPlanetName [as 别名]

#.........这里部分代码省略.........
        loweredCentricityType = centricityType.lower()
        if loweredCentricityType != "geocentric" and \
            loweredCentricityType != "topocentric" and \
            loweredCentricityType != "heliocentric":

            log.error("Invalid input: Centricity type is invalid.  " + \
                  "Value given was: {}".format(centricityType))
            return None

        # Check inputs for longitude type.
        loweredLongitudeType = longitudeType.lower()
        if loweredLongitudeType != "tropical" and \
            loweredLongitudeType != "sidereal":

            log.error("Invalid input: Longitude type is invalid.  " + \
                  "Value given was: {}".format(longitudeType))
            return None
            
    # Field name we are getting.
    fieldName = "longitude"
        
    # Initialize the Ephemeris with the birth location.
    log.debug("Setting ephemeris location ...")
    Ephemeris.setGeographicPosition(locationLongitude,
                                    locationLatitude,
                                    locationElevation)

    # Set the step size.
    stepSizeTd = datetime.timedelta(days=1)
    for planetTuple in planet1ParamsList + planet2ParamsList:
        planetName = planetTuple[0]
            
        if Ephemeris.isHouseCuspPlanetName(planetName) or \
           Ephemeris.isAscmcPlanetName(planetName):
                
            # House cusps and ascmc planets need a smaller step size.
            stepSizeTd = datetime.timedelta(hours=1)
        elif planetName == "Moon":
            # Use a smaller step size for the moon so we can catch
            # smaller aspect sizes.
            stepSizeTd = datetime.timedelta(hours=3)
        
    log.debug("Step size is: {}".format(stepSizeTd))
        
    # Desired angles.  We need to check for planets at these angles.
    desiredAngleDegList = []

    desiredAngleDeg1 = Util.toNormalizedAngle(degreeDifference)
    desiredAngleDegList.append(desiredAngleDeg1)
    if Util.fuzzyIsEqual(desiredAngleDeg1, 0):
        desiredAngleDegList.append(360)
        
    if uniDirectionalAspectsFlag == False:
        desiredAngleDeg2 = \
            360 - Util.toNormalizedAngle(degreeDifference)
        if desiredAngleDeg2 not in desiredAngleDegList:
            desiredAngleDegList.append(desiredAngleDeg2)

    # Debug output.
    anglesStr = ""
    for angle in desiredAngleDegList:
        anglesStr += "{} ".format(angle)
    log.debug("Angles in desiredAngleDegList: " + anglesStr)

    # Iterate through, appending to aspectTimestamps list as we go.
    steps = []
开发者ID:philsong,项目名称:pricechartingtool,代码行数:70,代码来源:calculatePlanetHeliocentricConjunctions.py

示例2: filterOutNonsensicalValues

# 需要导入模块: from ephemeris import Ephemeris [as 别名]
# 或者: from ephemeris.Ephemeris import isAscmcPlanetName [as 别名]
def filterOutNonsensicalValues(planetaryInfo):
    """Here we will do some filtering on the given PlanetaryInfo
    object.  We will be setting some values to None so that the
    field will end up being blank on the table, where it makes
    sense to do so.
    
    Returns:
    PlanetaryInfo with some fields set to None.
    """
    
    p = planetaryInfo
    
    tropical = "tropical"
    sidereal = "sidereal"
    
    if Ephemeris.isHouseCuspPlanetName(p.name) or \
           Ephemeris.isAscmcPlanetName(p.name):
        
        p.geocentric[tropical]['longitude_speed'] = None
        p.geocentric[tropical]['declination'] = None
        p.geocentric[tropical]['declination_speed'] = None
        p.geocentric[tropical]['latitude'] = None
        p.geocentric[tropical]['latitude_speed'] = None
        p.geocentric[sidereal]['longitude_speed'] = None
        p.geocentric[sidereal]['declination'] = None
        p.geocentric[sidereal]['declination_speed'] = None
        p.geocentric[sidereal]['latitude'] = None
        p.geocentric[sidereal]['latitude_speed'] = None
        
        p.heliocentric[tropical]['longitude'] = None
        p.heliocentric[tropical]['longitude_speed'] = None
        p.heliocentric[tropical]['declination'] = None
        p.heliocentric[tropical]['declination_speed'] = None
        p.heliocentric[tropical]['latitude'] = None
        p.heliocentric[tropical]['latitude_speed'] = None
        
        p.heliocentric[sidereal]['longitude'] = None
        p.heliocentric[sidereal]['longitude_speed'] = None
        p.heliocentric[sidereal]['declination'] = None
        p.heliocentric[sidereal]['declination_speed'] = None
        p.heliocentric[sidereal]['latitude'] = None
        p.heliocentric[sidereal]['latitude_speed'] = None
        
    elif p.name == "Sun":
        
        p.heliocentric[tropical]['longitude'] = None
        p.heliocentric[tropical]['longitude_speed'] = None
        p.heliocentric[tropical]['declination'] = None
        p.heliocentric[tropical]['declination_speed'] = None
        p.heliocentric[tropical]['latitude'] = None
        p.heliocentric[tropical]['latitude_speed'] = None
        
        p.heliocentric[sidereal]['longitude'] = None
        p.heliocentric[sidereal]['longitude_speed'] = None
        p.heliocentric[sidereal]['declination'] = None
        p.heliocentric[sidereal]['declination_speed'] = None
        p.heliocentric[sidereal]['latitude'] = None
        p.heliocentric[sidereal]['latitude_speed'] = None
        
    elif p.name == "MeanNorthNode" or \
             p.name == "TrueNorthNode" or \
             p.name == "MeanLunarApogee" or \
             p.name == "OsculatingLunarApogee" or \
             p.name == "InterpolatedLunarApogee" or \
             p.name == "InterpolatedLunarPerigee":
        
        if p.name == "MeanNorthNode" or \
               p.name == "TrueNorthNode":

            p.geocentric[tropical]['latitude'] = None
            p.geocentric[tropical]['latitude_speed'] = None
            
            p.geocentric[sidereal]['latitude'] = None
            p.geocentric[sidereal]['latitude_speed'] = None
            
        p.heliocentric[tropical]['longitude'] = None
        p.heliocentric[tropical]['longitude_speed'] = None
        p.heliocentric[tropical]['declination'] = None
        p.heliocentric[tropical]['declination_speed'] = None
        p.heliocentric[tropical]['latitude'] = None
        p.heliocentric[tropical]['latitude_speed'] = None
        
        p.heliocentric[sidereal]['longitude'] = None
        p.heliocentric[sidereal]['longitude_speed'] = None
        p.heliocentric[sidereal]['declination'] = None
        p.heliocentric[sidereal]['declination_speed'] = None
        p.heliocentric[sidereal]['latitude'] = None
        p.heliocentric[sidereal]['latitude_speed'] = None
        
    elif p.name == "Earth":
        
        p.geocentric[tropical]['longitude'] = None
        p.geocentric[tropical]['longitude_speed'] = None
        p.geocentric[tropical]['declination'] = None
        p.geocentric[tropical]['declination_speed'] = None
        p.geocentric[tropical]['latitude'] = None
        p.geocentric[tropical]['latitude_speed'] = None
        
        p.geocentric[sidereal]['longitude'] = None
        p.geocentric[sidereal]['longitude_speed'] = None
#.........这里部分代码省略.........
开发者ID:philsong,项目名称:pricechartingtool,代码行数:103,代码来源:swingFileToCsvFiles.py

示例3: getLongitudeDiffBetweenDatetimes

# 需要导入模块: from ephemeris import Ephemeris [as 别名]
# 或者: from ephemeris.Ephemeris import isAscmcPlanetName [as 别名]
def getLongitudeDiffBetweenDatetimes(planetName,
                                     centricityType,
                                     dt1,
                                     loc1Tuple,
                                     dt2,
                                     loc2Tuple):

    startTimestamp = dt1
    endTimestamp = dt2

    loc1Name = loc1Tuple[0]
    loc1Longitude = loc1Tuple[1]
    loc1Latitude = loc1Tuple[2]
    loc1Elevation = loc1Tuple[3]

    loc2Name = loc2Tuple[0]
    loc2Longitude = loc2Tuple[1]
    loc2Latitude = loc2Tuple[2]
    loc2Elevation = loc2Tuple[3]


    # maxErrorTd - datetime.timedelta object holding the maximum
    #              time difference between the exact planetary
    #              timestamp for the phenomena, and the one
    #              calculated.  This would define the accuracy of
    #              the calculations.
    #
    maxErrorTd = datetime.timedelta(seconds=4)

    # Size of a circle, in degrees.
    #
    # Here we define our own value instead of using the value in
    # AstrologyUtils.degreesInCircle because it is possible we may
    # want to test different sizes of a 'circle'.
    circleSizeInDegrees = 360.0
        
    # All references to longitude_speed need to
    # be from tropical zodiac measurements!  If I use
    # sidereal zodiac measurements for getting the
    # longitude_speed, then the measurements from the
    # Swiss Ephemeris do not yield the correct values.
    # I use the following variable in these locations.
    zodiacTypeForLongitudeSpeed = "tropical"

    tropicalZodiacFlag = True

    # Text to set in the text item.
    text = ""

    # Total number of degrees elapsed.
    totalDegrees = 0
    
    Ephemeris.setGeographicPosition(loc1Longitude,
                                    loc1Latitude,
                                    loc1Elevation)
    
    # List of PlanetaryInfo objects for this particular
    # planet, sorted by timestamp.
    planetData = []
                
    # Step size to use in populating the data list with
    # PlanetaryInfos.
    #
    # The step size should cause the planet to move less
    # than 120 degrees in all cases, and idealy much less
    # than this, that way we can easily narrow down when
    # the planet passes the 0 degree or 360 degree
    # threshold, and also so it is easier to narrow down
    # when retrograde periods happen.  If the step size is
    # too large, it is possible that we would miss a whole
    # time window of retrograde movement, so discretion
    # has to be used in determining what to use for this value.
    #
    # Here we will set it to 1 day for the default case,
    # but if the planet name is a house cusp then shrink
    # the step size so we will get the correct resolution.
    # Also, if the planet name is an outer planet with a
    # large period, we can increase the step size slightly
    # to improve performance.
    stepSizeTd = datetime.timedelta(days=1)

    
    if Ephemeris.isHouseCuspPlanetName(planetName) or \
           Ephemeris.isAscmcPlanetName(planetName):
                    
        stepSizeTd = datetime.timedelta(hours=1)
                    
    elif planetName == "Jupiter" or \
         planetName == "Saturn" or \
         planetName == "Neptune" or \
         planetName == "Uranus" or \
         planetName == "Pluto":
                    
        stepSizeTd = datetime.timedelta(days=5)
                
        log.debug("Stepping through from {} to {} ...".\
                  format(Ephemeris.datetimeToStr(startTimestamp),
                         Ephemeris.datetimeToStr(endTimestamp)))
                
    # Current datetime as we step through all the
#.........这里部分代码省略.........
开发者ID:philsong,项目名称:pricechartingtool,代码行数:103,代码来源:calculatePlanetLocationsAndDifferences.py

示例4: getOnePlanetLongitudeAspectTimestamps

# 需要导入模块: from ephemeris import Ephemeris [as 别名]
# 或者: from ephemeris.Ephemeris import isAscmcPlanetName [as 别名]

#.........这里部分代码省略.........
    loweredCentricityType = centricityType.lower()
    if loweredCentricityType != "geocentric" and \
        loweredCentricityType != "topocentric" and \
        loweredCentricityType != "heliocentric":

        log.error("Invalid input: Centricity type is invalid.  " + \
                  "Value given was: {}".format(centricityType))
        return None
        
    # Check inputs for longitude type.
    loweredLongitudeType = longitudeType.lower()
    if loweredLongitudeType != "tropical" and \
        loweredLongitudeType != "sidereal":

        log.error("Invalid input: Longitude type is invalid.  " + \
                  "Value given was: {}".format(longitudeType))
        return None

    # Field name we are getting.
    fieldName = "longitude"
        
    # Initialize the Ephemeris with the birth location.
    log.debug("Setting ephemeris location ...")
    Ephemeris.setGeographicPosition(locationLongitude,
                                    locationLatitude,
                                    locationElevation)

    # Set the step size.
    stepSizeTd = datetime.timedelta(days=1)

    planetName = planet1Params[0]
        
    if Ephemeris.isHouseCuspPlanetName(planetName) or \
        Ephemeris.isAscmcPlanetName(planetName):
                
        # House cusps and ascmc planets need a smaller step size.
        stepSizeTd = datetime.timedelta(hours=1)
    elif planetName == "Moon":
        # Use a smaller step size for the moon so we can catch
        # smaller aspect sizes.
        stepSizeTd = datetime.timedelta(hours=3)
        
    log.debug("Step size is: {}".format(stepSizeTd))
        
    # Desired angles.  We need to check for planets at these angles.
    desiredAngleDegList = []
        
    desiredAngleDeg1 = Util.toNormalizedAngle(degreeDifference)
    desiredAngleDegList.append(desiredAngleDeg1)
    if Util.fuzzyIsEqual(desiredAngleDeg1, 0):
        desiredAngleDegList.append(360)
        
    if uniDirectionalAspectsFlag == False:
        desiredAngleDeg2 = \
            360 - Util.toNormalizedAngle(degreeDifference)
        if desiredAngleDeg2 not in desiredAngleDegList:
            desiredAngleDegList.append(desiredAngleDeg2)
        
    # Debug output.
    anglesStr = ""
    for angle in desiredAngleDegList:
        anglesStr += "{} ".format(angle)
    log.debug("Angles in desiredAngleDegList: " + anglesStr)

    # Iterate through, appending to aspectTimestamps list as we go.
    steps = []
开发者ID:philsong,项目名称:pricechartingtool,代码行数:70,代码来源:createGenericEphemerisSpreadsheet.py


注:本文中的ephemeris.Ephemeris.isAscmcPlanetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。