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

Add domain_query option #280

Merged
merged 9 commits into from
Oct 4, 2024
Merged

Conversation

blychs
Copy link
Collaborator

@blychs blychs commented Sep 25, 2024

Solves Issue #278 .
As suggested by @rschwant , adds optional keyword "domain_query".
To avoid breaking old code, sets the default value for "domain_query" as True.
EDIT: I forgot to mention: I have tested this with airnow_wrfchem.ipynb, adding False domain_query and giorgi and EPA regions.

Cheers
Pablo

Copy link
Collaborator

@zmoon zmoon left a comment

Choose a reason for hiding this comment

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

I think the proposed config format (domain_query=False) is kind of confusing. In a sense it's still a query, just based on automatic lat/lon box. To me this feels more like a "domain query" than the original using site metadata already present in the dataframe.

Also, the Giorgi regions actually are rectangles so that's fine. But I would be skeptical about suggesting people use the EPA region rectangles, which are pretty rough estimates.

I have a little project for assigning to precise EPA regions. But it uses GeoPandas which is a heavy dependency.

melodies_monet/driver.py Outdated Show resolved Hide resolved
melodies_monet/driver.py Outdated Show resolved Hide resolved
@rschwant
Copy link
Collaborator

@zmoon, should we call it something else then?

domain_metadata=True (default, use metadata from observation file to determine domain)
domain_metadata=False (use build in features in MONETIO to determine metadata since it is not provided?)

Open to other options too?

@zmoon
Copy link
Collaborator

zmoon commented Sep 26, 2024

should we call it something else then?

I feel it could be done just with domain_type with a special syntax. For example

  • domain_type: auto-region:giorgi -- select on the fly using the rectangles (this PR method)
  • domain_type: giorgi_region -- current behavior, using column giorgi_region in the dataframe

@rschwant
Copy link
Collaborator

I like this method too. This may be easier to explain in the docs too.

@blychs
Copy link
Collaborator Author

blychs commented Sep 26, 2024

OK, I'll try to add that now.

Co-authored-by: Zachary Moon <zmoon92@gmail.com>
@blychs
Copy link
Collaborator Author

blychs commented Sep 26, 2024

I think the proposed config format (domain_query=False) is kind of confusing. In a sense it's still a query, just based on automatic lat/lon box. To me this feels more like a "domain query" than the original using site metadata already present in the dataframe.

Also, the Giorgi regions actually are rectangles so that's fine. But I would skeptical about suggesting people use the EPA region rectangles, which are pretty rough estimates.

I have a little project for assigning to precise EPA regions. But it uses GeoPandas which is a heavy dependency.

If we end up adding optional regionmask, that would include geopandas as a requirement.

melodies_monet/driver.py Outdated Show resolved Hide resolved
Co-authored-by: Zachary Moon <zmoon92@gmail.com>
@blychs
Copy link
Collaborator Author

blychs commented Oct 2, 2024

If anyone (probably @zmoon or @rschwant) could review this, we can accept it while creating a new issue to update it to something more robust in the future, as suggested by Zach.

@zmoon
Copy link
Collaborator

zmoon commented Oct 2, 2024

@blychs do you want to mention these new option in the docs YAML section?

@blychs
Copy link
Collaborator Author

blychs commented Oct 2, 2024

I don't understand the failed tests... I don't believe I changed any of that?

docs/appendix/yaml.rst Outdated Show resolved Hide resolved
Co-authored-by: Zachary Moon <zmoon92@gmail.com>
@blychs
Copy link
Collaborator Author

blychs commented Oct 2, 2024

@zmoon One of the tests is failing because it does not find noaa https://www.ncdc.noaa.gov/crn/ . Is it just out or does that link require updates?

@rschwant
Copy link
Collaborator

rschwant commented Oct 2, 2024

We are linking to data that normally is stable, but is located at the Asheville office, so it's likely that the recent hurricane took down some of their servers. Let's see if it's back up and running tomorrow and go from there. We can re-run the checks then.

@zmoon
Copy link
Collaborator

zmoon commented Oct 2, 2024

It seems the NCEI/NCDC websites are still having issues: https://www.ncei.noaa.gov/node/6696

@rschwant
Copy link
Collaborator

rschwant commented Oct 4, 2024

@zmoon do you approve this now, since you have looked at this closer than me? If so, I will merge without the checks passing as it might take NOAA awhile to fix the servers in Asheville.

docs/appendix/yaml.rst Outdated Show resolved Hide resolved
@zmoon
Copy link
Collaborator

zmoon commented Oct 4, 2024

@blychs were you able to test that it seems to work?

blychs and others added 2 commits October 4, 2024 09:43
@blychs
Copy link
Collaborator Author

blychs commented Oct 4, 2024

Wait, something is wrong. Nothing breaks (I had tested it) but it seems to not be doing anything. I'll fix it right away.

@blychs
Copy link
Collaborator Author

blychs commented Oct 4, 2024

OK, it was in effect being skipped. I had tested it with the airnow_wrfchem example, nothing broke, and I was happy with it.
Now it should be fine. I just tested it with that example, running it with and without auto-region:epa and auto-region:giorgi.
I don't have an aircraft example though.
We were not supporting anything like this for satellite before. This might work for it but I haven't tested it.

@rschwant rschwant merged commit 57e5b7e into NOAA-CSL:develop Oct 4, 2024
1 of 4 checks passed
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