Example #1
0
def main():

    p = ArgumentParser()
    p.add_argument('latlon',
                   help='geodetic latitude, longitude (degrees)',
                   type=float,
                   nargs=2)
    p.add_argument('-alt_km',
                   help='altitude START STOP STEP (km)',
                   type=float,
                   nargs=3,
                   default=(80, 1000, 20))
    p.add_argument('-q',
                   '--quiet',
                   help='disable plotting',
                   action='store_true')
    P = p.parse_args()

    alt_km = np.arange(*P.alt_km)

    iono = iri.IRI('2012-08-21T12', alt_km, *P.latlon)

    if not P.quiet:
        piri.altprofile(iono)
        show()
Example #2
0
def test_point():

    iri = iri2016.IRI('1980-03-21T12', 130., 0., 0.)

    assert [iri['ne'].item(), iri.NmF2, iri.hmF2
            ] == approx([267285184512.0, 2580958937088.0, 438.78643798828125],
                        rel=1e-4)
Example #3
0
def test_altitude_profile():
    time = '2015-12-13T10'
    alt_km = np.arange(100, 1000, 10)
    glat = 65.1
    glon = -147.5

    iri = iri2016.IRI(time, alt_km, glat, glon).squeeze()

    assert iri['ne'][10] == approx(4.931192e+09, rel=1e-4)
    assert (iri.NmF2, iri.hmF2) == approx((82.14109e9, 317.35287), rel=1e-4)
Example #4
0
def test_altitude_profile():
    time = "2015-12-13T10"
    altkmrange = (100, 1000, 10.0)
    glat = 65.1
    glon = -147.5

    iri = iri2016.IRI(time, altkmrange, glat, glon)

    # .item() necessary for stability across OS, pytest versions, etc.
    assert iri["ne"][10].item() == approx(3.98669824e9, rel=1e-4)
    assert iri.NmF2.item() == approx(7.71626844e10, rel=1e-4)
    assert iri.hmF2.item() == approx(312.837677, rel=1e-4)
Example #5
0
def main():

    p = ArgumentParser()
    p.add_argument("time", help="time of simulation")
    p.add_argument("latlon", help="geodetic latitude, longitude (degrees)", type=float, nargs=2)
    p.add_argument(
        "-alt_km",
        help="altitude START STOP STEP (km)",
        type=float,
        nargs=3,
        default=(80, 1000, 10),
    )
    P = p.parse_args()

    iono = iri.IRI(P.time, P.alt_km, *P.latlon)

    piri.altprofile(iono)
    show()
Example #6
0
def main():

    p = ArgumentParser()
    p.add_argument('latlon',
                   help='geodetic latitude, longitude (degrees)',
                   type=float,
                   nargs=2)
    p.add_argument('-alt_km',
                   help='altitude START STOP STEP (km)',
                   type=float,
                   nargs=3,
                   default=(80, 1000, 10))
    P = p.parse_args()

    iono = iri.IRI('2012-08-21T12', P.alt_km, *P.latlon)

    piri.altprofile(iono)
    show()
Example #7
0
def altitude():
    """ Height Profile Example """

    if show is None:
        raise ImportError("need matplotlib")

    p = ArgumentParser(description="IRI2016 altitude profile")
    p.add_argument("time", help="time of simulation")
    p.add_argument("latlon",
                   help="geodetic latitude, longitude (degrees)",
                   type=float,
                   nargs=2)
    p.add_argument("-alt_km",
                   help="altitude START STOP STEP (km)",
                   type=float,
                   nargs=3,
                   default=(80, 1000, 10))
    P = p.parse_args()

    iono = iri.IRI(P.time, P.alt_km, *P.latlon)

    piri.altprofile(iono)
    show()