pvdeg.geospatial.identify_mountains_weights#

pvdeg.geospatial.identify_mountains_weights(meta_df, kdtree, threshold=0, percentile=75, k_neighbors=3, method='mean', normalization='linear') array[source]#

Find mountains using weights calculated via changes in nearest neighbors.

elevations.

Parameters:#

meta_dfpd.DataFrame

Dataframe of metadata as generated by pvdeg.weather.get for geospatial

kdtreesklearn.neighbors.KDTree or str

kdtree containing latitude-longitude pairs for quick lookups Generate using pvdeg.geospatial.meta_KDTree. Can take a pickled kdtree as a path to the .pkl file.

thresholdfloat

minimum weight that a mountain can be identifed. value between [0,1] (inclusive)

percentilefloat, int, (default = 75)

mountain classification sensitivity. Calculates percentile of values remaining after thresholding, weights above this percentile are classified as mountains. value between [0, 100] (inclusive)

k_neighborsint, (default = 3)

number of neighbors to check for elevation data in nearest neighbors

methodstr, (default = ‘mean’)

method to calculate elevation weights for each point. Options : ‘mean’, ‘sum’, ‘median’

normalizationstr, (default = ‘linear’)

function to apply when normalizing weights. Logarithmic uses log_e/ln options : ‘linear’, ‘logarithmic’, ‘exponential’

Returns:#

gidsnp.array

numpy array of gids classified as mountains.