code: def _get_data(filename):
      data = xarray.open_dataset(
          pjoin(CELER_PATH, "climate/surface", filename),
          decode_times=False,
      )
  
      n_times = data[list(data.data_vars.keys())[0]].shape[0]
  
      X = np.array(data[list(data.data_vars.keys())[0]]).reshape(
          n_times, -1
      )
  
      # remove seasonality
      period = 12
      for m in range(period):
          # TODO using sklearn for preprocessing would be an improvement
          X[m::period] -= np.mean(X[m::period], axis=0)[None, :]
          X[m::period] /= np.std(X[m::period], axis=0)[None, :]
          if np.sum(np.isnan(X[m::period])) > 0:
              X[m::period] = np.where(
                  np.isnan(X[m::period]), 0, X[m::period]
              )
  
      # remove trend
      X = detrend(X, axis=0, type="linear")
  
      return X
  
file_path: celer/celer/datasets/climate.py
imports: import os
  from os.path import join
  import numpy
  import xarray
  import download
  from scipy.signal import detrend
  from celer.datasets import CELER_PATH
label_desc: Use image node_id 1 for calling a global function with example usage: _get_data(filename) and returns: X