Published October 18, 2022 | Version v1
Software Open

FixYourRain

  • 1. Centre of Hydrogeology of University of Málaga
  • 2. IGME-CSIC

Description

Aim

"FixYourRain" is a simple tool, built under free R code, whith main goal to facilitate the organization of precipitation data downloaded or requested from the Spanish Meteorological Agency (AEMET).

Data Source

Precipitation data sets requested from AEMET (https://www.aemet.es/es/portada).

Motivation

The daily precipitation data provided by AEMET is delivered in a file/spreadsheet where each day of the month occupies a different column in a spreadsheet. Ususally, the users, for treatment or analysis, organize the data with daily dates continuously, and each AEMET rain gauge occupying a column. Runing "FixYourRain" tool, make possible to carry out these changes of format with a minimum investment of time and zero cost of economic resources.

 

HOW TO USE IT

1. Organize input data

  • Create a CSV in your Spreadsheet program or download the sample file (precipitation_to_fix.csv).

  • Copy and paste the original data according to the following columns:

Column 1 (INDICATIVO): the name of the rain gauge must not begin with a number. It is convenient to rename those stations that start their code with a number using the Excel “concatenate” tool (or the similar tool in the software you are using) and adding a letter before the station name.

Columns 2 and 3 (ANO and MES):refers to the year and month of measurement.

Columns from 4 to 34: contains the information of RAIN GAUGES from AEMET, day 1 to 31. (Note: do not fill the gaps in days 29,30 or 31 when are empty).

2. Download and Install R y RStudio

3. Download the script from this repository

  • Download the script of this repository and save it on a known directory.
  • Both, the script and input data must be on the same directory.

4. Start RStudio and run the script

  • Start the script FixYourRain: File > OpenFile and select FixYourRain.R
  • Before running the script, change the directory of your files at row 12 > setwd C:/Users/miequipo/Documents/ *(read below)

*Be sure that the link use this separator “/” and no “\”

  • Run the script
  • Output data could be found on selected directory as a .csv file.

5. Check output data

Take in account the output data have been transformated following these chenges:

  • Data relocated in columns.
  • Units changed: from tenths of mm to mm.
  • Negative data have been replace by 0.

6. Treat output data to be able to explore and explote it

Remember to check decimal separators on your settings (periods or commas). Also you can replace it masivement on Notepad.

Files

FixYourRain_SpanishGuide.pdf

Files (184.4 kB)

Name Size Download all
md5:a9db43acd5de8248d843c9eb27ca3686
2.7 kB Download
md5:9d772682a587a5dfdc92318396214b32
178.2 kB Preview Download
md5:e42257b13c82adcfdf31386f3b21ce39
1.1 kB Preview Download
md5:8c08b9cce3e2bbfd7c88b879079251a5
2.4 kB Preview Download

Additional details