@@ -698,21 +698,37 @@ def _stereo_distortion_dist(lat):
698
698
699
699
def _parametric (lat ):
700
700
ones = np .ones (lat .shape )
701
- res = ((90 - lat ) * 2 + 18 ) / 180 * np .pi
702
- return np .minimum (res , ones )
701
+ y1 = ((90 - lat ) * 2 + 16 ) / 180 * np .pi
702
+ y2 = ((90 - lat ) * 4 + 8 ) / 180 * np .pi
703
+ y3 = ((90 - lat ) * 8 + 4 ) / 180 * np .pi
704
+ y4 = ((90 - lat ) * 16 + 2 ) / 180 * np .pi
705
+ y5 = ((90 - lat ) * 32 + 1 ) / 180 * np .pi
706
+ y6 = ((90 - lat ) * 64 + .5 ) / 180 * np .pi
707
+ y7 = ((90 - lat ) * 128 + .25 ) / 180 * np .pi
708
+ y8 = ((90 - lat ) * 252 + .125 ) / 180 * np .pi
709
+ y = np .minimum (y1 ,ones )
710
+ y = np .minimum (y2 ,y )
711
+ y = np .minimum (y3 ,y )
712
+ y = np .minimum (y4 ,y )
713
+ y = np .minimum (y5 ,y )
714
+ y = np .minimum (y6 ,y )
715
+ y = np .minimum (y7 ,y )
716
+ y = np .minimum (y8 ,y )
717
+ return y
703
718
704
719
705
720
def _generate_initial_points (min_edge_length , geps , bbox , fh , fd , pfix , stereo = False ):
706
721
"""Create initial distribution in bounding box (equilateral triangles)"""
707
722
if stereo :
708
- bbox = np .array ([[- 180 , 180 ], [- 89 , 89 ]])
723
+ bbox = np .array ([[- 180 , 180 ], [- 89 , 90 ]])
709
724
p = np .mgrid [
710
- tuple (slice (min , max + min_edge_length , min_edge_length ) for min , max in bbox )
725
+ tuple (slice (min , max , min_edge_length ) for min , max in bbox )
711
726
].astype (float )
712
727
if stereo :
713
728
# for global meshes in stereographic projections,
714
729
# we need to reproject the points from lon/lat to stereo projection
715
730
# then, we need to rectify their coordinates to lat/lon for the sizing function
731
+ p += np .random .rand (* p .shape ) * min_edge_length / 2 # randomise the distribution
716
732
p0 = p .reshape (2 , - 1 ).T
717
733
x , y = to_stereo (p0 [:, 0 ], p0 [:, 1 ])
718
734
p = np .asarray ([x , y ]).T
0 commit comments