Code Monkey home page Code Monkey logo

Comments (5)

Aquila96 avatar Aquila96 commented on June 19, 2024

It's not very clear in your description and code as to how you produced the forecast, I assumed that you have largely followed the processes laid out in the jupyter.

One of the reasons that you could be getting an all np.nan result is that some of your forcing_variables are not filled in correctly, most likely toa_incident_solar_radiation, that is, all of the target timesteps' toa_incident_solar_radiation must be supplied.

from graphcast.

qwer9872 avatar qwer9872 commented on June 19, 2024

@Aquila96 Thank you very much for your answer. Your demo data is complete global data, I added my code after your "Load weather data" section, my purpose is to only input my interest area and predict the result of this area, but the final result is nan.If it is wrong according to what you said, how should I correct it? Thank you very much for your reply.
@Aquila96

with gcs_bucket.blob(f"dataset/{dataset_file.value}").open("rb") as f:
  example_batch = xarray.load_dataset(f).compute()
SHP = geopandas. Read_file ('/content/drive/MyDrive/graphcast - the main/SHP/roi. SHP ')
example_batch.rio.set_spatial_dims(x_dim="lon", y_dim="lat", inplace=True)
example_batch.rio.write_crs("WGS1984", inplace=True)
example_batch = example_batch.rio.clip(shp.geometry.apply(mapping),shp.crs)

from graphcast.

Aquila96 avatar Aquila96 commented on June 19, 2024

@Aquila96 Thank you very much for your answer. Your demo data is complete global data, I added my code after your "Load weather data" section, my purpose is to only input my interest area and predict the result of this area, but the final result is nan.If it is wrong according to what you said, how should I correct it? Thank you very much for your reply. @Aquila96

with gcs_bucket.blob(f"dataset/{dataset_file.value}").open("rb") as f:
  example_batch = xarray.load_dataset(f).compute()
SHP = geopandas. Read_file ('/content/drive/MyDrive/graphcast - the main/SHP/roi. SHP ')
example_batch.rio.set_spatial_dims(x_dim="lon", y_dim="lat", inplace=True)
example_batch.rio.write_crs("WGS1984", inplace=True)
example_batch = example_batch.rio.clip(shp.geometry.apply(mapping),shp.crs)

I'm not familiar with rioxarray but it appears that the you have not supplied new data but simply clipped the example_batch (rio.clip()) to be the area you wanted (following the shp file). This will introduce np.nan values in the input (blank areas in your leftmost plot), the behaviour of GraphCast is that it does not like np.nan values anywhere in its forcing and input terms, so an all nan output is to be expected.

The model is designed to accept strictly global initial conditions with pre-defined grid sizes, inputs not following the prescribed data formulations would generate np.nan or inaccurate results.

from graphcast.

tewalds avatar tewalds commented on June 19, 2024

I don't quite follow what you're trying to do, but graphcast only works on the whole world, not on patches of any type. If you try to make predictions where some of the inputs are nonsensical (eg all zeros, or nans), you will get nonsense outputs (eg all nans) which may well be rendered as all white.

from graphcast.

mjwillson avatar mjwillson commented on June 19, 2024

I think Timo's reply above pretty much summarises it, closing.

from graphcast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.