Skip to content
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

added primitive match return function to CDMS reader #260

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

alovett-COAPS
Copy link

Fulfils requirement from SDAP-470- adding in functionality to cdms_reader.py to return matches in an alternate, simplified format

  • returns primary to secondary match information in format "matches[m][0-8]", where m is the match and indices 0-8 represent all associated primary and secondary data for that match
  • for users who attempt to use the "assemble_matches" function directly, this function can be used instead to obtain match information in a different format.

sec_lat.append(float(secondary.lat[int(y)].values))
sec_time.append(float(secondary.time[int(y)].values))
sec_speed.append(float(secondary.wind_speed[int(y)].values))
sec_dir.append(float(secondary.wind_to_direction[int(y)].values))
Copy link
Contributor

Choose a reason for hiding this comment

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

@alovett-COAPS This change to the reader appears to be specific just for the primary = sst and secondary = wind use case. This reader should be generic to support any variable(s). In the use case where secondary is an in situ source there can be also be multiple variables returned.

Copy link
Author

@alovett-COAPS alovett-COAPS left a comment

Choose a reason for hiding this comment

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

Updated function to support more use cases than just the wind-sst matchup, updated documentation to reflect changes.

@@ -14,7 +14,7 @@ Imported packages:
* csv
* collections
* logging
* xarray
Copy link
Contributor

Choose a reason for hiding this comment

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

@alovett-COAPS It appears xarray isn't used at all in cdms_reader.py so I think we should remove it as a dependency.

@ngachung ngachung self-requested a review November 17, 2023 22:08
ngachung
ngachung previously approved these changes Nov 17, 2023
Copy link
Contributor

@ngachung ngachung left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks Amanda!

@ngachung ngachung changed the base branch from master to develop January 19, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants