Skip to content

Conversation

sudha-murthy
Copy link
Contributor

Description

-SMAP L3 collections do not have CF compliance. No dimension arrays or cos are present. This update enables spatial subsetting for 3D variables . The 3D dimensions are configured in hoss_config.json

Jira Issue ID

DAS-2238

Local Test Steps

PR Acceptance Checklist

  • [X ] Jira ticket acceptance criteria met.
  • [ X] CHANGELOG.md updated to include high level summary of PR changes.
  • [X ] docker/service_version.txt updated if publishing a release.
  • [ X] Tests added/updated and passing.
  • Documentation updated (if needed).

):
dimension_array_names = get_dimension_array_names(varinfo, variable_name)
dimension_array_names = get_dimension_array_names_from_coordinates(
varinfo, variable_name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says if variable does not have coordinates (len = 0) but the code now will be get_dimension_arraay_names_coordinates ? I think a better name is get_default_dimension_names

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the variable itself is a coordinate. So we are using the coordinate to name it. Will update the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated comment - b9d3fe6

Copy link

@D-Auty D-Auty Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that the logic here still confuses me, and yes coordinates have coordinates - so that is a bit confusing. So...
# Given variable has coordinates: use latitude coordinate to define variable spatial dimensions.
# Given variable variable has no coordinate attribute itself, but is itself a coordinate (latitude or longitude): use as a coordinate

In both cases above - function should be: create_dimension_array_names_for_coorrdinate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated - 7614f4c

Copy link
Contributor

@joeyschultz joeyschultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to review unit tests and run the test instructions. In addition to my comments so far, we need to update docker/service_version.txt to v1.1.3

@joeyschultz
Copy link
Contributor

Overall, the changes look good! All unit tests and the harmony-in-a-box test passed. Once my minor comments are resolved I should be able to approve this.

class InvalidDimensionNames(CustomError):
"""This exception is raised when the granule file included in the input
request is not the nominal dimension order which is 'y,x'.
Copy link

@D-Auty D-Auty Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a cloned comment that I suspect is not accurate. It is the same description as the next exception UnsupportedDimensionOrder. I can't tell if this exception is referenced anywhere. One search shows it used in coordinate_utilities.py line 160, but that line, when I look in that file, shows a different exception raised???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. I copied over the function and missed to update the comment.

updated - 7614f4c

):
dimension_array_names = get_dimension_array_names(varinfo, variable_name)
dimension_array_names = get_dimension_array_names_from_coordinates(
varinfo, variable_name
Copy link

@D-Auty D-Auty Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that the logic here still confuses me, and yes coordinates have coordinates - so that is a bit confusing. So...
# Given variable has coordinates: use latitude coordinate to define variable spatial dimensions.
# Given variable variable has no coordinate attribute itself, but is itself a coordinate (latitude or longitude): use as a coordinate

In both cases above - function should be: create_dimension_array_names_for_coorrdinate.

if len(dimension_names) >= 2:
return dimension_names

# getting dimension names from coordinates
Copy link

@D-Auty D-Auty Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# creating dimension names from coordinates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated - 7614f4c

@sudha-murthy
Copy link
Contributor Author

@D-Auty @joeyschultz - I think all the changes have been updated. Let me know if anything is still missing

Copy link

@D-Auty D-Auty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the updates, Sudha.



def get_dimension_array_names(varinfo: VarInfoFromDmr, variable_name: str) -> str:
def get_dimension_array_names_from_coordinates(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`def create_dimension_array_names_for_coorrdinate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated - 601344d

…to create_spatial_dimension_names_from_coordinates
@sudha-murthy sudha-murthy merged commit 212fda9 into main Jan 31, 2025
4 checks passed
@sudha-murthy sudha-murthy deleted the DAS-2238 branch January 31, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants