Skip to content

Commit 3fb89a3

Browse files
committed
Adding global concentration maps to the download function, and to the particle set creation method
1 parent a46318b commit 3fb89a3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

plasticparcels/constructors.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create_hydrodynamic_fieldset(settings):
3939
wfiles = select_files(dirread_model, 'W_%4i*.nc', start_date, runtime, dt_margin=3)
4040
tfiles = select_files(dirread_model, 'T_%4i*.nc', start_date, runtime, dt_margin=3)
4141
sfiles = select_files(dirread_model, 'S_%4i*.nc', start_date, runtime, dt_margin=3)
42-
42+
4343
filenames = {'U': {'lon': ocean_mesh, 'lat': ocean_mesh, 'depth': wfiles[0], 'data': ufiles},
4444
'V': {'lon': ocean_mesh, 'lat': ocean_mesh, 'depth': wfiles[0], 'data': vfiles},
4545
'W': {'lon': ocean_mesh, 'lat': ocean_mesh, 'depth': wfiles[0], 'data': wfiles},
@@ -225,7 +225,7 @@ def create_particleset_from_map(fieldset, settings):
225225
'coastal': 'MPW_Cell',
226226
'rivers': 'Emissions',
227227
'fisheries': 'fishing_hours',
228-
'global_concentrations': None # TODO: Not implemented yet
228+
'global_concentrations': 'Concentration'
229229
}
230230
release_quantity_name = release_quantity_names[release_type]
231231

@@ -242,6 +242,8 @@ def create_particleset_from_map(fieldset, settings):
242242
particle_locations = particle_locations[particle_locations['Country'] == settings['release']['country']]
243243
if 'economicstatus' in settings['release'].keys():
244244
particle_locations = particle_locations[particle_locations['Economic status'] == settings['release']['economicstatus']]
245+
if 'concentration_type' in settings['release'].keys():
246+
particle_locations = particle_locations[particle_locations['ConcentrationType'] == settings['release']['concentrationtype']]
245247

246248
particle_locations = particle_locations.groupby(['Longitude', 'Latitude'])[release_quantity_name].agg('sum').reset_index()
247249
particle_locations = particle_locations[particle_locations[release_quantity_name] > 0]

plasticparcels/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def download_plasticparcels_dataset(dataset: str, settings, data_home=None):
132132
(("release_maps", "coastal"), "coastal_population_MPW_NEMO0083.csv"),
133133
(("release_maps", "rivers"), "river_emissions_NEMO0083.csv"),
134134
(("release_maps", "fisheries"), "agg_data_fisheries_info_NEMO0083.csv"),
135+
(("release_maps", "global_concentrations"), "global_concentrations_NEMO0083.csv"),
135136
(("unbeaching", "filename"), "land_current_NEMO0083.nc"),
136137
],
137138
}

0 commit comments

Comments
 (0)