inmet_monthly() aggregates
inmet_daily() output into monthly values per station (mean
and absolute extremes of temperature, precipitation and rain days,
humidity, wind, radiation), with a min_days completeness
rule.
inmet_et0() adds the FAO-56 Penman-Monteith
reference evapotranspiration (et0_mm) to daily data; it
reproduces the FAO-56 worked example 18. With
method = "hargreaves" it needs only temperature, and
estimate_radiation = TRUE fills missing radiation from the
temperature range. inmet_design_et0() gives the design
value (a percentile, by default 0.8) per group.
inmet_pet_thornthwaite() adds monthly potential
evapotranspiration from temperature, and
inmet_water_balance() computes the Thornthwaite-Mather soil
water balance (storage, actual evapotranspiration, deficit and
excess).
inmet_fill() fills short gaps of hourly or daily
data by linear interpolation and the rest with the typical value of the
day of the year, marking every filled value in
<variable>_filled. Rainfall and wind direction cannot
be filled.
inmet_indices() computes yearly or monthly climate
indices from daily data (ETCCDI-style temperature and precipitation
indices, dry and wet spells, growing degree days),
inmet_spi() the Standardized Precipitation Index, and
inmet_normals() and inmet_anomaly()
climatological normals and anomalies.
inmet_nearest() accepts many locations at once (for
example, municipality centroids), inmet_stations_within()
selects the stations inside a bounding box or an sf polygon, and
inmet_interpolate() estimates a variable at other locations
by inverse-distance weighting.
plot() draws rmet_hourly,
rmet_daily and rmet_monthly data, and
inmet_convert_radiation() converts between radiation
units.
inmet_derive() adds vapour pressure, vapour pressure
deficit, wind components (wind_u_ms,
wind_v_ms) and the heat index to hourly data, ignoring
values flagged by inmet_qc().
inmet_availability() lists the stations and periods
in the cached archives from the file names alone, without reading any
data.
inmet_cache_dir() gives the default cache directory,
which can now be changed for a whole session with
options(rmet.cache_dir = ) or the environment variable
RMET_CACHE_DIR. All dest_dir and
cache_dir arguments use it by default.
The results of inmet_read(),
inmet_get(), inmet_daily() and
inmet_monthly() have the classes rmet_hourly,
rmet_daily and rmet_monthly (all also
rmet_data and data.frame), with a compact
print(), a summary() per station and
as.data.frame(). They remain ordinary data frames, and the
example dataset has the new class.
New vignette: “Monthly Values, Evapotranspiration and Derived Variables”.
inmet_daily(), inmet_qc() and
inmet_completeness() return an empty result for the empty
data frame that inmet_read() and inmet_get()
give when no data is found, instead of failing with a message about
datetime.inmet_nearest() reports stations without coordinates
that it ignores.inmet_stations(); in 0.2.0 it was used offline, with
source = "bundled", and in examples. It is now a snapshot
of the official catalogue (669 stations, all columns), regenerated from
the INMET API by data-raw/stations.R, and tests check it
against known stations. Results obtained from the old catalogue should
be re-checked.start_date and end_date were one
day early: the API timestamps (e.g. 2000-09-21T21:00-03:00)
were truncated instead of converted. They are now UTC calendar dates
(2000-09-22 for A801).rmet_example was built with rmet
0.1.0 and had the dew-point extremes in the temp_max_c and
temp_min_c columns, and timestamps in Sao Paulo time. It
has been regenerated with the current parser (UTC timestamps,
temp_dew_max_c and temp_dew_min_c).inmet_read() output is now sorted by station code and
time.station_name was NA for files whose header
reads ESTAC?O:, a damaged spelling present in INMET’s 2019
archive.04-01-2020 as year 4.inmet_download() (and inmet_get()) now check
the server version of these archives and download updates
(check_updates = TRUE).as.Date(datetime), i.e. UTC days, and daily extremes from
instantaneous temperatures. It now uses inmet_daily().inmet_daily() builds daily summaries per station and
local day: maximum and minimum temperature from the previous-hour
extremes, means, totals, gusts and radiation, with a
min_hours completeness rule and an n_hours
column. By default (tz = "auto") each station uses its own
local time.inmet_qc() flags implausible hourly values: out of
physical range, internally inconsistent, isolated spikes, and stuck
sensors. Flags are stored in <variable>_flag columns
(or the values removed), summarised in the qc_summary
attribute, and respected by inmet_daily() and
inmet_completeness().inmet_completeness() reports the percentage of valid
hours per station and month or year.inmet_timezone() returns the historical local time zone
of Brazilian stations; inmet_stations() gains a
time_zone column.inmet_nearest() finds the stations closest to a
location.inmet_as_sf() converts stations or data to
sf points (requires the suggested package sf).inmet_read() and inmet_get() gain
drop_empty; FALSE keeps hours in which every
measurement is missing.inmet_extract() gains stations to extract
only some station files.inmet_cache_status() reports when each archive was
downloaded.double (some were
integer before).validate.R, parse.R,
read.R, download.R, stations.R,
daily.R, qc.R, completeness.R,
timezone.R, spatial.R and
cache.R, with comments on the INMET format.
utils.R was removed.inmet_get() as the recommended one-call
download-and-read workflow.inmet_stations() can now retrieve and cache the
complete official INMET automatic-station catalogue. New filters cover
operational status and provider entity; a bundled catalogue remains
available as an offline fallback.start_date,
end_date, status, entity,
wsi_code, and oscar_code. The existing
start_year column is retained."America/Sao_Paulo" to "UTC". INMET historical
files record UTC, while Brazilian stations span multiple time zones.
Users can still request any Olson time zone explicitly.2400 UTC timestamps and explicit
warnings for unparseable timestamps..part files, resume interrupted transfers,
validate ZIP structure, and only then publish the final archive.install.packages("rmet") the primary installation
instruction.