1. Overview
2. Installation
3. Scope of functionalities
4. Examples of use
5. Technologies
The goal of this microservice is to calculate the mean sea surface temperature over a from the user input timeframe and spatial subset. The data for the calculation comes from a netCDF Datacube containing sst data.
There also exists a Docker Repository, which is linked with this one and from which the service can be obtained as an image. And can then be used locally as a container.
The installation and execution is possible exclusively provided within the framework of the docker-compose.yml.docker-compose up
The mean sea surface temperature calculations are done via the central method 'mean_sst', which takes 3 parameters:
data
A datacube in netCDF format. The datacube must have the dimensions 'lon', 'lat' and 'time' and the data varible 'sst'timeframe
An array with two values: [start date, end date]. The dates must be in the ISO 8601 format yyyy-mm-dd (e.g. ['2007-06-01','2007-08-31']).bbox
A bounding box with four values: [min Longitude, min Latitude, max Longitude, max Latitude]. For example [0, 50, 30, 75] for North Europe. This parameter is optional. If this parameter isn't specified the mean will be calculated over the whole spatial dimension of the dataset.
The central method 'mean_sst' uses the function 'createSubset' to create the spatial subset. The parameters for this function are:
ds
The dataset from which a subset is generatedminLon
left value of the subsetminLat
bottom value of the subsetmaxLon
right value of the subsetmaxLat
top value of the subset
Both methods, 'mean_sst' and 'createSubset', are not meant to be used on their own, but rather always through the method 'exceptions_mean_sst'. This method checks the parameter values the user put in and throws exceptions for invalid inputs, e.g. for wrong parameter type, for timeframes and bounding boxes which go over the range of the dataset, for wanting to calculate mean sst on a dataset, that doesn't contain sst data, and more.
Since most sst datasets have longitude values from 0 to 360 the function 'createSubset' can also create subsets where minLon is greater than maxLon. This has the advantage that it is possible to create a subset for the whole of Europe, which would otherwise be split by the prime meridian. So for example [360, -20, 50, 20] would be a valid input for the parameter bbox. The same is not true for latitude values. [0, 50, 130, -50] is not valid!
Visualized the results can look like this:
Mean of oktober 1981 for region of north europe
\
POST /doJob/{job_id}
Accepts a job which is being processed.GET /jobstatus
Returns a JSON with the job status.
Software | Version |
---|---|
Python | 3.8.6 |
xarray | 0.16.1 |
dask | 2.30.0 |
Flask | 1.1.2 |
requests | 2.25.0 |
flask_cors | 3.0.9 |
numpy | 1.19.3 |
scipy | 1.5.4 |
netcdf4 | 1.5.4 |