Title: | Download and Processing of Automatic Weather Stations (AWS) Data of INMET-Brazil |
---|---|
Description: | A compilation of functions to download and processing AWS data of INMET-Brazil, with the purpose of reference evapotranspiration (ETo) estimation. The package aims to make meteorological and agricultural data analysis more parsimonious. |
Authors: | Roberto Filgueiras [aut, cre] |
Maintainer: | Roberto Filgueiras <[email protected]> |
License: | GPL-3 |
Version: | 0.2.0 |
Built: | 2025-02-15 02:48:17 UTC |
Source: | https://github.com/filgueirasr/brazilmet |
This function will calculate the reference evapotranspiration (ETo) based on FAO-56 (Allen et al., 1998) with the automatic weather stations (AWS) data, downloaded and processed in function *daily_download_AWS_INMET*.
daily_eto_FAO56(lat, tmin, tmax, tmean, Rs, u2, Patm, RH_max, RH_min, z, date)
daily_eto_FAO56(lat, tmin, tmax, tmean, Rs, u2, Patm, RH_max, RH_min, z, date)
lat |
A numeric value of the Latitude of the AWS (decimal degrees). |
tmin |
A dataframe with Minimum daily air temperature (°C). |
tmax |
A dataframe with Maximum daily air temperature (°C). |
tmean |
A dataframe with Mean daily air temperature (°C). |
Rs |
A dataframe with mean daily solar radiation (MJ m-2 day-1). |
u2 |
A dataframe with Wind speed at two meters high (m s-2). |
Patm |
A dataframe with atmospheric Pressure (mB). |
RH_max |
A dataframe with Maximum relative humidity (percentage). |
RH_min |
A dataframe with Minimum relative humidity (percentage). |
z |
A numeric value of the altitude of AWS (m). |
date |
A data.frame with the date information (YYYY-MM-DD). |
Returns a data.frame with the AWS data requested
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: eto <- daily_eto_FAO56(lat, tmin, tmax, tmean, Rs, u2, Patm, RH_max, RH_min, z, date) ## End(Not run)
## Not run: eto <- daily_eto_FAO56(lat, tmin, tmax, tmean, Rs, u2, Patm, RH_max, RH_min, z, date) ## End(Not run)
This function will download the hourly AWS data of INMET and it will aggregate the data in a daily time scale, based on the period of time selected (start_date and end_date).The function only works for downloading data from the same year.
download_AWS_INMET_daily(station, start_date, end_date)
download_AWS_INMET_daily(station, start_date, end_date)
station |
The station code (ID - WMO code) for download. To see the station ID, please see the function *see_stations_info*. |
start_date |
Date that start the investigation, should be in the following format (1958-01-01 /Year-Month-Day) |
end_date |
Date that end the investigation, should be in the following format (2017-12-31 /Year-Month-Day) |
Returns a data.frame with the AWS data requested
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: df <- download_AWS_INMET_daily(station = "A001", start_date = "2001-01-01", end_date = "2001-12-31") ## End(Not run)
## Not run: df <- download_AWS_INMET_daily(station = "A001", start_date = "2001-01-01", end_date = "2001-12-31") ## End(Not run)
Actual vapour pressure (ea) derived from dewpoint temperature
ea_dew_calculation(tdew)
ea_dew_calculation(tdew)
tdew |
A dataframe with dewpoint temperature (°C). |
Returns a data.frame object with the ea from dewpoint data.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha.
## Not run: ea <-ea_dew_calculation(tdew). ## End(Not run)
## Not run: ea <-ea_dew_calculation(tdew). ## End(Not run)
Actual vapour pressure (ea) derived from relative humidity data
ea_rh_calculation(tmin, tmax, rh_min, rh_mean, rh_max)
ea_rh_calculation(tmin, tmax, rh_min, rh_mean, rh_max)
tmin |
A dataframe with minimum daily air temperature (°C) |
tmax |
A dataframe with maximum daily air temperature (°C) |
rh_min |
A dataframe with minimum daily relative air humidity (percentage). |
rh_mean |
A dataframe with mean daily relative air humidity (percentage). |
rh_max |
A dataframe with maximum daily relative air humidity (percentage). |
Returns a data.frame object with the with ea from relative humidity data.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: ea <- ea_rh_calculation(tmin, tmax, rh_min, rh_mean, rh_max) ## End(Not run)
## Not run: ea <- ea_rh_calculation(tmin, tmax, rh_min, rh_mean, rh_max) ## End(Not run)
Mean saturation vapour pressure (es)
es_calculation(tmin, tmax)
es_calculation(tmin, tmax)
tmin |
A dataframe with Minimum daily air temperature (°C). |
tmax |
A dataframe with Maximum daily air temperature (°C). |
Returns a data.frame object with the es data.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha.
## Not run: es <-es_calculation(tmin, tmax) ## End(Not run)
## Not run: es <-es_calculation(tmin, tmax) ## End(Not run)
Vapour pressure deficit (es - ea)
es_ea_calculation(tmin, tmax, tdew, rh_min, rh_mean, rh_max, ea_method)
es_ea_calculation(tmin, tmax, tdew, rh_min, rh_mean, rh_max, ea_method)
tmin |
A dataframe with minimum daily air temperature (°C). |
tmax |
A dataframe with maximum daily air temperature (°C). |
tdew |
A dataframe with dewpoint temperature (°C). |
rh_min |
A dataframe with minimum daily relative air humidity (percentage). |
rh_mean |
A dataframe with mean daily relative air humidity (percentage). |
rh_max |
A dataframe with maximum daily relative air humidity (percentage). |
ea_method |
The methodology to calculate the actual vapour pressure. Assume the "rh" (default) for relative humidity procedure and "dew" for dewpoint temperature procedure. |
Returns a data.frame object with the ea from relative humidity data.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: ea <- es_ea_calculation(tmin, tmax, tdew, rh_min, rh_mean, rh_max, ea_method) ## End(Not run)
## Not run: ea <- es_ea_calculation(tmin, tmax, tdew, rh_min, rh_mean, rh_max, ea_method) ## End(Not run)
Hargreaves - Samani ETo
eto_hs(tmin, tmean, tmax, ra)
eto_hs(tmin, tmean, tmax, ra)
tmin |
A dataframe with Maximum daily air temperature (°C) |
tmean |
A dataframe with Minimum daily air temperature (°C) |
tmax |
A dataframe with Maximum daily air temperature (°C) |
ra |
A dataframe of extraterrestrial radiation (MJ m-2 day-1) |
Returns a data.frame object with the ETo HS data
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: eto_hs <- eto_hs(tmin, tmean, tmax, ra) ## End(Not run)
## Not run: eto_hs <- eto_hs(tmin, tmean, tmax, ra) ## End(Not run)
Thorntwaite - Potential evapotranspiration
etp_thorntwaite(tmean)
etp_thorntwaite(tmean)
tmean |
A dataframe with Mean monthly air temperature (°C) |
Returns a data.frame object with the Thorntwaite ETp data
Roberto Filgueiras.
## Not run: etp <- etp_thorntwaite(tmean) ## End(Not run)
## Not run: etp <- etp_thorntwaite(tmean) ## End(Not run)
This function will download the hourly AWS data of INMET for whatever station of interest, based on the period of time selected (start_date and end_date) and station code. The limit acquisition in the same requisition for hourly data is one year.
hourly_weather_station_download(start_date, end_date, station)
hourly_weather_station_download(start_date, end_date, station)
start_date |
Date that start the investigation, should be in the following format (1958-01-01 /Year-Month-Day) |
end_date |
Date that end the investigation, should be in the following format (2017-12-31 /Year-Month-Day) |
station |
The station code (ID - WMO code) for download. To see the station ID, please see the function *see_stations_info*. |
Returns a data.frame with the AWS data requested
Roberto Filgueiras
## Not run: df <- hourly_weather_station_download( station = "A001", start_date = "2022-08-12", end_date = "2022-08-16") ## End(Not run)
## Not run: df <- hourly_weather_station_download( station = "A001", start_date = "2022-08-12", end_date = "2022-08-16") ## End(Not run)
Atmospheric pressure (Patm)
Patm(z)
Patm(z)
z |
Elevation above sea level (m) |
Returns a data.frame object with the atmospheric pressure calculated.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: Patm <- Patm(z) ## End(Not run)
## Not run: Patm <- Patm(z) ## End(Not run)
Psychrometric constant (kPa/°C) is calculated in this function.
psy_const(Patm)
psy_const(Patm)
Patm |
Atmospheric pressure (kPa) |
A data.frame object with the psychrometric constant calculated.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: psy_df <- psy_const(Patm) ## End(Not run)
## Not run: psy_df <- psy_const(Patm) ## End(Not run)
ra is expressed in MJ m-2 day-1
ra_calculation(latitude, date)
ra_calculation(latitude, date)
latitude |
A dataframe with latitude in decimal degrees that you want to calculate the ra. |
date |
A dataframe with the dates that you want to calculate the ra. |
A data.frame with the extraterrestrial radiation for daily periods
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: ra <- ra_calculation(latitude, date) ## End(Not run)
## Not run: ra <- ra_calculation(latitude, date) ## End(Not run)
Function to convert the radiation data. The conversion name can be understand as follow:
conversion_1 = MJ m-2 day-1 to J cm-2 day-1;
conversion_2 = MJ m-2 day-1 to cal cm-2 day-1;
conversion_3 = MJ m-2 day-1 to W m-2;
conversion_4 = MJ m-2 day-1 to mm day-1;
conversion_5 = cal cm-2 day-1 to MJ m-2 day-1;
conversion_6 = cal cm-2 day-1 to J cm-2 day-1;
conversion_7 = cal cm-2 day-1 to W m-2;
conversion_8 = cal cm-2 day-1 to mm day-1;
conversion_9 = W m-2 to MJ m-2 day-1;
conversion_10 = W m-2 to J cm-2 day-1;
conversion_11 = W m-2 to cal cm-2 day-1;
conversion_12 = W m-2 to mm day-1;
conversion_13 = mm day-1 to MJ m-2 day-1;
conversion_14 = mm day-1 to J cm-2 day-1;
conversion_15 = mm day-1 to cal cm-2 day-1;
conversion_16 = mm day-1 to W m-2.
radiation_conversion(data_to_convert, conversion_name)
radiation_conversion(data_to_convert, conversion_name)
data_to_convert |
A data.frame with radiation values to convert. |
conversion_name |
A character with the conversion_name summarize in the description of this function. |
A data.frame object wit the converted radiation.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: radiation_conversion_df <- radiation_conversion( data_to_convert = df$rad, conversion_name = "conversion_1" ) ## End(Not run)
## Not run: radiation_conversion_df <- radiation_conversion( data_to_convert = df$rad, conversion_name = "conversion_1" ) ## End(Not run)
Relative humidity is calculated in this function based on minimum air temperature of the day and the air temperature of the moment.
rh_calculation(tmin, tmean)
rh_calculation(tmin, tmean)
tmin |
A dataframe with minimum daily air temperature (°C) |
tmean |
A dataframe with mean air temperature (°C) that you want to calculate the relative humidity. |
A data.frame object with the relative humidity calculated
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: rh <- rh_calculation(tmin, tmean) ## End(Not run)
## Not run: rh <- rh_calculation(tmin, tmean) ## End(Not run)
The net radiation (MJ m-2 day-1) is the difference between the incoming net shortwave radiation (rns) and the outgoing net longwave radiation (rnl).
rn_calculation(rns, rnl)
rn_calculation(rns, rnl)
rns |
The incomimg net shortwave radiation (MJ m-2 day-1). |
rnl |
The outgoing net longwave radiation (MJ m-2 day-1). |
A data.frame object with the net radiation data.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: rn <- rn_calculation(rns, rnl) ## End(Not run)
## Not run: rn <- rn_calculation(rns, rnl) ## End(Not run)
Net outgoing longwave radiation is calculate with this function
rnl_calculation(tmin, tmax, ea, rs, rso)
rnl_calculation(tmin, tmax, ea, rs, rso)
tmin |
A dataframe with Minimum daily air temperature (°C) |
tmax |
A dataframe with Maximum daily air temperature (°C) |
ea |
A dataframe with the actual vapour pressure (KPa). |
rs |
A dataframe with the incomimg solar radiation (MJ m-2 day-1). |
rso |
A dataframe with the clear-sky radiation (MJ m-2 day-1) |
A data.frame object with the net longwave radiation.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: rnl_df <- rnl_calculation(tmin, tmax, ea, rs, rso) ## End(Not run)
## Not run: rnl_df <- rnl_calculation(tmin, tmax, ea, rs, rso) ## End(Not run)
The rns results form the balance between incoming and reflected solar radiation (MJ m-2 day-1).
rns_calculation(albedo, rs)
rns_calculation(albedo, rs)
albedo |
Albedo or canopy reflectance coefficient. The 0.23 is the value used for hypothetical grass reference crop (dimensionless). |
rs |
The incoming solar radiation (MJ m-2 day-1). |
A data.frame object with the net solar or net shortwave radiation data.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: ra <- rns_calculation(albedo, rs) ## End(Not run)
## Not run: ra <- rns_calculation(albedo, rs) ## End(Not run)
The solar radiation data is calculated based in a nearby weather station.
rs_nearby_calculation(rs_reg, ra_reg, ra)
rs_nearby_calculation(rs_reg, ra_reg, ra)
rs_reg |
A dataframe with the solar radiation at the regional location (MJ m-2 day-1). |
ra_reg |
A dataframe with the extraterrestrial radiation at the regional location (MJ m-2 day-1). |
ra |
A dataframe with the extraterrestrial radiation for daily periods (ra). |
A data.frame object with the Solar radiation data based on a nearby weather station
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: rs_nearby_df <- rs_nearby_calculation(rs_reg, ra_reg, ra) ## End(Not run)
## Not run: rs_nearby_df <- rs_nearby_calculation(rs_reg, ra_reg, ra) ## End(Not run)
Clear-sky solar radiation is calculated in this function for near sea level or when calibrated values for as and bs are available.
rso_calculation_1(as, bs, ra)
rso_calculation_1(as, bs, ra)
as |
A dataframe with latitude in decimal degrees that you want to calculate the ra. The values of as = 0.25 is recommended by Allen et al. (1998). |
bs |
A dataframe with the dates that you want to calculate the ra. The values of bs = 0.50 is recommended by Allen et al. (1998). |
ra |
Extraterrestrial radiation for daily periods (ra). |
A data.frame object with the clear-sky radiation data
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: rso_df <- rso_calculation_1(as, bs, ra) ## End(Not run)
## Not run: rso_df <- rso_calculation_1(as, bs, ra) ## End(Not run)
Clear-sky solar radiation is calculated in this function for near sea level or when calibrated values for as and bs are available.
rso_calculation_2(z, ra)
rso_calculation_2(z, ra)
z |
Station elevation above sea level (m) |
ra |
Extraterrestrial radiation for daily periods (ra). |
A data.frame object with the clear-sky solar radiation
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: rso_df <- rso_calculation_2(z, ra) ## End(Not run)
## Not run: rso_df <- rso_calculation_2(z, ra) ## End(Not run)
Function to see the localization of the automatic weather station of INMET.
see_stations_info()
see_stations_info()
A data.frame with informations of OMM code, latitude, longitude and altitude of all AWS stations available in INMET.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: see_stations_info() ## End(Not run)
## Not run: see_stations_info() ## End(Not run)
If global radiation is not measure at station, it can be estimated with this function.
sr_ang_calculation(latitude, date, n, as, bs)
sr_ang_calculation(latitude, date, n, as, bs)
latitude |
A dataframe with latitude in decimal degrees that you want to calculate the ra. |
date |
A dataframe with the dates that you want to calculate the ra. |
n |
The actual duration of sunshine. This variable is recorded with Campbell-Stokes sunshine recorder. |
as |
A dataframe with latitude in decimal degrees that you want to calculate the ra. The values of as = 0.25 is recommended by Allen et al. (1998). |
bs |
A dataframe with the dates that you want to calculate the ra. The values of bs = 0.50 is recommended by Allen et al. (1998). |
A data.frame object with solar radiation data
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: sr_ang <- sr_ang_calculation(latitude, date, n, as, bs) ## End(Not run)
## Not run: sr_ang <- sr_ang_calculation(latitude, date, n, as, bs) ## End(Not run)
If global radiation is not measure at station, it can be estimated with this function.
sr_tair_calculation(latitude, date, tmax, tmin, location_krs)
sr_tair_calculation(latitude, date, tmax, tmin, location_krs)
latitude |
A dataframe with latitude in decimal degrees that you want to calculate the ra. |
date |
A dataframe with the dates that you want to calculate the ra. |
tmax |
A dataframe with Maximum daily air temperature (°C) |
tmin |
A dataframe with Minimum daily air temperature (°C) |
location_krs |
Adjustment coefficient based in location. Please decide between "coastal or "interior". If coastal the krs will be 0.19, if interior the krs will be 0.16. |
A data.frame object with solar radiation data
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: sr_tair <- sr_tair_calculation(latitude, date, tmax, tmin, location_krs) ## End(Not run)
## Not run: sr_tair <- sr_tair_calculation(latitude, date, tmax, tmin, location_krs) ## End(Not run)
Wind speed at two meters high can be calculated with this function.
u2_calculation(uz, z)
u2_calculation(uz, z)
uz |
measured wind speed at z meters above ground surface |
z |
height of measurement above ground surface. |
A data.frame with the wind speed at 2 meters high calculated.
Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha
## Not run: u2_df <- u2_calculation(uz, z) ## End(Not run)
## Not run: u2_df <- u2_calculation(uz, z) ## End(Not run)