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

GEFS reforecast has different scheme on every Wednesday #377

Open
juanqiu1 opened this issue Oct 27, 2024 · 0 comments
Open

GEFS reforecast has different scheme on every Wednesday #377

juanqiu1 opened this issue Oct 27, 2024 · 0 comments

Comments

@juanqiu1
Copy link

juanqiu1 commented Oct 27, 2024

On every Wednesday, GEFS reforecast dataset has different ensemble size and forecast length, and URLs are slightly different from other dates.

I made a small change to corresponding functions, as below

class gefs_reforecast:

    ........

    def template(self):
        self.DESCRIPTION = "Global Ensemble Forecast System (GEFS)"
        self.DETAILS = {
            "aws": "https://registry.opendata.aws/noaa-gefs-reforecast/",
        }
        self.PRODUCTS = {
            "GEFSv12/reforecast": "reforecasts for 2000-2019",
        }

        if self.date.weekday() == 2:
            # GEFS reforecast has extended ensemble on every Wednesday
            max_member_size = 10
            max_fxx = "Days:10-35"
        else:
            max_member_size = 4
            max_fxx = "Days:10-16"

        # Adjust "member" argument
        # - Member 0 is the control member
        # - Members 1-4 are the perturbation members
        if self.member == 0:
            member = f"c{self.member:02d}"
        elif self.member > 0 and self.member < max_member_size:
            member = f"p{self.member:02d}"
        else:
            raise ValueError(f"GEFS 'member' must be within range of [0 - {max_member_size}].")

        # Adjust "fxx" argument (given in hours)
        # This is used to define the directory to enter rather than the filename.
        if self.fxx <= 240:
            fxx = "Days:1-10"
        else:
            fxx = max_fxx

This change at least satisfies this call

H = Herbie("2000-01-05", model="gefs_reforecast", fxx=34 * 24, member=9, variable_level="ugrd_hgt")

However, I didn't test it thoroughly and I am not in a comfortable situation I could send a PR in. Could you kindly review and consider adopting this change?

Best,

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

No branches or pull requests

1 participant