synthesize.py

swxg.synthesize.synthesize_data(n: int, data: DataFrame, precip_dict: dict, copulaetemp_dict: dict, resolution: str, validate: bool, dirpath: str, synthesize_kwargs: dict) DataFrame

Managing function that synthesizes weather from the fit or given statistical parameters

Parameters

n: int

Number of years for the generator to synthesize weather for

data: pd.DataFrame

Dataframe of formatted weather data to reference

precip_dict: dict

Dictionary of fit precipitation parameters

copulaetemp_dict: dict

Dictionary of fit copula parameters to conditionally construct temperature

resolution: str

The temporal resolution of the data

validate: bool

Flag for producing figures to validate each step of the generator

dirpath: str

Path for where to save the validation figures

synthesize_kwargs: dict

Keyword arguments related to the fit

Returns

synth_data: pd.DataFrame

The synthesized weather data from the given observations and parameters

swxg.synthesize.synthesize_precip(n_synth_years: int, data: DataFrame, p_dict: dict, resolution: str, incomp_years: list[int]) array

Manager function to synthesize precipitation

Parameters

n_synth_years: int

Number of years for the generator to synthesize weather for

data: pd.DataFrame

Observed precipitation and temperature data

p_dict: dict

GMMHMM best-fitted model and corresponding parameters

resolution: str

Resolution of desired synthesized data

incomp_years: list[int]

List of years without the full set of months

Returns

synth_precip_monthly: pd.DataFrame

Synthesized monthly precipitation

swxg.synthesize.synthesize_pt_pairs(synth_prcp: array, t_dict: dict, pt_df: DataFrame, resolution: str) DataFrame

Manager function to conditionally synthesize temperature from precipitation

Parameters

synth_prcp: pd.DataFrame

Synthesized precipitation at monthly resolution

t_dict: dict

Copula best-fitted, spatially-averaged models and corresponding parameters

pt_df: pd.DataFrame

Temporally-formatted observed precipitation and temperature data

resolution: str

Time resolution of the synthesized data

Returns

synth_monthly_df: pd.DataFrame

Synthesized monthly precipitation and temperature