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 plotting downscaled results? #64

Closed NILICK closed 1 year ago

NILICK commented 1 year ago

I could run the example2 successfully, and the model produced nc files in the outputs folder. I want to show the temperature downscaled in GIS environment such as QGIS, but I confused to do that because in QGIS the output files not readable and return below error:

Unsupported Data Source: /TopoPyScale/Examples/TopoPyScale_examples-main/ex2_romania_retezat/outputs/downscaled/down_pt_2.nc is not a supported raster data source This raster file has no bands and is invalid as a raster layer. How can I plot the downscaled result as a map such as this.

ArcticSnow commented 1 year ago

See the documentation page Exampels This will plot the timeseries of each clustered mapped to the corresponding DEM pixels.

mp.plot.map_variable(time_step=1, var='t')

import matplotlib.pyplot as plt
plt.show()
NILICK commented 1 year ago

See the documentation page Exampels This will plot the timeseries of each clustered mapped to the corresponding DEM pixels.

mp.plot.map_variable(time_step=1, var='t')

import matplotlib.pyplot as plt
plt.show()

@ArcticSnow Thanks for your help, How can I save the above plot as nc or tif file? I tried to use mp.to_netcdf(), but netcdf file saved does not have latitude and longitude data for opening in the GIS environment.

ArcticSnow commented 1 year ago

Look here: https://github.com/ArcticSnow/TopoPyScale/blob/a723a6c3bcadb40f7003abd026e891c51c046ac1/TopoPyScale/topo_plot.py#L95