Skip to content

Dataset returning nothing #54

@manmeet3591

Description

@manmeet3591

My code is

      `    !git clone https://github.com/NASA-IMPACT/Prithvi-WxC
      %cd Prithvi-WxC
      !pip install '.[examples]'
      # %load_ext autoreload
      # %autoreload 2
      from pathlib import Path
      
      import numpy as np
      import matplotlib.pyplot as plt
      import xarray as xr
      from time import sleep
      
      import numpy as np
      from PrithviWxC.download import get_prithvi_wxc_input
      
      initialization_time = np.datetime64("2021-01-01")
      for tries in range(5):
          try:
              get_prithvi_wxc_input(
                  initialization_time,
                  input_time_step=6, # The time difference in hours between consecutive model input and unrolling steps.
                  lead_time=6, # Total maximum lead time.
                  input_data_dir="../data/merra-2", # Directory used to store the Prithvi-WxC input data.
                  download_dir="../data/raw" # Directory used to store the raw MERRA-2 files.
              )
              break
          except Exception as exc: 
              print("Attempt #%d, download unsuccessful: %s" % (tries, exc.args[0]))
              wtime = 2**tries
              print("Retrying in %d seconds..." % wtime)
              sleep(wtime)
              
        from PrithviWxC.configs import get_model_config
        config_name = "large"
        prithvi_config = get_model_config(config_name, data_dir="../data")
        
        from PrithviWxC.dataloaders.merra2 import Merra2Dataset, preproc
        
        dataset = Merra2Dataset(
            ("2021-01-01", "2021-01-02"),
            lead_times=[0],
            input_times=[-6],
            data_path_surface="../data/merra-2/",
            data_path_vertical="../data/merra-2/",
            climatology_path_surface="../data/merra-2/climatology/",
            climatology_path_vertical="../data/merra-2/climatology/",
            surface_vars=prithvi_config.surface_vars,
            static_surface_vars=prithvi_config.static_surface_vars,
            vertical_vars=prithvi_config.vertical_vars,
            positional_encoding=prithvi_config.positional_encoding,
            levels=prithvi_config.levels
        )
        len(dataset)`
I am trying this in colab: https://colab.research.google.com/drive/1xyZsNrVm0mZf82ij6v34OdAm_CmZYnWj?usp=sharing

Data gets downloaded but length of dataset is not returning anything. I even tried with the inference notebook

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions