← Back to all sparks
M

metR

INFRA · APIS
Velocity0.0

Tools for Easier Analysis of Meteorological Fields

A meteorology ggplot2 extension where the netCDF reader became the main event

meteorologyggplot2r-packagenetcdfdata-visualizationclimate-data
Current state
metR supplies meteorological and oceanographic tools for R: contour and streamline geoms, EOF decomposition, wave fitting, and ReadNetCDF() for getting gridded data in. Development has concentrated heavily on that reader. Version 0.18.0 added subsetting by dimension index, so the first or last ten timesteps can be read without knowing how many exist; 0.18.1 moved time parsing to the CFtime package; 0.18.2 added cdo operations through rcdo and reading across multiple files in parallel, and fixed a subsetting bug where nearest-gridpoint matching could return data outside the requested range entirely.
Where it's heading
Two threads run through the releases. The first is tracking ggplot2, absorbing the linewidth aesthetic, the trans to transform rename and guide compatibility as each landed upstream. The second is narrowing scope while deepening the data path: GetSMNData() was made defunct as too specific for a general package, raster and gdal dependencies were removed, and the udunits2 dependency was dropped when it was orphaned, initially replaced by a homebrewed date parser and eventually by CFtime. The result is a package steadily shedding its own code in favour of specialised upstream libraries.
Prediction
Expect further ReadNetCDF() work, since it has received features in four of the last five releases and the rcdo integration opens a large surface of operations to expose.

Recent moves

  1. 7mo ago

    Subset notation fix in the netCDF reader

    A single fix to I() notation handling in ReadNetCDF() subsetting. A patch closing an edge case in the feature area that has absorbed most of this package's recent work.

    View source ↗
  2. 11mo ago

    cdo operations, parallel multi-file reads, and a subsetting correctness fix

    Brings cdo operations into ReadNetCDF() via rcdo and adds reading across multiple files, optionally in parallel, which moves the reader closer to a data pipeline than a loader. The subsetting fix is the consequential part: requested ranges were resolved to the nearest gridpoint, so asking for 90S to 20S could return data north of it, and could fail badly when a file held nothing inside the range.

    View source ↗
  3. 1y ago

    netCDF time parsing handed to the CFtime package

    Replaces in-house time axis parsing with CFtime and adds ParseNetCDFtime() as a standalone helper. The maintainer flags it as potentially breaking with a candid note that times are weird, which is the correct posture given the package once had to write its own parser when udunits2 was orphaned.

    View source ↗
  4. 1y ago

    netCDF subsetting by dimension index

    Lets ReadNetCDF() subset on dimension indices rather than values, so the first or last N timesteps can be requested without knowing the file's date range or length. A small change that removes a common two-step read-then-read-again pattern.

    View source ↗
  5. 1y ago

    Longitude scales pass the transform argument correctly

    A one-line fix so longitude scales forward trans and transform properly. Published one minute before 0.18.0, making the two effectively a single release.

    View source ↗
  6. 1y ago

    EOF rotation takes a function, and scope narrows

    Opens EOF() rotation to any user-supplied function rather than a fixed varimax, with the boolean form deprecated. The breaking changes are the more telling half: GetSMNData() is made defunct as a hard-to-maintain hack outside the scope of a general package, and scale_mag() is rebuilt on standard continuous scale machinery rather than its own.

    View source ↗