reVX.hybrid_stats.hybrid_stats.HybridStabilityCoefficient

class HybridStabilityCoefficient(solar_h5, wind_h5, res_cls=<class 'rex.resource.Resource'>, year=None)[source]

Bases: HybridStats

Compute the annual/monthly stability coefficient for co-located wind and solar

Parameters:
  • solar_h5 (str) – Path to solar h5 file(s)

  • wind_h5 (str) – Path to wind h5 file(s)

  • res_cls (Class, optional) – Resource class to use to access res_h5, by default Resource

  • year (str | int, optional) – Year to extract time-index for if running on a multi-year file, by default None

Methods

cf_profile(solar_h5, wind_h5[, reference, ...])

Compute stability coefficient between solar and wind time-series.

compute_stats(dataset[, reference, annual, ...])

Compute stability coefficients

run(solar_h5, wind_h5, dataset[, reference, ...])

Compute stability coefficient between solar and wind time-series.

save_stats(out_stats, out_fpath)

Save correlations to disk

stability_coefficient(mix, ref)

Compute average stability coefficient

Attributes

STATS

lat_lon

Resource (lat, lon) coordinates

meta

Resource meta-data table

res_cls

Resource class to use to access res_h5

solar_h5

Path to solar h5 file(s)

statistics

Dictionary of statistic functions/kwargs to run

time_index

Resource Datetimes

wind_h5

Path to wind h5 file(s)

classmethod stability_coefficient(mix, ref)[source]

Compute average stability coefficient

Parameters:
  • mix (pandas.DataFrame) – DataFrame of mixed solar and wind time-series

  • ref (pandas.DataFrame) – DataFrame of reference (solar or wind) time-series

Returns:

stab (ndarray) – Vector of the average stability coefficient for all days in the provided time-series data. Averages are by site.

compute_stats(dataset, reference='solar', annual=True, month=False, combinations=False, max_workers=None, sites_per_worker=1000, lat_lon_only=True)[source]

Compute stability coefficients

Parameters:
  • dataset (tuple | str) – Dataset to compare, if a string, extract the same dataset for both with and solar, other wise a tuple of the form: (solar_dataset, wind_dataset)

  • reference (str, optional) – Which data to use as the reference (denominator) when computing the stability coefficient, by default ‘solar’

  • annual (bool, optional,) – Extract stats annualy. To extract multi-year monthly stats set annual=False and month=True`, by default True

  • month (bool, optional) – Extract monthly stats, by default False

  • combinations (bool, optional) – Extract all combinations of temporal stats, by default False

  • max_workers (None | int, optional) – Number of workers to use, if 1 run in serial, if None use all available cores, by default None

  • sites_per_worker (int, optional) – Number of sites to extract on each worker, by default 1000

  • lat_lon_only (bool, optional) – Only append lat, lon coordinates to stats, by default True

Returns:

res_stats (pandas.DataFrame) – DataFrame of desired statistics at desired time intervals

property lat_lon

Resource (lat, lon) coordinates

Returns:

pandas.DataFrame

property meta

Resource meta-data table

Returns:

pandas.DataFrame

property res_cls

Resource class to use to access res_h5

Returns:

Class

classmethod run(solar_h5, wind_h5, dataset, reference='solar', annual=True, month=False, combinations=False, res_cls=<class 'rex.resource.Resource'>, year=None, max_workers=None, sites_per_worker=1000, lat_lon_only=True, out_path=None)[source]

Compute stability coefficient between solar and wind time-series. Time-series are shifted to local time before computing the daily stability coefficient. Final data is the average of daily stability coefficients for each month and/or year.

Parameters:
  • solar_h5 (str) – Path to solar h5 file(s)

  • wind_h5 (str) – Path to wind h5 file(s)

  • dataset (tuple | str) – Dataset to compare, if a string, extract the same dataset for both with and solar, other wise a tuple of the form: (solar_dataset, wind_dataset)

  • reference (str, optional) – Which data to use as the reference (denominator) when computing the stability coefficient, by default ‘solar’

  • annual (bool, optional,) – Extract stats annualy. To extract multi-year monthly stats set annual=False and month=True`, by default True

  • month (bool, optional) – Extract monthly stats, by default False

  • combinations (bool, optional) – Extract all combinations of temporal stats, by default False

  • res_cls (Class, optional) – Resource class to use to access res_h5, by default Resource

  • year (str | int, optional) – Year to extract time-index for if running on a multi-year file, by default None

  • max_workers (None | int, optional) – Number of workers to use, if 1 run in serial, if None use all available cores, by default None

  • sites_per_worker (int, optional) – Number of sites to extract on each worker, by default 1000

  • lat_lon_only (bool, optional) – Only append lat, lon coordinates to stats, by default True

  • out_path (str, optional) – .csv, or .json path to save statistics too, by default None

Returns:

out_stats (pandas.DataFrame) – DataFrame of resource statistics

static save_stats(out_stats, out_fpath)

Save correlations to disk

Parameters:
  • out_stats (pandas.DataFrame) – Table of correlations to save

  • out_path (str) – .csv, or .json path to save statistics too

property solar_h5

Path to solar h5 file(s)

Returns:

str

property statistics

Dictionary of statistic functions/kwargs to run

Returns:

dict

property time_index

Resource Datetimes

Returns:

pandas.DatetimeIndex

property wind_h5

Path to wind h5 file(s)

Returns:

str

classmethod cf_profile(solar_h5, wind_h5, reference='solar', annual=True, month=False, combinations=False, res_cls=<class 'rex.resource.Resource'>, max_workers=None, sites_per_worker=1000, lat_lon_only=True, out_path=None)[source]

Compute stability coefficient between solar and wind time-series. Time-series are shifted to local time before computing the daily stability coefficient. Final data is the average of daily stability coefficients for each month and/or year.

Parameters:
  • solar_h5 (str) – Path to solar h5 file(s)

  • wind_h5 (str) – Path to wind h5 file(s)

  • reference (str, optional) – Which data to use as the reference (denominator) when computing the stability coefficient, by default ‘solar’

  • annual (bool, optional,) – Extract stats annualy. To extract multi-year monthly stats set annual=False and month=True`, by default True

  • month (bool, optional) – Extract monthly stats, by default False

  • combinations (bool, optional) – Extract all combinations of temporal stats, by default False

  • res_cls (Class, optional) – Resource class to use to access res_h5, by default Resource

  • max_workers (None | int, optional) – Number of workers to use, if 1 run in serial, if None use all available cores, by default None

  • sites_per_worker (int, optional) – Number of sites to extract on each worker, by default 1000

  • lat_lon_only (bool, optional) – Only append lat, lon coordinates to stats, by default True

  • out_path (str, optional) – .csv, or .json path to save statistics too, by default None

Returns:

out_stats (pandas.DataFrame) – DataFrame of resource statistics