gwgen.parameterization module¶
Module holding the parameterization scripts for the weather generator
Classes
CloudParameterizer(stations, config, ...[, ...]) |
Parameterizer to extract the months with complete clouds |
CloudParameterizerBase(stations, config, ...) |
Abstract base class for cloud parameterizers |
CompleteDailyCloud(stations, config, ...[, ...]) |
The parameterizer that calculates the days in complete months of cloud |
CompleteDailyGHCNData(stations, config, ...) |
The parameterizer that calculates the days in complete months |
CompleteMonthlyCloud(stations, config, ...) |
Parameterizer to extract the months with complete clouds |
CompleteMonthlyGHCNData(stations, config, ...) |
The parameterizer that calculates the monthly summaries from the daily |
CompleteMonthlyWind(stations, config, ...[, ...]) |
Parameterizer to extract the months with complete wind |
CrossCorrelation(stations, config, ...[, ...]) |
Class to calculate the cross correlation between the variables |
DailyCloud(stations, config, project_config, ...) |
Parameterizer to calculate the daily cloud values from hourly cloud data |
DailyGHCNData(stations, config, ...[, data, ...]) |
The parameterizer that reads in the daily data |
HourlyCloud(stations, config, ...[, data, ...]) |
Parameterizer that loads the hourly cloud data from the EECRA database |
MarkovChain(stations, config, ...[, data, ...]) |
The parameterizer to calculate the Markov Chain parameters |
MonthlyCloud(stations, config, ...[, data, ...]) |
Parameterizer to calculate the monthly cloud values from daily cloud |
MonthlyGHCNData(stations, config, ...[, ...]) |
The parameterizer that calculates the monthly summaries from the daily |
Parameterizer(stations, config, ...[, data, ...]) |
Base class for parameterization tasks |
PrcpDistParams(stations, config, ...[, ...]) |
The parameterizer to calculate the precipitation distribution parameters |
TemperatureParameterizer(stations, config, ...) |
Parameterizer to correlate the monthly mean and standard deviation on |
WindParameterizer(stations, config, ...[, ...]) |
Parameterizer to extract the months with complete clouds |
YearlyCompleteDailyCloud(stations, config, ...) |
The parameterizer that calculates the days in complete months of cloud |
YearlyCompleteDailyGHCNData(stations, ...[, ...]) |
The parameterizer that calculates the days in complete months |
YearlyCompleteMonthlyCloud(stations, config, ...) |
Parameterizer to extract the months with complete clouds |
YearlyCompleteMonthlyGHCNData(stations, ...) |
The parameterizer that calculates the monthly summaries from the daily |
YearlyCompleteMonthlyWind(stations, config, ...) |
Parameterizer to extract the months with complete wind |
Functions
cloud_func(x, a) |
Function for fitting the mean of wet and dry cloud to the mean of all |
cloud_sd_func(x, a) |
Function for fitting the standard deviation of wet and dry cloud to the |
default_cloud_config([args_type]) |
The default configuration for CloudParameterizerBase instances. |
default_daily_ghcn_config([download]) |
The default configuration for DailyGHCNData instances. |
default_prcp_config([thresh, threshs2compute]) |
The default configuration for PrcpDistParams instances. |
default_temp_config([cutoff, tmin_range1, ...]) |
The default configuration for TemperatureParameterizer instances. |
wind_sd_func(x, c1, c2, c3) |
-
class
gwgen.parameterization.CloudParameterizer(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteMonthlyCloudParameterizer to extract the months with complete clouds
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool cmonthly_cloudcmonthly_cloud parameterization instance dbnamestr(object=’‘) -> string dsThe dataframe of this parameterization task converted to a dataset error_keysdict() -> new empty dictionary fmtdict() -> new empty dictionary has_runbool(x) -> bool namestr(object=’‘) -> string namelist_keysdict() -> new empty dictionary setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string Methods
create_project(ds)Plot the relationship wet/dry cloud - mean cloud make_run_config(sp, info, full_nml)Configure with the wet/dry cloud - mean cloud correlation setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
allow_files= False¶
-
cmonthly_cloud¶ cmonthly_cloud parameterization instance
-
create_project(ds)[source]¶ Plot the relationship wet/dry cloud - mean cloud
Parameters: ds (xarray.Dataset) – The dataset to plot
-
dbname= 'cloud_correlation'¶
-
ds¶ The dataframe of this parameterization task converted to a dataset
-
error_keys= {'cldf_sd_w': 'sd_cloud_wet.a_err', 'cldf_sd_d': 'sd_cloud_dry.a_err', 'cldf_d': 'mean_cloud_dry.a_err', 'cldf_w': 'mean_cloud_wet.a_err'}¶
-
fmt= {'xlim': (0, 1), 'yrange': (0, 1), 'xrange': (0, 1), 'bounds': ['minmax', 11, 0, 99], 'ylim': (0, 1), 'cmap': 'w_Reds', 'xlabel': 'on %(state)s days', 'cbar': '', 'legend': False, 'bins': 10}¶
-
has_run= True¶
-
make_run_config(sp, info, full_nml)[source]¶ Configure with the wet/dry cloud - mean cloud correlation
Parameters: - %(TaskBase.make_run_config.parameters)s –
- full_nml (dict) – The dictionary with all the namelists
-
name= 'cloud'¶
-
namelist_keys= {'cldf_sd_w': 'sd_cloud_wet.a', 'cldf_sd_d': 'sd_cloud_dry.a', 'cldf_d': 'mean_cloud_dry.a', 'cldf_w': 'mean_cloud_wet.a'}¶
-
setup_requires= ['cmonthly_cloud']¶
-
sql_dtypes¶
-
summary= 'Parameterize the cloud data'¶
-
class
gwgen.parameterization.CloudParameterizerBase(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerAbstract base class for cloud parameterizers
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool args_typedefault_configsetup_fromsql_dtypesstationsMethods
eecra_ghcn_map()Get a dataframe mapping from GHCN id to EECRA station_id filter_stations(stations)Get the GHCN stations that are also in the EECRA dataset from_task(task, *args, **kwargs)Create a new instance from another task -
allow_files= False¶
-
args_type¶
-
default_config¶
-
classmethod
filter_stations(stations)[source]¶ Get the GHCN stations that are also in the EECRA dataset
Parameters: stations (np.ndarray) – A string array with stations to use Returns: The ids in stations that can be mapped to the eecra dataset Return type: np.ndarray
-
classmethod
from_task(task, *args, **kwargs)[source]¶ Create a new instance from another task
Parameters: - task (TaskBase) – The organizer to use the configuration from. Note that it can also be of a different type than this class
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible arguments
-
setup_from¶
-
sql_dtypes¶
-
stations¶
-
class
gwgen.parameterization.CompleteDailyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.DailyCloudThe parameterizer that calculates the days in complete months of cloud data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
colslist() -> new empty list daily_clouddaily_cloud parameterization instance dbnamestr(object=’‘) -> string monthly_cloudmonthly_cloud parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
init_from_scratch()setup_from_scratch()-
cols= ['wet_day', 'tmin', 'tmax', 'mean_cloud', 'wind']¶
-
daily_cloud¶ daily_cloud parameterization instance
-
dbname= 'complete_daily_cloud'¶
-
monthly_cloud¶ monthly_cloud parameterization instance
-
name= 'cdaily_cloud'¶
-
setup_requires= ['daily_cloud', 'monthly_cloud']¶
-
summary= 'Get the days of the complete daily cloud months'¶
-
class
gwgen.parameterization.CompleteDailyGHCNData(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.DailyGHCNDataThe parameterizer that calculates the days in complete months
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
dayday parameterization instance dbnamestr(object=’‘) -> string default_configmonthmonth parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
init_from_scratch()setup_from_scratch()-
day¶ day parameterization instance
-
dbname= 'complete_ghcn_daily'¶
-
default_config¶
-
month¶ month parameterization instance
-
name= 'cday'¶
-
setup_requires= ['day', 'month']¶
-
summary= 'Get the days of the complete months'¶
-
class
gwgen.parameterization.CompleteMonthlyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.MonthlyCloudParameterizer to extract the months with complete clouds
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
colslist() -> new empty list dbnamestr(object=’‘) -> string monthly_cloudmonthly_cloud parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
setup_from_scratch()-
cols= ['wet_day', 'mean_cloud']¶
-
dbname= 'complete_monthly_cloud'¶
-
monthly_cloud¶ monthly_cloud parameterization instance
-
name= 'cmonthly_cloud'¶
-
setup_requires= ['monthly_cloud']¶
-
summary= 'Extract the months with complete cloud data'¶
-
class
gwgen.parameterization.CompleteMonthlyGHCNData(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.MonthlyGHCNDataThe parameterizer that calculates the monthly summaries from the daily data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
dbnamestr(object=’‘) -> string monthmonth parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
setup_from_scratch()-
dbname= 'complete_ghcn_monthly'¶
-
month¶ month parameterization instance
-
name= 'cmonth'¶
-
setup_requires= ['month']¶
-
summary= 'Extract the complete months from the monthly data'¶
-
class
gwgen.parameterization.CompleteMonthlyWind(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteMonthlyCloudParameterizer to extract the months with complete wind
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
colslist() -> new empty list dbnamestr(object=’‘) -> string monthly_cloudmonthly_cloud parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string -
cols= ['wet_day', 'wind']¶
-
dbname= 'complete_monthly_wind'¶
-
monthly_cloud¶ monthly_cloud parameterization instance
-
name= 'cmonthly_wind'¶
-
setup_requires= ['monthly_cloud']¶
-
summary= 'Extract the months with complete wind data'¶
-
class
gwgen.parameterization.CrossCorrelation(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerClass to calculate the cross correlation between the variables
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
colslist() -> new empty list dbnamestr(object=’‘) -> string has_runbool(x) -> bool namestr(object=’‘) -> string namelist_keysdict() -> new empty dictionary setup_parallelbool(x) -> bool setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string yearly_cdaily_cloudyearly_cdaily_cloud parameterization instance Methods
run(info, full_nml)setup_from_db(**kwargs)Set up the parameterizer from datatables already created setup_from_file(**kwargs)Set up the parameterizer from already stored files setup_from_scratch()-
cols= ['tmin', 'tmax', 'mean_cloud', 'wind']¶
-
dbname= 'cross_correlation'¶
-
has_run= True¶
-
name= 'corr'¶
-
namelist_keys= {'a': None, 'b': None}¶
-
setup_parallel= False¶
-
setup_requires= ['yearly_cdaily_cloud']¶
-
sql_dtypes¶
-
summary= 'Cross corellation between temperature and cloudiness'¶
-
yearly_cdaily_cloud¶ yearly_cdaily_cloud parameterization instance
-
class
gwgen.parameterization.DailyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CloudParameterizerBaseParameterizer to calculate the daily cloud values from hourly cloud data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool dbnamestr(object=’‘) -> string hourly_cloudhourly_cloud parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
calculate_daily(df)setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
allow_files= True¶
-
dbname= 'daily_cloud'¶
-
hourly_cloud¶ hourly_cloud parameterization instance
-
name= 'daily_cloud'¶
-
setup_requires= ['hourly_cloud']¶
-
summary= 'Calculate the daily cloud values from hourly cloud data'¶
-
class
gwgen.parameterization.DailyGHCNData(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerThe parameterizer that reads in the daily data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
data_dirdbnamestr(object=’‘) -> string default_configflagslist() -> new empty list http_singlestr(object=’‘) -> string http_sourcestr(object=’‘) -> string namestr(object=’‘) -> string raw_src_filessql_dtypessummarystr(object=’‘) -> string Methods
init_from_scratch()Reimplemented to download the data if not existent setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
data_dir¶
-
dbname= 'ghcn_daily'¶
-
default_config¶
-
flags= ['tmax_m', 'prcp_s', 'tmax_q', 'prcp_m', 'tmin_m', 'tmax_s', 'tmin_s', 'prcp_q', 'tmin_q']¶
-
http_single= 'ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/all/{}'¶
-
http_source= 'ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd_all.tar.gz'¶
-
name= 'day'¶
-
raw_src_files¶
-
sql_dtypes¶
-
summary= 'Read in the daily GHCN data'¶
-
class
gwgen.parameterization.HourlyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CloudParameterizerBaseParameterizer that loads the hourly cloud data from the EECRA database
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool data_dirdbnamestr(object=’‘) -> string mon_mapdict() -> new empty dictionary monthslist() -> new empty list namestr(object=’‘) -> string raw_dirThe directory where we expect the raw files raw_src_filessql_dtypessrc_filessummarystr(object=’‘) -> string urlsdict() -> new empty dictionary yearslist() -> new empty list Methods
download_src(src_dir[, force, keep])Download the source files from the EECRA ftp server eecra_fname(year, mon[, ext])The the name of the eecra file get_data_from_files(files)get_eecra_url(year, mon)Get the download path for the file for a specific year and month init_from_scratch()Reimplemented to download the data if not existent setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()Set up the data -
allow_files= True¶
-
data_dir¶
-
dbname= 'hourly_cloud'¶
-
download_src(src_dir, force=False, keep=False)[source]¶ Download the source files from the EECRA ftp server
-
classmethod
get_eecra_url(year, mon)[source]¶ Get the download path for the file for a specific year and month
-
mon_map= {1: 'JAN', 2: 'FEB', 3: 'MAR', 4: 'APR', 5: 'MAY', 6: 'JUN', 7: 'JUL', 8: 'AUG', 9: 'SEP', 10: 'OCT', 11: 'NOV', 12: 'DEC'}¶
-
months= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]¶
-
name= 'hourly_cloud'¶
-
raw_dir¶ The directory where we expect the raw files
-
raw_src_files¶
-
sql_dtypes¶
-
src_files¶
-
summary= 'Hourly cloud data'¶
-
urls= {((1992, 3), (1996, 12)): 'http://cdiac.ess-dive.lbl.gov/ftp/ndp026c/land_199203_199612/', ((1997, 1), (2009, 12)): 'http://cdiac.ess-dive.lbl.gov/ftp/ndp026c/land_199701_200912/', ((1971, 1), (1977, 4)): 'http://cdiac.ess-dive.lbl.gov/ftp/ndp026c/land_197101_197704/', ((1982, 11), (1987, 6)): 'http://cdiac.ess-dive.lbl.gov/ftp/ndp026c/land_198211_198706/', ((1987, 7), (1992, 2)): 'http://cdiac.ess-dive.lbl.gov/ftp/ndp026c/land_198707_199202/', ((1977, 5), (1982, 10)): 'http://cdiac.ess-dive.lbl.gov/ftp/ndp026c/land_197705_198210/'}¶
-
years= [1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009]¶
-
class
gwgen.parameterization.MarkovChain(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerThe parameterizer to calculate the Markov Chain parameters
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsMethods
calc_ndays(df)calculate_probabilities(df)Calculate the transition probabilities for one month across multiple create_project(ds)Create the project of the plots of the transition probabilities make_run_config(sp, info, full_nml)Configure the experiment with the MarkovChain relationships setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()Attributes
cdaycday parameterization instance dbnamestr(object=’‘) -> string dsThe dataset of the dataDataFramefmtdict() -> new empty dictionary has_runbool(x) -> bool kwargsdict() -> new empty dictionary namestr(object=’‘) -> string namelist_keyslist() -> new empty list setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string -
classmethod
calculate_probabilities(df)[source]¶ Calculate the transition probabilities for one month across multiple years
-
cday¶ cday parameterization instance
-
create_project(ds)[source]¶ Create the project of the plots of the transition probabilities
Parameters: ds (xarray.Dataset) – The dataset to plot
-
dbname= 'markov'¶
-
ds¶ The dataset of the
dataDataFrame
-
fmt= {'ci': None, 'cbar': '', 'xlim': (0, 1), 'fix': 0, 'bounds': ['minmax', 11, 0, 99], 'ylim': (0, 1), 'cmap': 'w_Reds', 'legendlabels': ['$%(symbol)s$ = %(slope)1.4f * %(xname)s, $R^2$ = %(rsquared)1.3f'], 'ylabel': '%(long_name)s', 'legend': {'loc': 'upper left'}, 'bins': 10}¶
-
has_run= True¶
-
kwargs= {'ci': None, 'cbar': '', 'xlim': (0, 1), 'fix': 0, 'bounds': ['minmax', 11, 0, 99], 'ylim': (0, 1), 'cmap': 'w_Reds', 'legendlabels': ['$%(symbol)s$ = %(slope)1.4f * %(xname)s, $R^2$ = %(rsquared)1.3f'], 'ylabel': '%(long_name)s', 'legend': {'loc': 'upper left'}, 'bins': 10}¶
-
make_run_config(sp, info, full_nml)[source]¶ Configure the experiment with the MarkovChain relationships
Parameters: - %(TaskBase.make_run_config.parameters)s –
- full_nml (dict) – The dictionary with all the namelists
-
name= 'markov'¶
-
namelist_keys= ['p101_1', 'p001_1', 'p001_2', 'p11_1', 'p11_2', 'p101_2']¶
-
setup_requires= ['cday']¶
-
sql_dtypes¶
-
summary= 'Calculate the markov chain parameterization'¶
-
class
gwgen.parameterization.MonthlyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CloudParameterizerBaseParameterizer to calculate the monthly cloud values from daily cloud
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool daily_clouddaily_cloud parameterization instance dbnamestr(object=’‘) -> string namestr(object=’‘) -> string setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string Methods
calculate_monthly(df)setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
allow_files= True¶
-
daily_cloud¶ daily_cloud parameterization instance
-
dbname= 'monthly_cloud'¶
-
name= 'monthly_cloud'¶
-
setup_requires= ['daily_cloud']¶
-
sql_dtypes¶
-
summary= 'Calculate the monthly cloud values from daily cloud data'¶
-
class
gwgen.parameterization.MonthlyGHCNData(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerThe parameterizer that calculates the monthly summaries from the daily data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
dayday parameterization instance dbnamestr(object=’‘) -> string namestr(object=’‘) -> string setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string Methods
monthly_summary(df)setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
day¶ day parameterization instance
-
dbname= 'ghcn_monthly'¶
-
name= 'month'¶
-
setup_requires= ['day']¶
-
sql_dtypes¶
-
summary= 'Calculate monthly means from the daily GHCN data'¶
-
class
gwgen.parameterization.Parameterizer(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.utils.TaskBaseBase class for parameterization tasks
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
error_keysA mapping from the keys in the namelist that are modified by this namelist_keysA mapping from the keys in the namelist that are modified by this task_config_keysA mapping from the keys in the namelist that are modified by this task_data_dirThe directory where to store data Methods
get_config_key(nml_key)get_error(nml_key)get_task_for_nml_key(nml_key)make_run_config(sp, info, full_nml)Configure the experiment -
error_keys= {}¶ A mapping from the keys in the namelist that are modified by this parameterization task to the error as stored in the configuration
-
make_run_config(sp, info, full_nml)[source]¶ Configure the experiment
Parameters: - %(TaskBase.make_run_config.parameters)s –
- full_nml (dict) – The dictionary with all the namelists
-
namelist_keys= {}¶ A mapping from the keys in the namelist that are modified by this parameterization task to the key as it is used in the task information
-
task_config_keys= {}¶ A mapping from the keys in the namelist that are modified by this parameterization task to the key as it is used in the task_config attribute
-
task_data_dir¶ The directory where to store data
-
class
gwgen.parameterization.PrcpDistParams(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerThe parameterizer to calculate the precipitation distribution parameters
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
cdaycday parameterization instance dbnamestr(object=’‘) -> string default_configdsThe dataset of the datadataframeerror_keysdict() -> new empty dictionary filtered_dataReturn the data that only belongs to the specified threshold of the fmtdefault formatoptions for the has_runbool(x) -> bool kwargsdefault formatoptions for the namestr(object=’‘) -> string namelist_keysdict() -> new empty dictionary setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string task_config_keysdict() -> new empty dictionary Methods
create_project(ds)Make the gamma shape - number of wet days plot make_run_config(sp, info, full_nml)Configure the experiment with information on gamma scale and GP shape plot_additionals([pdf])Plot the histogram of GP shape prcp_dist_params(df[, threshs])setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
cday¶ cday parameterization instance
-
create_project(ds)[source]¶ Make the gamma shape - number of wet days plot
Parameters: %(TaskBase.create_project.parameters)s –
-
dbname= 'prcp_dist_params'¶
-
default_config¶
-
ds¶ The dataset of the
datadataframe
-
error_keys= {'gp_shape': 'gpshape_std'}¶
-
filtered_data¶ Return the data that only belongs to the specified threshold of the task
-
fmt= {'legendlabels': ['$\\theta$ = %(slope)1.4f * $\\bar{{p}}_d$, $R^2$ = %(rsquared)1.3f'], 'yrange': (0, ['rounded', 95]), 'xrange': (0, ['rounded', 95]), 'fix': 0, 'bounds': ['minmax', 11, 0, 99], 'precision': 0.1, 'cmap': 'w_Reds', 'xlabel': '{desc}', 'cbar': '', 'ylabel': '{desc}', 'legend': {'loc': 'upper left'}, 'bins': 10}¶ default formatoptions for the
psy_reg.plotters.DensityRegPlotterplotter
-
has_run= True¶
-
kwargs= {'legendlabels': ['$\\theta$ = %(slope)1.4f * $\\bar{{p}}_d$, $R^2$ = %(rsquared)1.3f'], 'yrange': (0, ['rounded', 95]), 'xrange': (0, ['rounded', 95]), 'fix': 0, 'bounds': ['minmax', 11, 0, 99], 'precision': 0.1, 'cmap': 'w_Reds', 'xlabel': '{desc}', 'cbar': '', 'ylabel': '{desc}', 'legend': {'loc': 'upper left'}, 'bins': 10}¶ default formatoptions for the
psy_reg.plotters.DensityRegPlotterplotter
-
make_run_config(sp, info, full_nml)[source]¶ Configure the experiment with information on gamma scale and GP shape
Parameters: %(Parameterizer.make_run_config.parameters)s –
-
name= 'prcp'¶
-
namelist_keys= {'gp_shape': 'gpshape', 'thresh': 'thresh', 'g_scale_coeff': 'slope'}¶
-
plot_additionals(pdf=None)[source]¶ Plot the histogram of GP shape
Parameters: pdf (matplotlib.backends.backend_pdf.PdfPages) – The PdfPages instance which can be used to save the figure
-
setup_requires= ['cday']¶
-
sql_dtypes¶
-
summary= 'Calculate the precipitation distribution parameters of the hybrid Gamma-GP'¶
-
task_config_keys= {'thresh': 'thresh'}¶
-
class
gwgen.parameterization.TemperatureParameterizer(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.ParameterizerParameterizer to correlate the monthly mean and standard deviation on wet and dry days with the montly mean
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsMethods
calc_monthly_props(df)Calculate the statistics for one single month in one year calculate_probabilities(df)Calculate the statistics for one month across multiple years create_project(ds)Create the plots of the wet/dry - mean relationships make_run_config(sp, info, full_nml)Configure the experiment with the correlations of wet/dry temperature setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()Attributes
cdaycday parameterization instance dbnamelist() -> new empty list default_configdsThe dataframe of this parameterization task converted to a dataset fmtdict() -> new empty dictionary has_runbool(x) -> bool namestr(object=’‘) -> string namelist_keysdict() -> new empty dictionary sd_fit_fmtdict() -> new empty dictionary sd_hist_fmtdict() -> new empty dictionary setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string -
classmethod
calculate_probabilities(df)[source]¶ Calculate the statistics for one month across multiple years
-
cday¶ cday parameterization instance
-
create_project(ds)[source]¶ Create the plots of the wet/dry - mean relationships
Parameters: %(TaskBase.create_project)s –
-
dbname= ['temperature_full', 'temperature']¶
-
default_config¶
-
ds¶ The dataframe of this parameterization task converted to a dataset
-
fmt= {'cbar': '', 'yrange': (['rounded', 5], ['rounded', 95]), 'xrange': (['rounded', 5], ['rounded', 95]), 'bounds': ['minmax', 11, 0, 99], 'precision': 0.1, 'cmap': 'w_Reds', 'xlabel': 'on %(state)s days', 'legendlabels': ['$%(symbol)s$ = %(intercept)1.4f + %(slope)1.4f * $%(xsymbol)s$'], 'legend': {'loc': 'upper left'}, 'bins': 10}¶
-
has_run= True¶
-
make_run_config(sp, info, full_nml)[source]¶ Configure the experiment with the correlations of wet/dry temperature to mean temperature
Parameters: - %(TaskBase.make_run_config.parameters)s –
- full_nml (dict) – The dictionary with all the namelists
-
name= 'temp'¶
-
namelist_keys= {'tmin_sd_w': 'tminstddev_wet.coeffs', 'tmin_w1': 'tmin_wet.intercept', 'tmin_w2': 'tmin_wet.slope', 'tmin_sd_d': 'tminstddev_dry.coeffs', 'tmin_d1': 'tmin_dry.intercept', 'tmin_d2': 'tmin_dry.slope', 'tmax_sd_w': 'tmaxstddev_wet.coeffs', 'tmax_d2': 'tmax_dry.slope', 'tmax_d1': 'tmax_dry.intercept', 'tmax_w2': 'tmax_wet.slope', 'tmax_w1': 'tmax_wet.intercept', 'tmax_sd_d': 'tmaxstddev_dry.coeffs', 'tmax_sd_breaks': 'tmaxstddev.breaks', 'tmin_sd_breaks': 'tminstddev.breaks'}¶
-
sd_fit_fmt= {'xlabel': 'on %(state)s days', 'legend': {'loc': 'upper left'}}¶
-
sd_hist_fmt= {'yrange': (0, ['rounded', 95]), 'xrange': (['rounded', 5], ['rounded', 95]), 'bounds': ['minmax', 11, 0, 99], 'precision': 0.1, 'cmap': 'w_Reds', 'xlabel': 'on %(state)s days', 'cbar': '', 'bins': 10}¶
-
setup_requires= ['cday']¶
-
sql_dtypes¶
-
summary= 'Temperature mean correlations'¶
-
class
gwgen.parameterization.WindParameterizer(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteMonthlyWindParameterizer to extract the months with complete clouds
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool cmonthly_windcmonthly_wind parameterization instance dbnamestr(object=’‘) -> string dsThe dataframe of this parameterization task converted to a dataset fmtdict() -> new empty dictionary has_runbool(x) -> bool namestr(object=’‘) -> string namelist_keysdict() -> new empty dictionary setup_requireslist() -> new empty list sql_dtypessummarystr(object=’‘) -> string Methods
create_project(ds)Plot the relationship wet/dry cloud - mean cloud make_run_config(sp, info, full_nml)Configure with the wet/dry cloud - mean cloud correlation setup_from_db(*args, **kwargs)setup_from_file(*args, **kwargs)setup_from_scratch()-
allow_files= False¶
-
cmonthly_wind¶ cmonthly_wind parameterization instance
-
create_project(ds)[source]¶ Plot the relationship wet/dry cloud - mean cloud
Parameters: ds (xarray.Dataset) – The dataset to plot
-
dbname= 'wind_correlation'¶
-
ds¶ The dataframe of this parameterization task converted to a dataset
-
fmt= {'legendlabels': ['$%(symbol)s = %(intercept)1.4f %(slope)+1.4f \\cdot %(xsymbol)s$'], 'yrange': (0, ['rounded', 95]), 'xrange': (0, ['rounded', 95]), 'fix': 0, 'bounds': ['minmax', 11, 0, 99], 'cmap': 'w_Reds', 'xlabel': 'on %(state)s days', 'cbar': '', 'legend': {'loc': 'upper left'}, 'bins': 100}¶
-
has_run= True¶
-
make_run_config(sp, info, full_nml)[source]¶ Configure with the wet/dry cloud - mean cloud correlation
Parameters: - %(TaskBase.make_run_config.parameters)s –
- full_nml (dict) – The dictionary with all the namelists
-
name= 'wind'¶
-
namelist_keys= {'wind_sd_w': 'sd_wind_wet', 'wind_d2': 'wind_dry.slope', 'wind_d1': 'wind_dry.intercept', 'wind_sd_d': 'sd_wind_dry', 'wind_w2': 'wind_wet.slope', 'wind_w1': 'wind_wet.intercept'}¶
-
setup_requires= ['cmonthly_wind']¶
-
sql_dtypes¶
-
summary= 'Parameterize the wind data'¶
-
class
gwgen.parameterization.YearlyCompleteDailyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteDailyCloudThe parameterizer that calculates the days in complete months of cloud data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool cdaily_cloudcdaily_cloud parameterization instance cmonthly_cloudcmonthly_cloud parameterization instance colslist() -> new empty list dbnamestr(object=’‘) -> string namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
setup_from_scratch()-
allow_files= False¶
-
cdaily_cloud¶ cdaily_cloud parameterization instance
-
cmonthly_cloud¶ cmonthly_cloud parameterization instance
-
cols= ['wet_day', 'mean_cloud', 'tmin', 'tmax', 'wind']¶
-
dbname= 'yearly_complete_daily_cloud'¶
-
name= 'yearly_cdaily_cloud'¶
-
setup_requires= ['cdaily_cloud', 'cmonthly_cloud']¶
-
summary= 'Get the days of the complete daily cloud months in complete years'¶
-
class
gwgen.parameterization.YearlyCompleteDailyGHCNData(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteDailyGHCNDataThe parameterizer that calculates the days in complete months
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
dayday parameterization instance dbnamestr(object=’‘) -> string monthmonth parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
setup_from_scratch()-
day¶ day parameterization instance
-
dbname= 'yearly_complete_ghcn_daily'¶
-
month¶ month parameterization instance
-
name= 'yearly_cday'¶
-
setup_requires= ['day', 'month']¶
-
summary= 'Get the days of the complete months in complete years'¶
-
class
gwgen.parameterization.YearlyCompleteMonthlyCloud(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteMonthlyCloudParameterizer to extract the months with complete clouds
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
allow_filesbool(x) -> bool cmonthly_cloudcmonthly_cloud parameterization instance colslist() -> new empty list dbnamestr(object=’‘) -> string namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
setup_from_scratch()-
allow_files= False¶
-
cmonthly_cloud¶ cmonthly_cloud parameterization instance
-
cols= ['wet_day', 'mean_cloud']¶
-
dbname= 'yearly_complete_monthly_cloud'¶
-
name= 'yearly_cmonthly_cloud'¶
-
setup_requires= ['cmonthly_cloud']¶
-
summary= 'Extract the months with complete cloud data in complete years'¶
-
class
gwgen.parameterization.YearlyCompleteMonthlyGHCNData(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.CompleteMonthlyGHCNDataThe parameterizer that calculates the monthly summaries from the daily data
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
dbnamestr(object=’‘) -> string monthmonth parameterization instance namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string Methods
setup_from_scratch()-
dbname= 'yearly_complete_ghcn_monthly'¶
-
month¶ month parameterization instance
-
name= 'yearly_cmonth'¶
-
setup_requires= ['month']¶
-
summary= 'Extract the complete months from the monthly data in complete years'¶
-
class
gwgen.parameterization.YearlyCompleteMonthlyWind(stations, config, project_config, global_config, data=None, requirements=None, *args, **kwargs)[source]¶ Bases:
gwgen.parameterization.YearlyCompleteMonthlyCloudParameterizer to extract the months with complete wind
Parameters: - stations (list) – The list of stations to process
- config (dict) – The configuration of the experiment
- project_config (dict) – The configuration of the underlying project
- global_config (dict) – The global configuration
- data (pandas.DataFrame) – The data to use. If None, use the
setup()method - requirements (list of
TaskBaseinstances) – The required instances. If None, you must call theset_requirements()method later
Other Parameters: ``*args, **kwargs`` – The configuration of the task. See the
TaskConfigfor arguments. Note that if you provide*args, you have to provide all possible argumentsAttributes
cmonthly_cloudcmonthly_windcmonthly_wind parameterization instance colslist() -> new empty list dbnamestr(object=’‘) -> string namestr(object=’‘) -> string setup_requireslist() -> new empty list summarystr(object=’‘) -> string -
cmonthly_cloud¶
-
cmonthly_wind¶ cmonthly_wind parameterization instance
-
cols= ['wet_day', 'wind']¶
-
dbname= 'yearly_complete_monthly_wind'¶
-
name= 'yearly_cmonthly_wind'¶
-
setup_requires= ['cmonthly_wind']¶
-
summary= 'Extract the months with complete wind data in complete years'¶
-
gwgen.parameterization.cloud_func(x, a)[source]¶ Function for fitting the mean of wet and dry cloud to the mean of all cloud
This function returns y with
\[y = ((-a - 1) / (a^2 x - a^2 - a)) - \frac{1}{a}\]Parameters: - x (np.ndarray) – The x input data
- a (float) – The parameter as mentioned in the equation above
-
gwgen.parameterization.cloud_sd_func(x, a)[source]¶ Function for fitting the standard deviation of wet and dry cloud to the mean of wet or dry cloud
This function returns y with
\[y = a^2 x (1 - x)\]Parameters: - x (np.ndarray) – The x input data
- a (float) – The parameter as mentioned in the equation above
-
gwgen.parameterization.default_cloud_config(args_type='ghcn', *args, **kwargs)[source]¶ The default configuration for
CloudParameterizerBaseinstances. See also theCloudParameterizerBase.default_configattributeParameters: - args_type (str) –
The type of the stations. One of
- ghcn
- Stations are GHCN ids
- eecra
- Stations are EECRA station numbers
- setup_from ({ 'scratch' | 'file' | 'db' | None }) –
The method how to setup the instance either from
'scratch'- To set up the task from the raw data
'file'- Set up the task from an existing file
'db'- Set up the task from a database
None- If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
- to_csv (bool) – If True, the data at setup will be written to a csv file
- to_db (bool) – If True, the data at setup will be written to into a database
- remove (bool) – If True and the old data file already exists, remove before writing to it
- skip_filtering (bool) – If True, skip the filtering for the correct stations in the datafile
- plot_output (str) – An alternative path to use for the PDF file of the plot
- nc_output (str) – An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data
- project_output (str) – An alternative path to use for the psyplot project file of the plot
- new_project (bool) – If True, a new project will be created even if a file in project_output exists already
- project (str) – The path to a psyplot project file to use for this parameterization
- close (bool) – Close the project at the end
- args_type (str) –
-
gwgen.parameterization.default_daily_ghcn_config(download=None, *args, **kwargs)[source]¶ The default configuration for
DailyGHCNDatainstances. See also theDailyGHCNData.default_configattributeParameters: - download ({ 'single' | 'all' | None }) – What to do if a stations file is missing. The default is
Nonewhich raises an Error. Otherwise, if'single', download the missing file from ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/all/{}. If'all'the entire tarball is downloaded from ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd_all.tar.gz - setup_from ({ 'scratch' | 'file' | 'db' | None }) –
The method how to setup the instance either from
'scratch'- To set up the task from the raw data
'file'- Set up the task from an existing file
'db'- Set up the task from a database
None- If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
- to_csv (bool) – If True, the data at setup will be written to a csv file
- to_db (bool) – If True, the data at setup will be written to into a database
- remove (bool) – If True and the old data file already exists, remove before writing to it
- skip_filtering (bool) – If True, skip the filtering for the correct stations in the datafile
- plot_output (str) – An alternative path to use for the PDF file of the plot
- nc_output (str) – An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data
- project_output (str) – An alternative path to use for the psyplot project file of the plot
- new_project (bool) – If True, a new project will be created even if a file in project_output exists already
- project (str) – The path to a psyplot project file to use for this parameterization
- close (bool) – Close the project at the end
- download ({ 'single' | 'all' | None }) – What to do if a stations file is missing. The default is
-
gwgen.parameterization.default_prcp_config(thresh=5.0, threshs2compute=[5, 7.5, 10, 12.5, 15, 17.5, 20], *args, **kwargs)[source]¶ The default configuration for
PrcpDistParamsinstances. See also thePrcpDistParams.default_configattributeParameters: - thresh (float) – The threshold to use for the configuration
- threshs2compute (list of floats) – The thresholds to compute during the setup of the data
- setup_from ({ 'scratch' | 'file' | 'db' | None }) –
The method how to setup the instance either from
'scratch'- To set up the task from the raw data
'file'- Set up the task from an existing file
'db'- Set up the task from a database
None- If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
- to_csv (bool) – If True, the data at setup will be written to a csv file
- to_db (bool) – If True, the data at setup will be written to into a database
- remove (bool) – If True and the old data file already exists, remove before writing to it
- skip_filtering (bool) – If True, skip the filtering for the correct stations in the datafile
- plot_output (str) – An alternative path to use for the PDF file of the plot
- nc_output (str) – An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data
- project_output (str) – An alternative path to use for the psyplot project file of the plot
- new_project (bool) – If True, a new project will be created even if a file in project_output exists already
- project (str) – The path to a psyplot project file to use for this parameterization
- close (bool) – Close the project at the end
-
gwgen.parameterization.default_temp_config(cutoff=10, tmin_range1=[-50, -40], tmin_range2=[25, 30], tmax_range1=[-40, -30], tmax_range2=[35, 45], *args, **kwargs)[source]¶ The default configuration for
TemperatureParameterizerinstances. See also thePrcpDistParams.default_configattributeParameters: - cutoff (int) – The minimum number of values that is required for fitting the standard deviation
- tmin_range1 (list of floats with length 2) – The ranges
[vmin, vmax]to use for the extrapolation of minimum temperatures standard deviation below 0. The fit will be used for all points below the givenvmax - tmin_range2 (list of floats with length 2) – The ranges
[vmin, vmax]to use for the extrapolation of minimum temperatures standard deviation above 0. The fit will be used for all points above the givenvmin - tmax_range1 (list of floats with length 2) – The ranges
[vmin, vmax]to use for the extrapolation of maximum temperatures standard deviation below 0. The fit will be used for all points below the givenvmax - tmax_range2 (list of floats with length 2) – The ranges
[vmin, vmax]to use for the extrapolation of maximum temperatures standard deviation above 0. The fit will be used for all points above the givenvmin - setup_from ({ 'scratch' | 'file' | 'db' | None }) –
The method how to setup the instance either from
'scratch'- To set up the task from the raw data
'file'- Set up the task from an existing file
'db'- Set up the task from a database
None- If the file name of this this task exists, use this one, otherwise a database is provided, use this one, otherwise go from scratch
- to_csv (bool) – If True, the data at setup will be written to a csv file
- to_db (bool) – If True, the data at setup will be written to into a database
- remove (bool) – If True and the old data file already exists, remove before writing to it
- skip_filtering (bool) – If True, skip the filtering for the correct stations in the datafile
- plot_output (str) – An alternative path to use for the PDF file of the plot
- nc_output (str) – An alternative path (or multiples depending on the task) to use for the netCDF file of the plot data
- project_output (str) – An alternative path to use for the psyplot project file of the plot
- new_project (bool) – If True, a new project will be created even if a file in project_output exists already
- project (str) – The path to a psyplot project file to use for this parameterization
- close (bool) – Close the project at the end