Esempio n. 1
0
    (although the latter won't know whether the year is leap or not).
    Returns the time by which the sun is ahead of your clock (once its
    time-zone adjustments have been undone).\n"""
    try: n = (date - date.__class__(date.year, 1, 1)).days
    except AttributeError: # assume date is a day number within the year
        n = date
        cycle = 365 +.97 / 4
    else:
        cycle = 365 if isleap(date.year) else 366
    day = (n - 81) * turn / cycle
    return (9.873 * (2 * day).Sin -7.67 * (day + offset).Sin) * unit

# My home planet:
Earth = body.Planet(
    'Earth',
    Surface(Quantity(Sample.flat(6356912, 6378388, 6371020,
                                 low=6352400, high=6384100),
                     metre, """Radius of the Earth's surface.

This is how far mean sea level is from the Earth's centre; which varies
significantly between the poles and equator, thanks to centrifugal force.  I've
included, as .low and .high, the extremes of the radius at the Earth's solid
surface, 4.5 km below sea level in the Arctic and 5.89 km above sea level at the
top of Mount Kilimanjaro, in Africa.  See also: altitude.\n"""),
            # radius should also be nauticalMile * 60 * 180 / math.pi

            kg.force / kg, # by definition, from special property of masses

            Spin(Quantity(day * (1 - day / year.sidereal),
                          doc="""Rotational period of Earth wrt the fixed stars""",
                          sample = (24 * hour - 4 * minute + 4 * second,),
                          fullname="Sidereal Day"),
Esempio n. 2
0
  15 Eunomia      395500     136  8.3e18    De Gasparis 1851
  52 Europa       463300     156     ?      Goldschmidt 1858
 243 Ida          428000      35     ?      ?           1880?
 433 Eros         172800      33x13x13      Witt        1989
 511 Davida       475400     168     ?      Dugan       1903
 911 Agamemnon    778100      88     ?      Reinmuth    1919
 951 Gaspra       330000       8     ?      Neujmin     1916
1566 Icarus       161269       0.7   ?      Baade       1949
1862 Apollo       220061       0.7   ?      Reinmuth    1932
2060 Chiron      2051900      85     ?      Kowal       1977
2062 Aten         144514       0.5   ?      Helin       1976
2212 Hephaistos   323884       4.4   ?      Chernykh    1978
3554 Amun         145710       ?     ?      Shoemaker   1986
"""

Albert = IArock('Albert', 1911, Sample.flat(3.5, 4.5), 3, 300, 20)
Eros = IArock(
    'Eros',
    Discovery("C.G. Witt",
              1898,
              location="Berlin",
              date="1898, August 13",
              etymology="Greek: Eros - god of love"), 1.76, 15, 15000, 14)
Amor = IArock('Amor', 1932, 2.67, 10, 12000, 10)
# Amor is also the name of a class of Mars-crossers that don't cross Earth's orbit.
Apollo = IArock('Apollo', 1932, 1.81, 2, 100, 7)
Icarus = IArock('Icarus', 1949, 1.12, 1, 12, 4)
Adonis = IArock('Adonis', 1936, 2.76, 1, 12, 1.5)
Hermes = IArock('Hermes', 1937, 1.47, 1, 12, .2)

Asteroids.borrow([Ceres, Albert, Eros, Amor, Apollo, Icarus, Adonis, Hermes])
Esempio n. 3
0
  15 Eunomia      395500     136  8.3e18    De Gasparis 1851
  52 Europa       463300     156     ?      Goldschmidt 1858
 243 Ida          428000      35     ?      ?           1880?
 433 Eros         172800      33x13x13      Witt        1989
 511 Davida       475400     168     ?      Dugan       1903
 911 Agamemnon    778100      88     ?      Reinmuth    1919
 951 Gaspra       330000       8     ?      Neujmin     1916
1566 Icarus       161269       0.7   ?      Baade       1949
1862 Apollo       220061       0.7   ?      Reinmuth    1932
2060 Chiron      2051900      85     ?      Kowal       1977
2062 Aten         144514       0.5   ?      Helin       1976
2212 Hephaistos   323884       4.4   ?      Chernykh    1978
3554 Amun         145710       ?     ?      Shoemaker   1986
"""

Albert = IArock('Albert', 1911, Sample.flat(3.5, 4.5), 3, 300, 20)
Eros = IArock('Eros', Discovery("C.G. Witt", 1898, location="Berlin",
                                date="1898, August 13",
                                etymology="Greek: Eros - god of love"), 1.76, 15, 15000, 14)
Amor = IArock('Amor', 1932, 2.67, 10, 12000, 10)
# Amor is also the name of a class of Mars-crossers that don't cross Earth's orbit.
Apollo = IArock('Apollo', 1932, 1.81, 2, 100, 7)
Icarus = IArock('Icarus', 1949, 1.12, 1, 12, 4)
Adonis = IArock('Adonis', 1936, 2.76, 1, 12, 1.5)
Hermes = IArock('Hermes', 1937, 1.47, 1, 12, .2)

Asteroids.borrow([ Ceres, Albert, Eros, Amor, Apollo, Icarus, Adonis, Hermes ])

del Sun, AU, Asteroid, DwarfAster, Ring, Discovery, Orbit, NASAmoon, NASAshell, IArock, \
    Sample, ton, tera, mega, mile, Quantity, year, km, kg
Esempio n. 4
0
def IAisland(name, area=None, *parts, **what):
    if area is not None: what['area'] = area * _square_kilo_mile
    what['name'] = name
    return Island(*parts, **what)

def IAocean(name, area=None, depth=None, *parts, **what):
    if area is not None: what['area'] = area * _square_kilo_mile
    if depth is not None: what['depth'] = depth * mile
    what['name'] = name
    return Ocean(*parts, **what)

# My home planet:
Earth = body.Planet(
    'Earth',
    Surface(Quantity(Sample.flat(6356912, 6378388, 6371020,
                                 low=6352400, high=6384100),
                     metre, """Radius of the Earth's surface.

This is how far mean sea level is from the Earth's centre; which varies
significantly between the poles and equator, thanks to centrifugal force.  I've
included, as .low and .high, the extremes of the radius at the Earth's solid
surface, 4.5 km below sea level in the Arctic and 5.89 km above sea level at the
top of Mount Kilimanjaro, in Africa.  See also: altitude.\n"""),
            # radius should also be nauticalMile * 60 * 180 / math.pi

            kg.force / kg, # by definition, from special property of masses

            Spin(Quantity(day * (1 - day / year.sidereal),
                          doc="""Rotational period of Earth wrt the fixed stars""",
                          sample = (24 * hour - 4 * minute + 4 * second,),
                          fullname="Sidereal Day"),