Missing data/ 0 value for Chl-a on 180 degree meridian (Oceanmap)

34 Views Asked by At

My first querstion here, fantastic community.

I have a slight issue projecting some chl-a data across the 180 meridian (Fiji), using Oceanmap package. I can do this in GIS but would like to be able to produce these results in R. Please see below for code and images. Basically when I project a larger frame of the area I want to display the data projects perfectly, however when I zoom in closer to Fiji which is really what I want, I get a white line (0 value I assume) across the 180 meridian. Is this a coordinate projection issue and the stitching now working at such resolution?

library(oceanmap) library(ncdf4) library(raster) library(viridis)

chl.win <- ('~/Desktop/A20200812020172.L3m_SNSP_CHL_chlor_a_4km.nc')

chl.dat <- nc_open(chl.win)

chl.dat.raster <- nc2raster(chl.dat, "chlor_a", lonname="lon", latname="lat", date=T)

chl.flip <- flip(chl.dat.raster, "y") chl.360 <- shift(raster::rotate(shift(chl.flip, 180)), 180)

chl.360.crop = raster::crop(chl.360, extent(c(176, 183, -19.8, -15.5)))

vpal <- viridis(100, alpha = 1, begin = 0, end = 1, option = "mako")

v(chl.360.crop, cbpos = "r", pal = "jet", zlim = c(0,1), cb.xlab = expression("Chlorophyll-a (mg m"^-3*")"), bwd = 0, grid = F, replace.na = F, Save = T, plotname = "First_Quarter_2020", fileformat = "png", width = 12, height = 6)

Image showing white line on 180 meridian

0

There are 0 best solutions below