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

Improve custom forcing #9

Open
7 tasks done
Daafip opened this issue Feb 27, 2024 · 3 comments
Open
7 tasks done

Improve custom forcing #9

Daafip opened this issue Feb 27, 2024 · 3 comments

Comments

@Daafip
Copy link
Owner

Daafip commented Feb 27, 2024

Look at making more intuitive:
want to keep flexible but simple: either define:

  • camels txt file: forcing.txt,
  • simply provide a xarray forcing.nc

moved to bulletpoint to #18 (eWaterCycle/ewatercycle#393)

  • Refactor forcing_file attribute to camel_txt_file -> as essentially its now a txt file of specific class which the from_camels functions is run on in model startup
  • Currently the the selection of dates for camels forcing is exclusive, change to be inclusive:
    • ds = ds.isel(time=(ds['time'].values > start) & ((ds['time'].values < end)))
    • or atleast check how it should be: kinda strange now - leads to errors in the las ttime step
  • Add a from_nc function to check user supplied datasets for correct dates and variable rather than leaving this for the model to do: docker tracebacks arent most useful
  • Currently new timestamped forcing '.nc' file is created each time code is run:
    • either remove timestamped aspect and check if exisits
      • downside is if we move the time window its no longer correct
    • or in finalize remove any forcing objects created (probably better approach?)
  • from ewatercycle.forcing import HBVforcing should work, but currently doesn't
@BSchilperoort
Copy link
Collaborator

Hi David, the eWaterCycle forcing should be finished and available soon.

You will get a forcing object, from which you can access the variables as such: forcing["pr"] which will return the xr.DataArray containing precip. (Makkink) potential evaporation will also be added.

@Daafip
Copy link
Owner Author

Daafip commented Feb 28, 2024

Awesome, thanks!

Daafip added a commit that referenced this issue Mar 4, 2024
- Refactor forcing_file attribute to camel_txt_file -> as essentially its now a txt file of specific class which the from_camels functions is run on in model startup
urrently the the selection of dates for camels forcing is exclusive, change to be inclusive:
ds = ds.isel(time=(ds['time'].values > start) & ((ds['time'].values < end)))
    - now is inclusive
@Daafip
Copy link
Owner Author

Daafip commented Mar 29, 2024

Tested to work with Makkink forcing.
Currently still slightly ''dev' though, should be impoved to be more eWaterCycle like:

  • loading and saving, like Makkink:
ERA5_forcing = ewatercycle.forcing.sources["LumpedMakkinkForcing"].load(forcingLocation)
  • let user handel files rather than temporary ones

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

2 participants