Skip to content
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

Merged
merged 24 commits into from
Sep 29, 2022

Conversation

laestrada
Copy link
Collaborator

This pr includes:

  • the addition of averaging tropomi retrievals for each GC gridcell
  • the addition of a weighting function (provided by zichong) to prevent overfitting
  • updating default gamma to 1
  • updates to how we area weight observations in multiple gridcells
  • I will flag areas for potential comment (most of the changes are in jacobian.py)

@laestrada laestrada changed the base branch from main to dev September 1, 2022 18:00

# 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"]
Copy link
Collaborator Author

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...

Copy link
Collaborator

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.

@laestrada laestrada marked this pull request as ready for review September 1, 2022 19:13
) # 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
Copy link
Collaborator

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"]

# =======================================================
# 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
Copy link
Collaborator

@djvaron djvaron Sep 1, 2022

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...

@msulprizio msulprizio changed the title Feature/average tropomi observations [PULL REQUEST] Average TROPOMI observations Sep 19, 2022
* moved tropomi operator to operators dir

* added in original tropomi operator for viz notebook

* cp config file to run directory for archival purposes
@laestrada laestrada merged commit dcca01f into dev Sep 29, 2022
@laestrada laestrada deleted the feature/average_tropomi_observations branch September 29, 2022 18:29
@msulprizio msulprizio added this to the IMI 1.1 milestone Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants