コード例 #1
0
def test_great_arc_calculable(start, end):
    c = SkyCoord(start[0]*u.degree, start[1]*u.degree, frame=frames.HeliographicStonyhurst,
                 observer=frames.HeliographicStonyhurst(0*u.deg, 0*u.deg, 1*u.AU))
    d = SkyCoord(end[0]*u.degree, end[1]*u.degree, frame=frames.HeliographicStonyhurst,
                 observer=frames.HeliographicStonyhurst(0*u.deg, 0*u.deg, 1*u.AU))
    gc = GreatArc(c, d)

    c_trans = c.transform_to(frames.Heliocentric)
    assert gc.start.x == c_trans.x
    assert gc.start.y == c_trans.y
    assert gc.start.z == c_trans.z
    assert gc.start.observer.lat == 0*u.deg
    assert gc.start.observer.lon == 0*u.deg
    assert gc.start.observer.radius == 1 * u.AU

    d_trans = d.transform_to(frames.Heliocentric(observer=c.observer))
    assert gc.end.x == d_trans.x
    assert gc.end.y == d_trans.y
    assert gc.end.z == d_trans.z
    assert gc.end.observer.lat == 0*u.deg
    assert gc.end.observer.lon == 0*u.deg
    assert gc.end.observer.radius == 1 * u.AU

    np.testing.assert_almost_equal(gc.inner_angle.to('deg').value, 45.0)
    np.testing.assert_almost_equal(gc.radius.to('km').value, sun.constants.radius.to('km').value)
    np.testing.assert_almost_equal(gc.distance.to(
        'km').value, sun.constants.radius.to('km').value * 2 * np.pi/8, decimal=1)
コード例 #2
0
def aia_test_arc(aia171_test_map):
    start = SkyCoord(735 * u.arcsec,
                     -471 * u.arcsec,
                     frame=aia171_test_map.coordinate_frame)
    end = SkyCoord(-100 * u.arcsec,
                   800 * u.arcsec,
                   frame=aia171_test_map.coordinate_frame)
    return GreatArc(start, end)
コード例 #3
0
ファイル: test_utils.py プロジェクト: zimmaz/sunpy
def test_great_arc_wrongly_formatted_points(points, aia171_test_map):
    coordinate_frame = aia171_test_map.coordinate_frame
    a = SkyCoord(600 * u.arcsec, -600 * u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100 * u.arcsec, 800 * u.arcsec, frame=coordinate_frame)
    with pytest.raises(ValueError):
        GreatArc(a, b, points=points)

    with pytest.raises(ValueError):
        GreatArc(a, b).coordinates(points=points)

    with pytest.raises(ValueError):
        GreatArc(a, b).inner_angles(points=points)

    with pytest.raises(ValueError):
        GreatArc(a, b).distances(points=points)

    with pytest.raises(ValueError):
        GreatArc(a, b).distances(points=points)
コード例 #4
0
ファイル: test_utils.py プロジェクト: zimmaz/sunpy
def test_great_arc_points_differentiates(aia171_test_map):
    coordinate_frame = aia171_test_map.coordinate_frame
    a = SkyCoord(600 * u.arcsec, -600 * u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100 * u.arcsec, 800 * u.arcsec, frame=coordinate_frame)
    gc = GreatArc(a, b)
    coordinates = gc.coordinates(10)
    inner_angles = gc.inner_angles(11)
    distances = gc.distances(12)
    assert len(coordinates) == 10 and len(gc.coordinates()) == 100
    assert len(inner_angles) == 11 and len(gc.inner_angles()) == 100
    assert len(distances) == 12 and len(gc.distances()) == 100
コード例 #5
0
ファイル: test_utils.py プロジェクト: yashrsharma44/sunpy
def test_great_arc_points_differentiates():
    m = sunpy.map.Map(sunpy.map.Map(sunpy.data.test.get_test_filepath('aia_171_level1.fits')))
    coordinate_frame = m.coordinate_frame
    a = SkyCoord(600*u.arcsec, -600*u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100*u.arcsec, 800*u.arcsec, frame=coordinate_frame)
    gc = GreatArc(a, b)
    coordinates = gc.coordinates(10)
    inner_angles = gc.inner_angles(11)
    distances = gc.distances(12)
    assert len(coordinates) == 10 and len(gc.coordinates()) == 100
    assert len(inner_angles) == 11 and len(gc.inner_angles()) == 100
    assert len(distances) == 12 and len(gc.distances()) == 100
コード例 #6
0
ファイル: test_utils.py プロジェクト: yashrsharma44/sunpy
def test_great_arc_wrongly_formatted_points(points):
    m = sunpy.map.Map(sunpy.map.Map(sunpy.data.test.get_test_filepath('aia_171_level1.fits')))
    coordinate_frame = m.coordinate_frame
    a = SkyCoord(600*u.arcsec, -600*u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100*u.arcsec, 800*u.arcsec, frame=coordinate_frame)
    with pytest.raises(ValueError):
        dummy = GreatArc(a, b, points=points)

    with pytest.raises(ValueError):
        dummy = GreatArc(a, b).coordinates(points=points)

    with pytest.raises(ValueError):
        dummy = GreatArc(a, b).inner_angles(points=points)

    with pytest.raises(ValueError):
        dummy = GreatArc(a, b).distances(points=points)

    with pytest.raises(ValueError):
        dummy = GreatArc(a, b).distances(points=points)
コード例 #7
0
ファイル: test_utils.py プロジェクト: yashrsharma44/sunpy
def test_great_arc_calculable(start, end):
    c = SkyCoord(start[0]*u.degree, start[1]*u.degree, frame=frames.HeliographicStonyhurst,
                 observer=frames.HeliographicStonyhurst(0*u.deg, 0*u.deg, 1*u.AU))
    d = SkyCoord(end[0]*u.degree, end[1]*u.degree, frame=frames.HeliographicStonyhurst,
                 observer=frames.HeliographicStonyhurst(0*u.deg, 0*u.deg, 1*u.AU))
    gc = GreatArc(c, d)

    assert gc.start == c
    assert gc.end == d
    np.testing.assert_almost_equal(gc.inner_angle.to('deg').value, 45.0)
    np.testing.assert_almost_equal(gc.radius.to('km').value, sun.constants.radius.to('km').value)
    np.testing.assert_almost_equal(gc.distance.to('km').value, sun.constants.radius.to('km').value * 2 * np.pi/8, decimal=1)
コード例 #8
0
ファイル: test_utils.py プロジェクト: Hypnus1803/sunpy
def test_great_arc_points_differentiates():
    m = sunpy.map.Map(sunpy.map.Map(sunpy.data.test.get_test_filepath('aia_171_level1.fits')))
    coordinate_frame = m.coordinate_frame
    a = SkyCoord(600*u.arcsec, -600*u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100*u.arcsec, 800*u.arcsec, frame=coordinate_frame)
    gc = GreatArc(a, b)
    coordinates = gc.coordinates(10)
    inner_angles = gc.inner_angles(11)
    distances = gc.distances(12)
    assert len(coordinates) == 10 and len(gc.coordinates()) == 100
    assert len(inner_angles) == 11 and len(gc.inner_angles()) == 100
    assert len(distances) == 12 and len(gc.distances()) == 100
コード例 #9
0
ファイル: PCH_tests.py プロジェクト: MSKirk/KirkPyLib
def test_pick_hole_extremes():

    PCH_Detection.pch_mask(test_map)
    holes = measure.label(np.logical_not(test_map.mask).astype(int),
                          connectivity=1,
                          background=0)

    plot_map = map.Map(sunpy.data.sample.AIA_171_IMAGE)

    fig = plt.figure()
    ax = plt.subplot(projection=plot_map)
    plot_map.plot(axes=ax)

    for r_number in range(1, np.max(holes) + 1, 1):
        hole_coords = test_map.pixel_to_world(
            np.where(holes == r_number)[1] * u.pixel,
            np.where(holes == r_number)[0] * u.pixel, 0)
        hole_start, hole_end = PCH_Detection.pick_hole_extremes(hole_coords)
        great_arc = GreatArc(hole_start, hole_end)
        ax.plot_coord(great_arc.coordinates(), color='c')
        print(hole_start, hole_end)

    plt.show()
コード例 #10
0
ファイル: test_utils.py プロジェクト: zimmaz/sunpy
def test_great_arc_different_observer(aia171_test_map):
    a = SkyCoord(600 * u.arcsec,
                 -600 * u.arcsec,
                 frame=aia171_test_map.coordinate_frame)

    observer = SkyCoord(-10.0 * u.deg,
                        83 * u.deg,
                        radius=0.9 * u.au,
                        frame=frames.HeliographicStonyhurst,
                        obstime=aia171_test_map.date)
    b = SkyCoord(400 * u.arcsec,
                 600 * u.arcsec,
                 observer=observer,
                 frame=frames.Helioprojective)

    # Test that the input observers are indeed different
    assert a.observer.lon != b.observer.lon
    assert a.observer.lat != b.observer.lat
    assert a.observer.radius != b.observer.radius

    # Create the great arc
    gc = GreatArc(a, b)

    # The start and end points stored internally are Heliocentric
    start = gc.start
    assert isinstance(start.frame, frames.Heliocentric)
    end = gc.end
    assert isinstance(end.frame, frames.Heliocentric)

    # The start and end points stored internally have the same observer
    assert start.observer.lon == end.observer.lon
    assert start.observer.lat == end.observer.lat
    assert start.observer.radius == end.observer.radius

    # The start point stored internally has the Heliocentric coordinates of the initial coordinate passed in.
    a2h = a.transform_to(frames.Heliocentric)
    assert start.x == a2h.x
    assert start.y == a2h.y
    assert start.z == a2h.z

    # The end point stored internally has the Heliocentric coordinates of the initial coordinate passed in.
    b2h = b.transform_to(
        frames.Heliocentric(observer=aia171_test_map.observer_coordinate))

    # Missing an dp on b2h compared to end (TODO BUG?)
    np.testing.assert_almost_equal(end.x.value, b2h.x.value)
    np.testing.assert_almost_equal(end.y.value, b2h.y.value)
    np.testing.assert_almost_equal(end.z.value, b2h.z.value)
コード例 #11
0
ファイル: test_utils.py プロジェクト: zimmaz/sunpy
def test_great_arc_coordinates(points_requested, points_expected, first_point,
                               last_point, last_inner_angle, last_distance,
                               aia171_test_map):
    coordinate_frame = aia171_test_map.coordinate_frame
    a = SkyCoord(600 * u.arcsec, -600 * u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100 * u.arcsec, 800 * u.arcsec, frame=coordinate_frame)
    gc = GreatArc(a, b, points=points_requested)
    coordinates = gc.coordinates()
    inner_angles = gc.inner_angles()
    distances = gc.distances()

    # Ensure a GreatArc object is returned
    assert isinstance(gc, GreatArc)

    # Test the properties of the GreatArc object
    a_trans = a.transform_to(frames.Heliocentric)
    assert gc.start.x == a_trans.x
    assert gc.start.y == a_trans.y
    assert gc.start.z == a_trans.z
    b_trans = b.transform_to(frames.Heliocentric(observer=a.observer))
    assert gc.end.x == b_trans.x
    assert gc.end.y == b_trans.y
    assert gc.end.z == b_trans.z
    assert gc.distance_unit == u.m
    assert gc.observer == a.observer
    assert gc.center.x == 0 * u.m
    assert gc.center.y == 0 * u.m
    assert gc.center.z == 0 * u.m

    assert u.allclose(
        gc.start_cartesian * u.m,
        np.asarray([428721.0913539, -428722.9051924, 341776.0910214]) * u.km)
    assert u.allclose(
        gc.end_cartesian * u.m,
        np.asarray([-71429.5229381, 571439.071248, 390859.5797815]) * u.km)
    assert u.allclose(gc.center_cartesian * u.m, np.asarray([0, 0, 0]) * u.km)

    assert u.allclose(
        gc.v1 * u.m,
        np.asarray([428721.0913539, -428722.9051924, 341776.0910214]) * u.km)
    assert u.allclose(gc._r, 696000000.0015007)
    assert u.allclose(
        gc.v2 * u.m,
        np.asarray([-71429.5229381, 571439.071248, 390859.5797815]) * u.km)
    assert u.allclose(
        gc.v3 * u.m,
        np.asarray([56761.6265851, 466230.7005856, 513637.0815867]) * u.km)

    # Inner angle
    assert gc.inner_angle.unit == u.rad
    np.testing.assert_almost_equal(gc.inner_angle.value, 1.8683580432741789)

    # Distance
    assert gc.distance.unit == u.m
    np.testing.assert_approx_equal(gc.distance.value, 1300377198.1299164)

    # Radius of the sphere
    assert gc.radius.unit == u.m
    assert u.isclose(gc.radius.value * u.m, 696000.000001501 * u.km)

    # Test the calculation of the SkyCoords
    # Coordinates method
    # Number of points
    assert len(coordinates) == points_expected

    # Start and end coordinates
    np.testing.assert_almost_equal(coordinates[0].Tx.value, first_point[0])
    np.testing.assert_almost_equal(coordinates[0].Ty.value, first_point[1])
    np.testing.assert_almost_equal(coordinates[-1].Tx.value, last_point[0])
    np.testing.assert_almost_equal(coordinates[-1].Ty.value, last_point[1])

    # Inner angles method
    # Inner angles
    assert len(inner_angles) == points_expected
    np.testing.assert_almost_equal(inner_angles[-1].value, last_inner_angle)

    # Distances method
    assert len(distances) == points_expected
    assert u.isclose(distances[-1].value * u.m, last_distance * u.km)
コード例 #12
0
ファイル: great_arc_example.py プロジェクト: Cadair/sunpy
import sunpy.map
from sunpy.coordinates.utils import GreatArc
from sunpy.data.sample import AIA_171_IMAGE

###############################################################################
# Make a map.
m = sunpy.map.Map(AIA_171_IMAGE)

###############################################################################
# Let's define the start and end co-ordinates of the arc on the Sun.
start = SkyCoord(735 * u.arcsec, -471 * u.arcsec, frame=m.coordinate_frame)
end = SkyCoord(-100 * u.arcsec, 800 * u.arcsec, frame=m.coordinate_frame)

###############################################################################
# Create the great arc between the start and end points.
great_arc = GreatArc(start, end)

###############################################################################
# Plot the great arc on the Sun.
fig = plt.figure()
ax = plt.subplot(projection=m)
m.plot(axes=ax)
ax.plot_coord(great_arc.coordinates(), color='c')
plt.show()

###############################################################################
# Now we can calculate the nearest integer pixels of the data that correspond
# to the location of arc.
pixels = np.asarray(np.rint(m.world_to_pixel(great_arc.coordinates())), dtype=int)
x = pixels[0, :]
y = pixels[1, :]
コード例 #13
0
ファイル: box.py プロジェクト: d-seki/solar-analysis
def map_box(amap, bl_arc, tr_arc, img=None, c='c'):
    color = c
    if type(bl_arc) != SkyCoord:
        bl_arc = SkyCoord(bl_arc[0] * u.arc,
                          bl_arc[1] * u.arc,
                          frame=amap.coordinate_frame)
        tr_arc = SkyCoord(tr_arc[0] * u.arc,
                          tr_arc[1] * u.arc,
                          frame=amap.coordinate_frame)
    br_arc = SkyCoord(tr_arc.Tx, bl_arc.Ty, frame=amap.coordinate_frame)
    tl_arc = SkyCoord(bl_arc.Tx, tr_arc.Ty, frame=amap.coordinate_frame)
    blbr = GreatArc(bl_arc, br_arc)
    brtr = GreatArc(br_arc, tr_arc)
    tltr = GreatArc(tl_arc, tr_arc)
    bltl = GreatArc(bl_arc, tl_arc)
    if not img:
        img = amap.plot()

    img.axes.plot_coord(blbr.coordinates(), color=color)
    img.axes.plot_coord(brtr.coordinates(), color=color)
    img.axes.plot_coord(tltr.coordinates(), color=color)
    img.axes.plot_coord(bltl.coordinates(), color=color)

    return img
コード例 #14
0
ファイル: great_arc_example.py プロジェクト: thilak007/sunpy
import sunpy.map
from sunpy.coordinates.utils import GreatArc
from sunpy.data.sample import AIA_171_IMAGE

###############################################################################
# We start with the sample data
m = sunpy.map.Map(AIA_171_IMAGE)

###############################################################################
# Let's define the start and end coordinates of the arc.
start = SkyCoord(735 * u.arcsec, -471 * u.arcsec, frame=m.coordinate_frame)
end = SkyCoord(-100 * u.arcsec, 800 * u.arcsec, frame=m.coordinate_frame)

###############################################################################
# Create the great arc between the start and end points.
great_arc = GreatArc(start, end)

###############################################################################
# Plot the great arc on the Sun.
fig = plt.figure()
ax = plt.subplot(projection=m)
m.plot(axes=ax)
ax.plot_coord(great_arc.coordinates(), color='c')
plt.show()

###############################################################################
# Now we can calculate the nearest integer pixels of the data that correspond
# to the location of arc.
pixels = np.asarray(np.rint(m.world_to_pixel(great_arc.coordinates())),
                    dtype=int)
x = pixels[0, :]
コード例 #15
0
def test_great_arc_coordinates(points_requested, points_expected, first_point,
                               last_point, last_inner_angle, last_distance):

    m = sunpy.map.Map(
        sunpy.map.Map(
            sunpy.data.test.get_test_filepath('aia_171_level1.fits')))
    coordinate_frame = m.coordinate_frame
    a = SkyCoord(600 * u.arcsec, -600 * u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100 * u.arcsec, 800 * u.arcsec, frame=coordinate_frame)
    gc = GreatArc(a, b, points=points_requested)
    coordinates = gc.coordinates()
    inner_angles = gc.inner_angles()
    distances = gc.distances()

    # Ensure a GreatArc object is returned
    assert isinstance(gc, GreatArc)

    # Test the properties of the GreatArc object
    assert gc.start == a
    assert gc.end == b
    assert gc.distance_unit == u.km
    assert gc.observer == a.observer
    assert gc.center.x == 0 * u.km
    assert gc.center.y == 0 * u.km
    assert gc.center.z == 0 * u.km

    np.testing.assert_almost_equal(
        gc.start_cartesian,
        np.asarray([428721.0913539, -428722.9051924, 341776.0910214]))
    np.testing.assert_almost_equal(
        gc.end_cartesian,
        np.asarray([-71429.5229381, 571439.071248, 390859.5797815]))
    np.testing.assert_almost_equal(gc.center_cartesian, np.asarray([0, 0, 0]))

    np.testing.assert_almost_equal(
        gc.v1, np.asarray([428721.0913539, -428722.9051924, 341776.0910214]))
    np.testing.assert_almost_equal(gc._r, 696000.000001501)
    np.testing.assert_almost_equal(
        gc.v2, np.asarray([-71429.5229381, 571439.071248, 390859.5797815]))
    np.testing.assert_almost_equal(
        gc.v3, np.asarray([56761.6265851, 466230.7005856, 513637.0815867]))

    # Inner angle
    assert gc.inner_angle.unit == u.rad
    np.testing.assert_almost_equal(gc.inner_angle.value, 1.8683580432741789)

    # Distance
    assert gc.distance.unit == u.km
    np.testing.assert_almost_equal(gc.distance.value, 1300377.1981298963)

    # Radius of the sphere
    assert gc.radius.unit == u.km
    np.testing.assert_almost_equal(gc.radius.value, 696000.000001501)

    # Test the calculation of the SkyCoords
    # Coordinates method
    # Number of points
    assert len(coordinates) == points_expected

    # Start and end coordinates
    np.testing.assert_almost_equal(coordinates[0].Tx.value, first_point[0])
    np.testing.assert_almost_equal(coordinates[0].Ty.value, first_point[1])
    np.testing.assert_almost_equal(coordinates[-1].Tx.value, last_point[0])
    np.testing.assert_almost_equal(coordinates[-1].Ty.value, last_point[1])

    # Inner angles method
    # Inner angles
    assert len(inner_angles) == points_expected
    np.testing.assert_almost_equal(inner_angles[-1].value, last_inner_angle)

    # Distances method
    assert len(distances) == points_expected
    np.testing.assert_almost_equal(distances[-1].value, last_distance)
コード例 #16
0
ax.plot(pixel_coord[0], pixel_coord[1], 'x', color='w',
        label=f'Pixel coordinate [{pixel_coord[0]}, {pixel_coord[1]}]')

###############################################################################
# As well as defining a point and using `.GenericMap.plot()`, you can also plot
# a point with WCSAxes using the `~astropy.visualization.wcsaxes.WCSAxes.plot_coord`
# functionality using a coordinate as a SkyCoord.
# We can demonstrate this by plotting a point and an arc on a map using two separate SkyCoords.
# Here we will plot a point (at -250,-250) on the map using a SkyCoord.

# sphinx_gallery_defer_figures

ax.plot_coord(SkyCoord(-250*u.arcsec, -250*u.arcsec, frame=my_map.coordinate_frame), "o",
              label=f'SkyCoord [{-250*u.arcsec}, {-250*u.arcsec}]')

###############################################################################
# Finally, let's create a great arc between a start and end point defined as SkyCoords.

start = SkyCoord(723 * u.arcsec, -500 * u.arcsec, frame=my_map.coordinate_frame)
end = SkyCoord(-100 * u.arcsec, 900 * u.arcsec, frame=my_map.coordinate_frame)

great_arc = GreatArc(start, end)

my_map.plot(axes=ax, clip_interval=(1, 99.99)*u.percent)
ax.plot_coord(great_arc.coordinates(), color='c',
              label=f'SkyCoord [{723*u.arcsec}, {-500*u.arcsec}],\n \
                               [{-100*u.arcsec}, {900*u.arcsec}]')
ax.legend(loc="lower center")

plt.show()
コード例 #17
0
ファイル: test_utils.py プロジェクト: Hypnus1803/sunpy
def test_great_arc_coordinates(points_requested, points_expected, first_point,
                               last_point, last_inner_angle, last_distance):

    m = sunpy.map.Map(sunpy.map.Map(sunpy.data.test.get_test_filepath('aia_171_level1.fits')))
    coordinate_frame = m.coordinate_frame
    a = SkyCoord(600*u.arcsec, -600*u.arcsec, frame=coordinate_frame)
    b = SkyCoord(-100*u.arcsec, 800*u.arcsec, frame=coordinate_frame)
    gc = GreatArc(a, b, points=points_requested)
    coordinates = gc.coordinates()
    inner_angles = gc.inner_angles()
    distances = gc.distances()

    # Ensure a GreatArc object is returned
    assert isinstance(gc, GreatArc)

    # Test the properties of the GreatArc object
    assert gc.start == a
    assert gc.end == b
    assert gc.distance_unit == u.km
    assert gc.observer == a.observer
    assert gc.center.x == 0 * u.km
    assert gc.center.y == 0 * u.km
    assert gc.center.z == 0 * u.km

    np.testing.assert_almost_equal(gc.start_cartesian, np.asarray([428721.09135385, -428722.90519236, 341776.09102756]))
    np.testing.assert_almost_equal(gc.end_cartesian, np.asarray([-71429.52293813, 571439.07124801, 390859.57978693]))
    np.testing.assert_almost_equal(gc.center_cartesian, np.asarray([0, 0, 0]))

    np.testing.assert_almost_equal(gc.v1, np.asarray([428721.09135385, -428722.90519236, 341776.09102756]))
    np.testing.assert_almost_equal(gc._r, 696000.00000451738)
    np.testing.assert_almost_equal(gc.v2, np.asarray([-71429.52293813, 571439.07124801, 390859.57978693]))
    np.testing.assert_almost_equal(gc.v3, np.asarray([56761.62657985, 466230.70058902, 513637.08158833]))

    # Inner angle
    assert gc.inner_angle.unit == u.rad
    np.testing.assert_almost_equal(gc.inner_angle.value, 1.8683580432741789)

    # Distance
    assert gc.distance.unit == u.km
    np.testing.assert_almost_equal(gc.distance.value, 1300377.1981272686)

    # Radius of the sphere
    assert gc.radius.unit == u.km
    np.testing.assert_almost_equal(gc.radius.value, 696000.0000045174)

    # Test the calculation of the SkyCoords
    # Coordinates method
    # Number of points
    assert len(coordinates) == points_expected

    # Start and end coordinates
    np.testing.assert_almost_equal(coordinates[0].Tx.value, first_point[0])
    np.testing.assert_almost_equal(coordinates[0].Ty.value, first_point[1])
    np.testing.assert_almost_equal(coordinates[-1].Tx.value, last_point[0])
    np.testing.assert_almost_equal(coordinates[-1].Ty.value, last_point[1])

    # Inner angles method
    # Inner angles
    assert len(inner_angles) == points_expected
    np.testing.assert_almost_equal(inner_angles[-1].value, last_inner_angle)

    # Distances method
    assert len(distances) == points_expected
    np.testing.assert_almost_equal(distances[-1].value, last_distance)