ArcticSnow / TopoPyScale

TopoPyScale: a Python library to perform simplistic climate downscaling at the hillslope scale
https://topopyscale.readthedocs.io
MIT License
39 stars 9 forks source link

How to join output from all clusters into a single netcdf or tiff file? #97

Closed srinivas2036 closed 8 months ago

srinivas2036 commented 8 months ago
  1. I am able to run the topopyscale model for my study region for ERA datasets. Is there anyway I can store the downscaled files as a single netcdf or tiff file. Otherwise, is there anyway I can store the output as latitude, longitue and datavariable in the form of a csv file. I want to use the downscaled varibels (for entire region) as forcing data to another energy balance model.
  2. Could you please inform about how to plot spatial snow depth from FSM model in Norway example (example1). Thankyou.
ArcticSnow commented 8 months ago

Hi @srinivas2036 , Welcome to using TopoPyScale.

  1. So TopoPyScale will save the output in netcdf files. You can then use xarray to open the files and manipulate the data in any way you want. This is all xarray tricks. You can get inspiration from the routines in the file topo_export.py for export of the data in a variety of formats. Otherwise I let you read up and learn further on xarray.
  2. This an example of the method used to plot a map of the output from FSM.
    dsf = xr.open_mfdataset('fsm_out*.nc', concat_dim='point_id', combine='nested')
    dsf.sel(time='2021-02-28T00:00:00').sd.sel(point_id=mp.toposub.ds_param.cluster_labels).plot.imshow(cmap=plt.cm.Blues)
    plt.show()