openclimatefix / metoffice_ec2

Subset Met Office MOGREPS-UK and UKV on AWS EC2
MIT License
11 stars 2 forks source link

✨ Add PV yield prediction via predict_pv_yield_nwp #34

Closed tomwhite closed 4 years ago

tomwhite commented 4 years ago

This is not yet ready for merge, but it shows the idea behind #33. It still needs changing to use UKV irradiance data.

cc @JackKelly @FWirtz

Fixes #33

tomwhite commented 4 years ago

Updated to get irradiance data from a Met Office UKV netcdf file. This should be easy to change to read from a Zarr store.

The output is JSON that looks like this:

[
    {
        "system_id":973,
        "easting":445587,
        "northing":497235,
        "time":1591290000000,
        "pv_yield_predicted":507.5
    },
    {
        "system_id":1364,
        "easting":431430,
        "northing":272536,
        "time":1591290000000,
        "pv_yield_predicted":214.8
    },
...
]
flowirtz commented 4 years ago

Awesome, thanks @tomwhite!

Just for my (very limited) understanding: Did you use the PV data from GCP to train the model once, and now for the inference bit we only rely on the NWP Metoffice data? Until we retrain, I suppose.

The output already looks usable, thanks. I'd prefer to use lat/long over easting/northing though, to future proof a bit for expanding to other countries as well. Also, it would be best if the output was GeoJSON.

I think the shape would look something like this then:

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [-1.299849, 54.368597]
  },
  "properties": {
    "system_id": 973,
    "time": 1591290000000,
    "pv_yield_predicted": 507.5
  }
}

But you can also keep the shape this way, I'd just convert it in the FE then. Thanks so much!!

tomwhite commented 4 years ago

Did you use the PV data from GCP to train the model once, and now for the inference bit we only rely on the NWP Metoffice data? Until we retrain, I suppose.

Yes that's right.

Also, it would be best if the output was GeoJSON.

Great idea! I will try to do that on the next iteration of this PR.

tomwhite commented 4 years ago

I've updated this to produce GeoJSON, e.g.

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -1.299834,
                    54.3686
                ]
            },
            "properties": {
                "system_id": 973,
                "time": "2020-06-04T17:00:00",
                "pv_yield_predicted": 507.5329670623049
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -1.54,
                    52.35
                ]
            },
            "properties": {
                "system_id": 1364,
                "time": "2020-06-04T17:00:00",
                "pv_yield_predicted": 214.8320996361009
            }
        },
...
   ]
}
tomwhite commented 4 years ago

This could be merged now and the change to use irradiance data done in a separate PR, or we could keep this open for that. Happy to do it either way.

flowirtz commented 4 years ago

Merging now, raised #41 to track the remaining work.