-
Notifications
You must be signed in to change notification settings - Fork 24
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
[PULL REQUEST] Average TROPOMI observations #57
Conversation
…vert.py to use correct num observations
src/inversion_scripts/jacobian.py
Outdated
|
||
# Compute virtual TROPOMI observation as weighted mean by overlapping area | ||
# i.e., need to divide out area [m2] from the previous step | ||
virtual_tropomi = area_weighted_virtual_tropomi / sum(overlap_area) | ||
virtual_tropomi = area_weighted_virtual_tropomi / gridcell_dict["overlap_area"] |
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 am not sure exactly whether this is still necessary... the overlap area is now the averaged overlap area...
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 don't think we need any of these area-weighting lines that multiply or divide by overlap area -- because you already dealt with the areas when building gridcell_dicts
, right? Now you just have one average TROPOMI observation for each GEOS-Chem grid cell. So you just need to map each grid cell to a TROPOMI once (rather than doing it for each individual observation, including ones that overlap with multiple grid cells). It looks like this code is multiplying and then dividing by gridcell_dict["overlap_area"]
in a couple of places.
I also think we should review the comments here to clarify. E.g., in places above we say "For each TROPOMI observation..." but what we're really talking about now are grid-cell-averaged TROPOMI observations.
src/inversion_scripts/jacobian.py
Outdated
) # ppb | ||
# Weight by overlapping area (to be divided out later) and add to sum | ||
area_weighted_virtual_tropomi += ( | ||
gridcell_dict["overlap_area"] * virtual_tropomi_gridcellIndex |
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.
Re: my comment below, we don't need this line, for example, since we already did the area weighting in constructing gridcell_dicts
and further down end up dividing out gridcell_dict["overlap_area"]
src/inversion_scripts/jacobian.py
Outdated
# ======================================================= | ||
# Map GEOS-Chem to TROPOMI observation space | ||
# ======================================================= | ||
|
||
# Otherwise, initialize tropomi virtual xch4 and virtual sensitivity as zero | ||
area_weighted_virtual_tropomi = 0 # virtual tropomi xch4 | ||
area_weighted_virtual_tropomi_sensitivity = 0 # virtual tropomi sensitivity |
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 don't think we need these lines anymore either, re: area_weighted_virtual_tropomi...
…ualizations of superobservations
* moved tropomi operator to operators dir * added in original tropomi operator for viz notebook * cp config file to run directory for archival purposes
This pr includes: