Skip to content

Commit

Permalink
refactor: switch regions from lists to tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Dec 10, 2023
1 parent b2c1e74 commit 65d7d92
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions src/antarctic_plots/regions.py
Expand Up @@ -29,50 +29,50 @@


# regions
antarctica = [-2800e3, 2800e3, -2800e3, 2800e3]
west_antarctica = [-2740e3, 570e3, -2150e3, 1670e3]
east_antarctica = [-840e3, 2880e3, -2400e3, 2600e3]
antarctic_peninsula = [-2600e3, -1200e3, 170e3, 1800e3]
marie_byrd_land = [-1500e3, -500e3, -1350e3, -800e3]
victoria_land = [100e3, 1000e3, -2200e3, -1000e3]
antarctica = (-2800e3, 2800e3, -2800e3, 2800e3)
west_antarctica = (-2740e3, 570e3, -2150e3, 1670e3)
east_antarctica = (-840e3, 2880e3, -2400e3, 2600e3)
antarctic_peninsula = (-2600e3, -1200e3, 170e3, 1800e3)
marie_byrd_land = (-1500e3, -500e3, -1350e3, -800e3)
victoria_land = (100e3, 1000e3, -2200e3, -1000e3)
# wilkes_land
# queen_maud_land

# study_sites
roosevelt_island = [-480e3, -240e3, -1220e3, -980e3]
ross_island = [210e3, 360e3, -1400e3, -1250e3]
minna_bluff = [210e3, 390e3, -1310e3, -1120e3]
roosevelt_island = (-480e3, -240e3, -1220e3, -980e3)
ross_island = (210e3, 360e3, -1400e3, -1250e3)
minna_bluff = (210e3, 390e3, -1310e3, -1120e3)
# discovery_deep
mcmurdo_dry_valleys = [320e3, 480e3, -1400e3, -1220e3]
siple_coast = [-700e3, 30e3, -1110e3, -450e3]
crary_ice_rise = [-330e3, -40e3, -830e3, -480e3]
siple_dome = [-630e3, -270e3, -970e3, -630e3]
mcmurdo_dry_valleys = (320e3, 480e3, -1400e3, -1220e3)
siple_coast = (-700e3, 30e3, -1110e3, -450e3)
crary_ice_rise = (-330e3, -40e3, -830e3, -480e3)
siple_dome = (-630e3, -270e3, -970e3, -630e3)

# ice_shelves
ross_ice_shelf = [-680e3, 470e3, -1420e3, -310e3]
# getz_ice_shelf = []
# abbott_ice_shelf = []
# george_vi_ice_shelf = []
# wilkins_ice_shelf = []
larsen_ice_shelf = [-2430e3, -1920e3, 900e3, 1400e3]
ronne_filchner_ice_shelf = [-1550e3, -500e3, 80e3, 1200e3]
# riiser_larsen_ice_shelf = []
# fimbul_ice_shelf = []
amery_ice_shelf = [1530e3, 2460e3, 430e3, 1000e3]
# west_ice_shelf = []
# shackleton_ice_shelf = []
# brunt_ice_shelf = []
ross_ice_shelf = (-680e3, 470e3, -1420e3, -310e3)
# getz_ice_shelf = ()
# abbott_ice_shelf = ()
# george_vi_ice_shelf = ()
# wilkins_ice_shelf = ()
larsen_ice_shelf = (-2430e3, -1920e3, 900e3, 1400e3)
ronne_filchner_ice_shelf = (-1550e3, -500e3, 80e3, 1200e3)
# riiser_larsen_ice_shelf = ()
# fimbul_ice_shelf = ()
amery_ice_shelf = (1530e3, 2460e3, 430e3, 1000e3)
# west_ice_shelf = ()
# shackleton_ice_shelf = ()
# brunt_ice_shelf = ()

# glaciers
# byrd_glacier
# nimrod_glacier
pine_island_glacier = [-1720e3, -1480e3, -380e3, -70e3]
thwaites_glacier = [-1650e3, -1200e3, -600e3, -300e3]
kamb_ice_stream = [-620e3, -220e3, -800e3, -400e3]
# whillans_ice_stream = []
pine_island_glacier = (-1720e3, -1480e3, -380e3, -70e3)
thwaites_glacier = (-1650e3, -1200e3, -600e3, -300e3)
kamb_ice_stream = (-620e3, -220e3, -800e3, -400e3)
# whillans_ice_stream = ()

# seas
ross_sea = [-500e3, 450e3, -2100e3, -1300e3]
ross_sea = (-500e3, 450e3, -2100e3, -1300e3)
# amundsen_sea
# bellinghausen_sea
# weddell_sea
Expand Down Expand Up @@ -114,9 +114,9 @@


def combine_regions(
region1: list,
region2: list,
):
region1: tuple[float, float, float, float],
region2: tuple[float, float, float, float],
) -> tuple[float, float, float, float]:
"""
Get the bounding region of 2 regions.
Expand All @@ -135,9 +135,10 @@ def combine_regions(
coords1 = utils.region_to_df(region1)
coords2 = utils.region_to_df(region2)
coords_combined = pd.concat((coords1, coords2))
region = vd.get_region((coords_combined.x, coords_combined.y))

return region
reg: tuple[float, float, float, float] = vd.get_region(
(coords_combined.x, coords_combined.y)
)
return reg


def draw_region(**kwargs):
Expand Down

0 comments on commit 65d7d92

Please sign in to comment.