rmendels / rerddapXtracto

xtractomactic using rerddap
Other
14 stars 4 forks source link

[rxtracto] does it work with datasets that has bounds like 0-01-15 #30

Closed khammami closed 2 years ago

khammami commented 2 years ago

Hello @rmendels Lately, I have been trying to extract some data from different datasets using your package. I was working like a charms till I've faced this dataset: http://apdrc.soest.hawaii.edu/erddap/griddap/hawaii_soest_b43f_3192_f51e.html

First I've got a bounds error as the boundaries of the dataset contain zero as year. So I've tried to adapt my date to that format so I got this time the following error

Error in req_time_index[i] <- which.min(abs(udtTime - temp_time)) : replacement has length zero

So I'm wondering if rxtracto is developed to extract data from this kind of datasets?

rmendels commented 2 years ago

@khammami Thanks for the input. That dataset is a climatology. At the moment, none of the functions in 'rerddapXtracto' are designed to work with climatologies. That is why you are getting the errors. It is possible I could add that capability, but it would be low on my priority list.

khammami commented 2 years ago

Thanks for the quick response and for the clarification.

It would be a great addition here to extract data from climatology datasets through ERDDAP

rmendels commented 2 years ago

@khammami - I am re-opening this because while my scripts do not work with climatologies, the 'rerddap' package does. The following is a silly script due to the choice of lat-lon, but it does work:

myURL <- 'http://apdrc.soest.hawaii.edu/erddap/'
myInfo <- info('hawaii_soest_b43f_3192_f51e', url = myURL)
test <- griddap( myInfo,
                            latitude = c(30, 40),
                           longitude = c(240, 250),
                           time = c('0000-01-15T00', '0000-02-15T00'),
                           fields = 'mld')

HTH

khammami commented 2 years ago

Thanks @rmendels I really appreciate your help.

I'm already using it, but the Hawaii server sometime doesn't respond (404 & 500 errors) so I've downloaded the netcdf file manually to do the extraction.