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

Add model reader for gocart output #217

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

MaggieMarvin
Copy link

These changes include the addition of a model reader for gocart output that can be used to process GEFS aerosol files. As written, this code reads in total AOD at 4 wavelengths (470, 550, 670, and 870 nm) and currently drops/ignores the speciated AOD variables generated by gocart (AOD_BC, AOD_DU, AOD_OC, AOD_SS, and AOD_SU), but could be extended to include those variables if they're likely to be used regularly.

@zmoon
Copy link
Member

zmoon commented Nov 14, 2024

@MaggieMarvin do you have an example file or two so we can write a test?

Copy link
Member

@zmoon zmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaggieMarvin this is looking good so far, have you tested it in MM already?

monetio/models/gocart.py Outdated Show resolved Hide resolved
monetio/models/gocart.py Outdated Show resolved Hide resolved
monetio/models/gocart.py Outdated Show resolved Hide resolved
monetio/models/gocart.py Outdated Show resolved Hide resolved
monetio/models/gocart.py Outdated Show resolved Hide resolved
monetio/models/gocart.py Outdated Show resolved Hide resolved
@MaggieMarvin
Copy link
Author

@zmoon Great, thanks! Yes I've tested in melodies-monet - the model files I used are here on Hera: /scratch2/NCEPDEV/stmp3/Margaret.R.Marvin/global/stmp/RUNDIRS/WetDep_Dust/gefsfcst.2018081600/fcst.371442/gocart.inst_aod*.nc4

drop_variables=["AOD_BC", "AOD_DU", "AOD_OC", "AOD_SS", "AOD_SU"],
)

ds["AOD470"] = ds.AOD.isel(lev=0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you set it up so the user can specify the wavelengths (in case they are different)? It can default to these four though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's only these four wavelengths that are available from gocart - should wavelength be a required argument and then we can pass all AOD variables at that wavelength? Error if a wavelength is requested that isn't provided?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Barry told me the wavelengths are technically configurable. My thought was the wavelength list could be an optional argument (defaulting to your four if not provided), but then we make sure the list length is the same as the lev dim size.

fnames,
concat_dim="time",
combine="nested",
drop_variables=["AOD_BC", "AOD_DU", "AOD_OC", "AOD_SS", "AOD_SU"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User might want these. If so, I guess you'd want to select and rename them too.

Suggested change
drop_variables=["AOD_BC", "AOD_DU", "AOD_OC", "AOD_SS", "AOD_SU"],

Copy link
Author

@MaggieMarvin MaggieMarvin Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I hadn't thought of a good naming convention since these variables are also wavelength-dependent - for example could do "AOD550_DU" or something else? Unless wavelength is a required argument as above, then they can all keep their original names

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just always stick the wavelength on the end of the initial name?

monetio/models/gocart.py Outdated Show resolved Hide resolved
@zmoon
Copy link
Member

zmoon commented Nov 21, 2024

I extracted a small spatial subset of one of the files to use for test. gocart.inst_aod.20180901_1200z.subset.nc4.zip

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.

2 participants