Example #1
0
File: sun.py Project: tsarjak/sunpy
def apparent_longitude(t='now'):
    """Returns the apparent longitude of the Sun."""
    T = julian_centuries(t)
    omega = (259.18 - 1934.142 * T) * u.deg
    true_long = true_longitude(t)
    result = true_long - (0.00569 - 0.00479 * np.sin(omega)) * u.deg
    return Longitude(result)
Example #2
0
def mean_anomaly(t='now'):
    """Returns the mean anomaly (the angle through which the Sun has moved
    assuming a circular orbit) as a function of time."""
    T = julian_centuries(t)
    result = 358.475830 + 35999.049750 * T - 0.0001500 * T ** 2 - 0.00000330 * T ** 3
    result = result * u.deg
    return Longitude(result)
Example #3
0
File: sun.py Project: tdunn19/sunpy
def mean_anomaly(t=None):
    """Returns the mean anomaly (the angle through which the Sun has moved
    assuming a circular orbit) as a function of time."""
    T = julian_centuries(t)
    result = 358.475830 + 35999.049750 * T - 0.0001500 * T**2 - 0.00000330 * T**3
    result = result % 360.0
    return result
Example #4
0
def apparent_longitude(t=None):
    """Returns the apparent longitude of the Sun."""
    T = julian_centuries(t)
    omega = 259.18 - 1934.142 * T
    true_long = true_longitude(t)        
    result = true_long - 0.00569 - 0.00479 * np.sin(np.radians(omega))
    return result
Example #5
0
File: sun.py Project: tdunn19/sunpy
def apparent_longitude(t=None):
    """Returns the apparent longitude of the Sun."""
    T = julian_centuries(t)
    omega = 259.18 - 1934.142 * T
    true_long = true_longitude(t)
    result = true_long - 0.00569 - 0.00479 * math.sin(np.radians(omega))
    return result
Example #6
0
def apparent_longitude(t='now'):
    """Returns the apparent longitude of the Sun."""
    T = julian_centuries(t)
    omega = (259.18 - 1934.142 * T) * u.deg
    true_long = true_longitude(t)
    result = true_long - (0.00569 - 0.00479 * np.sin(omega)) * u.deg
    return Longitude(result)
Example #7
0
def equation_of_center(t='now'):
    """Returns the Sun's equation of center (in degrees)"""
    T = julian_centuries(t)
    mna = mean_anomaly(t) 
    result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T
    ** 2) * np.sin(np.radians(mna)) + (0.0200940 - 0.0001000 * T) *
    np.sin(np.radians(2 * mna)) + 0.0002930 * np.sin(np.radians(3 * mna)))
    return result
Example #8
0
def equation_of_center(t='now'):
    """Returns the Sun's equation of center (in degrees)"""
    T = julian_centuries(t)
    mna = mean_anomaly(t)
    result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T**2) * np.sin(mna) +
              (0.0200940 - 0.0001000 * T) * np.sin(2 * mna) + 0.0002930 * np.sin(3 * mna))
    result = result * u.deg
    return Angle(result)
Example #9
0
File: sun.py Project: yashkgp/sunpy
def true_obliquity_of_ecliptic(t='now'):
    """
    Returns the true obliquity of the ecliptic.

    """
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3
    return Angle(result, u.deg)
Example #10
0
def true_obliquity_of_ecliptic(t='now'):
    """
    Returns the true obliquity of the ecliptic.

    """
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3
    return Angle(result, u.deg)
Example #11
0
def eccentricity_SunEarth_orbit(t='now'):
    """
    Returns the eccentricity of the Sun Earth Orbit.

    """
    T = julian_centuries(t)
    result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T**2
    return result
Example #12
0
File: sun.py Project: yashkgp/sunpy
def eccentricity_SunEarth_orbit(t='now'):
    """
    Returns the eccentricity of the Sun Earth Orbit.

    """
    T = julian_centuries(t)
    result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T**2
    return result
Example #13
0
def equation_of_center(t=None):
    """Returns the Sun's equation of center (in degrees)"""
    T = julian_centuries(t)
    mna = mean_anomaly(t) 
    result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T
    ** 2) * np.sin(np.radians(mna) + (0.0200940 - 0.0001000 * T) *
    np.sin(np.radians(2 * mna)) + 0.0002930 * np.sin(np.radians(3 * mna))))
    return result
Example #14
0
File: sun.py Project: yashkgp/sunpy
def mean_ecliptic_longitude(t='now'):
    """
    Returns the mean ecliptic longitude.

    """
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result * u.deg
    return Longitude(result)
Example #15
0
def geometric_mean_longitude(t='now'):
    """
    Returns the geometric mean longitude (in degrees).

    """
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result * u.deg
    return Longitude(result)
Example #16
0
def mean_ecliptic_longitude(t='now'):
    """
    Returns the mean ecliptic longitude.

    """
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result * u.deg
    return Longitude(result)
Example #17
0
File: sun.py Project: yashkgp/sunpy
def geometric_mean_longitude(t='now'):
    """
    Returns the geometric mean longitude (in degrees).

    """
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result * u.deg
    return Longitude(result)
Example #18
0
def eccentricity_sun_earth_orbit(t='now'):
    """
    Returns the eccentricity of the Sun Earth Orbit.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a palongitude_Sun_perigee, true_latitude and apparent_latitude need to be fixedrse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T**2
    return result
Example #19
0
File: sun.py Project: Cadair/sunpy
def true_obliquity_of_ecliptic(t='now'):
    """
    Returns the true obliquity of the ecliptic.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3
    return Angle(result, u.deg)
Example #20
0
File: sun.py Project: Cadair/sunpy
def eccentricity_sun_earth_orbit(t='now'):
    """
    Returns the eccentricity of the Sun Earth Orbit.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a palongitude_Sun_perigee, true_latitude and apparent_latitude need to be fixedrse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T**2
    return result
Example #21
0
def true_obliquity_of_ecliptic(t='now'):
    """
    Returns the true obliquity of the ecliptic.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3
    return Angle(result, u.deg)
Example #22
0
def mean_ecliptic_longitude(t='now'):
    """
    Returns the mean ecliptic longitude.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result * u.deg
    return Longitude(result)
Example #23
0
File: sun.py Project: Cadair/sunpy
def mean_ecliptic_longitude(t='now'):
    """
    Returns the mean ecliptic longitude.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result * u.deg
    return Longitude(result)
Example #24
0
def apparent_longitude(t='now'):
    """
    Returns the apparent longitude of the Sun.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    omega = (259.18 - 1934.142 * T) * u.deg
    true_long = true_longitude(t)
    result = true_long - (0.00569 - 0.00479 * np.sin(omega)) * u.deg
    return Longitude(result)
Example #25
0
File: sun.py Project: Cadair/sunpy
def apparent_longitude(t='now'):
    """
    Returns the apparent longitude of the Sun.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    omega = (259.18 - 1934.142 * T) * u.deg
    true_long = true_longitude(t)
    result = true_long - (0.00569 - 0.00479 * np.sin(omega)) * u.deg
    return Longitude(result)
Example #26
0
File: sun.py Project: tsarjak/sunpy
def solar_north(t='now'):
    """Returns the position of the Solar north pole in degrees."""
    T = julian_centuries(t)
    ob1 = true_obliquity_of_ecliptic(t)
    # in degrees
    i = 7.25 * u.deg
    k = (74.3646 + 1.395833 * T) * u.deg
    lamda = true_longitude(t) - (0.00569 * u.deg)
    omega = (259.18 - 1934.142 * T) * u.deg
    lamda2 = lamda - (0.00479 * np.sin(omega)) * u.deg
    diff = lamda - k
    x = np.arctan(-np.cos(lamda2) * np.tan(ob1))
    y = np.arctan(-np.cos(diff) * np.tan(i))
    result = x + y
    return Angle(result.to(u.deg))
Example #27
0
def solar_north(t='now'):
    """Returns the position of the Solar north pole in degrees."""
    T = julian_centuries(t)
    ob1 = true_obliquity_of_ecliptic(t)
    # in degrees
    i = 7.25
    k = 74.3646 + 1.395833 * T
    lamda = true_longitude(t) - 0.00569
    omega = apparent_longitude(t)
    lamda2 = lamda - 0.00479 * np.sin(np.radians(omega))
    diff = np.radians(lamda - k)
    x = np.degrees(np.arctan(-np.cos(np.radians(lamda2)*np.tan(np.radians(ob1)))))
    y = np.degrees(np.arctan(-np.cos(diff) * np.tan(np.radians(i))))
    result = x + y
    return result
Example #28
0
def solar_north(t=None):
    """Returns the position of the Solar north pole in degrees."""
    T = julian_centuries(t)
    ob1 = true_obliquity_of_ecliptic(t)
    # in degrees
    i = 7.25
    k = 74.3646 + 1.395833 * T
    lamda = true_longitude(t) - 0.00569
    omega = apparent_longitude(t)
    lamda2 = lamda - 0.00479 * np.sin(np.radians(omega))
    diff = np.radians(lamda - k)
    x = np.degrees(np.arctan(-np.cos(np.radians(lamda2)*np.tan(np.radians(ob1)))))
    y = np.degrees(np.arctan(-np.cos(diff) * np.tan(np.radians(i))))
    result = x + y
    return result
Example #29
0
File: sun.py Project: Cadair/sunpy
def mean_anomaly(t='now'):
    """
    Returns the mean anomaly (the angle through which the Sun has moved
    assuming a circular orbit) as a function of time.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 358.475830 + 35999.049750 * T - 0.0001500 * T**2 - 0.00000330 * T**3
    result = result * u.deg
    return Longitude(result)
Example #30
0
def mean_anomaly(t='now'):
    """
    Returns the mean anomaly (the angle through which the Sun has moved
    assuming a circular orbit) as a function of time.

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    result = 358.475830 + 35999.049750 * T - 0.0001500 * T**2 - 0.00000330 * T**3
    result = result * u.deg
    return Longitude(result)
Example #31
0
def solar_north(t='now'):
    """Returns the position of the Solar north pole in degrees."""
    T = julian_centuries(t)
    ob1 = true_obliquity_of_ecliptic(t)
    # in degrees
    i = 7.25 * u.deg
    k = (74.3646 + 1.395833 * T) * u.deg
    lamda = true_longitude(t) - (0.00569 * u.deg)
    omega = apparent_longitude(t)
    lamda2 = lamda - (0.00479 * np.sin(omega)) * u.deg
    diff = lamda - k
    x = np.arctan(-np.cos((lamda2) * np.tan(ob1)))
    y = np.arctan(-np.cos(diff) * np.tan(i))
    result = x + y
    return Angle(result.to(u.deg))
Example #32
0
File: sun.py Project: Cadair/sunpy
def equation_of_center(t='now'):
    """
    Returns the Sun's equation of center (in degrees).

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    mna = mean_anomaly(t)
    result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T**2) * np.sin(mna) +
              (0.0200940 - 0.0001000 * T) * np.sin(2 * mna) + 0.0002930 * np.sin(3 * mna))
    result = result * u.deg
    return Angle(result)
Example #33
0
def equation_of_center(t='now'):
    """
    Returns the Sun's equation of center (in degrees).

    Parameters
    ----------
    t : {parse_time_types}
        A time (usually the start time) specified as a parse_time-compatible
        time string, number, or a datetime object.
    """
    T = julian_centuries(t)
    mna = mean_anomaly(t)
    result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T**2) * np.sin(mna) +
              (0.0200940 - 0.0001000 * T) * np.sin(2 * mna) +
              0.0002930 * np.sin(3 * mna))
    result = result * u.deg
    return Angle(result)
Example #34
0
def heliographic_solar_center(t='now'):
    """Returns the position of the solar center in heliographic coordinates."""
    jd = julian_day(t)
    T = julian_centuries(t)
    # Heliographic coordinates in degrees
    theta = ((jd - 2398220)*360/25.38) * u.deg
    i = 7.25 * u.deg
    k = (74.3646 + 1.395833 * T) * u.deg
    lamda = true_longitude(t) - 0.00569 * u.deg
    diff = lamda - k
    # Latitude at center of disk (deg):
    he_lat = np.degrees(np.arcsin(np.sin(diff)*np.sin(i)))
    # Longitude at center of disk (deg):
    y = -np.sin(diff)*np.cos(i)
    x = -np.cos(diff)
    rpol = (np.arctan2(y, x))
    he_lon = rpol - theta
    return [Longitude(he_lon), Latitude(he_lat)]
Example #35
0
File: sun.py Project: tsarjak/sunpy
def heliographic_solar_center(t='now'):
    """Returns the position of the solar center in heliographic coordinates."""
    jd = julian_day(t)
    T = julian_centuries(t)
    # Heliographic coordinates in degrees
    theta = ((jd - 2398220)*360/25.38) * u.deg
    i = 7.25 * u.deg
    k = (74.3646 + 1.395833 * T) * u.deg
    lamda = true_longitude(t) - 0.00569 * u.deg
    diff = lamda - k
    # Latitude at center of disk (deg):
    he_lat = np.arcsin(np.sin(diff)*np.sin(i))
    # Longitude at center of disk (deg):
    y = -np.sin(diff)*np.cos(i)
    x = -np.cos(diff)
    rpol = (np.arctan2(y, x))
    he_lon = rpol - theta
    return (Longitude(he_lon.to(u.deg)), Latitude(he_lat.to(u.deg)))
Example #36
0
File: sun.py Project: tdunn19/sunpy
def heliographic_solar_center(t=None):
    """Returns the position of the solar center in heliographic coordinates."""
    jd = julian_day(t)
    T = julian_centuries(t)
    # Heliographic coordinates in degrees
    theta = (jd - 2398220) * 360 / 25.38
    i = 7.25
    k = 74.3646 + 1.395833 * T
    lamda = true_longitude(t) - 0.00569
    #omega = apparent_longitude(t)
    #lamda2 = lamda - 0.00479 * math.sin(np.radians(omega))
    diff = np.radians(lamda - k)
    # Latitude at center of disk (deg):
    he_lat = np.degrees(math.asin(math.sin(diff) * math.sin(np.radians(i))))
    # Longitude at center of disk (deg):
    y = -math.sin(diff) * math.cos(np.radians(i))
    x = -math.cos(diff)
    rpol = cmath.polar(complex(x, y))
    he_lon = np.degrees(rpol[1]) - theta
    he_lon = he_lon % 360
    if he_lon < 0:
        he_lon = he_lon + 360.0

    return [he_lon, he_lat]
Example #37
0
def heliographic_solar_center(t=None):
    """Returns the position of the solar center in heliographic coordinates."""
    jd = julian_day(t)
    T = julian_centuries(t)
    # Heliographic coordinates in degrees
    theta = (jd - 2398220)*360/25.38
    i = 7.25
    k = 74.3646 + 1.395833 * T
    lamda = true_longitude(t) - 0.00569
    #omega = apparent_longitude(t)
    #lamda2 = lamda - 0.00479 * math.sin(np.radians(omega))
    diff = np.radians(lamda - k)
    # Latitude at center of disk (deg):    
    he_lat = np.degrees(np.arcsin(np.sin(diff)*np.sin(np.radians(i))))
    # Longitude at center of disk (deg):
    y = -np.sin(diff)*np.cos(np.radians(i))
    x = -np.cos(diff)
    rpol = cmath.polar(complex(x,y))
    he_lon = np.degrees(rpol[1]) - theta
    he_lon = he_lon % 360
    if he_lon < 0:
        he_lon = he_lon + 360.0

    return [he_lon, he_lat]
Example #38
0
def true_obliquity_of_ecliptic(t="now"):
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T ** 2 + 0.000000503 * T ** 3
    return Angle(result, u.deg)
Example #39
0
def geometric_mean_longitude(t=None):
    """Returns the geometric mean longitude (in degrees)"""   
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T ** 2
    result = result % 360.0
    return result
Example #40
0
File: sun.py Project: tdunn19/sunpy
def mean_ecliptic_longitude(t=None):
    """Returns the mean ecliptic longitude."""
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result % 360.0
    return result
Example #41
0
File: sun.py Project: tdunn19/sunpy
def true_obliquity_of_ecliptic(t=None):
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3
    return result
Example #42
0
def true_obliquity_of_ecliptic(t=None):
    T = julian_centuries(t)
    result = 23.452294 - 0.0130125 * T - 0.00000164 * T ** 2 + 0.000000503 * T ** 3
    return result
Example #43
0
File: sun.py Project: tdunn19/sunpy
def geometric_mean_longitude(t=None):
    """Returns the geometric mean longitude (in degrees)"""
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2
    result = result % 360.0
    return result
Example #44
0
def mean_ecliptic_longitude(t=None):
    """Returns the mean ecliptic longitude."""
    T = julian_centuries(t)
    result = 279.696680 + 36000.76892 * T + 0.0003025 * T ** 2
    result = result % 360.0
    return result