Update aircraft pairing (no changes to results) #305
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ASIA-AQ WRF-Chem test NaNed many points during the pairing step. It looks like because there were tacked on 0.000001 values to the end of some of the numbers in lat, lon, and pressure (e.g., 120.0000001) and then the vertical pairing step could not match these values properly. I added code to round before this pairing occurs to truncate these extra digits. @colin-harkins and @zmoon, is there a better way to do this? I've seen this happen before with pulling in .txt files into Python and I'm not sure why sometimes this happens. Is this rounding approach an okay fix? I want to make sure this code works for all icartt files even if there are some odd formatting, so I think this is safer.
I also as I was going through the code to find the problem realized that we really only want to replace the pressure_model NaNed points with pressure_obs when the pressure_obs is outside of the range of the model data. Right now it is doing this for all time steps. I tested that you get the same results doing both methods because merge_asof "nearest" approach selects the right point anyway in FIREX-AQ, RECAP, and AEROMMA, but I think the code is cleaner this way and less likely to have problems later on.
Let me know what you all think! Thanks!