-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathsetup_ice_shelves.py
executable file
·170 lines (153 loc) · 5.11 KB
/
setup_ice_shelves.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/usr/bin/env python
"""
This script creates region groups for ice shelves
"""
from geometric_features import GeometricFeatures, FeatureCollection
import matplotlib.pyplot as plt
plot = True
iceShelfNames = ['Abbot',
'Amery',
'Atka',
'Aviator',
'Bach',
'Baudouin',
'Borchgrevink',
'Brahms',
'Brunt_Stancomb',
'Campbell',
'Cheetham',
'Conger_Glenzer',
'Cook',
'Cosgrove',
'Crosson',
'Dennistoun',
'Dibble',
'Dotson',
'Drygalski',
'Edward_VIII',
'Ekstrom',
'Ferrigno',
'Filchner',
'Fimbul',
'Fitzgerald',
'Frost',
'GeikieInlet',
'George_VI',
'Getz',
'Gillet',
'Hamilton',
'Hannan',
'HarbordGlacier',
'Helen',
'Holmes',
'HolmesWest',
'Hull',
'Jelbart',
'Land',
'Larsen_B',
'Larsen_C',
'Larsen_D',
'Larsen_E',
'Larsen_F',
'Larsen_G',
'Lazarev',
'Lillie',
'Mariner',
'Matusevitch',
'Mendelssohn',
'Mertz',
'Moscow_University',
'Moubray',
'Mulebreen',
'Myers',
'Nansen',
'Nickerson',
'Ninnis',
'Nivl',
'Noll',
'Nordenskjold',
'Pine_Island',
'PourquoiPas',
'Prince_Harald',
'Publications',
'Quar',
'Rayner_Thyer',
'Rennick',
'Richter',
'Riiser-Larsen',
'Ronne',
'Western_Ross',
'Eastern_Ross',
'Shackleton',
'Shirase',
'Slava',
'SmithInlet',
'Stange',
'Sulzberger',
'Suvorov',
'Swinburne',
'Thwaites',
'Tinker',
'Totten',
'Tracy_Tremenchus',
'Tucker',
'Underwood',
'Utsikkar',
'Venable',
'Verdi',
'Vigrid',
'Vincennes',
'Voyeykov',
'West',
'Wilkins',
'Wilma_Robert_Downer',
'Withrow',
'Wordie',
'Wylde',
'Zubchatyy']
combinedIceShelves = {'Filchner-Ronne': ['Filchner', 'Ronne'],
'Ross': ['Western_Ross', 'Eastern_Ross'],
'Antarctica': ['AntarcticPenninsulaIMBIE',
'WestAntarcticaIMBIE',
'EastAntarcticaIMBIE'],
'Peninsula': ['AntarcticPenninsulaIMBIE'],
'West Antarctica': ['WestAntarcticaIMBIE'],
'East Antarctica': ['EastAntarcticaIMBIE']}
nIMBIEBasins = 27
for basinNumber in range(1, nIMBIEBasins+1):
basinName = 'Antarctica_IMBIE{}'.format(basinNumber)
combinedIceShelves['IMBIE{}'.format(basinNumber)] = [basinName]
# create a GeometricFeatures object that points to a local cache of geometric
# data and knows which branch of geometric_feature to use to download
# missing data
gf = GeometricFeatures()
# create a FeatureCollection containing all ice shelves and combined ice-shelf
# regions
fc = FeatureCollection()
# build analysis regions from combining ice shelves from regions with the
# appropriate tags
for shelfName in combinedIceShelves:
subNames = combinedIceShelves[shelfName]
print(shelfName)
print(' * merging features')
fcShelf = gf.read(componentName='iceshelves', objectType='region',
tags=subNames, allTags=False)
print(' * combining features')
fcShelf = fcShelf.combine(featureName=shelfName)
# merge the feature for the basin into the collection of all basins
fc.merge(fcShelf)
# build ice shelves from regions with the appropriate tags
for shelfName in iceShelfNames:
print(shelfName)
print(' * merging features')
fcShelf = gf.read(componentName='iceshelves', objectType='region',
tags=[shelfName])
print(' * combining features')
fcShelf = fcShelf.combine(featureName=shelfName)
# merge the feature for the basin into the collection of all basins
fc.merge(fcShelf)
# save the feature collection to a geojson file
fc.to_geojson('iceShelves20200621.geojson')
if plot:
fc.plot(projection='southpole')
plt.show()