noaa-onms / cinms

Channel Islands National Marine Sanctuary
https://noaa-onms.github.io/cinms
MIT License
3 stars 1 forks source link

Chlorophyll data raising problems #48

Closed superjai closed 4 years ago

superjai commented 4 years ago

So, I am attempting to redo the new SST graph (showing standard deviation and average for entire sanctuary) for the chlorophyll data. Unfortunately, it isn't working due to some funny file naming error in the chlorophyll data. I created a script to reproduce the error, with the script just reproducing most of the ply2erddap function. If you just run the entire script, you will hopefully see my errors, with the script being here.

The problem is in line 63, which produces the following error:

 [1] "vobjtovarid4: error #F: I could not find the requsted var (or dimvar) in the file!"
 [1] "var (or dimvar) name: coord_ref"
 [1] "file name: /Users/jai/Library/Caches/R/rerddap/e93f320f7d59040b4824d520e998c936.nc"

Not sure what is going on here, because data is being pulled, as can be seen from the following plot of the chlorophyll data (line 66). Screen Shot 2020-09-11 at 11 26 23 AM

bbest commented 4 years ago

This lack of coord_ref dimension seems related to a disparity between SST and Chl netcdf's.

I was previously able to read Chl raster from erddap in the P2P project here (note: currently commented):

https://github.com/marinebon/p2p/blob/ab4d4a48ed5f08d8639f5368333025e9a1879579/site_template.Rmd#L118-L120

https://github.com/marinebon/p2p/blob/ab4d4a48ed5f08d8639f5368333025e9a1879579/functions.R#L34-L36

superjai commented 4 years ago

Issue fixed by changing how chlorophyll dataset is handled in ply2erddap function located in nm4r/spatial.r