Add qartod and config - #48
Conversation
|
I added qartod.py inside the esdglider folder, and I added qartod-config.yml in esdglider/data. Also, I messed up my branch name because I've been working with Quarto a lot, so the branch should've been qartod-module, but instead I accidentally named it quarto-module. |
There was a problem hiding this comment.
Please remove this file from the pr
| # to prevent file-locking issues during | ||
| # subsequent processing and output writing. | ||
|
|
||
| ds = xr.open_dataset(input_file) |
There was a problem hiding this comment.
I use xr.load_dataset(input_file) rather than these three lines
There was a problem hiding this comment.
Ya that's a better approach, I'll update it.
|
Hi Madi - thanks for this! I've put some comments inline. A couple general ones, happy to discuss any of these: For log messages, please use the syntax For me, having extra blank lines, eg between function calls makes the code less easily readable (example below). For esdglider, I'd like to stick to the principles of a) generally keeping code on one line is the line length is <80, and b) not having extra blank lines between lines in the same function. |
|
Hi Sam, I'll make sure to fix all of these! |
Do you want me to remove the comments in the code (example below)? EVALUATE ALL DATA VARIABLES |
|
No, I think the comments are overall good, although I typically don't like them over logs because (unless it's really complicated) I think the log should be self-explanatory. I would format that block something like: Thanks! |
|
I updated everything based on your comments. If there's anything else, please let me know! |
|
Thank you! This is looking good. I'll try out the fork tomorrow. One other ask - could you add a notebook (to the 'notebooks' folder) that shows a representative example or two of using this functionality? |
|
Yes! Sorry to get back late, I have been traveling. I'll make sure to add a notebook today. |
|
Thanks, this is looking good. The outputs make sense A couple more requests to complete the pr are below; sorry I didn't think to include these initially.
|
d25d5f4 to
a6a226b
Compare
|
I updated the requests you gave, but for visualizing/logging of the qc flags, what would be most helpful for you? Are you interested in seeing exactly when the bad flags occur or just generally how many flags (of each kind) there are? |
|
Thanks @madrichardson! Updates look great. For visualizing/summarizing, I'm thinking both a histogram (or logged summary counts) of the number of each flag per variable, and then a timeseries of the flags. For the timeseries, either using color-coding to mark 'bad' flags, or have the plot only be of the 'bad' flags. |
|
Hi Sam, the Glider DAC folks provided guidance for determining the thresholds for two of the tests for qc'ing. They already have functions for both: get_spike_thresholds() & get_rate_of_change_threshold(). Did you want me to incorporate these in the qartod module? I was thinking I would update qartod.py with these and then edit parts of the script so that if would load the qartod-config.yml, create the config-dictionary, compute the threshold statistics, replace the placeholder thresholds, and then update the config-dictionary so that the qartod-config.yml is never overwritten, just used as a template. Also, I saw you were out of office until August, so no worries about getting back to me until then! |
|
Thanks Madi. This all makes sense to me. I like just updating the config dictionary, rather than having to update qartod-config.yml all the time. When adding functions, please just make sure to provide credit/links in the function docstring that points back to the DAC's original function Also, maybe this happens by default, but will the output nc file have these function-calculated values as an attribute for the applicable quartod variable? Eg, will qartod_density_spike_flag have an attribute that contains the calculated spike thresholds? I think that could be useful for any future troubleshooting |
No description provided.