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 VIIRS EDR AOD quality filter flag #674

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion polar2grid/readers/viirs_edr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"""
from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
from argparse import ArgumentParser, _ArgumentGroup, BooleanOptionalAction
from typing import Optional

from satpy import DataQuery
Expand Down Expand Up @@ -149,4 +149,26 @@ def add_reader_argument_groups(
if group is None:
group = parser.add_argument_group(title="VIIRS EDR Reader")

group.add_argument(
"--filter-veg",
action=BooleanOptionalAction,
default=True,
help="Filter vegetation index variables by various quality flags. Default is enabled.",
)
group.add_argument(
"--aod-qc-filter",
default=1,
Copy link
Member Author

Choose a reason for hiding this comment

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

Default is 1 like you mentioned in the related issue @kathys so that should include medium and high quality data. If that sounds good to you then I'll merge this. Oh...except I'll need to make sure the Satpy PR is merged first.

type=_int_or_none,
choices=[None, 0, 1, 2, 3],
help="Filter AOD550 variable by QCAll variable. Value specifies the maximum "
"quality to include (0-high, 1-medium, 2-low, 3-no retrieval). Defaults to "
"1 which means medium and high quality data are included.",
)

return group, None


def _int_or_none(value: str) -> None | int:
if value.lower() == "none":
return None
return int(value)