rmendels / rerddapXtracto

xtractomactic using rerddap
Other
14 stars 4 forks source link

using data that has 0000-01-16- 0000-12-16 time range #32

Closed emmakb closed 10 months ago

emmakb commented 10 months ago

Hi Roy,

I am trying to use the salinity data from this erddap grid https://upwell.pfeg.noaa.gov/erddap/info/noaa_psl_ce4e_561b_d306/index.html and combine it to my species distribution data.

When I use pHInfo<-rerddap::info('noaa_psl_ce4e_561b_d306') I get the proper output that looks like this:

noaa_psl_ce4e_561b_d306 Base URL: https://upwell.pfeg.noaa.gov/erddap Dataset Type: griddap Dimensions (range): time: (0001-01-01T00:00:00Z, 0001-12-01T00:00:00Z) depth: (0.0, 1000.0) latitude: (-89.5, 89.5) longitude: (0.5, 359.5) Variables: salt: Range: 0.0, 47.369995 Units: g/kg However, since the time dimension of the dataset is in that format, when I try to join my species data to my environmental data using "phWYOY<- rxtracto(pHInfo, parameter = "salt", xcoord = xposw4, ycoord = yposw4, tcoord = tposw4, zcoord = zposw4, xlen = xlen, ylen = ylen, zName = "depth")" I get the following error message: [1] "dimension coordinate out of bounds" [1] "dimension name: time" [1] "given coordinate bounds 2016-08-23 11:14:03 2019-05-21 15:28:29" [1] "ERDDAP datasets bounds 0001-01-01 0001-12-01" [1] "Coordinates out of dataset bounds - see messages above" Is there anyway for me to fix this? Any tips are much appreciated since it seems that all the salinity data that I could potentially use has this format :/ Thank you, Emma
rmendels commented 10 months ago

@emmakb My first guess is that you are misunderstanding the dataset. It is a monthly climatology, and following CF conventions times are given by 0001-01-01T00:00:00Z and the like. You are likely passing actual times, and 'rxtracto()' rightly caught your error. If you tell me the time period of you your data, I may be able to point you to a better source.

emmakb commented 10 months ago

oh okay - thank you! The time period of the data is 2013-01-04 to 2022-06-28.

rmendels commented 10 months ago

@emmakb I forgot to ask, are you after surface salinity or at depth? The latter may be problematic.

emmakb commented 10 months ago

Surface, and I should specify that my species are distributed in the North Atlantic so that spatial range as well.

rmendels commented 10 months ago

@emmakb You have a choice of a daily salinity:

https://coastwatch.pfeg.noaa.gov/erddap/griddap/coastwatchSMOSv662SSS1day.graph

or 3-day which will be less sparse:

https://coastwatch.pfeg.noaa.gov/erddap/griddap/coastwatchSMOSv662SSS3day.graph

These should work properly with 'rxtracto()'

emmakb commented 10 months ago

Thank you so much!