scan_to_raster: convert a polar scan into a raster

View source: R/scan_convert.R

scan_to_rasterR Documentation

convert a polar scan into a raster

Description

convert an object of class 'scan' into a raster of class 'RasterBrick'

Usage

scan_to_raster(
  scan,
  nx = 100,
  ny = 100,
  xlim,
  ylim,
  res = NA,
  param,
  raster = NA,
  lat,
  lon,
  crs = NA,
  k = 4/3,
  re = 6378,
  rp = 6357
)

Arguments

scan

a scan (sweep) of class scan

nx

number of raster pixels in the x (longitude) dimension

ny

number of raster pixels in the y (latitude) dimension

xlim

x (longitude) range

ylim

y (latitude) range

res

numeric vector of length 1 or 2 to set the resolution of the raster (see res). If this argument is used, arguments nx and ny are ignored. Unit is identical to xlim and ylim.

param

scan parameters to include. If NA include all scan parameters. Reducing the number of scan parameters speeds up evaluation.

raster

(optional) RasterLayer with a CRS. When specified this raster topology is used for the output, and nx, ny, res arguments are ignored.

lat

Geodetic latitude of the radar in degrees. If missing taken from scan.

lon

Geodetic longitude of the radar in degrees. If missing taken from scan.

crs

character or object of class CRS. PROJ.4 type description of a Coordinate Reference System (map projection). When 'NA' (default), an azimuthal equidistant projection with origin at the radar location is used. To use a WSG84 (lat,lon) projection, use crs="+proj=longlat +datum=WGS84"

k

Numeric. Standard refraction coefficient.

re

Numeric. Earth equatorial radius, in km.

rp

Numeric. Earth polar radius, in km.

Details

uses scan_to_spatial to georeference the scan's pixels. If multiple scan pixels fall within the same raster pixel, the last added pixel is given (see rasterize for details).

Value

a RasterBrick

Examples


# default projects full extent on 100x100 pixel raster:
scan_to_raster(example_scan)

# crop the scan and project at a resolution of 0.1 degree:
scan_to_raster(example_scan, ylim = c(55, 57), xlim = c(12, 13), res = .1)

# using a template raster
template_raster <- raster::raster(raster::extent(12, 13, 56, 58), crs = sp::CRS("+proj=longlat"))
scan_to_raster(example_scan, raster = template_raster)


adokter/birdRad documentation built on Nov. 5, 2024, 10:27 p.m.