-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fixing African easterly wave density plots in TC analysis #851
Conversation
Comparing with apply The AEW density plots uses three TE functions: @paullric I'm not sure if TE is applied properly in this case, any advice for further trouble shooting is appreciated! |
Also to add that: |
Following suggestion from @wlin7, when regridding, with a bilinear mapping file (to replace the aave one I used), the TC count (70) get closer to the results tracked with native ne120 data. |
This PR will also address: empty input TC files. |
This is addressed by 0cb36e9 by @tomvothecoder in cdat-migration-branch. I will copy the code over here, so that current |
@tomvothecoder this PR is ready to review, it partially addresses the plotting problem (Y shapes remains); also cross year TCs are removed; I copied over the error capture for cyclones stitches files as well. |
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.
LGTM with some comments.
# Add year info | ||
te_stitch_vars["year_start"] = data_start_year | ||
te_stitch_vars["year_end"] = data_end_year | ||
te_stitch_vars["num_years"] = data_end_year - data_start_year + 1 |
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.
If I understand correctly, you moved the year info out of _get_vars_from_te_stitch()
because they are now different after removing the excessive time points that cross year bounds. Is this right?
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.
The start and end years were previously based on data from te_stitches files. It worked fine earlier because in the simulated data, there are always TCs each year. It became problematic when testing v3 datasets, years with no TCs get skipped. The new code now use start and end included in file name, which represent the actually year range being assessed.
line_ind = [] | ||
data_start_year = int(te_stitch_file.split(".")[-2].split("_")[-2]) | ||
data_end_year = int(te_stitch_file.split(".")[-2].split("_")[-1]) | ||
for i in range(0, np.size(lines_orig)): | ||
if lines_orig[i][0] == "s": | ||
year = int(lines_orig[i].split("\t")[2]) | ||
|
||
if year <= data_end_year: | ||
line_ind.append(i) | ||
|
||
# Remove excessive time points cross year bounds from 6 hourly data | ||
end_ind = line_ind[-1] | ||
lines = lines_orig[0:end_ind] |
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.
Minor suggestion, I would extract this block of logic into a private function called _remove_time_crossing_bounds()
or something to make the main run_diags()
cleaner.
However, this can be done in the refactored codebase too.
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 the suggestion. I considered to have a function instead as well. I think we can update the refactored code base when bringing more fix and enhancement to tc set.
Description
Karthik (@karthik-balaguru) noted the odd Y shapes in easterly wave density plots in recent TC analysis results (issue 1). And @paullric also noticed that the ERA5 results are also off, which always have a base value of ~5 (issue 2).
Checklist
If applicable: