I am using satellite data to look at light levels in the surface ocean. (any data from here works as im just trying to understand how to open and work with the data)
In the code below, I saved all the nc files in a folder on my desktop then imported it all under files
then started a loop to open the file.
Is there a way to 1) crop the data extent(-180, -176, -40, -36)
then 2) extract the lat, Lon and par values? Im guessing that there is multiple depths available, but I dont know how to check that.
library(raster)
setwd("/Users/AquaModis_PAR")
nc.data<-list()
files<-list.files(pattern = ".nc",full.names=TRUE)
df=NULL
for(i in seq_along(files)) {
par[i] = brick(files[i], stopIfNotEqualSpaced = FALSE, varname = "par")
}