mcglinnlab / shark-ray-div

Global patterns of shark and ray diversity
0 stars 1 forks source link

setting up chlorophyll data #27

Closed dmcglinn closed 2 years ago

dmcglinn commented 6 years ago

In the script "./scripts/rasterize_polygons.R" we convert the chlorophyll raster to a polygon to use the function spTransform to reproject it but there is the function projectRaster which provides a direct solution without converting first to polygons to carry this calculation out. Specifically all we need is:

chloro <- raster('./data/Environment/MY1DMM_CHLORA_2017-06-01_rgb_360x180.TIFF')
cholor_ras = projectRaster(chloro, oceans_raster)

Where oceans_raster is a raster object that is already in projected in the manner we wish to use for all of our rasters in the analysis.

@EmmalineSheahan I know you're cleaning this code up so can you please introduce this change?

EmmalineSheahan commented 6 years ago

Yup no problem