Skip to content

Commit

Permalink
site plotting across dateline
Browse files Browse the repository at this point in the history
  • Loading branch information
didillysquat committed Jul 13, 2022
1 parent 6c3ce8f commit 886c193
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
52 changes: 36 additions & 16 deletions reefmapmaker/reefmapmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
warnings.filterwarnings("ignore", category=DownloadWarning)


__version__ = "v0.1.9"
__version__ = "v0.1.10"


class ReefMapMaker:
Expand Down Expand Up @@ -931,26 +931,46 @@ def _plot_user_points(self):
print('plotting user reefs\n')
line_widths = ((self.site_df['radius_in_deg'].astype(
float) * 2) * self.coord_to_point_scaler) * 0.1
self.large_map_ax.scatter(
x=self.site_df['longitude_deg_e'],
y=self.site_df['latitude_deg_n'],
s=(((self.site_df['radius_in_deg'].astype(
float) * 2) * self.coord_to_point_scaler) ** 2),
facecolors=self.site_df['facecolor'],
edgecolors=self.site_df['edgecolor'], zorder=3,
linewidths=line_widths
)
if self.date_line_centered:
self.large_map_ax.scatter(
x=[self._convert_point_coord_to_new_xcoords_central(_) for _ in self.site_df['longitude_deg_e']],
y=self.site_df['latitude_deg_n'],
s=(((self.site_df['radius_in_deg'].astype(
float) * 2) * self.coord_to_point_scaler) ** 2),
facecolors=self.site_df['facecolor'],
edgecolors=self.site_df['edgecolor'], zorder=3,
linewidths=line_widths
)
else:
self.large_map_ax.scatter(
x=self.site_df['longitude_deg_e'],
y=self.site_df['latitude_deg_n'],
s=(((self.site_df['radius_in_deg'].astype(
float) * 2) * self.coord_to_point_scaler) ** 2),
facecolors=self.site_df['facecolor'],
edgecolors=self.site_df['edgecolor'], zorder=3,
linewidths=line_widths
)

def _annotate_site_labels(self):
if self.config_dict['user_site_labels']:
for ind in self.site_df.index:
self.large_map_ax.annotate(
ind,
(
self.site_df.at[ind, 'longitude_deg_e'] + self.site_df.at[ind, 'radius_in_deg'],
self.site_df.at[ind, 'latitude_deg_n'] + self.site_df.at[ind, 'radius_in_deg']
if self.date_line_centered:
self.large_map_ax.annotate(
ind,
(
self._convert_point_coord_to_new_xcoords_central(self.site_df.at[ind, 'longitude_deg_e']) + self.site_df.at[ind, 'radius_in_deg'],
self.site_df.at[ind, 'latitude_deg_n'] + self.site_df.at[ind, 'radius_in_deg']
)
)
else:
self.large_map_ax.annotate(
ind,
(
self.site_df.at[ind, 'longitude_deg_e'] + self.site_df.at[ind, 'radius_in_deg'],
self.site_df.at[ind, 'latitude_deg_n'] + self.site_df.at[ind, 'radius_in_deg']
)
)
)

def _add_reference_reefs(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="reefmapmaker",
version='0.1.9',
version='0.1.10',
author="Benjamin C C Hume",
author_email="[email protected]",
description="Script to plot maps with reference coral reefs annotated.",
Expand Down

0 comments on commit 886c193

Please sign in to comment.