module TopoPyScale.topoclass
Toposcale class definition
S. Filhol, September 2021
project/ config.ini -> input/ -> dem/ -> climate/ -> output/
class Topoclass
A python class to bring the typical use-case of toposcale in a user friendly object
method __init__
method compute_dem_param
method compute_horizon
Function to compute horizon angle and sample values for list of points
method compute_solar_geometry
method downscale_climate
method extract_grid_param
method extract_pts_param
Function to use a list point as input rather than cluster centroids from DEM segmentation (topo_sub.py/self.clustering_dem()).
Args:
df (dataFrame):
- method (str): method of sampling
- **kwargs: pd.read_csv() parameters
Returns:
method extract_topo_cluster_param
Function to segment a DEM in clusters and retain only the centroids of each cluster.
:return:
TODO:
- try to migrate most code of this function to topo_sub.py as a function itself segment_topo()
method extract_topo_param
Function to select which
method get_WMO_observations
Function to download and parse in-situ data from WMO database
method get_era5
Funtion to call fetching of ERA5 data
TODO:
- merge monthly data into one file (cdo?)- this creates massive slow down!
method get_era5_snowmapper
Funtion to call fetching of ERA5 data
TODO:
- merge monthly data into one file (cdo?)- this creates massive slow down!
method get_ifs_forecast
method get_lastday
method load_project
Function to load pre-existing TopoPyScale project saved in files
method process_SURF_file
method remap_netcdf
method search_optimum_number_of_clusters
search_optimum_number_of_clusters(
cluster_range=array([100, 300, 500, 700, 900]),
scaler_type=StandardScaler(),
plot=True
)
Function to test what would be an appropriate number of clusters
Args:
cluster_range(int array): numpy array or list of number of clusters to compute scores.
Returns:
method to_crocus
function to export toposcale output to crocus format .nc. This functions saves one file per point_name
Args:
fout_format(str): filename format. point_name is inserted where * isscale_precip(float): scaling factor to apply on precipitation. Default is 1
method to_cryogrid
wrapper function to export toposcale output to cryosgrid format from TopoClass
Args:
fname_format(str): filename format. point_name is inserted where * is
method to_fsm
function to export toposcale output to FSM format
method to_geotop
function to export toposcale output to FSM format
method to_musa
function to export TopoPyScale output in a format compatible with MuSa MuSa: https://github.com/ealonsogzl/MuSA
Args:
fname: filename of the netcdf
method to_netcdf
function to export toposcale output to one single generic netcdf format, compressed
Args:
file_out(str): name of export filevariables(list str): list of variable to export. Default exports all variables
method to_snowmodel
function to export toposcale output to snowmodel format .ascii, for single station standard
fout_format: str, filename format. point_name is inserted where * is
method to_snowpack
function to export toposcale output to FSM format
method to_surfex
function to export toposcale output to surfex format .nc. This functions saves one file per point_name
Args:
fout_format(str): filename format. point_name is inserted where * isscale_precip(float): scaling factor to apply on precipitation. Default is 1
class Plotting
Sub-Class with plotting functions for topoclass object
method horizon
method map_center_clusters
map_center_clusters(
background_var='elevation',
cmap=<matplotlib.colors.ListedColormap object at 0x72cb4b5c7dc0>,
hillshade=True,
**kwargs
)
method map_clusters
method map_terrain
method map_variable
map_variable(
var='t',
time_step=1,
time=None,
cmap=<matplotlib.colors.LinearSegmentedColormap object at 0x72cb4b3f1270>,
hillshade=True,
**kwargs
)
method solar_geom
method timeseries
This file was automatically generated via lazydocs.