-
Notifications
You must be signed in to change notification settings - Fork 5
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/viirs aod smoke dust #1550
base: develop
Are you sure you want to change the base?
Conversation
…affected observations
… for clarity. 2.) Renamed variable conf_mask in flag_confidence_lvl() to inv_conf_mask to make clear that it is the inverse of a mask rather than a mask. 3.) Placed flag_confidence_lvl() diagnostic output block in if block (not run by default) instead of leaving it in as a comment block (perhaps this diagnostic prinout block should just be removed, though).
…more general set of original AOD output filenames
* Previously the program derived the ADP filename from the AOD filename, but it assumed the files were stored in a certain directory structure * Previously, --adp_mask was a boolean CLI argument * Now ADP filename(s) specified by user via CLI argument --adp_mask=<file or files>
* Fixed variable name for ADP filenames * Added output of filenames currently being processed * Made --adp_mask filename specification accept multiple filenames (and made it produce a list of strings instead of a string)
* Argument parser help messages made clearer * Also for clarity, argument --adp_qc_lvl, variable adp_qc_lvl, and attribute AOD.adp_qc_lvl renamed to --adp_conf_lvl, adp_conf_lvl, and AOD.adp_conf_lvl, respectively * README updated with usage information for the smoke and dust processing
src/compo/viirs_aod2ioda.py
Outdated
@@ -13,10 +13,57 @@ | |||
import numpy as np | |||
import os | |||
|
|||
import glob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that import, it was left over from an earlier way of creating the list of ADP files. I have removed it in the newest commit 5161a8b.
src/compo/viirs_aod2ioda.py
Outdated
@@ -13,10 +13,57 @@ | |||
import numpy as np | |||
import os | |||
|
|||
import glob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this imported module is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that import, it was left over from an earlier way of creating the list of ADP files. I have removed it in the newest commit 5161a8b.
qcall_dust = qcall_dust[mask_thin_dust] | ||
obs_time_dust = obs_time_dust[mask_thin_dust] | ||
|
||
# calculate and store ob errors | ||
# defined surface type and uncertainty | ||
if self.method == "nesdis": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scripts looks only support the method of "nesdis". If it is not "nesdis", the variable "errs" become undefined. If so, please update the document mentioning that this script only support nesdis product. The zero observation error could cause some issues in assimilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @ytangnoaa. Based on the documentation, it looks like when that method selection conditional was added there was supposed to be an else block that set the errors to zero if the nesdis method wasn't specified with -m/--method. So the current documentation is incorrect regarding the default behavior.
I could add in the missing else block to set the errors to zero, but given that both undefined and zero error values could cause problems during DA, I would propose changing the default behavior to use the nesdis method and then updating the documentation accordingly. That way the method option will remain available at the command line for existing scripts that call the code using that option, but the ability to use a method other than nesdis will be gone unless additional methods are added in later. If you think anyone may for some reason be using the converter with the expectation of it following the current default of leaving the error values undefined, though, then I will just update the documentation.
For clarity, the options I see are:
1.) Leave the code as is, update the documentation to note that the default behavior leaves the error values undefined and is not recommended.
2.) Add in the else block to set the error values to zero for the default case to match the behavior stated in the current documentation, but also update the documentation to note that the default zero error values may cause problems.
3.) Change the default value for the -m/--method argument from none to nesdis and update the documentation to note that the nesdis method is the only method currently available, but the argument remains available for ease of possible future expansion (and for current backward compatibility).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this information. Since this script is only tested with the nesdis product, the option 3) looks more reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a default option that do make sense and should avoid creating strictly 0 errors. This WILL cause problems in data assimilation. The data assimilaiton code will crash. So we should modify the code (the if statement in question here) to avoid creating zeros as errors and make sure that we can only use the nesdis option or whatever allowed options we could have in the future.
Ok with solution 3. And update the the help argument to something that is not confusing: for example: obs error calculation method available: nesdis, user must specify it or the converter won't work
.
Thanks
simplify code for changing case of conf_lvl in function flag_by_confidence_lvl Co-authored-by: Cory Martin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this new capability.
print('Processing the following AOD and ADP files:') | ||
print(f) | ||
print(self.adp_mask[n]) | ||
print() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure you remove unnecessary print statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jeromebarre , I was wondering if I would need to create a test for this. Also, sorry for the slow reply, I was out on vacation last week.
Regarding the test, would it be preferred for me to expand the current test that exists for this IODA converter, or should I add a new, separate test to cover the new functionality?
Regarding the print statements, I had added those just before opening the PR as I thought it may be good for users to have a log of what files were processed, but I've got no problem removing those if that is unneccessary or unwanted.
(edited to add a user tag, as I'm unsure if reply notifications are sent if that isn't done)
@BlakeJAllen-NOAA are you familiar with how to add a ctest? here is an example of a new converter (it just added a yaml file to use the but you add a small sample input file to |
Thanks, Benjamin, it's good to have an example of adding a ctest. I haven't added any before, but it looks like the process is fairly well documented and plus there is the earlier test of this converter's functionality that I can follow in addition to the info that is in the PR you linked. I'll be busy with other things the next couple of days, but hopefully I will have an chance to work on this later this week. |
@BlakeJAllen-NOAA shall we work on this PR.. this week? if you have a sample data file, can show the next steps.... Just send an email a short meeting will likely wrap this up. |
Thanks @BenjaminRuston for the support on this. If need be you can add me on the meeting just as optional, not sure I'll be able to make it. |
@BlakeJAllen-NOAA I'm going to put this into draft mode as well as then you can do many updates and pushes to the repository and not kick off a bunch of regression tests once we think it's ready, then will remove from draft mode, and run the CI |
fixed typo Co-authored-by: Benjamin Ruston <[email protected]>
--adp_mask testinput/JRR-ADP_v3r2_j01_s20240110T202044Z_e20240110T202044Z.sample.nc | ||
--adp_conf_lvl 'medhigh' | ||
-o testrun/obs.20240110T202044Z_PT1M_aod.nc | ||
-m nesdis | ||
-k maskout | ||
-n 0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would advise modifying the code and simplify these, making a few more transparent -n
should not have a shorthand and be --thinning_distance (option) and should have a default of 0.0.... the -k
should be a logical switch, the adp_conf_level
again spelled out a bit more adp_confidence_level
and should default to 'medhigh'
and then does not need to be present in the call. I can't think of a more verbose name for the --adp_mask
but think it too should be more explicit. And the help message should spell out the ADP acronym and have two section describing separately how to run for just AOD, and then how to run for ADP.
At this point OK doing 2 ctests one checking smoke and the other dust; however, this could be done via optional flag requiring two call to the converter
--adp_mask testinput/JRR-ADP_v3r2_j01_s20240110T202044Z_e20240110T202044Z.sample.nc | |
--adp_conf_lvl 'medhigh' | |
-o testrun/obs.20240110T202044Z_PT1M_aod.nc | |
-m nesdis | |
-k maskout | |
-n 0.0" | |
--adp_mask testinput/JRR-ADP_v3r2_j01_s20240110T202044Z_e20240110T202044Z.sample.nc | |
-o testrun/obs.20240110T202044Z_PT1M_aod.nc | |
--apply_mask" |
@CoryMartin-NOAA are you using this ? @BlakeJAllen-NOAA any plans to continue to pursue this? |
@BenjaminRuston this is for the 'simplified' smoke/dust system developed mainly by GSL, so I'm aware but EMC is not actively using it |
@BlakeJAllen-NOAA, Could you please prioritize finishing this PR? It's important to avoid leaving relatively straightforward PRs like this one unresolved for an extended period. We appreciate your contributions and your responsibility in seeing this through. However, if it's not completed soon, we may need to close it without merging into the develop branch. Thanks! |
Description
The VIIRS AOD Converter has been modified to add the ability to identify smoke- and dust-affected AOD observations and output them in separate IODA files. This processing uses information contained in Aerosol Data Product (ADP) files that are distributed as a companion dataset for each VIIRS AOD granule. The smoke and dust processing feature is initially needed for use with the RRFS Smoke/Dust model.
The list and description of changes to enable the new functionality is somewhat long, but I will provide it if it would be helpful for the code review.
Issue(s) addressed
N/A
Dependencies
None
Impact
Expected impact on downstream repositories:
None. Converter behavior should not change if new smoke and dust processing capability is not activated using --adp_mask CLI argument
Checklist