openclimatefix / metoffice_ec2

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

Various NaN values in predictions #50

Open flowirtz opened 3 years ago

flowirtz commented 3 years ago

Hey @tomwhite, I just got around to run predict from your work in f1812ffdd659eab09fcf18ecfab626f10dd8334d to get it deployed on AWS. One thing I noticed is that the Zarr file that you use in the predict_test produces a bunch of NaN values in the resulting GeoJSON.

e.g.

{
    "type": "Feature",
    "geometry": {
        "type": "Point",
        "coordinates": [
            -0.07,
            52.33
        ]
    },
    "properties": {
        "system_id": 1883,
        "time": "2020-09-08T13:00:00",
        "pv_yield_predicted": NaN
    }
},

It's no biggie - apparently NaN is fine in JS, just not valid JSON - but I'd like to understand where they come from and if we can get rid of them. I did check whether the system_id doesn't exist in the model, but it does.

Do you have any ideas?

flowirtz commented 3 years ago

I changed it so that the NaNs get replaced with null, but still not sure where they come from 🤔

https://github.com/openclimatefix/metoffice_ec2/blob/6cda8f583f3ceb4fdc3920e1f13f657039404b8a/metoffice_ec2/predict.py#L79