imd_rainfall_point: Download and process IMD rainfall for a single point (nearest...

View source: R/imd_core.R

IMDRainfallPointR Documentation

Download and process IMD rainfall for a single point (nearest grid cell)

Description

Extracts the daily rainfall series for the IMD grid cell that is nearest to a (lat, lon) point. For each year, the function reads only that one cell from the disk. Thus, this function is the method with the lowest cost to get a long series for one location.

Usage

IMDRainfallPoint(...)

imd_rainfall_point(
  request_id,
  start_year,
  end_year,
  latitude,
  longitude,
  resolution = 0.25,
  frequency = "daily",
  save_raw = FALSE,
  output_dir = tempdir(),
  use_cache = TRUE
)

Arguments

...

Arguments that the aliases send to the primary function.

request_id

Unique identifier for the request.

start_year

Start year (1901-2024).

end_year

End year (1901-2024).

latitude

Latitude of the point.

longitude

Longitude of the point.

resolution

Spatial resolution: 0.25 or 1.0 degrees (default: 0.25).

frequency

Temporal frequency: "daily", "monthly", "yearly" (default: "daily").

save_raw

If TRUE, keep the raw downloaded files (default: FALSE).

output_dir

Directory for the output files (default: tempdir()).

use_cache

If TRUE, use the cached data when it is available (default: TRUE).

Value

data.frame with the rainfall series of the nearest cell.

Examples


powai <- tryCatch(
  imd_rainfall_point("powai", 2023, 2023, 19.1277, 72.9047,
    resolution = 1, use_cache = FALSE
  ),
  error = function(e) message("IMD server unavailable: ", conditionMessage(e))
)


varunayan documentation built on Oct. 30, 2026, 1:07 a.m.