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

[Feature]: Shape file capablity for mean climate #1083

Open
lee1043 opened this issue Apr 25, 2024 · 3 comments
Open

[Feature]: Shape file capablity for mean climate #1083

lee1043 opened this issue Apr 25, 2024 · 3 comments

Comments

@lee1043
Copy link
Contributor

lee1043 commented Apr 25, 2024

Is your feature request related to a problem?

Capability to apply shape file for mean climate metrics calculation.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@lee1043
Copy link
Contributor Author

lee1043 commented Apr 25, 2024

@acordonez I recall you have implemented the shape file capability, could you point how this task could be initiated?

@acordonez
Copy link
Collaborator

@lee1043 The function is here: https://github.com/PCMDI/pcmdi_metrics/blob/main/pcmdi_metrics/io/region_from_file.py

It's a good idea to apply the shape file to all data files used, including things like the land/sea mask.

For an example of how to apply it, you can look at my edits to the precip variability code:
Parameters needed:

P.add_argument(
"--region_file",
dest="region_file",
help="File containing vector region of interest.",
default=None,
)
P.add_argument(
"--feature", dest="feature", help="Feature in vectorized region.", default=None
)
P.add_argument(
"--attr",
dest="attr",
help="Attribute containing feature in vectorized region.",
default=None,
)

Function call:
rgtmp_ds = region_from_file(rgtmp_ds, fshp, attr, feature)

@lee1043
Copy link
Contributor Author

lee1043 commented Apr 25, 2024

@acordonez thank you for the information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants