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

🚀[FEA]: Use GEFS members as initial condition data source #143

Closed
djzurawski opened this issue Sep 30, 2024 · 3 comments
Closed

🚀[FEA]: Use GEFS members as initial condition data source #143

djzurawski opened this issue Sep 30, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@djzurawski
Copy link

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

Low (would be nice)

Please provide a clear description of problem you would like to solve.

I would like to be able to select a GEFS member to use for initial conditions for a prognostic model. A few weeks ago I attempted to repurpose the GEFS_FX forecast source but failed.

@djzurawski djzurawski added ? - Needs Triage Need team to review and classify enhancement New feature or request labels Sep 30, 2024
@NickGeneva
Copy link
Collaborator

Hi @djzurawski

How did it fail can you provide some details?
Did selecting the member with the product string not work as intended?

@NickGeneva NickGeneva removed the ? - Needs Triage Need team to review and classify label Sep 30, 2024
@djzurawski
Copy link
Author

This solution should have been obvious to me the first time I dont know why it wasnt. The DataArray returned from data.GEFS_FX calls contain lead_time as a coordinate which the initialization datasources like data.GFS do not have which was the source of my errors. I got it working by creating a child class of GEFS_FX which selects the 0 lead_time (or any lead_time you want for time-lagging).

class GEFS_INIT(GEFS_FX):

    def __call__(
        self,
        time: datetime | list[datetime] | TimeArray,
        variable: str | list[str] | VariableArray,
    ) -> xr.DataArray:

        da = super().__call__(time=time, lead_time=timedelta(0), variable=variable)
        return da.isel(lead_time=0)

Then you can follow the Readme quickstart example

model = DLWP.load_model(DLWP.load_default_package())
ds = GEFS_INIT(product="gep10")
io = NetCDF4Backend("output.nc")

run(["2024-01-01"], 10, model, ds, io)

@NickGeneva
Copy link
Collaborator

Thanks for the follow up with your solution!
Closing for now, can reopen if others would find a GEFS data source particularly useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants