module TopoPyScale.topo_utils
function ds_to_indexed_dataframe
Function to convert an Xarray dataset with multi-dimensions to indexed dataframe (and not a multilevel indexed dataframe). WARNING: this only works if the variable of the dataset have all the same dimensions!
By default the ds.to_dataframe() returns a multi-index dataframe. Here the coordinates are transfered as columns in the dataframe
Args:
ds(dataset): xarray dataset with all variable of same number of dimensions
Returns: pandas dataframe:
function multicore_pooling
Function to perform multiprocessing on n_cores
Args:
fun(obj): function to distributefun_param zip(list): zip list of function argumentsn_core(int): number of cores
function multithread_pooling
Function to perform multiprocessing on n_threads
Args:
fun(obj): function to distributefun_param zip(list): zip list of functino argumentsn_core(int): number of threads
function get_versionning
function FsmMetParser
Parses FSM forcing files from toposcale sims
function FsmSnowParser
parses FSM output fuiles
function FsmPlot_ensemble
Function to plot ensemble results for a given variable and point.
Args:
wdir: full path to sim directorysimvar: variable to plot (str)sampleN: sample number to plot
Returns:
sampleN: sample number
Example: FsmPlot_ensemble('/home/joel/sim/topoPyscale_davos/', "HS", 0)
function SmetParser
val_file = full path to a smet resample = "TRUE" or "FALSE" freq = '1D' '1H' etc
function getCoordinatePixel
Function to find which sample a point exists in. Can accept any combination of projections of the map and points.
Args:
map_path: full path to mapx_coord: x coord of pointy_coord: y coord of pointepsg_in: input proj epsg code (lonlat: 4326)epsg_out: ouput proj epsg code
Returns:
sampleN: sample number
Example: # get epsg of map from TopoPyScale import topo_da as da epsg_out, bbxox = da.projFromLandform(map_path)
getCoordinatePixel("/home/joel/sim/topoPyscale_davos/landform.tif", 9.80933, 46.82945, 4326, 32632)
function val_plots
function time_vecs
Function to build timestamp vectors of year starts and year ends for arbitrary time range.
Args:
start_date(str): descriptionend_date(str): description
Returns:
start_year: vector of start of years (datetime64)end_year: vector of end of year (datetime64)
This file was automatically generated via lazydocs.