broker
Broker
- class weatherDB.broker.Broker[source]
Bases:
objectA class to manage and update the database.
Can get used to update all the stations and parameters at once.
This class is only working with super user privileges.
Public Methods:
__init__()update_raw([only_new, paras])Update the raw data from the DWD-CDC server to the database.
update_meta([paras])Update the meta file from the CDC Server to the Database.
update_ma([paras])Update the multi-annual data from raster to table.
update_period_meta([paras])Update the periods in the meta table.
quality_check([paras, with_fillup_nd])Do the quality check on the stations raw data.
last_imp_quality_check([paras, with_fillup_nd])Quality check the last imported data.
fillup([paras])Fillup the timeseries.
last_imp_fillup([paras])Fillup the last imported data.
Richter correct all of the precipitation data.
Richter correct the last imported precipitation data.
update_db([paras])The regular Update of the database.
Initiate the Database.
- fillup(paras=['n', 't', 'et'])[source]
Fillup the timeseries.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].
- initiate_db()[source]
Initiate the Database.
Downloads all the data from the CDC server for the first time. Updates the multi-annual data and the richter-class for all the stations. Quality checks and fills up the timeseries.
- last_imp_fillup(paras=['n', 't', 'et'])[source]
Fillup the last imported data.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].
- last_imp_quality_check(paras=['n', 't', 'et'], with_fillup_nd=True)[source]
Quality check the last imported data.
Also fills up the daily precipitation data if the 10 minute precipitation data should get quality checked.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n”, “t”, “et”]. The default is [“n”, “t”, “et”].
with_fillup_nd (bool, optional) – Should the daily precipitation data get filled up if the 10 minute precipitation data gets quality checked. The default is True.
- quality_check(paras=['n', 't', 'et'], with_fillup_nd=True)[source]
Do the quality check on the stations raw data.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n”, “t”, “et”]. The default is [“n”, “t”, “et”].
with_fillup_nd (bool, optional) – Should the daily precipitation data get filled up if the 10 minute precipitation data gets quality checked. The default is True.
- update_db(paras=['n_d', 'n', 't', 'et'])[source]
The regular Update of the database.
Downloads new data. Quality checks the newly imported data. Fills up the newly imported data.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].
- update_ma(paras=['n_d', 'n', 't', 'et'])[source]
Update the multi-annual data from raster to table.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].
- update_meta(paras=['n_d', 'n', 't', 'et'])[source]
Update the meta file from the CDC Server to the Database.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].
- update_period_meta(paras=['n_d', 'n', 't', 'et'])[source]
Update the periods in the meta table.
- Parameters
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].
- update_raw(only_new=True, paras=['n_d', 'n', 't', 'et'])[source]
Update the raw data from the DWD-CDC server to the database.
- Parameters
only_new (bool, optional) – Get only the files that are not yet in the database? If False all the available files are loaded again. The default is True.
paras (list of str, optional) – The parameters for which to do the actions. Can be one, some or all of [“n_d”, “n”, “t”, “et”]. The default is [“n_d”, “n”, “t”, “et”].