{"id":20200955,"url":"https://github.com/openclimatefix/uk-wind-modelling-basic","last_synced_at":"2025-05-07T06:31:05.931Z","repository":{"id":190651208,"uuid":"683071007","full_name":"openclimatefix/uk-wind-modelling-basic","owner":"openclimatefix","description":"Simple wind forecast repo","archived":false,"fork":false,"pushed_at":"2023-08-25T15:12:08.000Z","size":2,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-14T11:50:43.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openclimatefix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["openclimatefix"],"patreon":null,"open_collective":"openclimatefix","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-08-25T14:24:50.000Z","updated_at":"2023-10-02T20:36:40.000Z","dependencies_parsed_at":"2023-08-25T19:43:46.712Z","dependency_job_id":"e4dda7ce-a4ec-4692-a869-07dbf081bf88","html_url":"https://github.com/openclimatefix/uk-wind-modelling-basic","commit_stats":null,"previous_names":["openclimatefix/uk-wind-modelling-fun"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-wind-modelling-basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-wind-modelling-basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-wind-modelling-basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-wind-modelling-basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openclimatefix","download_url":"https://codeload.github.com/openclimatefix/uk-wind-modelling-basic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224568034,"owners_count":17332834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:46:19.707Z","updated_at":"2024-11-14T04:46:20.788Z","avatar_url":"https://github.com/openclimatefix.png","language":null,"funding_links":["https://github.com/sponsors/openclimatefix","https://opencollective.com/openclimatefix"],"categories":[],"sub_categories":[],"readme":"# uk-wind-modelling-basic\n\nThe idea is to create a simple model for predicting wind farm generation.\n\n## Wind Farm Data\n\nLets look at the wind generation from the Elexon API. Technically its a 1 hour forecast, but I think its good to start with.\nLets look at the data from the `WesterMost Rough` wind farm. Its located 53°49′N 0°09′E, which is in the North Sea, just off the coast of Hull.\n\nA good package to use is https://github.com/OSUKED/ElexonDataPortal \n\nThe expected wind generation can be generated from\n\n```python\nfrom ElexonDataPortal import api\nclient = api.Client('your_api_key_here')\n\nstart_date = '2020-01-01'\nend_date = '2020-01-02'\n\n# data from `WesterMost Rough` wind farm\ndf_PHYBMDATA = client.get_PHYBMDATA(start_date=start_date, end_date=end_date, BMUnitId='T_WTMSO-1')\ndf_PHYBMDATA = df_PHYBMDATA[df_PHYBMDATA['recordType'] == 'PN']\ndf_PHYBMDATA = df_PHYBMDATA[['local_datetime','pnLevelFrom']]\n```\n*PN means Physical notification, this is how much the wind farm is expected to generate.\n\n## NWP data\n\nLets get some NWP (numerical weather prediction) data from the GFS. This is a global model, so we will need to extract the data for the UK.\n\nA good package to use is Herbie - https://herbie.readthedocs.io/en/stable/\n\nHere's an example of how to get some wind speeds\n```python\nimport pandas as pd\nfrom herbie import FastHerbie\n\n# Create a range of dates\ndates = pd.date_range(\n    start=\"2023-01-01 00:00\",\n    periods=4,\n    freq=\"6H\",\n)\n\n# Just get the 1 hour forecast\nfxx = range(0, 1)\n# Make FastHerbie Object.\nFH = FastHerbie(dates, model=\"gfs\", fxx=fxx)\n# download the U V wind components at 80m\nds = FH.xarray(\":(U|V)GRD:80 m\")\n\n# reduce to just the wind farm location\nds = ds.sel(latitude=slice(53, 53), longitude=slice(0, 0))\n\n# here are the values\nu = ds.u.values\nv = ds.v.values\ntime = ds.time.values\n```\n# ML\n\nHere's the fun bit, and its very open ended.\n\n1. Decide on your train and test set, perhaps 1 year of each.\n2. Start with a simple model, and try to predict the wind generation\n3. Evaluate your results, and iterate.\n\nQuestions to think about:\n- What features should you use?\n- What model should you use?\n- How should you evaluate your model?\n- How much data to use?\n- Can we get more data from different wind farms?\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Fuk-wind-modelling-basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenclimatefix%2Fuk-wind-modelling-basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Fuk-wind-modelling-basic/lists"}