Some models use -180 -> 190, and some use 0 -> 360, and which is appropriate depends on what part of the world one is interested in.
A start in this that will handle many (most>) cases was done in: #46
But we left that with a bit more that can be done -- summarized here:
We can determine with coordinate system the user wants, by looking at the BB provided. (It could be indeterminate (i.e. all lons between 0 and 180, but then it wouldn't matter).
We know the coordinate system the model uses
So:
1) Translate the user's supplied BB into the coords the model uses
2) Do the subset
3) Translate the results back into the coords the user requested.
When in doubt, default to -180--180
Raise an error if the result is empty. (we want any anyway just to catch mistakes)
Raise an error (I think,maybe warning???) if the user asks for what would be a disjoin result, e.g.
model domain: 0--360, thus a discontinuity at 0
BB -20, 20 -- thus overlapping the discontinuity
The question is whether to raise an error or return a disjoint result, so the user can fix it themselves later.
Some models use -180 -> 190, and some use 0 -> 360, and which is appropriate depends on what part of the world one is interested in.
A start in this that will handle many (most>) cases was done in: #46
But we left that with a bit more that can be done -- summarized here:
We can determine with coordinate system the user wants, by looking at the BB provided. (It could be indeterminate (i.e. all lons between 0 and 180, but then it wouldn't matter).
We know the coordinate system the model uses
So:
1) Translate the user's supplied BB into the coords the model uses 2) Do the subset 3) Translate the results back into the coords the user requested.
When in doubt, default to -180--180
Raise an error if the result is empty. (we want any anyway just to catch mistakes)
Raise an error (I think,maybe warning???) if the user asks for what would be a disjoin result, e.g.
The question is whether to raise an error or return a disjoint result, so the user can fix it themselves later.