I'm a graduate student working with your MODIS data, specifically Chlorophyll a. I want to convert these data into a different geographic coordinate system, but I'm having trouble finding what the existing coordinate system is. I can't seem to find the information in the metadata of the netCDF file, nor do I see it online.
I see that the coordinate system on the https://worldview.earthdata.nasa.gov/ site is EPSG:4326 (and this is the portal I used to download the MODIS data). However, the latitude and longitude coordinates of the Chlorophyll a data -- listed in the metadata under var as navigation_data/longitude & navigation_data/latitude -- do not match EPSG:4326. My evidence of this is that I've plotted the MODIS Aqua data with a coastline layer, where the coastline layer is defined as EPSG:4326 . . . while the coastline layer matches the coordinates from your worldview.earthdata site, it is clearly offset from the MODIS coordinate system (please see attached figure, where the Chlorophyll a data from the Channel Islands of the southern California coast are visible in the middle of California).
Can someone please let me know what the geographic coordinate system of the MODIS Chlorophyll a data is so that I can convert it to EPSG:4326? I apologize if I'm missing something quite obvious here . . .
Thank you, I very much appreciate any assistance!
- mismatch between coast and chlorophyll layer
- chlor_mismatch.png (59.97 KiB) Not viewed yet
I downloaded LV2 data, specifically: T2020165192000.L2_LAC_OC.nc, and I am using R to visualize Chlorophyll_a data around the Channel Islands off the southern coast of California, specifically around San Nicolas Island.
I see from this post that the MODIS data do not have a built in geographic coordinate system, and instead have latitude and longitude coordinates based on GPS and reference WDS84 datum (https://oceancolor.gsfc.nasa.gov/forum/ ... l?tid=6660)
However, I am still confused because while the latitude and longitude coordinates within the data file above align properly, the Chlorophyll_a do not seem to align with those lat / long coordinates. For example, in the attached figure I plot the full extent of the LV2 data referenced above, and then add a coastlines layer. I add blue lines to designate San Nicolas Island and the lines indicate that the LV2 latitude / longitude coordinates are spot on (as they're centered on the small island). And yet, the Chlorophyll_a data are not consistent with these latitude / longitude coordinates?
I next called this exact data file in SeaDAS, add 1km GSHHS borders, and lo and behold everything aligns.
So, my question: why are the Chlorophyll_a data not aligned with their own internal latitude / longitude coordinates when I create this raster in R??
Minimal code for how I'm pulling information from the .nc file:
nc_data <- nc_open("T2020165192000.L2_LAC_OC.nc")
chlor <- ncvar_get(nc_data, "geophysical_data/chlor_a")
lat <- as.data.frame(ncvar_get(nc_data, "navigation_data/latitude"))
long <- as.data.frame(ncvar_get(nc_data, "navigation_data/longitude"))
p1 <- raster(t(chlor),
I'm sure I'm missing something obvious . . . I'm new to working with these data, so I appreciate any help!!
- SeaDAS_aligned.png (297.98 KiB) Not viewed yet
- LV2_coastlines.png (76.04 KiB) Not viewed yet
While the Level-2 product includes a lat/lon for each pixel, it is not mapped. Looks like R is assuming a regular grid based on the geographic extents of the file. The data are very much NOT on a regular grid. Perhaps for your R processing you'll want to map the data prior to reading them (or at least plotting them).
BTW, out of curiosity, where did you get a file named T2020165192000.L2_LAC_OC.nc? That name suggests from the OB.DAAC, but MODIS-Terra at19:20:00 on day 165 of 2020 was imaging at night...over Somalia...so, no chlorophyll product would have been produced for it...and it's quite far from San Nicolas Is.
Thank you very much for your reply. Yes, you are spot on -- I was treating the data as if they were mapped. I also posted this question to GIS StackExchange, and was able to get some assistance: https://gis.stackexchange.com/questions ... 712#400712
As you can see in the attached figure, we're now mapped properly to San Nicolas Island.
And re: your question about the data, I must confess I made a slight typo: the actual data file is T2020165182000.L2_LAC_OC.nc (the 8 to the left was erroneously a 9 in my previous post!). Just in case, here's where I downloaded the data: https://search.earthdata.nasa.gov/searc ... !1!0!0%2C2
Again, thank you very much for your response!
- Chlorophyll data mapped to SNI
- fourRegions.png (13.67 KiB) Not viewed yet