1515from py_eddy_tracker import data
1616from py_eddy_tracker .generic import coordinates_to_local , local_to_coordinates
1717from py_eddy_tracker .observations .observation import EddiesObservations
18- from py_eddy_tracker .poly import fit_circle_ , fit_ellips
18+ from py_eddy_tracker .poly import fit_circle_ , fit_ellipse
1919
2020# %%
2121# Load example identification file
2222a = EddiesObservations .load_file (data .get_demo_path ("Anticyclonic_20190223.nc" ))
2323
2424
2525# %%
26- # Function to draw circle or ellips from parameter
26+ # Function to draw circle or ellipse from parameter
2727def build_circle (x0 , y0 , r ):
2828 angle = radians (linspace (0 , 360 , 50 ))
2929 x_norm , y_norm = cos (angle ), sin (angle )
3030 return local_to_coordinates (x_norm * r , y_norm * r , x0 , y0 )
3131
3232
33- def build_ellips (x0 , y0 , a , b , theta ):
33+ def build_ellipse (x0 , y0 , a , b , theta ):
3434 angle = radians (linspace (0 , 360 , 50 ))
3535 x = a * cos (theta ) * cos (angle ) - b * sin (theta ) * sin (angle )
3636 y = a * sin (theta ) * cos (angle ) + b * cos (theta ) * sin (angle )
3737 return local_to_coordinates (x , y , x0 , y0 )
3838
3939
4040# %%
41- # Plot fitted circle or ellips on stored contour
41+ # Plot fitted circle or ellipse on stored contour
4242xs , ys = a .contour_lon_s , a .contour_lat_s
4343
4444fig = plt .figure (figsize = (15 , 15 ))
@@ -51,9 +51,9 @@ def build_ellips(x0, y0, a, b, theta):
5151 ax = fig .add_subplot (4 , 4 , j )
5252 ax .grid (), ax .set_aspect ("equal" )
5353 ax .plot (x , y , label = "store" , color = "black" )
54- x0 , y0 , a , b , theta = fit_ellips (x_ , y_ )
54+ x0 , y0 , a , b , theta = fit_ellipse (x_ , y_ )
5555 x0 , y0 = local_to_coordinates (x0 , y0 , x0_ , y0_ )
56- ax .plot (* build_ellips (x0 , y0 , a , b , theta ), label = "ellips " , color = "green" )
56+ ax .plot (* build_ellipse (x0 , y0 , a , b , theta ), label = "ellipse " , color = "green" )
5757 x0 , y0 , radius , shape_error = fit_circle_ (x_ , y_ )
5858 x0 , y0 = local_to_coordinates (x0 , y0 , x0_ , y0_ )
5959 ax .plot (* build_circle (x0 , y0 , radius ), label = "circle" , color = "red" , lw = 0.5 )
0 commit comments