-
Notifications
You must be signed in to change notification settings - Fork 74
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 CFS model #199
Add CFS model #199
Conversation
Hello, any plan to merge this PR? |
Thanks for the poke @MeasureSpace. After looking at this again, I remember why I didn't merge it...I am so unfamiliar with the CFS structure and didn't understand the naming convention to make the Herbie template easy to use. It would take some time to come up with a good template that allowed users to download all types of CFS files. I don't have that time now, but could do two things:
|
Hi @blaylockbk, thanks a lot for the quick response. I tested the CFS code, and it works fine for me. Another useful component is the time series data from CFS (see below). Feel free to include it in your code. class cfs_time_series:
def template(self):
self.DESCRIPTION = "Climate Forecast System; Time Series"
self.DETAILS = {
"NOMADS product description": "https://www.nco.ncep.noaa.gov/pmb/products/cfs/",
"Amazon Open Data": "https://registry.opendata.aws/noaa-cfs/",
"Microsoft Azure": "https://planetarycomputer.microsoft.com/dataset/storage/noaa-cfs",
}
# https://www.nco.ncep.noaa.gov/pmb/products/cfs/#DAILY
self.PRODUCTS = {
"wnd10m": "10 meter wind",
"tmp2m": "2 meter temperature",
"tmin": "Minimum Temperature 2 Meters Above",
"tmax": "Maximum Temperature 2 Meters Above",
"q2m": "2 meter specific humidity",
"tcdcclm": "total cloud cover",
"prate": "total precipitation rate",
"weasd": " Water Equivalent of Accumulated Snow Depth",
"soilt1": "Soil Temperature, 0-0.1 m Below Ground",
"soilm1": "Soil Moisture Content, 0-0.1 m Below Ground",
"pressfc": "surface pressure",
"dswsfc": "shortwave radiation at the surface",
}
try:
self.member
except NameError:
print(
"'member' is not defined. Please set 'member=1` for monthly data for the 6, 12, and 18 UTC cycles, but may be 1, 2, 3, or 4 for the 0 UTC cycle."
)
PATH = f"cfs.{self.date:%Y%m%d/%H}/time_grib_{self.member:02d}/{self.product}.{self.member:02d}.{self.date:%Y%m%d%H}.daily.grb2"
self.SOURCES = {
"aws": f"https://noaa-cfs-pds.s3.amazonaws.com/{PATH}",
"nomads": f"https://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/{PATH}",
# "azure": f"https://noaacfs.blob.core.windows.net/cfs/{PATH}"
}
self.IDX_SUFFIX = [".grb2.idx", ".idx", ".grib.idx"]
self.LOCALFILE = f"{self.get_remoteFileName}" |
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.
Might want to check the CI failures and include the cfs_time_series model. Otherwise, LGTM.
a single entry point to the CFS model. Arguments depend on the product you are requesting.
After thinking more about this, it will be better to have one entry point into the CFS model template The allowed products values are
Other expected arguments depend on the product requested. Here are some examples... H = Herbie(
"2025-01-01",
model="cfs",
product="time_series",
member=1, # {1, 2, 3, 4}
variable="tmp2m", # the file's variable short name*.
) H = Herbie(
"2024-12-25",
model="cfs",
product="6_hourly",
kind="flxf", # {"flxf", "pgbf", "ocnf", "ipvf"}
member=1, # {1, 2, 3, 4}
fxx=12, # {0 ... (what's the max forecast hour??}
) H = Herbie(
"2024-05-25",
model="cfs",
product="monthly_means",
kind="pgbf", # {"flxf", "pgbf", "ocnh", "ocnf", "ipvf"}
member=1, # {1, 2, 3, 4}
month=1, # {0 through 9 (I think)}
hour=None, # None for daily mean, or {0, 6, 12, 18}
) *List of variable shortnames as listed at https://www.nco.ncep.noaa.gov/pmb/products/cfs/#DAILY
|
Note: I turned off the use of pygrib to get the CF coordinate reference system because its failing the GitHub Action tests. I'll resolve that in another PR. |
Adds a Herbie template for the NOAA Climate Forecast System (CFS)
Resolves #198 request.
The CFS model has lots of files associated with it, and thus the inputs for the Herbie template are kind of all over the place.