-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding stereographic subset #263
base: main
Are you sure you want to change the base?
Conversation
e72b349
to
c089ad9
Compare
c6c9768
to
18980f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the code maybe I would get rid the words latitude and longitude altogether (except for input, "latlon" to know the type of grid, and the longitude modulus)
Exception raised when using longitude and latitude subset is not available | ||
for original grid datasets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implicitely this says that for some originalGrid dataset longitude and latitude is available sometimes
class XYNotAvailableInNonOriginalGridDatasets(Exception): | ||
""" | ||
Exception raised when using x and y subset is not available for non-original grid | ||
datasets. | ||
Please make sure the dataset part is 'originalGrid' when using x and y subset. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate it haha:
Isn't it weird that when the user wants stereographic data it has to make two actions: change the way to define the bounding box and also choose the part? since those two actions are necessary and if you miss one it throws an error
@@ -148,23 +148,29 @@ def _get_best_arco_service_type( | |||
dataset_subset: DatasetTimeAndSpaceSubset, | |||
dataset_url: str, | |||
username: Optional[str], | |||
dataset_version_part_name: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part_name
enough maybe?
if ( | ||
"x" not in coordinates_name_and_axis.keys() | ||
): # assume they will come together | ||
coordinates_name_and_axis["y"] = "not_defined" | ||
coordinates_name_and_axis["x"] = "not_defined" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quite confusing tbh
geographical_parameters = GeographicalParameters( | ||
latitude_parameters=LatitudeParameters( | ||
minimum_latitude=subset_request.minimum_latitude, | ||
maximum_latitude=subset_request.maximum_latitude, | ||
name=coordinates_name_and_axis["y"], | ||
axis=1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it an int? I feel like from before it was named x,y,z,t maybe clearer to keep it this way?
axis: int = 0 | ||
|
||
|
||
@dataclass | ||
class LongitudeParameters: | ||
minimum_longitude: Optional[float] = None | ||
maximum_longitude: Optional[float] = None | ||
name: str = "longitude" | ||
axis: int = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The numbers don't seem to match with the download_arco_series.py
file: 1 and 2 vs 0 and 1
@@ -151,56 +152,56 @@ def _nearest_selection( | |||
|
|||
def _dataset_custom_sel( | |||
dataset: xarray.Dataset, | |||
coord_type: Literal["latitude", "longitude", "depth", "time"], | |||
coord_type: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it's not a coord_type
but a coordinate_name
or coordinate_label
now
return dataset | ||
|
||
|
||
def _x_subset( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be a way to mix _x_subset
, _y_subset
and longitude_subset
, latitude_subset
even for the longitude it's a bit more complicated
Let's try to add a way to do subset also for datasets which have stereographic (in general, original) projections.
To do:
-x
and-y
also work for originalGrid Datasets📚 Documentation preview 📚: https://copernicusmarine--263.org.readthedocs.build/en/263/