Antarctic ice shelf analysis

This notebook analyzes the results generated from the notebook antarctic_ice_shelf_calculations.ipynb.

[21]:
%load_ext autoreload
%autoreload 2
import logging
import os

import geopandas as gpd
import matplotlib as mpl
import numpy as np
import pandas as pd
import verde as vd
import xarray as xr
from adjustText import adjust_text
from matplotlib import patheffects
from matplotlib import pyplot as plt
from polartoolkit import fetch, maps
from polartoolkit import utils as polar_utils
from shapely.geometry import Point

os.environ["POLARTOOLKIT_HEMISPHERE"] = "south"
import pygmt
import seaborn as sns
from invert4geom import utils
from matplotlib.gridspec import GridSpec

from synthetic_bathymetry_inversion import ice_shelf_stats, synthetic

sns.set_theme()


# logging.basicConfig()
logging.getLogger("synthetic_bathymetry_inversion").setLevel(logging.INFO)
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
[23]:
logging.getLogger("synthetic_bathymetry_inversion").setLevel(logging.WARN)
[24]:
ice_shelves = ice_shelf_stats.get_ice_shelves()

Save and load to csv

[25]:
antarctic_bed_points = pd.read_csv(
    "../results/ice_shelves/antarctica_constraints.csv.gz",
    sep=",",
    header=0,
    index_col=None,
    encoding="utf-8",
    compression="gzip",
)
[26]:
min_dist = xr.open_dataarray("../results/ice_shelves/antarctica_min_dist.nc")
grav_grid = xr.open_dataset("../results/ice_shelves/antarctica_grav_grids.nc")
[27]:
df = pd.read_csv("../results/ice_shelves/ice_shelf_gravity_stats.csv", index_col=None)

# turn back into geodataframe
ice_shelf_stats_gdf_full = gpd.GeoDataFrame(
    df,
    geometry=gpd.GeoSeries.from_wkt(df["geometry"], crs="EPSG:3031"),
    crs="EPSG:3031",
)
ice_shelf_stats_gdf = ice_shelf_stats_gdf_full[ice_shelf_stats_gdf_full.area_km > 1000]
ice_shelf_stats_gdf
[27]:
NAME Regions TYPE geometry area_km median_constraint_distance mean_constraint_distance max_constraint_distance constraint_proximity_skewness gravity_disturbance_rms ... reg_rms reg_stdev res_rms res_stdev error_rms error_stdev residual_constraint_proximity_ratio_rms residual_constraint_proximity_ratio_stdev regional_constraint_proximity_ratio_rms regional_constraint_proximity_ratio_stdev
0 Ross West FL POLYGON ((-240677.184 -678259.006, -240038.274... 480428.37 17.282824 17.636882 62.339089 0.431810 44.934094 ... 17.652465 17.159272 6.399599 6.397548 12.748633 3.154937 132.093296 132.083718 306.642616 292.262320
1 Ronne_Filchner West FL POLYGON ((-1006734.891 880592.98, -1006335.923... 427041.70 7.686515 8.739788 46.338298 1.456174 41.514238 ... 34.036735 20.853880 4.087359 4.084574 7.952294 1.760702 60.063692 60.065236 350.615365 251.773078
2 Amery East FL POLYGON ((2134701.422 618463.117, 2131452.011 ... 60797.28 16.941666 21.373582 74.852666 0.844014 54.656450 ... 41.754702 25.626999 15.490488 12.651456 8.432001 0.497149 516.984001 453.747317 1173.773769 858.199460
3 LarsenC Peninsula FL POLYGON ((-2235724.269 1271352.188, -2235828.5... 47443.51 9.067471 10.260593 36.855613 0.763313 14.824574 ... 38.595139 14.498270 5.654761 5.647546 5.735885 1.390208 69.319708 69.157083 508.573512 329.301767
4 Riiser-Larsen East FL POLYGON ((-592166.317 1592824.258, -593783.16 ... 42913.14 17.664812 20.596557 63.202992 0.713248 53.556828 ... 80.002938 41.235478 11.714963 11.313144 8.285409 0.728764 400.456039 396.959121 1942.610309 1289.222243
5 Fimbul East FL POLYGON ((145423.961 2176737.792, 145088.314 2... 40947.75 5.450097 6.460643 26.199066 1.391103 55.666475 ... 85.682386 37.892171 8.297214 7.978892 6.037483 1.283386 104.190480 100.468045 651.273997 428.275246
6 Brunt_Stancomb East FL POLYGON ((-648673.952 1612385.898, -648144.2 1... 36137.10 14.462157 18.965093 66.878832 0.713434 31.663309 ... 60.831688 37.897353 16.341843 14.232125 5.764394 2.020729 464.852285 411.069585 1195.526791 842.794187
7 Getz West FL MULTIPOLYGON (((-1464395.442 -1011065.611, -14... 33389.04 10.337270 11.505782 40.419329 0.774685 45.815742 ... 12.205220 9.303628 16.998768 11.747717 6.840661 2.799637 290.474365 226.021130 142.812858 112.543489
8 Baudouin East FL POLYGON ((894980.201 1963931.58, 894465.744 19... 33129.24 22.523870 24.018180 72.093600 0.635214 37.878304 ... 48.879327 37.573922 10.108949 8.132793 7.175396 1.815555 370.587351 313.933210 1189.930499 915.632328
9 Abbot West FL MULTIPOLYGON (((-1946681.999 -330470.661, -194... 31389.73 9.786923 10.943510 34.300815 0.673908 28.653549 ... 28.884329 18.295812 24.157426 17.545262 6.650965 1.750310 362.377493 286.900839 341.590904 239.269065
10 Shackleton East FL POLYGON ((2633675.06 -479241.005, 2632371.431 ... 26927.90 26.857001 30.320176 84.476658 0.528034 34.623367 ... 21.161772 16.583821 25.629659 22.316325 8.183697 1.713532 878.761872 796.097579 708.223791 526.485359
11 George_VI Peninsula FL POLYGON ((-1774674.35 512798.517, -1773489.407... 23259.86 6.629541 7.765265 28.809121 0.916105 37.630662 ... 20.944093 17.180645 9.886067 9.549641 5.335354 1.284207 106.139745 104.798720 183.519858 150.927667
12 LarsenD Peninsula FL MULTIPOLYGON (((-2046617.921 1133347.186, -204... 22633.36 9.747474 11.223082 35.745032 0.729375 26.100451 ... 22.351237 17.551993 19.839734 17.231720 6.049384 1.446036 252.179193 238.484520 299.503837 232.906140
13 Borchgrevink East FL POLYGON ((673415.109 2122771.487, 672998.689 2... 21615.61 14.245119 15.609578 43.083083 0.524661 47.743811 ... 71.111799 32.809827 6.734850 6.730842 10.503035 2.459579 161.875877 161.582709 1268.940192 765.712781
14 West East FL POLYGON ((2563983.553 220837.286, 2563003.768 ... 16082.67 14.361596 16.644050 54.804727 0.791998 22.957914 ... 44.052011 13.914831 13.304884 11.951100 7.049417 1.611335 251.086094 238.214179 858.633036 499.671858
15 Wilkins Peninsula FL POLYGON ((-2099746.399 584996.044, -2100523.90... 12906.75 17.496130 19.212720 57.283478 0.526020 17.100584 ... 18.511484 9.428037 15.128348 12.296971 7.178177 1.613022 366.603800 332.444698 481.128657 314.451081
16 Sulzberger West FL POLYGON ((-661704.253 -1219812.221, -661564.09... 11969.52 5.291712 5.976404 20.055580 0.974902 83.919330 ... 22.847154 15.232767 15.792321 11.968309 5.175029 0.614085 135.447072 116.815678 134.781946 102.028194
17 Jelbart East FL POLYGON ((-218574.64 2131324.79, -217808.505 2... 10845.49 11.208331 12.891675 34.708913 0.538191 65.086870 ... 69.913894 55.393184 15.912717 14.140983 5.436008 0.819316 212.094210 206.407071 1066.271632 875.389617
18 Lazarev East FL POLYGON ((607354.123 2097919.164, 607390.414 2... 8571.63 10.392029 11.124736 28.285719 0.506552 41.231610 ... 57.778623 14.027711 3.939256 3.878213 8.388131 0.359499 56.805559 54.896712 735.361815 372.759155
19 Stange Peninsula FL POLYGON ((-1727712.171 477501.975, -1724636.95... 7930.02 8.561534 9.740539 29.517175 0.642805 18.889995 ... 27.893201 9.650491 21.455620 14.722837 5.945450 1.670934 381.616246 311.830174 323.672161 192.960859
20 Nivl East FL POLYGON ((464341.95 2137439.241, 464211.633 21... 7321.50 10.667219 11.455388 30.335890 0.412275 46.668969 ... 50.590825 41.485220 8.349499 8.020072 7.358711 1.332392 136.218616 131.186252 632.362749 525.341247
21 Ekstrom East FL POLYGON ((-321325.354 2109824.907, -322025.425... 6870.83 2.733504 3.413805 15.303827 1.091623 88.423961 ... 100.430952 66.504162 5.032808 4.849027 3.945405 1.349207 36.847508 35.538492 391.933600 322.561833
22 Nickerson West FL POLYGON ((-956577.608 -1277290.219, -955837.27... 6335.28 8.165844 10.227400 32.923505 1.023376 78.748823 ... 38.222944 16.442105 14.625910 12.231593 6.407424 2.195490 258.817500 235.428918 362.045683 212.752074
23 Totten East FL POLYGON ((2246041.394 -1157675.447, 2239414.25... 6187.04 6.274200 7.373829 24.156028 0.728359 73.993164 ... 19.504152 18.733900 24.318478 18.803521 4.226202 0.851438 326.562293 279.713187 193.678285 190.061220
24 Pine_Island West FL POLYGON ((-1684242.607 -341481.119, -1685079.5... 6120.28 3.984452 4.598587 16.703882 0.606235 37.497041 ... 11.727781 10.323847 4.913605 4.793041 3.798641 1.001197 36.874955 36.582037 47.184627 45.960112
25 Moscow_University East FL MULTIPOLYGON (((2192162.937 -1342195.65, 21909... 5949.58 6.716427 7.295015 20.452319 0.535940 82.060155 ... 15.993502 15.937466 24.113897 15.920992 5.624316 1.961263 268.409093 205.406955 132.513942 129.689061
26 Dotson West FL POLYGON ((-1535033.641 -603663.519, -1523891.9... 5677.28 6.061000 6.965584 21.949416 0.807072 43.949766 ... 14.048409 13.240744 14.355342 10.598480 4.497715 1.108233 156.322935 127.326626 91.026939 88.943243
27 Mertz East FL POLYGON ((1409174.577 -2033174.141, 1409425.16... 5652.20 4.848562 6.125292 22.753403 0.852462 73.477617 ... 36.280897 19.652023 8.436730 8.454509 9.633673 4.057948 103.082464 103.186752 400.249587 312.792178
28 Prince_Harald East FL MULTIPOLYGON (((1367928.932 1754234.348, 13668... 5455.02 25.980222 25.862225 61.765863 0.128630 33.425492 ... 28.816741 28.285337 11.311922 11.327516 8.431992 0.050487 370.103227 368.129513 689.269643 690.068501
29 Thwaites West FL POLYGON ((-1600077.739 -445017.92, -1599824.40... 5377.37 2.514499 3.863388 16.327860 0.921421 27.918822 ... 23.252751 11.749283 3.816426 3.773032 3.882824 0.849178 34.082356 34.142123 94.016739 67.733592
30 Bach Peninsula FL POLYGON ((-1852808.829 579336.22, -1853187.96 ... 4547.92 6.984483 7.902379 21.396119 0.736829 9.435792 ... 27.131616 7.860826 9.996486 6.068227 6.824091 1.558595 103.680658 74.729847 238.272021 124.704572
31 Cook East FL POLYGON ((1053300.202 -2130175.163, 1052767.82... 3531.84 16.061323 17.647837 45.203958 0.408027 90.606794 ... 33.197024 4.942182 25.225528 12.127439 7.097700 2.003441 605.708859 394.786594 657.430707 340.964127
32 Crosson West FL POLYGON ((-1485656.428 -625686.627, -1491316.3... 3331.23 8.020299 9.976549 29.537062 0.753281 30.039716 ... 16.443290 7.376695 13.497936 9.237666 3.997538 0.851595 143.263725 103.275024 214.413749 144.654041
33 Rennick East FL POLYGON ((668275.342 -2045686.903, 667858.789 ... 3276.48 8.382017 8.420208 20.847725 0.090211 201.018641 ... 155.550517 28.360502 18.500710 11.648852 10.123007 3.215634 182.180075 127.868301 1439.231760 657.889292
34 Venable West FL POLYGON ((-1836561.107 134217.571, -1836278.22... 3155.04 7.631753 8.039256 20.881108 0.414615 26.649466 ... 20.042249 10.732811 18.797018 13.069439 5.753215 1.619751 219.537608 172.635264 194.715030 136.130371
35 Cosgrove West FL POLYGON ((-1756239.555 -353406.569, -1756380.9... 2989.54 9.790910 10.319020 24.004050 0.315979 35.807715 ... 11.315775 10.435270 14.232502 8.782699 6.666859 1.636633 208.993616 149.121747 103.071941 95.214253
36 Tracy_Tremenchus East FL POLYGON ((2586375.936 -480787.476, 2586938.359... 2941.02 15.576057 16.242676 36.087534 0.179918 30.139494 ... 34.002267 4.318785 9.424696 9.436255 9.219408 2.451026 230.934030 231.729783 648.703199 324.507220
37 Mariner East FL POLYGON ((393072.24 -1759690.414, 392784.207 -... 2672.87 9.068760 10.559233 28.437255 0.768003 75.259329 ... 42.492249 22.834966 15.986361 11.262662 10.569656 2.278087 143.275583 99.674651 413.875415 234.125379
38 Holmes East FL MULTIPOLYGON (((1997471.65 -1552909.64, 199768... 2366.35 7.517926 9.195149 31.935346 1.218393 56.328624 ... 23.427345 6.911150 1.943640 1.934667 14.321592 1.387805 25.338756 25.451705 264.037032 161.580466
39 Drygalski East FL POLYGON ((471675.11 -1519675.151, 471799.885 -... 2280.86 3.963965 4.265640 13.938510 0.510656 107.719772 ... 69.398843 58.897213 8.194334 8.191274 8.266895 2.886299 42.776449 42.409462 350.701530 303.318939
40 LarsenB Peninsula FL POLYGON ((-2322226.017 1287020.491, -2322192.0... 2151.14 5.418445 6.351085 18.929508 0.636706 14.050233 ... 29.150028 8.680453 4.886146 4.668150 6.849321 1.339996 40.920191 41.027909 194.598915 105.669533
41 Quar East FL POLYGON ((-378324.562 2048575.36, -378164.216 ... 2131.89 4.807345 5.785503 17.747388 0.828849 104.526989 ... 127.414056 13.122358 7.025344 5.866438 6.455409 0.439714 52.329162 43.957190 882.854340 503.968053
42 Vigrid East FL POLYGON ((344318.997 2156889.869, 342203.503 2... 2096.02 10.294453 11.474471 32.221545 0.652380 48.087287 ... 69.292687 22.069168 11.617080 11.175258 6.410457 1.816587 221.964183 219.761627 1094.118764 714.306009
43 Atka East FL POLYGON ((-277564.446 2105750.401, -277546.543... 1993.74 6.984946 7.798236 21.461812 0.508949 98.527113 ... 118.754121 11.446779 6.623843 5.727348 5.466605 1.609184 57.972645 52.259648 1086.234822 581.142071
44 Nansen East FL POLYGON ((483245.044 -1547614.188, 483709.392 ... 1942.07 3.557490 4.216609 14.246912 0.741455 109.400166 ... 86.214466 31.952463 10.019495 7.921007 7.442287 1.891788 60.934852 50.775213 507.066701 356.013489
45 Ninnis East FL MULTIPOLYGON (((1312866.432 -2026243.651, 1314... 1929.03 7.151927 8.566233 26.433129 0.744688 79.307785 ... 20.079431 7.284808 20.814791 14.883603 8.703523 2.666469 364.409916 308.220622 211.724953 131.883965
46 Conger_Glenzer East FL POLYGON ((2569966.039 -636188.979, 2570323.627... 1600.94 32.468017 32.413522 49.768507 0.007600 20.600937 ... 13.571781 5.500923 17.290143 17.195246 7.846109 2.314243 567.785134 572.027791 413.540516 138.254030
47 Publications East FL POLYGON ((2140550.303 599450.133, 2139844.108 ... 1563.27 6.028745 7.656435 22.507517 0.850635 34.278739 ... 17.514361 12.776547 2.683513 2.654676 8.404819 0.066097 27.292913 27.074809 126.650106 91.622756
48 Dibble East FL POLYGON ((1878424.501 -1827174.544, 1879031.46... 1463.17 7.950698 8.209674 21.853908 0.508016 94.450669 ... 54.752182 18.017360 5.395037 5.424791 13.542626 2.560673 45.589709 43.879894 437.934974 192.691040
49 LarsenE Peninsula FL MULTIPOLYGON (((-1556766.778 871991.554, -1557... 1167.29 5.602792 5.853480 14.848904 0.403158 35.285661 ... 20.745813 18.116646 21.506119 14.908023 6.958159 1.643375 160.204052 126.640887 148.146399 125.566951

50 rows × 27 columns

[28]:
df = ice_shelf_stats_gdf_full.sort_values(
    "median_constraint_distance", ascending=False
).reset_index(drop=True)
val = df[df.NAME == "Ross"].index[0]
print(f"{val + 1} out of {len(ice_shelves)} ice shelves")
print(f"{((val + 1) / len(ice_shelves)) * 100} %")
9 out of 164 ice shelves
5.487804878048781 %
[8]:
df = ice_shelf_stats_gdf.sort_values(
    "max_constraint_distance", ascending=False
).reset_index(drop=True)[
    [
        "NAME",
        "max_constraint_distance",
    ]
]
df.iloc[0], df.iloc[-1]
[8]:
(NAME                       Shackleton
 max_constraint_distance     84.476658
 Name: 0, dtype: object,
 NAME                       Drygalski
 max_constraint_distance     13.93851
 Name: 49, dtype: object)
[9]:
df = ice_shelf_stats_gdf.sort_values(
    "median_constraint_distance", ascending=False
).reset_index(drop=True)[
    [
        "NAME",
        "median_constraint_distance",
    ]
]
df.iloc[0], df.iloc[-1]
[9]:
(NAME                          Conger_Glenzer
 median_constraint_distance         32.468017
 Name: 0, dtype: object,
 NAME                          Thwaites
 median_constraint_distance    2.514499
 Name: 49, dtype: object)
[10]:
df = ice_shelf_stats_gdf.sort_values(
    "constraint_proximity_skewness", ascending=False
).reset_index(drop=True)[
    [
        "NAME",
        "constraint_proximity_skewness",
    ]
]
df.iloc[0], df.iloc[-1]
[10]:
(NAME                             Ronne_Filchner
 constraint_proximity_skewness          1.456174
 Name: 0, dtype: object,
 NAME                             Conger_Glenzer
 constraint_proximity_skewness            0.0076
 Name: 49, dtype: object)
[11]:
df = ice_shelf_stats_gdf.sort_values(
    "topo_free_disturbance_stdev", ascending=False
).reset_index(drop=True)[
    [
        "NAME",
        "topo_free_disturbance_stdev",
    ]
]
df.iloc[0], df.iloc[-1]
[11]:
(NAME                             Ekstrom
 topo_free_disturbance_stdev    66.265034
 Name: 0, dtype: object,
 NAME                             Holmes
 topo_free_disturbance_stdev    6.980136
 Name: 49, dtype: object)
[12]:
df = ice_shelf_stats_gdf.sort_values("error_rms", ascending=False).reset_index(
    drop=True
)[
    [
        "NAME",
        "error_rms",
    ]
]
df.iloc[0], df.iloc[-1]
[12]:
(NAME            Holmes
 error_rms    14.321592
 Name: 0, dtype: object,
 NAME         Pine_Island
 error_rms       3.798641
 Name: 49, dtype: object)
[29]:
# define region around antarctica with a buffer
reg = polar_utils.region_to_bounding_box(
    gpd.read_file(fetch.antarctic_boundaries(version="Coastline")).bounds.to_numpy()[0]
)
reg = vd.pad_region(reg, 50e3)

fig = maps.plot_grd(
    min_dist,
    region=reg,
    fig_height=12,
    frame=False,
    cmap="dense",
    cpt_lims=(
        0,
        polar_utils.get_min_max(
            min_dist,
            robust=True,
        )[1],
    ),
    hist=True,
    hist_bin_num=30,
    cbar_label="Distance to nearest bed measurement",
    cbar_font="18p,Helvetica",
    cbar_width_perc=0.3,
    cbar_height_perc=0.08,
    cbar_yoffset=-1.5,
    cbar_xoffset=-3.2,
    cbar_hist_height=1,
    cbar_unit="km",
)
fig.plot(
    ice_shelves,
    pen="0.3p,black",
)

# plot shelves with labels above
names = ["Totten", "Cook", "Ninnis", "Amery", "Vigrid", "Atka"]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="0c/.3c+v.2p",
    justify="BC",
)
names1 = [
    "Fimbul",
]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names1)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="0c/.6c+v.2p",
    justify="BC",
)

# plot shelves with labels above and to left
names2 = [
    "Brunt_Stancomb",
    "Ekstrom",
]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names2)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="-.3c/.3c+v.2p",
    justify="BR",
)

# plot shelves with labels below
names3 = [
    "Jelbart",
    "Nivl",
    "Shackleton",
]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names3)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="0c/-.3c+v.2p",
    justify="TC",
)

# plot remaining shelves with labels above and to right
df = ice_shelves[ice_shelves.NAME.isin(ice_shelf_stats.inverted_shelves)]
non_inverted_shelves = [
    "Ronne_Filchner",
    "West",
]
df = pd.concat(
    [
        df[~df.NAME.isin(names + names1 + names2 + names3)],
        ice_shelves[ice_shelves.NAME.isin(non_inverted_shelves)],
    ]
)
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    df,
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset=".3c/.2c+v.2p",
    justify="BL",
)

fig.text(  # type: ignore[attr-defined]
    justify="TL",
    position="TL",
    offset=".1c/-.1c",
    text="a)",  # type: ignore[index]
    font="18p,Helvetica,black",
    no_clip=True,
)

fig.show(dpi=500)
_images/antarctic_ice_shelf_analysis_14_0.png
[30]:
fig = maps.plot_grd(
    grav_grid.topo_free_disturbance,
    fig=fig,
    origin_shift="x",
    xshift_amount=0.9,
    region=reg,
    fig_height=12,
    frame=False,
    cmap="balance+h0",
    cpt_lims=polar_utils.get_min_max(
        grav_grid.topo_free_disturbance,
        absolute=True,
        robust=True,
    ),
    # robust=True,
    hist=True,
    hist_bin_num=30,
    cbar_label="Topo-corrected disturbance",
    cbar_font="18p,Helvetica",
    cbar_width_perc=0.3,
    cbar_height_perc=0.08,
    cbar_yoffset=-1.5,
    cbar_xoffset=-3.2,
    cbar_hist_height=1,
    cbar_unit="mGal",
)

fig.plot(
    ice_shelves,
    pen="0.3p,black",
)


# plot shelves with labels above
names = ["Totten", "Cook", "Ninnis", "Amery", "Vigrid", "Atka"]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="0c/.3c+v.2p",
    justify="BC",
)
names1 = [
    "Fimbul",
]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names1)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="0c/.6c+v.2p",
    justify="BC",
)

# plot shelves with labels above and to left
names2 = [
    "Brunt_Stancomb",
    "Ekstrom",
]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names2)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="-.3c/.3c+v.2p",
    justify="BR",
)

# plot shelves with labels below
names3 = [
    "Jelbart",
    "Nivl",
    "Shackleton",
]
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    ice_shelves[ice_shelves.NAME.isin(names3)],
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset="0c/-.3c+v.2p",
    justify="TC",
)

# plot remaining shelves with labels above and to right
df = ice_shelves[ice_shelves.NAME.isin(ice_shelf_stats.inverted_shelves)]
non_inverted_shelves = [
    "Ronne_Filchner",
    "West",
]
df = pd.concat(
    [
        df[~df.NAME.isin(names + names1 + names2 + names3)],
        ice_shelves[ice_shelves.NAME.isin(non_inverted_shelves)],
    ]
)
ice_shelf_stats.plot_ice_shelf_names(
    fig,
    df,
    font="8p,Helvetica",
    shadow_font="2p,white",
    offset=".3c/.2c+v.2p",
    justify="BL",
)

fig.text(  # type: ignore[attr-defined]
    justify="TL",
    position="TL",
    offset=".1c/-.1c",
    text="b)",  # type: ignore[index]
    font="18p,Helvetica,black",
    no_clip=True,
)

fig.savefig(
    "../paper/figures/Antarctic_grids.png",
    dpi=1000,
)

fig.show(dpi=500)
_images/antarctic_ice_shelf_analysis_15_0.png

Stats for largest ice shelves

[15]:
ice_shelf_stats_gdf[
    [
        "area_km",
        "mean_constraint_distance",
        "median_constraint_distance",
        "max_constraint_distance",
        "constraint_proximity_skewness",
        "topo_free_disturbance_stdev",
        "reg_stdev",
        "error_rms",
    ]
].describe()
[15]:
area_km mean_constraint_distance median_constraint_distance max_constraint_distance constraint_proximity_skewness topo_free_disturbance_stdev reg_stdev error_rms
count 50.000000 50.000000 50.000000 50.000000 50.000000 50.000000 50.000000 50.000000
mean 30128.755200 11.581651 10.344047 34.304192 0.669226 22.983007 20.322042 7.271860
std 88679.087868 6.732966 6.431627 17.775279 0.290886 13.553702 14.154541 2.320993
min 1167.290000 3.413805 2.514499 13.938510 0.007600 6.980136 4.318785 3.798641
25% 2739.907500 7.314719 6.114300 21.412542 0.509376 14.122654 10.509655 5.756010
50% 6034.930000 9.858544 8.273931 29.163148 0.693578 18.397941 16.512963 6.903740
75% 22378.922500 14.930102 13.485922 42.417144 0.803303 27.722374 24.928991 8.362451
max 480428.370000 32.413522 32.468017 84.476658 1.456174 66.265034 66.504162 14.321592
[16]:
ice_shelf_stats_gdf.median_constraint_distance.median()
[16]:
np.float64(8.273930533451015)
[17]:
ice_shelf_stats_gdf.topo_free_disturbance_stdev.median()
[17]:
np.float64(18.397940832078188)
[18]:
ice_shelf_stats_gdf[
    ice_shelf_stats_gdf.NAME.isin(ice_shelf_stats.inverted_shelves)
].sort_values("max_constraint_distance", ascending=False)[
    ["NAME", "max_constraint_distance"]
]
[18]:
NAME max_constraint_distance
2 Amery 74.852666
8 Baudouin 72.093600
6 Brunt_Stancomb 66.878832
0 Ross 62.339089
31 Cook 45.203958
13 Borchgrevink 43.083083
7 Getz 40.419329
3 LarsenC 36.855613
17 Jelbart 34.708913
9 Abbot 34.300815
42 Vigrid 32.221545
20 Nivl 30.335890
32 Crosson 29.537062
11 George_VI 28.809121
18 Lazarev 28.285719
45 Ninnis 26.433129
5 Fimbul 26.199066
23 Totten 24.156028
26 Dotson 21.949416
43 Atka 21.461812
34 Venable 20.881108
24 Pine_Island 16.703882
29 Thwaites 16.327860
21 Ekstrom 15.303827
[19]:
ice_shelf_stats_gdf.sort_values(
    "max_constraint_distance",
    ascending=False,
)[["NAME", "max_constraint_distance"]]
[19]:
NAME max_constraint_distance
10 Shackleton 84.476658
2 Amery 74.852666
8 Baudouin 72.093600
6 Brunt_Stancomb 66.878832
4 Riiser-Larsen 63.202992
0 Ross 62.339089
28 Prince_Harald 61.765863
15 Wilkins 57.283478
14 West 54.804727
46 Conger_Glenzer 49.768507
1 Ronne_Filchner 46.338298
31 Cook 45.203958
13 Borchgrevink 43.083083
7 Getz 40.419329
3 LarsenC 36.855613
36 Tracy_Tremenchus 36.087534
12 LarsenD 35.745032
17 Jelbart 34.708913
9 Abbot 34.300815
22 Nickerson 32.923505
42 Vigrid 32.221545
38 Holmes 31.935346
20 Nivl 30.335890
32 Crosson 29.537062
19 Stange 29.517175
11 George_VI 28.809121
37 Mariner 28.437255
18 Lazarev 28.285719
45 Ninnis 26.433129
5 Fimbul 26.199066
23 Totten 24.156028
35 Cosgrove 24.004050
27 Mertz 22.753403
47 Publications 22.507517
26 Dotson 21.949416
48 Dibble 21.853908
43 Atka 21.461812
30 Bach 21.396119
34 Venable 20.881108
33 Rennick 20.847725
25 Moscow_University 20.452319
16 Sulzberger 20.055580
40 LarsenB 18.929508
41 Quar 17.747388
24 Pine_Island 16.703882
29 Thwaites 16.327860
21 Ekstrom 15.303827
49 LarsenE 14.848904
44 Nansen 14.246912
39 Drygalski 13.938510
[20]:
ice_shelf_stats_gdf[
    ice_shelf_stats_gdf.NAME.isin(ice_shelf_stats.inverted_shelves)
].sort_values("median_constraint_distance", ascending=False)[
    ["NAME", "median_constraint_distance"]
]
[20]:
NAME median_constraint_distance
8 Baudouin 22.523870
0 Ross 17.282824
2 Amery 16.941666
31 Cook 16.061323
6 Brunt_Stancomb 14.462157
13 Borchgrevink 14.245119
17 Jelbart 11.208331
20 Nivl 10.667219
18 Lazarev 10.392029
7 Getz 10.337270
42 Vigrid 10.294453
9 Abbot 9.786923
3 LarsenC 9.067471
32 Crosson 8.020299
34 Venable 7.631753
45 Ninnis 7.151927
43 Atka 6.984946
11 George_VI 6.629541
23 Totten 6.274200
26 Dotson 6.061000
5 Fimbul 5.450097
24 Pine_Island 3.984452
21 Ekstrom 2.733504
29 Thwaites 2.514499
[21]:
ice_shelf_stats_gdf.sort_values(
    "median_constraint_distance",
    ascending=False,
)[["NAME", "median_constraint_distance"]]
[21]:
NAME median_constraint_distance
46 Conger_Glenzer 32.468017
10 Shackleton 26.857001
28 Prince_Harald 25.980222
8 Baudouin 22.523870
4 Riiser-Larsen 17.664812
15 Wilkins 17.496130
0 Ross 17.282824
2 Amery 16.941666
31 Cook 16.061323
36 Tracy_Tremenchus 15.576057
6 Brunt_Stancomb 14.462157
14 West 14.361596
13 Borchgrevink 14.245119
17 Jelbart 11.208331
20 Nivl 10.667219
18 Lazarev 10.392029
7 Getz 10.337270
42 Vigrid 10.294453
35 Cosgrove 9.790910
9 Abbot 9.786923
12 LarsenD 9.747474
37 Mariner 9.068760
3 LarsenC 9.067471
19 Stange 8.561534
33 Rennick 8.382017
22 Nickerson 8.165844
32 Crosson 8.020299
48 Dibble 7.950698
1 Ronne_Filchner 7.686515
34 Venable 7.631753
38 Holmes 7.517926
45 Ninnis 7.151927
43 Atka 6.984946
30 Bach 6.984483
25 Moscow_University 6.716427
11 George_VI 6.629541
23 Totten 6.274200
26 Dotson 6.061000
47 Publications 6.028745
49 LarsenE 5.602792
5 Fimbul 5.450097
40 LarsenB 5.418445
16 Sulzberger 5.291712
27 Mertz 4.848562
41 Quar 4.807345
24 Pine_Island 3.984452
39 Drygalski 3.963965
44 Nansen 3.557490
21 Ekstrom 2.733504
29 Thwaites 2.514499
[22]:
ice_shelf_stats_gdf[
    ice_shelf_stats_gdf.NAME.isin(ice_shelf_stats.inverted_shelves)
].sort_values("constraint_proximity_skewness", ascending=False)[
    ["NAME", "constraint_proximity_skewness"]
]
[22]:
NAME constraint_proximity_skewness
5 Fimbul 1.391103
21 Ekstrom 1.091623
29 Thwaites 0.921421
11 George_VI 0.916105
2 Amery 0.844014
26 Dotson 0.807072
7 Getz 0.774685
3 LarsenC 0.763313
32 Crosson 0.753281
45 Ninnis 0.744688
23 Totten 0.728359
6 Brunt_Stancomb 0.713434
9 Abbot 0.673908
42 Vigrid 0.652380
8 Baudouin 0.635214
24 Pine_Island 0.606235
17 Jelbart 0.538191
13 Borchgrevink 0.524661
43 Atka 0.508949
18 Lazarev 0.506552
0 Ross 0.431810
34 Venable 0.414615
20 Nivl 0.412275
31 Cook 0.408027
[23]:
ice_shelf_stats_gdf.sort_values(
    "constraint_proximity_skewness",
    ascending=False,
)[["NAME", "constraint_proximity_skewness"]]
[23]:
NAME constraint_proximity_skewness
1 Ronne_Filchner 1.456174
5 Fimbul 1.391103
38 Holmes 1.218393
21 Ekstrom 1.091623
22 Nickerson 1.023376
16 Sulzberger 0.974902
29 Thwaites 0.921421
11 George_VI 0.916105
27 Mertz 0.852462
47 Publications 0.850635
2 Amery 0.844014
41 Quar 0.828849
26 Dotson 0.807072
14 West 0.791998
7 Getz 0.774685
37 Mariner 0.768003
3 LarsenC 0.763313
32 Crosson 0.753281
45 Ninnis 0.744688
44 Nansen 0.741455
30 Bach 0.736829
12 LarsenD 0.729375
23 Totten 0.728359
6 Brunt_Stancomb 0.713434
4 Riiser-Larsen 0.713248
9 Abbot 0.673908
42 Vigrid 0.652380
19 Stange 0.642805
40 LarsenB 0.636706
8 Baudouin 0.635214
24 Pine_Island 0.606235
17 Jelbart 0.538191
25 Moscow_University 0.535940
10 Shackleton 0.528034
15 Wilkins 0.526020
13 Borchgrevink 0.524661
39 Drygalski 0.510656
43 Atka 0.508949
48 Dibble 0.508016
18 Lazarev 0.506552
0 Ross 0.431810
34 Venable 0.414615
20 Nivl 0.412275
31 Cook 0.408027
49 LarsenE 0.403158
35 Cosgrove 0.315979
36 Tracy_Tremenchus 0.179918
28 Prince_Harald 0.128630
33 Rennick 0.090211
46 Conger_Glenzer 0.007600
[24]:
ice_shelf_stats_gdf[
    ice_shelf_stats_gdf.NAME.isin(ice_shelf_stats.inverted_shelves)
].sort_values("topo_free_disturbance_stdev", ascending=False)[
    ["NAME", "topo_free_disturbance_stdev"]
]
[24]:
NAME topo_free_disturbance_stdev
21 Ekstrom 66.265034
17 Jelbart 60.337627
6 Brunt_Stancomb 41.405157
5 Fimbul 40.672422
20 Nivl 40.081430
8 Baudouin 36.306592
13 Borchgrevink 33.708347
2 Amery 28.288451
42 Vigrid 26.998457
23 Totten 25.712331
9 Abbot 20.099808
11 George_VI 18.554697
26 Dotson 18.241184
0 Ross 17.981856
45 Ninnis 16.497366
3 LarsenC 14.886413
18 Lazarev 14.264696
31 Cook 14.075307
7 Getz 13.642623
34 Venable 12.648398
24 Pine_Island 11.977974
29 Thwaites 11.536633
43 Atka 11.316067
32 Crosson 11.158160
[25]:
ice_shelf_stats_gdf.sort_values(
    "topo_free_disturbance_stdev",
    ascending=False,
)[["NAME", "topo_free_disturbance_stdev"]]
[25]:
NAME topo_free_disturbance_stdev
21 Ekstrom 66.265034
39 Drygalski 62.462354
17 Jelbart 60.337627
6 Brunt_Stancomb 41.405157
5 Fimbul 40.672422
4 Riiser-Larsen 40.164796
20 Nivl 40.081430
8 Baudouin 36.306592
13 Borchgrevink 33.708347
44 Nansen 32.681266
37 Mariner 29.164842
2 Amery 28.288451
33 Rennick 27.963679
42 Vigrid 26.998457
23 Totten 25.712331
10 Shackleton 25.104175
12 LarsenD 24.111215
28 Prince_Harald 22.924666
25 Moscow_University 21.620063
1 Ronne_Filchner 21.372407
46 Conger_Glenzer 20.804669
48 Dibble 20.788456
9 Abbot 20.099808
27 Mertz 19.632669
11 George_VI 18.554697
26 Dotson 18.241184
0 Ross 17.981856
49 LarsenE 16.611058
45 Ninnis 16.497366
14 West 16.422096
41 Quar 16.305250
22 Nickerson 16.024422
19 Stange 15.741630
15 Wilkins 15.668455
16 Sulzberger 15.408477
3 LarsenC 14.886413
18 Lazarev 14.264696
31 Cook 14.075307
7 Getz 13.642623
35 Cosgrove 13.131035
47 Publications 13.074221
34 Venable 12.648398
24 Pine_Island 11.977974
29 Thwaites 11.536633
43 Atka 11.316067
32 Crosson 11.158160
36 Tracy_Tremenchus 9.704702
30 Bach 9.436552
40 LarsenB 9.190028
38 Holmes 6.980136
[26]:
ice_shelf_stats_gdf[
    ice_shelf_stats_gdf.NAME.isin(ice_shelf_stats.inverted_shelves)
].sort_values("reg_stdev", ascending=False)[["NAME", "reg_stdev"]]
[26]:
NAME reg_stdev
21 Ekstrom 66.504162
17 Jelbart 55.393184
20 Nivl 41.485220
6 Brunt_Stancomb 37.897353
5 Fimbul 37.892171
8 Baudouin 37.573922
13 Borchgrevink 32.809827
2 Amery 25.626999
42 Vigrid 22.069168
23 Totten 18.733900
9 Abbot 18.295812
11 George_VI 17.180645
0 Ross 17.159272
3 LarsenC 14.498270
18 Lazarev 14.027711
26 Dotson 13.240744
29 Thwaites 11.749283
43 Atka 11.446779
34 Venable 10.732811
24 Pine_Island 10.323847
7 Getz 9.303628
32 Crosson 7.376695
45 Ninnis 7.284808
31 Cook 4.942182
[27]:
ice_shelf_stats_gdf[
    ice_shelf_stats_gdf.NAME.isin(ice_shelf_stats.inverted_shelves)
].sort_values("error_rms", ascending=False)[["NAME", "error_rms"]]
[27]:
NAME error_rms
0 Ross 12.748633
13 Borchgrevink 10.503035
45 Ninnis 8.703523
2 Amery 8.432001
18 Lazarev 8.388131
20 Nivl 7.358711
8 Baudouin 7.175396
31 Cook 7.097700
7 Getz 6.840661
9 Abbot 6.650965
42 Vigrid 6.410457
5 Fimbul 6.037483
6 Brunt_Stancomb 5.764394
34 Venable 5.753215
3 LarsenC 5.735885
43 Atka 5.466605
17 Jelbart 5.436008
11 George_VI 5.335354
26 Dotson 4.497715
23 Totten 4.226202
32 Crosson 3.997538
21 Ekstrom 3.945405
29 Thwaites 3.882824
24 Pine_Island 3.798641
[28]:
ice_shelf_stats_gdf.sort_values(
    "error_rms",
    ascending=False,
)[["NAME", "error_rms"]]
[28]:
NAME error_rms
38 Holmes 14.321592
48 Dibble 13.542626
0 Ross 12.748633
37 Mariner 10.569656
13 Borchgrevink 10.503035
33 Rennick 10.123007
27 Mertz 9.633673
36 Tracy_Tremenchus 9.219408
45 Ninnis 8.703523
2 Amery 8.432001
28 Prince_Harald 8.431992
47 Publications 8.404819
18 Lazarev 8.388131
4 Riiser-Larsen 8.285409
39 Drygalski 8.266895
10 Shackleton 8.183697
1 Ronne_Filchner 7.952294
46 Conger_Glenzer 7.846109
44 Nansen 7.442287
20 Nivl 7.358711
15 Wilkins 7.178177
8 Baudouin 7.175396
31 Cook 7.097700
14 West 7.049417
49 LarsenE 6.958159
40 LarsenB 6.849321
7 Getz 6.840661
30 Bach 6.824091
35 Cosgrove 6.666859
9 Abbot 6.650965
41 Quar 6.455409
42 Vigrid 6.410457
22 Nickerson 6.407424
12 LarsenD 6.049384
5 Fimbul 6.037483
19 Stange 5.945450
6 Brunt_Stancomb 5.764394
34 Venable 5.753215
3 LarsenC 5.735885
25 Moscow_University 5.624316
43 Atka 5.466605
17 Jelbart 5.436008
11 George_VI 5.335354
16 Sulzberger 5.175029
26 Dotson 4.497715
23 Totten 4.226202
32 Crosson 3.997538
21 Ekstrom 3.945405
29 Thwaites 3.882824
24 Pine_Island 3.798641

Constraint proximity skewness

[29]:
fig, ax = plt.subplots(figsize=(5, 3))

x = "constraint_proximity_skewness"
y = "max_constraint_distance"

df = ice_shelf_stats_gdf.sort_values("area_km", ascending=False)  # .iloc[2:]

texts_a, texts_b = [], []
for ind, (_i, row) in enumerate(df.iterrows()):
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}: {round(row[x], 1)}",
        )
        texts_a.append(
            ax.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}: {round(row[x], 1)}",
        )
        texts_b.append(
            ax.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax,
    expand=(1.2, 1.2),
)

ax.set_xlabel("Constraint proximtiy skewness")
ax.set_ylabel("Maximum constraint\nproximity (km)")

leg = ax.legend(
    title="Ice Shelves",
    title_fontproperties={"size": 12},
    loc="center left",
    bbox_to_anchor=(1, 0.5),
    handlelength=0,
    columnspacing=-0.5,
    markerscale=0,
    fontsize=8,
    ncol=3,
)
for handle, text in zip(leg.legend_handles, leg.get_texts(), strict=False):
    text.set_color(handle.get_facecolor()[0])
_images/antarctic_ice_shelf_analysis_32_0.png
[30]:
fig, ax = plt.subplots(figsize=(5, 3))

x = "constraint_proximity_skewness"
y = "median_constraint_distance"

df = ice_shelf_stats_gdf.sort_values("area_km", ascending=False)  # .iloc[2:]

texts_a, texts_b = [], []
for ind, (_i, row) in enumerate(df.iterrows()):
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}: {round(row[x], 1)}",
        )
        texts_a.append(
            ax.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}: {round(row[x], 1)}",
        )
        texts_b.append(
            ax.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax,
    expand=(1.2, 1.2),
)

ax.set_xlabel("Constraint proximtiy skewness")
ax.set_ylabel("Median constraint\nproximity (km)")

leg = ax.legend(
    title="Ice Shelves",
    title_fontproperties={"size": 12},
    loc="center left",
    bbox_to_anchor=(1, 0.5),
    handlelength=0,
    columnspacing=-0.5,
    markerscale=0,
    fontsize=8,
    ncol=3,
)
for handle, text in zip(leg.legend_handles, leg.get_texts(), strict=False):
    text.set_color(handle.get_facecolor()[0])
_images/antarctic_ice_shelf_analysis_33_0.png

For 2 parameters

[31]:
df = ice_shelf_stats_gdf


fig = plt.figure(
    figsize=(8, 6),
)

gs = GridSpec(
    2,
    2,
    figure=fig,
    height_ratios=[1, 1.5],
    hspace=0.35,
    wspace=0.2,
)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[0, 1])
ax3 = fig.add_subplot(gs[1, 0])
ax4 = fig.add_subplot(gs[1, 1])

###
###
# Histogram 1
###
###
ax1.annotate(
    "c)",
    (0.01, 0.86),
    xycoords="axes fraction",
    fontsize=14,
)
ax1.hist(
    df.median_constraint_distance,
    bins=20,
    alpha=0.8,
)
mean = round(df.median_constraint_distance.mean())
ax1.axvline(mean, color="r", linestyle="dashed", linewidth=2, label=f"mean: {mean} km")
median = round(df.median_constraint_distance.median())
ax1.axvline(
    median, color="g", linestyle="dashed", linewidth=2, label=f"median: {median} km"
)
ax1.legend(fontsize="x-small")

ax1.set_xlabel("Median constraint proximity (km)")
ax1.set_ylabel(None)

###
###
# Histogram 2
###
###
ax2.annotate(
    "d)",
    (0.01, 0.86),
    xycoords="axes fraction",
    fontsize=14,
)
ax2.hist(
    df.topo_free_disturbance_stdev,
    bins=20,
    alpha=0.8,
)
mean = round(df.topo_free_disturbance_stdev.mean())
ax2.axvline(
    mean, color="r", linestyle="dashed", linewidth=2, label=f"mean: {mean} mGal"
)
median = round(df.topo_free_disturbance_stdev.median())
ax2.axvline(
    median, color="g", linestyle="dashed", linewidth=2, label=f"median: {median} mGal"
)
ax2.legend(fontsize="x-small")


ax2.set_xlabel(r"$\delta g_{{TC}}$ stdev (mGal)")
ax2.set_ylabel(None)

###
###
# Scatterplot 1
###
###
ax3.annotate(
    "e)",
    (0.01, 0.86),
    xycoords="axes fraction",
    fontsize=14,
)
x = "median_constraint_distance"
y = "topo_free_disturbance_stdev"

# add boxes showing Ensemble extents
constraint_spacing_lims = (2.521, 17.741)
regional_stdev_lims = (4.091585, 40.915854)

rect = mpl.patches.Rectangle(
    (constraint_spacing_lims[0], regional_stdev_lims[0]),  # lower left
    constraint_spacing_lims[1] - constraint_spacing_lims[0],  # width
    regional_stdev_lims[1] - regional_stdev_lims[0],  # height
    linewidth=1,
    edgecolor="b",
    facecolor="none",
)
ax3.add_patch(rect)
ax3.scatter(
    x=8.557,  # median constraint proximity
    y=18.41093,  # regional stdev
    marker="^",
    color="b",
    linewidth=1,
    edgecolor="k",
)
ax3.scatter(
    x=8.557,  # median constraint proximity
    y=40.91585,  # regional stdev
    marker="^",
    color="r",
    linewidth=1,
    edgecolor="k",
)

ax3.scatter(
    [],
    [],
    color="r",
    marker="*",
    linewidths=0.5,
    s=11,
    label="previously inverted",
)
ax3.scatter(
    [],
    [],
    color="k",
    marker=".",
    s=7,
    linewidths=0.5,
    label="50 largest",
)
ax3.scatter(
    [],
    [],
    marker="^",
    color="r",
    linewidth=1,
    edgecolor="k",
    label="Ensemble 4",
)
ax3.scatter(
    [],
    [],
    marker="^",
    color="b",
    linewidth=1,
    edgecolor="k",
    label="Test 5/Ensemble 3",
)

# Get existing handles and labels.
handles, labels = ax3.get_legend_handles_labels()

handles.insert(2, rect)
labels.insert(2, "Ensemble 1")

ax3.legend(
    handles,
    labels,
    fontsize="x-small",
    labelspacing=0.2,
    handletextpad=0.2,
    borderpad=0.2,
    borderaxespad=0.1,
)

texts_a, texts_b = [], []
for ind, (_i, row) in enumerate(df.iterrows()):
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax3.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}: {round(row[x], 1)}",
        )
        texts_a.append(
            ax3.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax3.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}: {round(row[x], 1)}",
        )
        texts_b.append(
            ax3.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )

# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax3,
    expand=(1.2, 1.2),
)

ax3.set_xlabel("Median constraint proximity (km)")
ax3.set_ylabel(r"$\delta g_{{TC}}$ stdev (mGal)")


###
###
# Scatterplot 2
###
###
ax4.annotate(
    "f)",
    (0.01, 0.86),
    xycoords="axes fraction",
    fontsize=14,
)

x = "constraint_proximity_skewness"
y = "topo_free_disturbance_stdev"

texts_a, texts_b = [], []
for ind, (_i, row) in enumerate(df.iterrows()):
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax4.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}",  #: {round(row[x],1)}",
        )
        texts_a.append(
            ax4.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax4.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{ind + 1} {row.NAME.replace('_', ' ')}",  #: {round(row[x],1)}",
        )
        texts_b.append(
            ax4.text(
                row[x],
                row[y],
                f"{ind + 1}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )

# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax4,
    expand=(1.2, 1.2),
)

ax4.set_xlabel("Constraint proximity skewness")
ax4.set_ylabel(r"$\delta g_{{TC}}$ stdev (mGal)")
[31]:
Text(399.9318181818181, 0.5, '$\\delta g_{{TC}}$ stdev (mGal)')
_images/antarctic_ice_shelf_analysis_35_1.png
[32]:
leg = ax4.legend(
    title="Ice Shelves",
    title_fontproperties={"size": 14},
    loc="center left",
    bbox_to_anchor=(1, 0.9),
    handlelength=0,
    columnspacing=-0.5,
    markerscale=0,
    fontsize=10,
    ncol=3,
)
for handle, text in zip(leg.legend_handles, leg.get_texts(), strict=False):
    text.set_color(handle.get_facecolor()[0])

fig.savefig(
    "../paper/figures/Antarctic_correlations.png",
    bbox_inches="tight",
    dpi=400,
)

fig
[32]:
_images/antarctic_ice_shelf_analysis_36_0.png
[32]:
ice_shelf_added_constraints = pd.read_csv(
    "../results/ice_shelves/ice_shelf_gravity_stats_added_constraint.csv",
    index_col=None,
)

# turn back into geodataframe
ice_shelf_added_constraints = gpd.GeoDataFrame(
    ice_shelf_added_constraints,
    geometry=gpd.GeoSeries.from_wkt(
        ice_shelf_added_constraints["geometry"], crs="EPSG:3031"
    ),
    crs="EPSG:3031",
)

ice_shelf_added_constraints
[32]:
NAME Regions TYPE geometry area_km median_constraint_distance mean_constraint_distance max_constraint_distance constraint_proximity_skewness gravity_disturbance_rms ... res_stdev error_rms error_stdev residual_constraint_proximity_ratio_rms residual_constraint_proximity_ratio_stdev regional_constraint_proximity_ratio_rms regional_constraint_proximity_ratio_stdev updated_median_constraint_distance median_proximity_change percent_median_proximity_change
0 Ross West FL POLYGON ((-240677.184 -678259.006, -240038.274... 480428.37 17.282824 17.636882 62.339089 0.431810 44.934094 ... 6.397548 12.748633 3.154937 132.093296 132.083718 306.642616 292.262320 17.232338 0.050486 0.292117
1 Ronne_Filchner West FL POLYGON ((-1006734.891 880592.98, -1006335.923... 427041.70 7.686515 8.739788 46.338298 1.456174 41.514238 ... 4.084574 7.952294 1.760702 60.063692 60.065236 350.615365 251.773078 7.680386 0.006128 0.079730
2 Amery East FL POLYGON ((2134701.422 618463.117, 2131452.011 ... 60797.28 16.941666 21.373582 74.852666 0.844014 54.656450 ... 12.651456 8.432001 0.497149 516.984001 453.747317 1173.773769 858.199460 16.374142 0.567524 3.349870
3 LarsenC Peninsula FL POLYGON ((-2235724.269 1271352.188, -2235828.5... 47443.51 9.067471 10.260593 36.855613 0.763313 14.824574 ... 5.647546 5.735885 1.390208 69.319708 69.157083 508.573512 329.301767 8.970575 0.096897 1.068617
4 Riiser-Larsen East FL POLYGON ((-592166.317 1592824.258, -593783.16 ... 42913.14 17.664812 20.596557 63.202992 0.713248 53.556828 ... 11.313144 8.285409 0.728764 400.456039 396.959121 1942.610309 1289.222243 16.920875 0.743937 4.211407
5 Fimbul East FL POLYGON ((145423.961 2176737.792, 145088.314 2... 40947.75 5.450097 6.460643 26.199066 1.391103 55.666475 ... 7.978892 6.037483 1.283386 104.190480 100.468045 651.273997 428.275246 5.432545 0.017552 0.322051
6 Brunt_Stancomb East FL POLYGON ((-648673.952 1612385.898, -648144.2 1... 36137.10 14.462157 18.965093 66.878832 0.713434 31.663309 ... 14.232125 5.764394 2.020729 464.852285 411.069585 1195.526791 842.794187 13.506528 0.955630 6.607795
7 Getz West FL MULTIPOLYGON (((-1464395.442 -1011065.611, -14... 33389.04 10.337270 11.505782 40.419329 0.774685 45.815742 ... 11.747717 6.840661 2.799637 290.474365 226.021130 142.812858 112.543489 10.146531 0.190739 1.845161
8 Baudouin East FL POLYGON ((894980.201 1963931.58, 894465.744 19... 33129.24 22.523870 24.018180 72.093600 0.635214 37.878304 ... 8.132793 7.175396 1.815555 370.587351 313.933210 1189.930499 915.632328 20.907322 1.616548 7.177044
9 Abbot West FL MULTIPOLYGON (((-1946681.999 -330470.661, -194... 31389.73 9.786923 10.943510 34.300815 0.673908 28.653549 ... 17.545262 6.650965 1.750310 362.377493 286.900839 341.590904 239.269065 9.617116 0.169807 1.735043
10 Shackleton East FL POLYGON ((2633675.06 -479241.005, 2632371.431 ... 26927.90 26.857001 30.320176 84.476658 0.528034 34.623367 ... 22.316325 8.183697 1.713532 878.761872 796.097579 708.223791 526.485359 25.767472 1.089529 4.056778
11 George_VI Peninsula FL POLYGON ((-1774674.35 512798.517, -1773489.407... 23259.86 6.629541 7.765265 28.809121 0.916105 37.630662 ... 9.549641 5.335354 1.284207 106.139745 104.798720 183.519858 150.927667 6.551480 0.078061 1.177472
12 LarsenD Peninsula FL MULTIPOLYGON (((-2046617.921 1133347.186, -204... 22633.36 9.747474 11.223082 35.745032 0.729375 26.100451 ... 17.231720 6.049384 1.446036 252.179193 238.484520 299.503837 232.906140 9.631332 0.116142 1.191511
13 Borchgrevink East FL POLYGON ((673415.109 2122771.487, 672998.689 2... 21615.61 14.245119 15.609578 43.083083 0.524661 47.743811 ... 6.730842 10.503035 2.459579 161.875877 161.582709 1268.940192 765.712781 13.512260 0.732859 5.144630
14 West East FL POLYGON ((2563983.553 220837.286, 2563003.768 ... 16082.67 14.361596 16.644050 54.804727 0.791998 22.957914 ... 11.951100 7.049417 1.611335 251.086094 238.214179 858.633036 499.671858 14.145295 0.216301 1.506107
15 Wilkins Peninsula FL POLYGON ((-2099746.399 584996.044, -2100523.90... 12906.75 17.496130 19.212720 57.283478 0.526020 17.100584 ... 12.296971 7.178177 1.613022 366.603800 332.444698 481.128657 314.451081 16.035185 1.460944 8.350098
16 Sulzberger West FL POLYGON ((-661704.253 -1219812.221, -661564.09... 11969.52 5.291712 5.976404 20.055580 0.974902 83.919330 ... 11.968309 5.175029 0.614085 135.447072 116.815678 134.781946 102.028194 5.261927 0.029785 0.562860
17 Jelbart East FL POLYGON ((-218574.64 2131324.79, -217808.505 2... 10845.49 11.208331 12.891675 34.708913 0.538191 65.086870 ... 14.140983 5.436008 0.819316 212.094210 206.407071 1066.271632 875.389617 10.402378 0.805952 7.190653
18 Lazarev East FL POLYGON ((607354.123 2097919.164, 607390.414 2... 8571.63 10.392029 11.124736 28.285719 0.506552 41.231610 ... 3.878213 8.388131 0.359499 56.805559 54.896712 735.361815 372.759155 9.839077 0.552953 5.320932
19 Stange Peninsula FL POLYGON ((-1727712.171 477501.975, -1724636.95... 7930.02 8.561534 9.740539 29.517175 0.642805 18.889995 ... 14.722837 5.945450 1.670934 381.616246 311.830174 323.672161 192.960859 8.107517 0.454018 5.302997
20 Nivl East FL POLYGON ((464341.95 2137439.241, 464211.633 21... 7321.50 10.667219 11.455388 30.335890 0.412275 46.668969 ... 8.020072 7.358711 1.332392 136.218616 131.186252 632.362749 525.341247 9.875905 0.791314 7.418184
21 Ekstrom East FL POLYGON ((-321325.354 2109824.907, -322025.425... 6870.83 2.733504 3.413805 15.303827 1.091623 88.423961 ... 4.849027 3.945405 1.349207 36.847508 35.538492 391.933600 322.561833 2.711619 0.021885 0.800631
22 Nickerson West FL POLYGON ((-956577.608 -1277290.219, -955837.27... 6335.28 8.165844 10.227400 32.923505 1.023376 78.748823 ... 12.231593 6.407424 2.195490 258.817500 235.428918 362.045683 212.752074 7.717575 0.448269 5.489563
23 Totten East FL POLYGON ((2246041.394 -1157675.447, 2239414.25... 6187.04 6.274200 7.373829 24.156028 0.728359 73.993164 ... 18.803521 4.226202 0.851438 326.562293 279.713187 193.678285 190.061220 6.023895 0.250305 3.989433
24 Pine_Island West FL POLYGON ((-1684242.607 -341481.119, -1685079.5... 6120.28 3.984452 4.598587 16.703882 0.606235 37.497041 ... 4.793041 3.798641 1.001197 36.874955 36.582037 47.184627 45.960112 3.915623 0.068830 1.727453
25 Moscow_University East FL MULTIPOLYGON (((2192162.937 -1342195.65, 21909... 5949.58 6.716427 7.295015 20.452319 0.535940 82.060155 ... 15.920992 5.624316 1.961263 268.409093 205.406955 132.513942 129.689061 6.586690 0.129738 1.931649
26 Dotson West FL POLYGON ((-1535033.641 -603663.519, -1523891.9... 5677.28 6.061000 6.965584 21.949416 0.807072 43.949766 ... 10.598480 4.497715 1.108233 156.322935 127.326626 91.026939 88.943243 5.837889 0.223112 3.681107
27 Mertz East FL POLYGON ((1409174.577 -2033174.141, 1409425.16... 5652.20 4.848562 6.125292 22.753403 0.852462 73.477617 ... 8.454509 9.633673 4.057948 103.082464 103.186752 400.249587 312.792178 4.670285 0.178277 3.676898
28 Prince_Harald East FL MULTIPOLYGON (((1367928.932 1754234.348, 13668... 5455.02 25.980222 25.862225 61.765863 0.128630 33.425492 ... 11.327516 8.431992 0.050487 370.103227 368.129513 689.269643 690.068501 20.989286 4.990936 19.210519
29 Thwaites West FL POLYGON ((-1600077.739 -445017.92, -1599824.40... 5377.37 2.514499 3.863388 16.327860 0.921421 27.918822 ... 3.773032 3.882824 0.849178 34.082356 34.142123 94.016739 67.733592 2.462868 0.051631 2.053345
30 Bach Peninsula FL POLYGON ((-1852808.829 579336.22, -1853187.96 ... 4547.92 6.984483 7.902379 21.396119 0.736829 9.435792 ... 6.068227 6.824091 1.558595 103.680658 74.729847 238.272021 124.704572 6.656592 0.327891 4.694567
31 Cook East FL POLYGON ((1053300.202 -2130175.163, 1052767.82... 3531.84 16.061323 17.647837 45.203958 0.408027 90.606794 ... 12.127439 7.097700 2.003441 605.708859 394.786594 657.430707 340.964127 13.251580 2.809743 17.493847
32 Crosson West FL POLYGON ((-1485656.428 -625686.627, -1491316.3... 3331.23 8.020299 9.976549 29.537062 0.753281 30.039716 ... 9.237666 3.997538 0.851595 143.263725 103.275024 214.413749 144.654041 7.472525 0.547773 6.829836
33 Rennick East FL POLYGON ((668275.342 -2045686.903, 667858.789 ... 3276.48 8.382017 8.420208 20.847725 0.090211 201.018641 ... 11.648852 10.123007 3.215634 182.180075 127.868301 1439.231760 657.889292 7.956525 0.425492 5.076251
34 Venable West FL POLYGON ((-1836561.107 134217.571, -1836278.22... 3155.04 7.631753 8.039256 20.881108 0.414615 26.649466 ... 13.069439 5.753215 1.619751 219.537608 172.635264 194.715030 136.130371 7.043906 0.587847 7.702651
35 Cosgrove West FL POLYGON ((-1756239.555 -353406.569, -1756380.9... 2989.54 9.790910 10.319020 24.004050 0.315979 35.807715 ... 8.782699 6.666859 1.636633 208.993616 149.121747 103.071941 95.214253 8.804826 0.986084 10.071424
36 Tracy_Tremenchus East FL POLYGON ((2586375.936 -480787.476, 2586938.359... 2941.02 15.576057 16.242676 36.087534 0.179918 30.139494 ... 9.436255 9.219408 2.451026 230.934030 231.729783 648.703199 324.507220 13.077479 2.498577 16.041143
37 Mariner East FL POLYGON ((393072.24 -1759690.414, 392784.207 -... 2672.87 9.068760 10.559233 28.437255 0.768003 75.259329 ... 11.262662 10.569656 2.278087 143.275583 99.674651 413.875415 234.125379 8.493081 0.575679 6.347936
38 Holmes East FL MULTIPOLYGON (((1997471.65 -1552909.64, 199768... 2366.35 7.517926 9.195149 31.935346 1.218393 56.328624 ... 1.934667 14.321592 1.387805 25.338756 25.451705 264.037032 161.580466 7.219777 0.298149 3.965838
39 Drygalski East FL POLYGON ((471675.11 -1519675.151, 471799.885 -... 2280.86 3.963965 4.265640 13.938510 0.510656 107.719772 ... 8.191274 8.266895 2.886299 42.776449 42.409462 350.701530 303.318939 3.794103 0.169862 4.285154
40 LarsenB Peninsula FL POLYGON ((-2322226.017 1287020.491, -2322192.0... 2151.14 5.418445 6.351085 18.929508 0.636706 14.050233 ... 4.668150 6.849321 1.339996 40.920191 41.027909 194.598915 105.669533 5.001574 0.416872 7.693567
41 Quar East FL POLYGON ((-378324.562 2048575.36, -378164.216 ... 2131.89 4.807345 5.785503 17.747388 0.828849 104.526989 ... 5.866438 6.455409 0.439714 52.329162 43.957190 882.854340 503.968053 4.524377 0.282969 5.886172
42 Vigrid East FL POLYGON ((344318.997 2156889.869, 342203.503 2... 2096.02 10.294453 11.474471 32.221545 0.652380 48.087287 ... 11.175258 6.410457 1.816587 221.964183 219.761627 1094.118764 714.306009 9.007173 1.287280 12.504596
43 Atka East FL POLYGON ((-277564.446 2105750.401, -277546.543... 1993.74 6.984946 7.798236 21.461812 0.508949 98.527113 ... 5.727348 5.466605 1.609184 57.972645 52.259648 1086.234822 581.142071 6.172211 0.812735 11.635526
44 Nansen East FL POLYGON ((483245.044 -1547614.188, 483709.392 ... 1942.07 3.557490 4.216609 14.246912 0.741455 109.400166 ... 7.921007 7.442287 1.891788 60.934852 50.775213 507.066701 356.013489 3.383867 0.173623 4.880495
45 Ninnis East FL MULTIPOLYGON (((1312866.432 -2026243.651, 1314... 1929.03 7.151927 8.566233 26.433129 0.744688 79.307785 ... 14.883603 8.703523 2.666469 364.409916 308.220622 211.724953 131.883965 6.625798 0.526129 7.356463
46 Conger_Glenzer East FL POLYGON ((2569966.039 -636188.979, 2570323.627... 1600.94 32.468017 32.413522 49.768507 0.007600 20.600937 ... 17.195246 7.846109 2.314243 567.785134 572.027791 413.540516 138.254030 21.211645 11.256371 34.669106
47 Publications East FL POLYGON ((2140550.303 599450.133, 2139844.108 ... 1563.27 6.028745 7.656435 22.507517 0.850635 34.278739 ... 2.654676 8.404819 0.066097 27.292913 27.074809 126.650106 91.622756 5.317916 0.710828 11.790651
48 Dibble East FL POLYGON ((1878424.501 -1827174.544, 1879031.46... 1463.17 7.950698 8.209674 21.853908 0.508016 94.450669 ... 5.424791 13.542626 2.560673 45.589709 43.879894 437.934974 192.691040 7.430268 0.520430 6.545715
49 LarsenE Peninsula FL MULTIPOLYGON (((-1556766.778 871991.554, -1557... 1167.29 5.602792 5.853480 14.848904 0.403158 35.285661 ... 14.908023 6.958159 1.643375 160.204052 126.640887 148.146399 125.566951 5.291861 0.310930 5.549563

50 rows × 30 columns

[33]:
ice_shelf_added_constraints.sort_values("median_proximity_change")[
    [
        "NAME",
        "constraint_proximity_skewness",
        "percent_median_proximity_change",
        "median_proximity_change",
        "median_constraint_distance",
        "updated_median_constraint_distance",
    ]
]
[33]:
NAME constraint_proximity_skewness percent_median_proximity_change median_proximity_change median_constraint_distance updated_median_constraint_distance
1 Ronne_Filchner 1.456174 0.079730 0.006128 7.686515 7.680386
5 Fimbul 1.391103 0.322051 0.017552 5.450097 5.432545
21 Ekstrom 1.091623 0.800631 0.021885 2.733504 2.711619
16 Sulzberger 0.974902 0.562860 0.029785 5.291712 5.261927
0 Ross 0.431810 0.292117 0.050486 17.282824 17.232338
29 Thwaites 0.921421 2.053345 0.051631 2.514499 2.462868
24 Pine_Island 0.606235 1.727453 0.068830 3.984452 3.915623
11 George_VI 0.916105 1.177472 0.078061 6.629541 6.551480
3 LarsenC 0.763313 1.068617 0.096897 9.067471 8.970575
12 LarsenD 0.729375 1.191511 0.116142 9.747474 9.631332
25 Moscow_University 0.535940 1.931649 0.129738 6.716427 6.586690
9 Abbot 0.673908 1.735043 0.169807 9.786923 9.617116
39 Drygalski 0.510656 4.285154 0.169862 3.963965 3.794103
44 Nansen 0.741455 4.880495 0.173623 3.557490 3.383867
27 Mertz 0.852462 3.676898 0.178277 4.848562 4.670285
7 Getz 0.774685 1.845161 0.190739 10.337270 10.146531
14 West 0.791998 1.506107 0.216301 14.361596 14.145295
26 Dotson 0.807072 3.681107 0.223112 6.061000 5.837889
23 Totten 0.728359 3.989433 0.250305 6.274200 6.023895
41 Quar 0.828849 5.886172 0.282969 4.807345 4.524377
38 Holmes 1.218393 3.965838 0.298149 7.517926 7.219777
49 LarsenE 0.403158 5.549563 0.310930 5.602792 5.291861
30 Bach 0.736829 4.694567 0.327891 6.984483 6.656592
40 LarsenB 0.636706 7.693567 0.416872 5.418445 5.001574
33 Rennick 0.090211 5.076251 0.425492 8.382017 7.956525
22 Nickerson 1.023376 5.489563 0.448269 8.165844 7.717575
19 Stange 0.642805 5.302997 0.454018 8.561534 8.107517
48 Dibble 0.508016 6.545715 0.520430 7.950698 7.430268
45 Ninnis 0.744688 7.356463 0.526129 7.151927 6.625798
32 Crosson 0.753281 6.829836 0.547773 8.020299 7.472525
18 Lazarev 0.506552 5.320932 0.552953 10.392029 9.839077
2 Amery 0.844014 3.349870 0.567524 16.941666 16.374142
37 Mariner 0.768003 6.347936 0.575679 9.068760 8.493081
34 Venable 0.414615 7.702651 0.587847 7.631753 7.043906
47 Publications 0.850635 11.790651 0.710828 6.028745 5.317916
13 Borchgrevink 0.524661 5.144630 0.732859 14.245119 13.512260
4 Riiser-Larsen 0.713248 4.211407 0.743937 17.664812 16.920875
20 Nivl 0.412275 7.418184 0.791314 10.667219 9.875905
17 Jelbart 0.538191 7.190653 0.805952 11.208331 10.402378
43 Atka 0.508949 11.635526 0.812735 6.984946 6.172211
6 Brunt_Stancomb 0.713434 6.607795 0.955630 14.462157 13.506528
35 Cosgrove 0.315979 10.071424 0.986084 9.790910 8.804826
10 Shackleton 0.528034 4.056778 1.089529 26.857001 25.767472
42 Vigrid 0.652380 12.504596 1.287280 10.294453 9.007173
15 Wilkins 0.526020 8.350098 1.460944 17.496130 16.035185
8 Baudouin 0.635214 7.177044 1.616548 22.523870 20.907322
36 Tracy_Tremenchus 0.179918 16.041143 2.498577 15.576057 13.077479
31 Cook 0.408027 17.493847 2.809743 16.061323 13.251580
28 Prince_Harald 0.128630 19.210519 4.990936 25.980222 20.989286
46 Conger_Glenzer 0.007600 34.669106 11.256371 32.468017 21.211645
[34]:
fig, ax = plt.subplots(figsize=(5, 3))

x = "median_proximity_change"
y = "median_constraint_distance"

df = ice_shelf_added_constraints

df = df[df[x] < 2]

texts_a, texts_b = [], []
for _i, row in df.iterrows():
    row_index = row.name + 1
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{row_index} {row.NAME.replace('_', ' ')}",
        )
        texts_a.append(
            ax.text(
                row[x],
                row[y],
                f"{row_index}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{row_index} {row.NAME.replace('_', ' ')}",
        )
        texts_b.append(
            ax.text(
                row[x],
                row[y],
                f"{row_index}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax,
    expand=(1.2, 1.2),
)

ax.set_xlabel(x)
ax.set_ylabel(y)

leg = ax.legend(
    title="Ice Shelves",
    title_fontproperties={"size": 12},
    loc="center left",
    bbox_to_anchor=(1, 0.5),
    handlelength=0,
    columnspacing=-0.5,
    markerscale=0,
    fontsize=8,
    ncol=3,
)
for handle, text in zip(leg.legend_handles, leg.get_texts(), strict=False):
    text.set_color(handle.get_facecolor()[0])
_images/antarctic_ice_shelf_analysis_39_0.png
[35]:
fig, ax = plt.subplots(figsize=(5, 3))

x = "median_proximity_change"
y = "constraint_proximity_skewness"

df = ice_shelf_added_constraints

df = df[df[x] < 3]

texts_a, texts_b = [], []
for _i, row in df.iterrows():
    row_index = row.name + 1
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{row_index} {row.NAME.replace('_', ' ')}",
        )
        texts_a.append(
            ax.text(
                row[x],
                row[y],
                f"{row_index}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{row_index} {row.NAME.replace('_', ' ')}",
        )
        texts_b.append(
            ax.text(
                row[x],
                row[y],
                f"{row_index}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax,
    expand=(1.2, 1.2),
)

ax.set_xlabel(x)
ax.set_ylabel(y)

leg = ax.legend(
    title="Ice Shelves",
    title_fontproperties={"size": 12},
    loc="center left",
    bbox_to_anchor=(1, 0.5),
    handlelength=0,
    columnspacing=-0.5,
    markerscale=0,
    fontsize=8,
    ncol=3,
)
for handle, text in zip(leg.legend_handles, leg.get_texts(), strict=False):
    text.set_color(handle.get_facecolor()[0])
_images/antarctic_ice_shelf_analysis_40_0.png
[36]:
fig, ax = plt.subplots(figsize=(5, 3))

y = "median_constraint_distance"
x = "constraint_proximity_skewness"

df = ice_shelf_added_constraints

texts_a, texts_b = [], []
for _i, row in df.iterrows():
    row_index = row.name + 1
    # plot inverted shelves as red stars and red labels
    if row.NAME in ice_shelf_stats.inverted_shelves:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="r",
            marker="*",
            linewidths=0.5,
            s=9,
            label=f"{row_index} {row.NAME.replace('_', ' ')}",
        )
        texts_a.append(
            ax.text(
                row[x],
                row[y],
                f"{row_index}",
                fontsize=9,
                color="r",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
    else:
        ax.scatter(
            x=row[x],
            y=row[y],
            color="k",
            marker=".",
            s=5,
            linewidths=0.5,
            label=f"{row_index} {row.NAME.replace('_', ' ')}",
        )
        texts_b.append(
            ax.text(
                row[x],
                row[y],
                f"{row_index}",
                fontsize=8,
                color="k",
                fontweight="normal",
                path_effects=[
                    patheffects.withStroke(linewidth=0.5, foreground="white")
                ],
            )
        )
# auto adjust labels so they dont overlap
adjust_text(
    texts_a + texts_b,
    arrowprops=dict(arrowstyle="-", color="k", lw=0.4),
    ax=ax,
    expand=(1.2, 1.2),
)

ax.set_xlabel(x)
ax.set_ylabel(y)

leg = ax.legend(
    title="Ice Shelves",
    title_fontproperties={"size": 12},
    loc="center left",
    bbox_to_anchor=(1, 0.5),
    handlelength=0,
    columnspacing=-0.5,
    markerscale=0,
    fontsize=8,
    ncol=3,
)
for handle, text in zip(leg.legend_handles, leg.get_texts(), strict=False):
    text.set_color(handle.get_facecolor()[0])
_images/antarctic_ice_shelf_analysis_41_0.png

Adding a constraint

[37]:
ice_shelf_added_constraints[ice_shelf_added_constraints.NAME == "Cosgrove"]
[37]:
NAME Regions TYPE geometry area_km median_constraint_distance mean_constraint_distance max_constraint_distance constraint_proximity_skewness gravity_disturbance_rms ... res_stdev error_rms error_stdev residual_constraint_proximity_ratio_rms residual_constraint_proximity_ratio_stdev regional_constraint_proximity_ratio_rms regional_constraint_proximity_ratio_stdev updated_median_constraint_distance median_proximity_change percent_median_proximity_change
35 Cosgrove West FL POLYGON ((-1756239.555 -353406.569, -1756380.9... 2989.54 9.79091 10.31902 24.00405 0.315979 35.807715 ... 8.782699 6.666859 1.636633 208.993616 149.121747 103.071941 95.214253 8.804826 0.986084 10.071424

1 rows × 30 columns

[38]:
ice_shelf_added_constraints[ice_shelf_added_constraints.NAME == "Ronne_Filchner"]
[38]:
NAME Regions TYPE geometry area_km median_constraint_distance mean_constraint_distance max_constraint_distance constraint_proximity_skewness gravity_disturbance_rms ... res_stdev error_rms error_stdev residual_constraint_proximity_ratio_rms residual_constraint_proximity_ratio_stdev regional_constraint_proximity_ratio_rms regional_constraint_proximity_ratio_stdev updated_median_constraint_distance median_proximity_change percent_median_proximity_change
1 Ronne_Filchner West FL POLYGON ((-1006734.891 880592.98, -1006335.923... 427041.7 7.686515 8.739788 46.338298 1.456174 41.514238 ... 4.084574 7.952294 1.760702 60.063692 60.065236 350.615365 251.773078 7.680386 0.006128 0.07973

1 rows × 30 columns

[39]:
file_path = "../results/ice_shelves/"

min_dists = []
min_dist_updates = []
constraints_dfs = []
min_dist_coords = []
shelfs = []
shelf_regions = []
names = [
    "Cosgrove",
    "Ronne_Filchner",
]

for name in names:
    constraints_df = pd.read_csv(f"{file_path}{name}_constraints.csv.gz")

    shelf = ice_shelf_added_constraints[name == ice_shelf_added_constraints.NAME].iloc[
        0
    ]
    # define region around each ice shelf with 10km buffer
    reg = polar_utils.region_to_bounding_box(shelf.geometry.bounds)
    reg = vd.pad_region(reg, 20e3)

    coords = vd.grid_coordinates(
        region=reg,
        spacing=100,
    )
    grid = vd.make_xarray_grid(coords, np.ones_like(coords[0]), data_names="z").z

    # calculate minimum distance between each grid cell and the nearest point
    min_dist = (
        utils.normalized_mindist(
            constraints_df,
            grid=grid,
        )
        / 1e3
    )
    # mask to the ice shelf outline
    min_dist = polar_utils.mask_from_shp(
        shapefile=shelf,
        grid=min_dist,
        invert=False,
        masked=True,
    )

    df = vd.grid_to_table(min_dist)
    min_dist_coord = df.iloc[df.min_dist.argmax()]

    min_dist_coord = pd.DataFrame(
        [{"easting": min_dist_coord.easting, "northing": min_dist_coord.northing}]
    )

    # add 1 constraint at point of max proximity
    constraints_df_update = pd.concat(
        [constraints_df, min_dist_coord],
        ignore_index=True,
    )

    # calculate minimum distance between each grid cell and the nearest point
    min_dist_update = (
        utils.normalized_mindist(
            constraints_df_update,
            grid=grid,
        )
        / 1e3
    )

    # mask to the ice shelf outline
    min_dist_update = polar_utils.mask_from_shp(
        shapefile=shelf,
        grid=min_dist_update,
        invert=False,
        masked=True,
    )

    median_before = np.nanmedian(min_dist)
    median_after = np.nanmedian(min_dist_update)
    change = median_after - median_before

    print(
        f"{name.replace('_', ' ')} Ice Shelf",
    )
    print(f"Median before; {round(median_before, 3)} km")
    print(f"Median after; {round(median_after, 3)} km")
    print(f"change; {round(change, 3)} km")

    constraints_dfs.append(constraints_df)
    shelfs.append(shelf)
    shelf_regions.append(reg)
    min_dists.append(min_dist)
    min_dist_updates.append(min_dist_update)
    min_dist_coords.append(min_dist_coord)
Cosgrove Ice Shelf
Median before; 9.791 km
Median after; 8.805 km
change; -0.986 km
Ronne Filchner Ice Shelf
Median before; 7.687 km
Median after; 7.68 km
change; -0.006 km
[43]:
min_dist = min_dists[0]
min_dist_update = min_dist_updates[0]
constraints_df = constraints_dfs[0]
shelf = shelfs[0]
name = names[0]
min_dist_coord = min_dist_coords[0]
reg = shelf_regions[0]
cpt_lims = (
    0,
    polar_utils.get_combined_min_max([min_dist, min_dist_update], robust=False)[1],
)

fig = maps.plot_grd(
    min_dist,
    region=reg,
    cmap="dense",
    cpt_lims=cpt_lims,
    scalebar=True,
    scalebar_box="+gwhite@30+p0.5p,gray30,solid+r3p",
    modis_basemap=True,
    modis_version="125m",
    modis_transparency=60,
    hist=True,
    points=constraints_df,
    points_style="p2p",
    points_fill="black",
    cbar_label="Distance to nearest constraint (km)",
    cbar_font="20p,Helvetica",
)
fig.text(
    position="TC",
    justify="BC",
    text=f"Median; {round(np.nanmedian(min_dist), 2)} km",
    offset="0c/.3c",
    font="20p,Helvetica",
    no_clip=True,
)
# plot constraints
fig.plot(
    constraints_df[["easting", "northing"]].iloc[0],
    style="p2p",
    fill="black",
)
# plot outline of ice shelf
fig.plot(
    gpd.GeoDataFrame(geometry=[shelf.geometry]),
    pen="1.5p,salmon",
)

fig.text(
    position="TL",
    text="a",
    fill="white",
    pen=True,
    font="22p,Helvetica,black",
    offset="j.2/.2",
    clearance="+tO",
    no_clip=True,
)
fig.text(
    position="TR",
    justify="BC",
    text=f"{name.replace('_', ' ')} Ice Shelf",
    offset="0c/1c",
    font="26p,Helvetica",
    no_clip=True,
)


fig = maps.plot_grd(
    min_dist_update,
    fig=fig,
    origin_shift="x",
    region=reg,
    cmap="dense",
    cpt_lims=cpt_lims,
    inset=True,
    inset_width=0.3,
    inset_position="jTL+jTC+o-0.5/-1",
    modis_basemap=True,
    modis_version="125m",
    modis_transparency=60,
    hist=True,
    points=constraints_df,
    points_style="p1.5p",
    points_fill="black",
    cbar_label="Distance to nearest constraint (km)",
    cbar_font="20p,Helvetica",
)
fig.text(
    position="TC",
    justify="BC",
    text=f"Median; {round(np.nanmedian(min_dist_update), 2)} km",
    offset="0c/.3c",
    font="20p,Helvetica",
    no_clip=True,
)
# plot constraints
fig.plot(
    constraints_df[["easting", "northing"]].iloc[0],
    style="p1.5p",
    fill="black",
    label="existing constraints",
)
# plot outline of ice shelf
fig.plot(
    gpd.GeoDataFrame(geometry=[shelf.geometry]),
    pen="1.5p,salmon",
    label="ice shelf boundary",
)

# plot additional point
# fake plot for legend
fig.plot(
    min_dist_coord,
    style="t0.3c",
    fill="green",
    pen="1.5p,black",
    label="added constraint",
)
fig.plot(
    min_dist_coord,
    style="t0.6c",
    fill="green",
    pen="1.5p,black",
)
fig.text(
    position="TL",
    text="b",
    fill="white",
    pen=True,
    font="22p,Helvetica,black",
    offset="j1.5/.2",
    clearance="+tO",
    no_clip=True,
)
with pygmt.config(FONT_ANNOT_PRIMARY="14p"):
    fig.legend(
        position="JTR+jTR+o0.1c",
        box="+gwhite+p0.5p",
    )


###
###
# Plot 2nd shelf
###
###

min_dist = min_dists[1]
min_dist_update = min_dist_updates[1]
constraints_df = constraints_dfs[1]
shelf = shelfs[1]
name = names[1]
min_dist_coord = min_dist_coords[1]
reg = shelf_regions[1]

cpt_lims = (
    0,
    polar_utils.get_combined_min_max([min_dist, min_dist_update], robust=False)[1],
)

fig = maps.plot_grd(
    min_dist,
    fig=fig,
    origin_shift="both",
    xshift_amount=-1,
    yshift_amount=-1.15,
    region=reg,
    cmap="dense",
    cpt_lims=cpt_lims,
    scalebar=True,
    scalebar_box="+gwhite@30+p0.5p,gray30,solid+r3p",
    modis_basemap=True,
    modis_version="125m",
    modis_transparency=60,
    hist=True,
    points=constraints_df,
    points_style="p1.5p",
    points_fill="black",
    cbar_label="Distance to nearest constraint (km)",
    cbar_font="20p,Helvetica",
)
fig.text(
    position="TC",
    justify="BC",
    text=f"Median; {round(np.nanmedian(min_dist), 2)} km",
    offset="0c/.3c",
    font="20p,Helvetica",
    no_clip=True,
)
# plot constraints
fig.plot(
    constraints_df[["easting", "northing"]].iloc[0],
    style="p1.5p",
    fill="black",
)
# plot outline of ice shelf
fig.plot(
    gpd.GeoDataFrame(geometry=[shelf.geometry]),
    pen="1.5p,salmon",
)
fig.text(
    position="TL",
    text="c",
    fill="white",
    pen=True,
    font="22p,Helvetica,black",
    offset="j.2/.2",
    clearance="+tO",
    no_clip=True,
)
fig.text(
    position="TR",
    justify="BC",
    text=f"{name.replace('_', ' ')} Ice Shelf",
    offset="0c/1c",
    font="26p,Helvetica",
    no_clip=True,
)

fig = maps.plot_grd(
    min_dist_update,
    fig=fig,
    origin_shift="x",
    region=reg,
    cmap="dense",
    cpt_lims=cpt_lims,
    inset=True,
    inset_width=0.3,
    inset_position="jTL+jTC+o-0.5/-1",
    modis_basemap=True,
    modis_version="125m",
    modis_transparency=80,
    hist=True,
    points=constraints_df,
    points_style="p1.5p",
    points_fill="black",
    cbar_label="Distance to nearest constraint (km)",
    cbar_font="20p,Helvetica",
)
fig.text(
    position="TC",
    justify="BC",
    text=f"Median; {round(np.nanmedian(min_dist_update), 2)} km",
    offset="0c/.3c",
    font="20p,Helvetica",
    no_clip=True,
)
# plot constraints
fig.plot(
    constraints_df[["easting", "northing"]].iloc[0],
    style="p1.5p",
    fill="black",
    label="existing constraints",
)
# plot outline of ice shelf
fig.plot(
    gpd.GeoDataFrame(geometry=[shelf.geometry]),
    pen="1.5p,salmon",
    label="ice shelf boundary",
)

# plot additional point
# fake plot for legend
fig.plot(
    min_dist_coord,
    style="t0.3c",
    fill="green",
    pen="1.5p,black",
    label="added constraint",
)
fig.plot(
    min_dist_coord,
    style="t0.6c",
    fill="green",
    pen="1.5p,black",
)
fig.text(
    position="TL",
    text="d",
    fill="white",
    pen=True,
    font="22p,Helvetica,black",
    offset="j1.5/.2",
    clearance="+tO",
    no_clip=True,
)
with pygmt.config(FONT_ANNOT_PRIMARY="14p"):
    fig.legend(
        position="JBR+jBR+o0.1c",
        box="+gwhite+p0.5p",
    )

fig.show()
_images/antarctic_ice_shelf_analysis_46_0.png
[44]:
fig.savefig(
    "../paper/figures/constraint_proximity_examples.png",
    dpi=1000,
)

Estimating optimal gravity line spacing

[49]:
shelf_shp = ice_shelves[ice_shelves.NAME == "Getz"]

shelf_bounds = shelf_shp.minimum_rotated_rectangle().iloc[0]

# calculate length and width of the polygon
x, y = shelf_bounds.exterior.coords.xy
edge_length = (
    Point(x[0], y[0]).distance(Point(x[1], y[1])),
    Point(x[1], y[1]).distance(Point(x[2], y[2])),
)
length = max(edge_length)
width = min(edge_length)
buffer = max(length, width) * 0.05

shelf_bounds = shelf_bounds.buffer(
    buffer,
    cap_style="flat",
    join_style="mitre",
)

# create flight lines
grav_survey_df = synthetic.rotated_airborne_survey(
    survey_polygon=shelf_bounds,
    along_line_spacing=500,
    grav_observation_height=1e3,
    line_spacing=10e3,
    tie_numbers=0,
    plot=True,
    mask=shelf_shp.buffer(buffer).iloc[0],
    proximity_mask=shelf_shp.iloc[0].geometry,
    survey_spacing_mask=shelf_shp.iloc[0].geometry,
)
grav_survey_df.attrs
_images/antarctic_ice_shelf_analysis_49_0.png
[49]:
{'number_ties': 0,
 'number_lines': 15,
 'tie_spacing': nan,
 'line_spacing': np.float64(10.0),
 'survey_spacing': np.float64(10.0),
 'flight_kms': 7318.5,
 'median_proximity': np.float64(2.482602248387818),
 'max_proximity': np.float64(5.006049348724906),
 'proximity_skew': np.float64(0.02658344084115517)}
[50]:
shelf_shp = ice_shelves[ice_shelves.NAME == "Dotson"]

shelf_bounds = shelf_shp.minimum_rotated_rectangle().iloc[0]

# calculate length and width of the polygon
x, y = shelf_bounds.exterior.coords.xy
edge_length = (
    Point(x[0], y[0]).distance(Point(x[1], y[1])),
    Point(x[1], y[1]).distance(Point(x[2], y[2])),
)
length = max(edge_length)
width = min(edge_length)
buffer = max(length, width) * 0.05

shelf_bounds = shelf_bounds.buffer(
    buffer,
    cap_style="flat",
    join_style="mitre",
)

# create flight lines
grav_survey_df = synthetic.rotated_airborne_survey(
    survey_polygon=shelf_bounds,
    along_line_spacing=500,
    grav_observation_height=1e3,
    line_spacing=10e3,
    tie_numbers=4,
    plot=True,
    mask=shelf_shp.buffer(buffer).iloc[0],
    proximity_mask=shelf_shp.iloc[0].geometry,
    survey_spacing_mask=shelf_shp.iloc[0].geometry,
)
grav_survey_df.attrs
_images/antarctic_ice_shelf_analysis_50_0.png
[50]:
{'number_ties': 4,
 'number_lines': 9,
 'tie_spacing': 28.824355950768414,
 'line_spacing': np.float64(10.0),
 'survey_spacing': np.float64(19.412177975384207),
 'flight_kms': 1135.5,
 'median_proximity': np.float64(2.096438832428336),
 'max_proximity': np.float64(5.005509002707998),
 'proximity_skew': np.float64(0.24551603151928922)}
[51]:
shelf_shp = ice_shelves[ice_shelves.NAME == "Rennick"]

shelf_bounds = shelf_shp.minimum_rotated_rectangle().iloc[0]

# calculate length and width of the polygon
x, y = shelf_bounds.exterior.coords.xy
edge_length = (
    Point(x[0], y[0]).distance(Point(x[1], y[1])),
    Point(x[1], y[1]).distance(Point(x[2], y[2])),
)
length = max(edge_length)
width = min(edge_length)
buffer = max(length, width) * 0.05

shelf_bounds = shelf_bounds.buffer(
    buffer,
    cap_style="flat",
    join_style="mitre",
)

# create flight lines
grav_survey_df = synthetic.rotated_airborne_survey(
    survey_polygon=shelf_bounds,
    along_line_spacing=500,
    grav_observation_height=1e3,
    line_numbers=4,
    tie_numbers=2,
    plot=True,
    mask=shelf_shp.buffer(buffer).iloc[0],
    proximity_mask=shelf_shp.iloc[0].geometry,
    survey_spacing_mask=shelf_shp.iloc[0].geometry,
)
grav_survey_df.attrs
_images/antarctic_ice_shelf_analysis_51_0.png
[51]:
{'number_ties': 2,
 'number_lines': 4,
 'tie_spacing': 73.62872348549706,
 'line_spacing': 8.674035603877469,
 'survey_spacing': np.float64(41.151379544687266),
 'flight_kms': 677.0,
 'median_proximity': np.float64(2.020216732352776),
 'max_proximity': np.float64(4.343599384464118),
 'proximity_skew': np.float64(0.11231160153935679)}
[52]:
num = 30
name = "set_survey_spacing"
name = "set_grav_line_numbers"

# Define number of flights lines on log scale
values = np.unique(np.round(np.linspace(1, num, num)))
values = [int(i) for i in values]

# turn into dataframe
sampled_params_df = pd.DataFrame(values, columns=[name])

# calculate buffer and shp for ice shelf
shelf_shp = ice_shelves[ice_shelves.NAME == "Rennick"]
shelf_bounds = shelf_shp.minimum_rotated_rectangle().iloc[0]
x, y = shelf_bounds.exterior.coords.xy
edge_length = (
    Point(x[0], y[0]).distance(Point(x[1], y[1])),
    Point(x[1], y[1]).distance(Point(x[2], y[2])),
)
length = max(edge_length)
width = min(edge_length)
buffer = max(length, width) * 0.05
shelf_bounds = shelf_bounds.buffer(
    buffer,
    cap_style="flat",
    join_style="mitre",
)

grav_survey_dfs = []
for i, row in sampled_params_df.iterrows():
    val = int(row[name])

    # create flight lines
    grav_survey_df = synthetic.rotated_airborne_survey(
        survey_polygon=shelf_bounds,
        along_line_spacing=500,
        grav_observation_height=1e3,
        line_numbers=val,
        tie_numbers=3,
        mask=shelf_shp.buffer(buffer).iloc[0],
        proximity_mask=shelf_shp.iloc[0].geometry,
        survey_spacing_mask=shelf_shp.iloc[0].geometry,
    )
    grav_survey_dfs.append(grav_survey_df)

    sampled_params_df.loc[i, "grav_lines_numbers"] = len(grav_survey_df.line.unique())
    sampled_params_df.loc[i, "tie_spacing"] = grav_survey_df.attrs.get("tie_spacing")
    sampled_params_df.loc[i, "line_spacing"] = grav_survey_df.attrs.get("line_spacing")
    sampled_params_df.loc[i, "survey_spacing"] = grav_survey_df.attrs.get(
        "survey_spacing"
    )
    sampled_params_df.loc[i, "flight_kms"] = grav_survey_df.attrs.get("flight_kms")
    sampled_params_df.loc[i, "median_proximity"] = grav_survey_df.attrs.get(
        "median_proximity"
    )
    sampled_params_df.loc[i, "max_proximity"] = grav_survey_df.attrs.get(
        "max_proximity"
    )
    sampled_params_df.loc[i, "proximity_skew"] = grav_survey_df.attrs.get(
        "proximity_skew"
    )

sampled_params_df.describe()
[52]:
set_grav_line_numbers grav_lines_numbers tie_spacing line_spacing survey_spacing flight_kms median_proximity max_proximity proximity_skew
count 30.000000 30.000000 3.000000e+01 29.000000 30.000000 30.000000 30.000000 30.000000 30.000000
mean 15.500000 18.500000 4.908582e+01 3.583259 27.092913 2402.733333 0.954205 2.336463 0.134958
std 8.803408 8.803408 2.168069e-14 3.608360 4.516287 1291.597172 0.971250 3.336217 0.129332
min 1.000000 4.000000 4.908582e+01 1.156538 25.121177 281.000000 0.321755 0.629424 0.032429
25% 8.250000 11.250000 4.908582e+01 1.508528 25.305743 1340.125000 0.402490 0.802670 0.084575
50% 15.500000 18.500000 4.908582e+01 2.168509 25.663304 2398.250000 0.563351 1.147364 0.108790
75% 22.750000 25.750000 4.908582e+01 3.855127 26.651180 3464.125000 1.009945 2.122246 0.122765
max 30.000000 33.000000 4.908582e+01 17.348071 49.085816 4535.500000 4.670160 17.336884 0.708698
[53]:
# get best dimensions for subplot
nrows, ncols = polar_utils.square_subplots(len(grav_survey_dfs))

region = polar_utils.region_to_bounding_box(shelf_bounds.bounds)

cols = sampled_params_df.columns
col = cols[cols.str.startswith("set")][0]

row_num = 0
for i, df in enumerate(grav_survey_dfs):
    xshift = 1
    yshift = -1
    scalebar = True
    if i == 0:
        fig = None
        origin_shift = "initialize"
    elif i % ncols == 0:
        origin_shift = "both"
        xshift = (-ncols + 1) * xshift
        row_num += 1
    else:
        origin_shift = "x"

    fig = maps.basemap(
        region=region,
        simple_basemap=True,
        simple_basemap_version="measures-v2",
        title=f"{col[4:]}: {sampled_params_df.loc[i, col]}",
        points=df,
        points_style="p1p",
        fig=fig,
        origin_shift=origin_shift,
        xshift_amount=xshift,
        yshift_amount=yshift,
        scalebar=scalebar,
    )
    fig.plot(
        data=shelf_shp,
        pen="1p,black",
        label="supplied polygon",
    )
fig.show()
_images/antarctic_ice_shelf_analysis_53_0.png
[54]:
sampled_params_df.sort_values("proximity_skew", ascending=False)
[54]:
set_grav_line_numbers grav_lines_numbers tie_spacing line_spacing survey_spacing flight_kms median_proximity max_proximity proximity_skew
0 1 4.0 49.085816 NaN 49.085816 281.0 4.670160 17.336884 0.708698
1 2 5.0 49.085816 17.348071 33.216943 421.5 3.063294 8.677277 0.446885
2 3 6.0 49.085816 11.565381 30.325598 571.5 2.559434 5.787595 0.168871
3 4 7.0 49.085816 8.674036 28.879926 712.0 1.945432 4.343654 0.162153
4 5 8.0 49.085816 6.939228 28.012522 861.5 1.580371 3.478008 0.152896
5 6 9.0 49.085816 5.782690 27.434253 1011.5 1.343418 2.901865 0.138915
6 7 10.0 49.085816 4.956592 27.021204 1150.0 1.164110 2.489883 0.132191
11 12 15.0 49.085816 2.891345 25.988580 1887.0 0.705539 1.466954 0.123171
13 14 17.0 49.085816 2.478296 25.782056 2186.5 0.612579 1.263187 0.121546
12 13 16.0 49.085816 2.668934 25.877375 2036.5 0.656049 1.357430 0.121392
8 9 12.0 49.085816 3.855127 26.470471 1453.0 0.924346 1.943264 0.120362
7 8 11.0 49.085816 4.337018 26.711417 1302.5 1.038478 2.181907 0.113654
9 10 13.0 49.085816 3.469614 26.277715 1594.5 0.841958 1.751815 0.113616
14 15 18.0 49.085816 2.313076 25.699446 2323.5 0.579146 1.182709 0.110511
10 11 14.0 49.085816 3.154195 26.120005 1748.5 0.771814 1.596503 0.109965
18 19 22.0 49.085816 1.826113 25.455964 2916.5 0.467444 0.946028 0.107615
15 16 19.0 49.085816 2.168509 25.627162 2473.0 0.547555 1.112018 0.105953
16 17 20.0 49.085816 2.040950 25.563383 2623.0 0.517889 1.048957 0.105766
19 20 23.0 49.085816 1.734807 25.410311 3057.5 0.447737 0.901876 0.101569
17 18 21.0 49.085816 1.927563 25.506690 2763.5 0.493846 0.995129 0.099468
20 21 24.0 49.085816 1.652197 25.369006 3207.5 0.428873 0.862542 0.099417
21 22 25.0 49.085816 1.577097 25.331457 3359.5 0.412925 0.826906 0.092453
22 23 26.0 49.085816 1.508528 25.297172 3499.0 0.399012 0.794591 0.081950
23 24 27.0 49.085816 1.445673 25.265744 3651.5 0.383729 0.764646 0.081771
24 25 28.0 49.085816 1.387846 25.236831 3801.0 0.371182 0.737057 0.074737
25 26 29.0 49.085816 1.334467 25.210141 3943.0 0.359224 0.712158 0.069115
26 27 30.0 49.085816 1.285042 25.185429 4090.5 0.349139 0.688877 0.059619
27 28 31.0 49.085816 1.239148 25.162482 4234.0 0.339629 0.667088 0.049377
28 29 32.0 49.085816 1.196419 25.141117 4386.0 0.330095 0.647647 0.042671
29 30 33.0 49.085816 1.156538 25.121177 4535.5 0.321755 0.629424 0.032429
[55]:
df = sampled_params_df
y = "median_proximity"
x = "line_spacing"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[55]:
Text(0, 0.5, 'median_proximity')
_images/antarctic_ice_shelf_analysis_55_1.png
[56]:
df = sampled_params_df
y = "median_proximity"
x = "flight_kms"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[56]:
Text(0, 0.5, 'median_proximity')
_images/antarctic_ice_shelf_analysis_56_1.png
[57]:
df = sampled_params_df
y = "median_proximity"
x = "grav_lines_numbers"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[57]:
Text(0, 0.5, 'median_proximity')
_images/antarctic_ice_shelf_analysis_57_1.png
[58]:
df = sampled_params_df
y = "proximity_skew"
x = "flight_kms"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)

max_ind = df[y].idxmax()
ax.scatter(
    x=df[x].iloc[max_ind],
    y=df[y].iloc[max_ind],
    marker="*",
    c="r",
    s=200,
    zorder=20,
)
print(f"Max y value at x value: {df[x].iloc[max_ind]}")
print(f"Max y value: {df[y].iloc[max_ind]}")
Max y value at x value: 281.0
Max y value: 0.708698496502439
_images/antarctic_ice_shelf_analysis_58_1.png
[59]:
shelf_shp = ice_shelves[ice_shelves.NAME == "Getz"]

shelf_bounds = shelf_shp.minimum_rotated_rectangle().iloc[0]

# calculate length and width of the polygon
x, y = shelf_bounds.exterior.coords.xy
edge_length = (
    Point(x[0], y[0]).distance(Point(x[1], y[1])),
    Point(x[1], y[1]).distance(Point(x[2], y[2])),
)
length = max(edge_length)
width = min(edge_length)
buffer = max(length, width) * 0.05

shelf_bounds = shelf_bounds.buffer(
    buffer,
    cap_style="flat",
    join_style="mitre",
)

# create flight lines
grav_survey_df = synthetic.rotated_airborne_survey(
    survey_polygon=shelf_bounds,
    along_line_spacing=500,
    grav_observation_height=1e3,
    line_numbers=4,
    tie_numbers=2,
    plot=True,
    mask=shelf_shp.buffer(buffer).iloc[0],
    proximity_mask=shelf_shp.iloc[0].geometry,
    survey_spacing_mask=shelf_shp.iloc[0].geometry,
)
grav_survey_df.attrs
_images/antarctic_ice_shelf_analysis_59_0.png
[59]:
{'number_ties': 2,
 'number_lines': 4,
 'tie_spacing': 291.355052479669,
 'line_spacing': 36.46132702376717,
 'survey_spacing': np.float64(163.90818975171808),
 'flight_kms': 2258.5,
 'median_proximity': np.float64(8.302668529964075),
 'max_proximity': np.float64(18.232133066089165),
 'proximity_skew': np.float64(0.1264938481976068)}
[60]:
num = 30
name = "set_survey_spacing"
name = "set_grav_line_numbers"

# Define number of flights lines on log scale
values = np.unique(np.round(np.linspace(1, num, num)))
values = [int(i) for i in values]

# turn into dataframe
sampled_params_df = pd.DataFrame(values, columns=[name])

# calculate buffer and shp for ice shelf
shelf_shp = ice_shelves[ice_shelves.NAME == "Getz"]
shelf_bounds = shelf_shp.minimum_rotated_rectangle().iloc[0]
x, y = shelf_bounds.exterior.coords.xy
edge_length = (
    Point(x[0], y[0]).distance(Point(x[1], y[1])),
    Point(x[1], y[1]).distance(Point(x[2], y[2])),
)
length = max(edge_length)
width = min(edge_length)
buffer = max(length, width) * 0.05
shelf_bounds = shelf_bounds.buffer(
    buffer,
    cap_style="flat",
    join_style="mitre",
)

grav_survey_dfs = []
for i, row in sampled_params_df.iterrows():
    val = int(row[name])

    # create flight lines
    grav_survey_df = synthetic.rotated_airborne_survey(
        survey_polygon=shelf_bounds,
        along_line_spacing=500,
        grav_observation_height=1e3,
        line_numbers=val,
        tie_numbers=0,
        mask=shelf_shp.buffer(buffer).iloc[0],
        proximity_mask=shelf_shp.iloc[0].geometry,
        survey_spacing_mask=shelf_shp.iloc[0].geometry,
    )
    grav_survey_dfs.append(grav_survey_df)

    sampled_params_df.loc[i, "grav_lines_numbers"] = len(grav_survey_df.line.unique())
    sampled_params_df.loc[i, "tie_spacing"] = grav_survey_df.attrs.get("tie_spacing")
    sampled_params_df.loc[i, "line_spacing"] = grav_survey_df.attrs.get("line_spacing")
    sampled_params_df.loc[i, "survey_spacing"] = grav_survey_df.attrs.get(
        "survey_spacing"
    )
    sampled_params_df.loc[i, "flight_kms"] = grav_survey_df.attrs.get("flight_kms")
    sampled_params_df.loc[i, "median_proximity"] = grav_survey_df.attrs.get(
        "median_proximity"
    )
    sampled_params_df.loc[i, "max_proximity"] = grav_survey_df.attrs.get(
        "max_proximity"
    )
    sampled_params_df.loc[i, "proximity_skew"] = grav_survey_df.attrs.get(
        "proximity_skew"
    )

sampled_params_df.describe()
[60]:
set_grav_line_numbers grav_lines_numbers tie_spacing line_spacing survey_spacing flight_kms median_proximity max_proximity proximity_skew
count 30.000000 30.000000 0.0 29.000000 29.000000 30.000000 30.000000 30.000000 30.000000
mean 15.500000 15.500000 NaN 15.062235 15.062235 7605.033333 4.506766 9.716518 0.036440
std 8.803408 8.803408 NaN 15.167751 15.167751 4313.041066 6.009317 14.067322 0.066771
min 1.000000 1.000000 NaN 4.861510 4.861510 578.500000 1.221332 2.443451 -0.014990
25% 8.250000 8.250000 NaN 6.341100 6.341100 4014.750000 1.611471 3.216271 0.015984
50% 15.500000 15.500000 NaN 9.115332 9.115332 7615.500000 2.355271 4.716116 0.026153
75% 22.750000 22.750000 NaN 16.205034 16.205034 11148.750000 4.414382 8.865561 0.033332
max 30.000000 30.000000 NaN 72.922654 72.922654 14717.500000 31.881381 72.898027 0.366372
[61]:
# get best dimensions for subplot
nrows, ncols = polar_utils.square_subplots(len(grav_survey_dfs))

region = polar_utils.region_to_bounding_box(shelf_bounds.bounds)

cols = sampled_params_df.columns
col = cols[cols.str.startswith("set")][0]

row_num = 0
for i, df in enumerate(grav_survey_dfs):
    xshift = 1
    yshift = -1
    scalebar = True
    if i == 0:
        fig = None
        origin_shift = "initialize"
    elif i % ncols == 0:
        origin_shift = "both"
        xshift = (-ncols + 1) * xshift
        row_num += 1
    else:
        origin_shift = "x"

    fig = maps.basemap(
        region=region,
        simple_basemap=True,
        simple_basemap_version="measures-v2",
        title=f"{col[4:]}: {sampled_params_df.loc[i, col]}",
        points=df,
        points_style="p1p",
        fig=fig,
        origin_shift=origin_shift,
        xshift_amount=xshift,
        yshift_amount=yshift,
        scalebar=scalebar,
    )
    fig.plot(
        data=shelf_shp,
        pen="1p,black",
        label="supplied polygon",
    )
fig.show()
_images/antarctic_ice_shelf_analysis_61_0.png
[62]:
sampled_params_df.sort_values("proximity_skew", ascending=False)
[62]:
set_grav_line_numbers grav_lines_numbers tie_spacing line_spacing survey_spacing flight_kms median_proximity max_proximity proximity_skew
1 2 2.0 NaN 72.922654 72.922654 961.0 13.763512 36.462009 0.366372
2 3 3.0 NaN 48.615103 48.615103 1491.0 11.271300 24.308773 0.108153
4 5 5.0 NaN 29.169062 29.169062 2415.5 6.904897 14.586501 0.077643
3 4 4.0 NaN 36.461327 36.461327 1989.0 8.852953 18.232133 0.043198
29 30 30.0 NaN 4.861510 4.861510 14717.5 1.221332 2.443451 0.038568
27 28 28.0 NaN 5.208761 5.208761 13736.5 1.306231 2.616282 0.037081
28 29 29.0 NaN 5.029149 5.029149 14222.5 1.265001 2.526803 0.034645
26 27 27.0 NaN 5.401678 5.401678 13243.5 1.355625 2.712255 0.033937
25 26 26.0 NaN 5.609435 5.609435 12746.0 1.408164 2.815537 0.031517
5 6 6.0 NaN 24.307551 24.307551 2972.5 5.956637 12.156274 0.031371
18 19 19.0 NaN 7.676069 7.676069 9326.5 1.910672 3.846118 0.030214
20 21 21.0 NaN 6.945015 6.945015 10303.5 1.733211 3.481434 0.030031
24 25 25.0 NaN 5.833812 5.833812 12257.0 1.465927 2.927418 0.027909
23 24 24.0 NaN 6.076888 6.076888 11781.0 1.526276 3.048590 0.026895
21 22 22.0 NaN 6.629332 6.629332 10795.5 1.661070 3.324056 0.026357
0 1 1.0 NaN NaN NaN 578.5 31.881381 72.898027 0.025950
19 20 20.0 NaN 7.292265 7.292265 9788.5 1.823711 3.654514 0.025145
22 23 23.0 NaN 6.341100 6.341100 11266.5 1.594938 3.180343 0.022521
16 17 17.0 NaN 8.579136 8.579136 8310.0 2.146407 4.296674 0.019306
7 8 8.0 NaN 18.230664 18.230664 3886.0 4.518759 9.118650 0.019148
14 15 15.0 NaN 9.723021 9.723021 7355.0 2.428471 4.867837 0.017800
15 16 16.0 NaN 9.115332 9.115332 7876.0 2.282070 4.564395 0.016572
17 18 18.0 NaN 8.102517 8.102517 8844.0 2.034516 4.058859 0.015788
12 13 13.0 NaN 11.218870 11.218870 6399.0 2.810409 5.614787 0.010763
13 14 14.0 NaN 10.417522 10.417522 6863.5 2.618466 5.214705 0.006909
11 12 12.0 NaN 12.153776 12.153776 5888.0 3.051540 6.081939 0.006378
10 11 11.0 NaN 13.258664 13.258664 5380.5 3.334778 6.634030 0.001655
8 9 9.0 NaN 16.205034 16.205034 4401.0 4.101251 8.106292 -0.011328
6 7 7.0 NaN 20.835044 20.835044 3432.5 5.267496 10.420478 -0.012318
9 10 10.0 NaN 14.584531 14.584531 4923.5 3.705984 7.296375 -0.014990
[63]:
df = sampled_params_df
y = "median_proximity"
x = "flight_kms"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[63]:
Text(0, 0.5, 'median_proximity')
_images/antarctic_ice_shelf_analysis_63_1.png
[64]:
df = sampled_params_df
y = "median_proximity"
x = "grav_lines_numbers"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[64]:
Text(0, 0.5, 'median_proximity')
_images/antarctic_ice_shelf_analysis_64_1.png
[65]:
df = sampled_params_df
y = "line_spacing"
x = "flight_kms"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[65]:
Text(0, 0.5, 'line_spacing')
_images/antarctic_ice_shelf_analysis_65_1.png
[66]:
df = sampled_params_df
y = "proximity_skew"
x = "flight_kms"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[66]:
Text(0, 0.5, 'proximity_skew')
_images/antarctic_ice_shelf_analysis_66_1.png
[67]:
df = sampled_params_df
y = "proximity_skew"
x = "line_spacing"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[67]:
Text(0, 0.5, 'proximity_skew')
_images/antarctic_ice_shelf_analysis_67_1.png
[68]:
df = sampled_params_df
y = "proximity_skew"
x = "median_proximity"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[68]:
Text(0, 0.5, 'proximity_skew')
_images/antarctic_ice_shelf_analysis_68_1.png
[69]:
df = sampled_params_df
y = "proximity_skew"
x = "median_proximity"

plt.plot(df[x], df[y], marker="o")
ax = plt.gca()
ax.set_xlabel(x)
ax.set_ylabel(y)
[69]:
Text(0, 0.5, 'proximity_skew')
_images/antarctic_ice_shelf_analysis_69_1.png