I ran into this scenario. Here is the setup (from pydap
)
# EXTRACT single time snapshot of SST data
$ from import pydap.client import url
$ url = "http://test.opendap.org/opendap/hyrax/data/nc/sst.mnmean.nc.gz?lat[0:1:88],lon[0:1:179],time[0],sst[0][0:1:88][0:1:179]"
$ dataset = open_url(url) # DAP2 constraint
$ dataset['sst'].shape
>>> (1, 89, 180)
Now I want to further select a spatial region bounded by the range:
\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; \left( 206 \leq Lon \leq 210\right) \times \left( 56 \leq Lat \leq 62\right)
To accomplish it I do:
$ newdataset = dataset.functions.geogrid('sst', 62,206,56,210)
$ newdataset.shape
>>> (1857, 4, 3)
The resulting time dimensions matches that of the original dataset, as if there was no initial Constraint Expression (as defined in URL above).
Q1. Will geogrid() by default disregard any other previous selection?
Q2. Can one combine a Constraint Expression that looks like this:
proj_1,proj_2&ServerSideFunction(args)
For example,
http://test.opendap.org/opendap/hyrax/data/nc/sst.mnmean.nc.gz?lat[0:1:88],lon[0:1:179],time[0],sst[0][0:1:88][0:1:179]&geogrid('sst', 62,206,56,210)"
It would be great if something like this worked: a SSF that is applied to the dataset resulting from the Constraint Expression.
I think Q2 can be easily addressed from the client side (e.g. pydap), but I would like to know if there is an elegant way to accomplish this from the server side.
Thanks!