read_imd_rainfall_cropped: Read only the bbox area of an IMD rainfall NetCDF file (fast...

View source: R/imd_processing.R

read_imd_rainfall_croppedR Documentation

Read only the bbox area of an IMD rainfall NetCDF file (fast path)

Description

Reads only the spatial hyperslab that contains bbox directly from the disk with ncvar_get(start, count). The function does not read the full national grid into memory and then filter it. For a small region and many years, this method is orders of magnitude faster. It also uses much less memory (GB -> MB, minutes -> seconds).

Usage

read_imd_rainfall_cropped(file_path, year, bbox)

Arguments

file_path

Path to the IMD NetCDF rainfall file.

year

Year of the data (for the date axis).

bbox

Named numeric vector or list with north, south, east, and west.

Value

data.frame with columns date, latitude, longitude, rainfall.


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