In the next step we want to download the data and store them to disc.
To obtain the contributors for this dataset, we need to create a dedicated file. This can be uploaded to the TOAR database to obtain a preformatted list of contributors. The required recipe can be found in the global metadata of the netCDF file.
The request the database can take several minutes. This duration is also dependent on the overall usage of the services. The `get_data` function checks every 5minutes, if the data are ready for download. After 30min this cell stops the execution. Simply restart this cell to continue checking for the results.
%% Cell type:code id: tags:
``` python
# this cell can run longer than 30minutes
data=analysis_service.get_data(metadata)
# create contributors endpoint and write result to metadata
print("Gridded data have been written to ",out_file_name)
```
%% Cell type:markdown id: tags:
### Visual inspection
%% Cell type:markdown id: tags:
We are working here with raw data and also want to visualize the station positions. Therefore, we want to distinguish stations that have valid data and those without valid data.
%% Cell type:code id: tags:
``` python
#calculation of coordinates for plotting
#especially separation of coordinates with results and without results.
In the next step we prepare a function for plotting the gridded data to a world map. The flag *discrete* influences the creation of the color bar. The *plot_stations* flag allows including the station positions into the map.
plt.title(f"global ozon at {data.time.values}{data.time.units}")
unit=data.attrs["units"]
plt.title(f"global ozone [{unit}] at {data.time.values}{data.time.units}")
```
%% Cell type:markdown id: tags:
Now we do the actual plotting. We select a single time from the dataset. To obtain two maps: 1) the mean ozone concentration per grid point and second the number of stations contributing to a grid point.