wiki:WikiStart

Version 54 (modified by alafoe, 6 years ago) (diff)

--

MINERVE-D3

Le projet TRAC MINERVE-D3 correspond aux développements informatiques réalisés dans le cadre de la thèse MINERVE d'Alain Foehn.

Un certain nombre d'outils, présentés ci-dessous, ont été développés.
Les outils interagissent aux travers des api-node et api-research directement avec les bases de données spatiales MAYA et DANA ainsi que la base de données mysql MINERVE. Les fonctions de base permettant cette interaction avec les api on été regroupées dans le dossier suivant:

MINERVE-D3\Code

Le fichier fc_API-REST.R contient les fonctions suivantes :

Function nameDescriptionCalling functionAPIType of output
download_data_in_slots Parallel computation of slots download (value of a pixel or aggregated raster) over a period download_slot - time series OR raster
download_slot Manages data download (value of a pixel or aggregated raster) for a given slot of the entire period download_timeseries_from_raster_Node
download_timeseries_from_raster_research
manage_download_raster
- time series OR raster
download_timeseries_from_raster_node Request set up with good variable arguments download_request node time series
download_timeseries_from_raster_research Request set up with good variable arguments download_request research time series
download_request Manages download_request to node and research APIs download_request_node
download_request_research
- time series
download_request_node Curl subprocess to call the request spawn_process (in-built function) node time series
download_request_research Curl subprocess to call the request spawn_process (in-built function) research time series
manage_download_raster Manages between server and local raster acquisition download_raster (server option) - raster
download_raster Request set up with good variable arguments curl_fetch_memory (in-built function) +
curl_download (in-built function)
node (!) raster
download_altitude_of_pixel Manages download_request to node and research APIs download_altitude_of_pixel_node
download_altitude_of_pixel_research
- value
download_altitude_of_pixel_node Function to download the elevation value of a pixel from the metadata DEM of a given product curl_fetch_memory (in-built function) +
curl_download (in-built function)
node value
download_altitude_of_pixel_research Function to download the elevation value of a pixel from the metadata DEM of a given product curl_fetch_memory (in-built function) +
curl_download (in-built function)
research value

Le fichier fc_common.R contient les fonction suivantes :

Function nameDescription
get_token Manage acquisition of the token : first uses get_token_local, if it fails, uses get_token_server and the saves the token with write_token
get_token_local Reads the token from the local file
get_token_server Acquires a new token from the API-REST
write_token Saves in the local file the newly acquire token
define_computetime Date formating function
print_elapsed_time Function to print the time of a code part, with an argument for the text to be printed
pause_and_print Function to makes a break and print that it has done a break (used in the download functions, to handle cases where API-REST does temporary not answer, for example due to a manuel restart)
read.dst Function to read a .dst file and transform it into a structure usable in R
write.RSMcsv Function to export data in a CSV format readable by RS MINERVE (currently not used in the tools listed below)

Combi-Valais

Outil de spatialisation des pluies.

MINERVE-D3\Combi-Valais

Spatial_Temp [en développement]

Outil de spatialisatoin des températures.

MINERVE-D3\Spatial_Temp

Snow_Analyzer [en développement]

Outil pour calculer les coefficients degré-jour de fonte de neige, à partir soit du produit OSHD du SLF, soit de MODIS.

MINERVE-D3\Snow_Analyzer

Raster_gap_Analyzer

Outil pour identifier les valeurs manquantes sur un produit raster dans la BD MAYA.
Possible d'analyser plusieurs produits en même temps.

MINERVE-D3\Divers\Raster_gap_Analyzer

Raster_Additioner

Outil pour appliquer une fonction d'aggréation sur un produit raster sur une longue période (pas possible directement par l'API-REST).
Note : la fonction d'aggrégation est définie dans le fichier API-node.

MINERVE-D3\Divers\Raster_Additioner

Raster_to_CSVR [En développement par javflu]

Outil pour extraire les valeurs d'un produit de la BD MAYA sur une période, un extent et une résolution spatiale définie par l'utilisateur.
Démarche proposée :

  • Créer une fonction de lecture de données qui ne sauvegarde pas à chaque slot un fichier de données.
  • Créer une fonction get_coords_in_shp to define coordinates on which the function must loop.
MINERVE-D3\Divers\Raster_to_CSVR

Snow_Analyzer [A développer]

Outil pour l'assimilation de données en temps réel.

MINERVE-D3\Data_Assimilation

Améliorations / Tâches proposées

  • Créer un fichier global_param.ini qui contiendrait des paramêtres globaux utilisables par tous les outils. À placer dans le dossier \MINERVE-D3. Il fuadrait donc changer, pour les fonctions qui l'utiliseraient, la façon de créer l'objet 'config'
  • Fixer un temps maximum pour télécharger des données de l'API
  • Donner l'option de ne pas créer un fichier temp différent à chaque itération (argument write_temp=TRUE). Ceci devrait fixer le nom du tmp_file sans l'incrémenter
MINERVE-D3\Divers\Raster_to_CSVR

Computer configuration

In order to work properly, the code requires

  • An installation of curl in C:\opt\Curl
  • Jave 8 Update 171 (64-bit) installed on the machine
  • RS MINERVE (at least version 2.6.0.0) installed on the machine

Personne(s) de contact: alafoe

Autres projets: Crealp-Admin, Crealp-API, Crealp-Product, MINERVE-scripts, Ofev-CC, polhydro-pcr, RSDataset, RSMinerve, S.T.R.E.S.S, TeREsA, VIVA

Projets inactifs: MINERVE-bulletin, MINERVE-rest, MINERVE-www, SnowMapping, ToolMap 2