convert an object of class 'scan' into a raster of class 'RasterBrick'
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 )
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 |
param | scan parameters to include. If |
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 |
lon | Geodetic longitude of the radar in degrees. If missing taken from |
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 | Standard refraction coefficient. |
re | Earth equatorial radius in km. |
rp | Earth polar radius in km. |
a RasterBrick
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).
# default projects full extent on 100x100 pixel raster: scan_to_raster(example_scan)#> class : RasterBrick #> dimensions : 100, 100, 10000, 5 (nrow, ncol, ncell, nlayers) #> resolution : 4796.962, 4796.962 (x, y) #> extent : -239848.1, 239848.1, -239848.1, 239848.1 (xmin, xmax, ymin, ymax) #> crs : +proj=aeqd +lat_0=56.3675003051758 +lon_0=12.8516998291016 +units=m +ellps=WGS84 #> source : memory #> names : VRADH, DBZH, ZDR, RHOHV, PHIDP #> min values : -21.43643, -12.00000, -15.90588, 0.02680, -178.58824 #> max values : 20.684274, 32.000000, 7.905883, 0.999300, 178.588244 #># 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)#> class : RasterBrick #> dimensions : 20, 10, 200, 5 (nrow, ncol, ncell, nlayers) #> resolution : 0.1, 0.1 (x, y) #> extent : 12, 13, 55, 57 (xmin, xmax, ymin, ymax) #> crs : +proj=aeqd +lat_0=56.3675003051758 +lon_0=12.8516998291016 +units=m +ellps=WGS84 #> source : memory #> names : VRADH, DBZH, ZDR, RHOHV, PHIDP #> min values : -0.1880389, NA, -0.7529409, 0.9254000, -103.7647040 #> max values : 0.3760777, NA, 0.6588239, 0.9951000, -27.5294080 #># 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)#> class : RasterBrick #> dimensions : 10, 10, 100, 5 (nrow, ncol, ncell, nlayers) #> resolution : 0.1, 0.2 (x, y) #> extent : 12, 13, 56, 58 (xmin, xmax, ymin, ymax) #> crs : +proj=longlat +ellps=WGS84 #> source : memory #> names : VRADH, DBZH, ZDR, RHOHV, PHIDP #> min values : -20.684274, -8.000000, -9.882353, 0.078400, -161.647058 #> max values : 14.478992, 18.000000, 7.905883, 0.952100, 147.529420 #>