Package 'BrazilMet'

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] , Luan P. Venancio [aut] , Catariny C. Aleman [aut] , Fernando F. da Cunha [aut]
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

Help Index


Eto calculation based on FAO-56 Penman-Monteith methodology, with data from automatic weather stations (AWS) downloaded and processed in function *daily_download_AWS_INMET*

Description

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*.

Usage

daily_eto_FAO56(lat, tmin, tmax, tmean, Rs, u2, Patm, RH_max, RH_min, z, date)

Arguments

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).

Value

Returns a data.frame with the AWS data requested

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
eto <- daily_eto_FAO56(lat, tmin, tmax, tmean, Rs, u2, Patm, RH_max, RH_min, z, date)

## End(Not run)

Download of hourly data from automatic weather stations (AWS) of INMET-Brazil in daily aggregates

Description

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.

Usage

download_AWS_INMET_daily(station, start_date, end_date)

Arguments

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)

Value

Returns a data.frame with the AWS data requested

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## 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

Description

Actual vapour pressure (ea) derived from dewpoint temperature

Usage

ea_dew_calculation(tdew)

Arguments

tdew

A dataframe with dewpoint temperature (°C).

Value

Returns a data.frame object with the ea from dewpoint data.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha.

Examples

## Not run: 
ea <-ea_dew_calculation(tdew).

## End(Not run)

Actual vapour pressure (ea) derived from relative humidity data

Description

Actual vapour pressure (ea) derived from relative humidity data

Usage

ea_rh_calculation(tmin, tmax, rh_min, rh_mean, rh_max)

Arguments

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).

Value

Returns a data.frame object with the with ea from relative humidity data.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
ea <- ea_rh_calculation(tmin, tmax, rh_min, rh_mean, rh_max)

## End(Not run)

Mean saturation vapour pressure (es)

Description

Mean saturation vapour pressure (es)

Usage

es_calculation(tmin, tmax)

Arguments

tmin

A dataframe with Minimum daily air temperature (°C).

tmax

A dataframe with Maximum daily air temperature (°C).

Value

Returns a data.frame object with the es data.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha.

Examples

## Not run: 
es <-es_calculation(tmin, tmax)

## End(Not run)

Vapour pressure deficit (es - ea)

Description

Vapour pressure deficit (es - ea)

Usage

es_ea_calculation(tmin, tmax, tdew, rh_min, rh_mean, rh_max, ea_method)

Arguments

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.

Value

Returns a data.frame object with the ea from relative humidity data.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
ea <- es_ea_calculation(tmin, tmax, tdew, rh_min, rh_mean, rh_max, ea_method)

## End(Not run)

Hargreaves - Samani ETo

Description

Hargreaves - Samani ETo

Usage

eto_hs(tmin, tmean, tmax, ra)

Arguments

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)

Value

Returns a data.frame object with the ETo HS data

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
eto_hs <- eto_hs(tmin, tmean, tmax, ra)

## End(Not run)

Thorntwaite - Potential evapotranspiration

Description

Thorntwaite - Potential evapotranspiration

Usage

etp_thorntwaite(tmean)

Arguments

tmean

A dataframe with Mean monthly air temperature (°C)

Value

Returns a data.frame object with the Thorntwaite ETp data

Author(s)

Roberto Filgueiras.

Examples

## Not run: 
etp <- etp_thorntwaite(tmean)

## End(Not run)

Download of hourly data from automatic weather stations (AWS) of INMET-Brazil

Description

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.

Usage

hourly_weather_station_download(start_date, end_date, station)

Arguments

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*.

Value

Returns a data.frame with the AWS data requested

Author(s)

Roberto Filgueiras

Examples

## 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)

Description

Atmospheric pressure (Patm)

Usage

Patm(z)

Arguments

z

Elevation above sea level (m)

Value

Returns a data.frame object with the atmospheric pressure calculated.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
Patm <- Patm(z)

## End(Not run)

Psychrometric constant

Description

Psychrometric constant (kPa/°C) is calculated in this function.

Usage

psy_const(Patm)

Arguments

Patm

Atmospheric pressure (kPa)

Value

A data.frame object with the psychrometric constant calculated.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
psy_df <- psy_const(Patm)

## End(Not run)

Extraterrestrial radiation for daily periods (ra)

Description

ra is expressed in MJ m-2 day-1

Usage

ra_calculation(latitude, date)

Arguments

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.

Value

A data.frame with the extraterrestrial radiation for daily periods

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
ra <- ra_calculation(latitude, date)

## End(Not run)

Conversion factors for radiation

Description

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.

Usage

radiation_conversion(data_to_convert, conversion_name)

Arguments

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.

Value

A data.frame object wit the converted radiation.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
radiation_conversion_df <- radiation_conversion(
  data_to_convert = df$rad,
  conversion_name = "conversion_1"
)

## End(Not run)

Relative humidity (rh) calculation

Description

Relative humidity is calculated in this function based on minimum air temperature of the day and the air temperature of the moment.

Usage

rh_calculation(tmin, tmean)

Arguments

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.

Value

A data.frame object with the relative humidity calculated

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
rh <- rh_calculation(tmin, tmean)

## End(Not run)

Net radiation (rn)

Description

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).

Usage

rn_calculation(rns, rnl)

Arguments

rns

The incomimg net shortwave radiation (MJ m-2 day-1).

rnl

The outgoing net longwave radiation (MJ m-2 day-1).

Value

A data.frame object with the net radiation data.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
rn <- rn_calculation(rns, rnl)

## End(Not run)

Net longwave radiation (rnl)

Description

Net outgoing longwave radiation is calculate with this function

Usage

rnl_calculation(tmin, tmax, ea, rs, rso)

Arguments

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)

Value

A data.frame object with the net longwave radiation.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
rnl_df <- rnl_calculation(tmin, tmax, ea, rs, rso)

## End(Not run)

Net solar or net shortwave radiation (rns)

Description

The rns results form the balance between incoming and reflected solar radiation (MJ m-2 day-1).

Usage

rns_calculation(albedo, rs)

Arguments

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).

Value

A data.frame object with the net solar or net shortwave radiation data.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
ra <- rns_calculation(albedo, rs)

## End(Not run)

Solar radiation data from a nearby weather station

Description

The solar radiation data is calculated based in a nearby weather station.

Usage

rs_nearby_calculation(rs_reg, ra_reg, ra)

Arguments

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).

Value

A data.frame object with the Solar radiation data based on a nearby weather station

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
rs_nearby_df <- rs_nearby_calculation(rs_reg, ra_reg, ra)

## End(Not run)

Clear-sky solar radiation with calibrated values available

Description

Clear-sky solar radiation is calculated in this function for near sea level or when calibrated values for as and bs are available.

Usage

rso_calculation_1(as, bs, ra)

Arguments

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).

Value

A data.frame object with the clear-sky radiation data

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
rso_df <- rso_calculation_1(as, bs, ra)

## End(Not run)

Clear-sky solar radiation when calibrated values are not available

Description

Clear-sky solar radiation is calculated in this function for near sea level or when calibrated values for as and bs are available.

Usage

rso_calculation_2(z, ra)

Arguments

z

Station elevation above sea level (m)

ra

Extraterrestrial radiation for daily periods (ra).

Value

A data.frame object with the clear-sky solar radiation

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
rso_df <- rso_calculation_2(z, ra)

## End(Not run)

Localization of the automatic weather station of INMET

Description

Function to see the localization of the automatic weather station of INMET.

Usage

see_stations_info()

Value

A data.frame with informations of OMM code, latitude, longitude and altitude of all AWS stations available in INMET.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
see_stations_info()

## End(Not run)

Solar radiation based in Angstrom formula (sr_ang)

Description

If global radiation is not measure at station, it can be estimated with this function.

Usage

sr_ang_calculation(latitude, date, n, as, bs)

Arguments

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).

Value

A data.frame object with solar radiation data

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
sr_ang <- sr_ang_calculation(latitude, date, n, as, bs)

## End(Not run)

Solar radiation data derived from air temperature differences

Description

If global radiation is not measure at station, it can be estimated with this function.

Usage

sr_tair_calculation(latitude, date, tmax, tmin, location_krs)

Arguments

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.

Value

A data.frame object with solar radiation data

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
sr_tair <- sr_tair_calculation(latitude, date, tmax, tmin, location_krs)

## End(Not run)

Wind speed at 2 meters high

Description

Wind speed at two meters high can be calculated with this function.

Usage

u2_calculation(uz, z)

Arguments

uz

measured wind speed at z meters above ground surface

z

height of measurement above ground surface.

Value

A data.frame with the wind speed at 2 meters high calculated.

Author(s)

Roberto Filgueiras, Luan P. Venancio, Catariny C. Aleman and Fernando F. da Cunha

Examples

## Not run: 
u2_df <- u2_calculation(uz, z)

## End(Not run)