Make ens and time dimensions specific to variable being called. #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change ensemble and time indices to be set according to the variable being queried rather than be fixed.
Description
ens_idx and time_idx were previously fixed by default to
but some variables have different lengths of time dimension. Now both indices are set based on the value range of the specific variable. In addition,
ens_idx
andtime_idx
were depreciated in favor ofens
andtime
, which allow the user to specify the values rather than the indices. This conforms to how the other dimension values (latitude and longitude) are set.Tests are also included to check that the new values are correctly set, that indices out of bounds return an informative error, and that indices override values if both are set (i.e. if
time = c(6,12)
andtime_idx = 1:3
, the query will return timesc(6,12,18)
that correspond to time indices1:3
).Related Issue
Fixes #320