Service de datasets¶
- Service de datasets contrôle l’accès aux bases de données (datasets) de climat. Il a pour fonction de :
lister les variables,
avoir la liste des échéances
Les datasets sont des fichiers au format netcdf.
Dépendances côté serveur¶
Python (3.7, 3.8, 3.9)
Django (3.0, 3.1)
Django REST Framework (3.10, 3.11, 3.12)
Django Aria User (0.1.4) - django-aria-user from ARIA Gitlab repository
Django Aria Core (0.1.4) - django-aria-core from ARIA Gitlab repository
ARIA library (1.2.27) - ariapy from ARIA Gitlab repository
Usage¶
-
GET/datasets/(str: dataset)¶ - Query Parameters
project – le nom du projet
case – Le catégorie de données climat (RCP45 | RCP85)
type – Le type de dataset (clim)
- Request Headers
Accept – Le type du contenu de la réponse accepté: application/json
Authorization – Le mécanisme d’authentification par Token
- Response Headers
Content-Type – Le type du contenu de la réponse: application/json
- Status Codes
200 OK – OK
403 Forbidden – Forbidden
401 Unauthorized – Incorrect token, Non authorisé
404 Not Found – Ressource non trouvée
500 Internal Server Error – Erreur interne
Description
Le service GET contient un paramètre ‘path’ de type
string: {dataset}. Si ce paramètre n’est pas présent, le service retourne une liste des datasets disponibles. Dans le cas contraire, le dataset dont le nom est {dataset} sera retourné.Exemple d’une requête:
GET /datasets/?project=INMCLIMAT&case=RCP45&type=clim HTTP/1.1 Host : apibeta.aria.fr/py/v2 Accept : application/json
Exemple d’une réponse:
HTTP/1.1 200 OK Allow: GET, HEAD, OPTIONS Vary: Accept Content-Type: application/json { "error": false, "status": "OK", "data": [ { "id": 9, "variables": [ { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_cdd_avg_year", "avg_month": "inmclimat_cdd_avg_mensuel", "ano_year": "inmclimat_cdd_ano_year", "ano_month": "inmclimat_cdd_ano_mensuel" }, "scalingColor": "linear", "name": "CDD", "transformA": 1.666, "noDataColor": "transparent", "description": "Nombre de jours consécutifs secs", "transformUnit": "", "aboveMaxColor": "#FF0000", "transform": 1, "belowMinColor": "#FF0000", "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Nombre de jours consécutifs secs", "colorScaleRange": "-100 400", "type": "colorshape", "transformB": 0, "unit": "days", "statisticRange": 8 }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_csdi_avg_year", "avg_month": "inmclimat_csdi_avg_mensuel", "ano_year": "inmclimat_csdi_ano_year", "ano_month": "inmclimat_csdi_ano_mensuel" }, "scalingColor": "linear", "name": "CSDI", "transformA": 1.666, "noDataColor": "transparent", "description": "Nombre de jours de vague de froid", "transformUnit": "", "aboveMaxColor": "#FF0000", "transform": 1, "belowMinColor": "#FF0000", "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Nombre de jours de vague de froid", "colorScaleRange": "-1 10", "type": "colorshape", "transformB": 0, "unit": "days", "statisticRange": 8 }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_cwd_avg_year", "avg_month": "inmclimat_cwd_avg_mensuel", "ano_year": "inmclimat_cwd_ano_year", "ano_month": "inmclimat_cwd_ano_mensuel" }, "colorScaleRange": "-2 10", "scalingColor": "linear", "name": "CWD", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Nombre de jours consécutifs humide", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "days", "description": "Nombre de jours consécutifs humide" }, { "spinup": 0, "palette": { "default": "climat_rain", "avg_year": "inmclimat_pr_avg_year", "avg_month": "inmclimat_pr_avg_mensuel", "ano_year": "inmclimat_pr_ano_year", "ano_month": "inmclimat_pr_ano_mensuel" }, "colorScaleRange": "-300 1000", "scalingColor": "linear", "name": "PR", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Précipitation", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "mm/day", "description": "Précipitation" }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_r10_avg_year", "avg_month": "inmclimat_r10_avg_mensuel", "ano_year": "inmclimat_r10_ano_year", "ano_month": "inmclimat_r10_ano_mensuel" }, "colorScaleRange": "-10 50", "scalingColor": "linear", "name": "R10MM", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Cumul journalier supérieur à 10mm", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "days", "description": "Cumul journalier supérieur à 10mm" }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_r20_avg_year", "avg_month": "inmclimat_r20_avg_mensuel", "ano_year": "inmclimat_r20_ano_year", "ano_month": "inmclimat_r20_ano_mensuel" }, "colorScaleRange": "-5 30", "scalingColor": "linear", "name": "R20MM", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Jours de précipitation > 20mm", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "days", "description": "Jours de précipitation > 20mm" }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_r40_avg_year", "avg_month": "inmclimat_r40_avg_mensuel", "ano_year": "inmclimat_r40_ano_year", "ano_month": "inmclimat_r40_ano_mensuel" }, "colorScaleRange": "-5 25", "scalingColor": "linear", "name": "R40MM", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Jours de précipitation > 40mm", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "days", "description": "Jours de précipitation > 40mm" }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_r70_avg_year", "avg_month": "inmclimat_r70_avg_mensuel", "ano_year": "inmclimat_r70_ano_year", "ano_month": "inmclimat_r70_ano_mensuel" }, "colorScaleRange": "-5 15", "scalingColor": "linear", "name": "R70MM", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Jours de précipitation > 70mm", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "days", "description": "Jours de précipitation > 70mm" }, { "spinup": 0, "palette": { "default": "undp_temp", "avg_year": "inmclimat_tmax_avg_year", "avg_month": "inmclimat_tmax_avg_mensuel", "ano_year": "inmclimat_tmax_ano_year", "ano_month": "inmclimat_tmax_ano_mensuel" }, "colorScaleRange": "-50 100", "scalingColor": "linear", "name": "TASMAX", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Températures maximales", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "°C", "description": "T2 max" }, { "spinup": 0, "palette": { "default": "undp_temp", "avg_year": "inmclimat_tmin_avg_year", "avg_month": "inmclimat_tmin_avg_mensuel", "ano_year": "inmclimat_tmin_ano_year", "ano_month": "inmclimat_tmin_ano_mensuel", "ano_year_score": "inmclimat_tmin_ano_year_score" }, "colorScaleRange": "-50 100", "scalingColor": "linear", "name": "TASMIN", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Températures minimales", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "°C", "description": "T2 min" }, { "spinup": 0, "palette": { "default": "undp_temp", "avg_year": "inmclimat_tavg_avg_year", "avg_month": "inmclimat_tavg_avg_mensuel", "ano_year": "inmclimat_tavg_ano_year", "ano_month": "inmclimat_tavg_ano_mensuel" }, "colorScaleRange": "-50 100", "scalingColor": "linear", "name": "TAS", "transformA": 1.666, "noDataColor": "transparent", "transformUnit": "", "aboveMaxColor": "#FF0000", "statisticRange": 8, "transform": 1, "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Températures moyennes", "belowMinColor": "#FF0000", "type": "colorshape", "transformB": 0, "unit": "°C", "description": "T2 min" }, { "spinup": 0, "palette": { "default": "undp_days", "avg_year": "inmclimat_wsdi_avg_year", "avg_month": "inmclimat_wsdi_avg_mensuel", "ano_year": "inmclimat_wsdi_ano_year", "ano_month": "inmclimat_wsdi_ano_mensuel" }, "scalingColor": "linear", "name": "WSDI", "transformA": 1.666, "noDataColor": "transparent", "description": "Nombre de jours de vague de chaleur", "transformUnit": "", "aboveMaxColor": "#FF0000", "transform": 1, "belowMinColor": "#FF0000", "statisticType": "", "numColorBands": 8, "statistic": "", "title": "Nombre de jours de vague de chaleur", "colorScaleRange": "-30 250", "type": "colorshape", "transformB": 0, "unit": "days", "statisticRange": 8 } ], "created": "2021-03-17T15:33:13.785464Z", "name": "INMCLIMAT_RCP45", "title": "INMCLIMAT RCP45", "project": "INMCLIMAT", "case": "RCP45", "location": "Tunisie", "historyInterval": 3600, "epsg": 4326, "dataType": "clim", "visuType": "", "format": "netcdf", "path": "/nas-3/APIARIA/MODEL/INMCLIMAT/RCP45/CLIMAT", "tags": "", "user": 2, "group": 2, "domain": { "nx": 120, "ny": 160, "nt": 96, "xno": 7.024993896484375, "yno": 37.974998474121094, "xse": 12.974990844726562, "yse": 30.024993896484375, "dx": 0.04999997435497636, "dy": -0.050000028790168044, "epsg": 4326 } } ] }