ReferenceModels
CalibrateEDMF.ReferenceModels.ReferenceModel — TypeReferenceModel{FT <: Real}A structure containing information about the 'true' reference model and the observation map used to compare the parameterized and reference models.
Fields
y_names::Vector{String}: Vector of reference variable namesy_dir::String: Directory for reference data to computeymean vectorΣ_dir::String: Directory for reference data to computeΣcovariance matrixcase_name::String: Name of casey_t_start::Real: Start time for computing mean statistics overy_t_end::Real: End time for computing mean statistics overΣ_t_start::Real: Start time for computing covariance statistics overΣ_t_end::Real: End time for computing covariance statistics overz_obs::Vector{FT} where FT<:Real: Vector of observed vertical locationsnamelist::Dict: TurbulenceConvection namelisty_type::CalibrateEDMF.ModelTypes.ModelType: Type of model used to generate mean observationsΣ_type::CalibrateEDMF.ModelTypes.ModelType: Type of model used to generate observational noise
Constructors
ReferenceModel(y_names, y_dir, case_name, t_start, t_end; [Σ_dir, Σ_t_start, Σ_t_end, y_type, Σ_type, n_obs, namelist_args, seed])A ReferenceModel can be defined for a case case_name, provided the location of the data, y_dir, the  reference variable names y_names, and the averaging interval (t_start, t_end) is provided.
If data and/or averaging intervals for the empirical covariance matrix Σ is different than the mean observations y, this is specified with Σ_dir, Σ_t_start, and Σ_t_end.
ReferenceModel constructor allowing for any or all of Σ_dir, Σ_t_start, Σ_t_end to be unspecified, in which case they take their values from y_dir, t_start and t_end, respectively.
A tuple of namelist_args can be specified to overwrite default arguments for the case in TurbulenceConvection.jl.
Mainly for testing purposes, a seed can also be specified to avoid randomness during namelist generation.
CalibrateEDMF.ReferenceModels.get_ref_model_kwargs — Functionget_ref_model_kwargs(ref_config::Dict; [global_namelist_args])Extract fields from the reference config necessary to construct ReferenceModels.
The namelist that defines a case is fetched from TC.jl for each case defined in ref_config["case_name"]. These can be overwritten in one of two ways;
- Define case-by-case overwrite entries in 
ref_config["namelist_args"] - Define global overwrite entries with the keyword argument 
global_namelist_args(VectorofTuples). These entries apply to all cases, training, validation, testing, etc. 
Note that the case-by-case namelist_args supersede both TC.jl defaults and global namelist_args entries.
See also construct_reference_models.
CalibrateEDMF.ReferenceModels.construct_reference_models — Functionconstruct_reference_models(kwarg_ld::Dict; [seed])::Vector{ReferenceModel}Returns a vector of ReferenceModels given a dictionary of keyword argument lists.
See also get_ref_model_kwargs.
Inputs:
kwarg_ld:: Dictionary of keyword argument listsseed:: If set, seed is an integer, and is the seed value to generate a TC namelist for each case
Outputs:
ref_models:: Vector where the i-th ReferenceModel is constructed from the i-th element of every keyword argument list of the dictionary.
CalibrateEDMF.ReferenceModels.time_shift_reference_model — Functiontime_shift_reference_model(m::ReferenceModel, time_shift::FT) where {FT <: Real}Returns a time-shifted ReferenceModel, considering an interval relative to the last available time step of the original model. Only LES data (from ydir or Σdir) are time shifted.
Inputs:
m:: A ReferenceModel.time_shift:: [LES last time - SCM start time (LES timeframe)]
Outputs:
- The time-shifted ReferenceModel.
 
CalibrateEDMF.ReferenceModels.get_z_obs — FunctionReturns the observed vertical locations for a reference model
CalibrateEDMF.ReferenceModels.get_scm_namelist — Functionget_scm_namelist(case_name; [les_dir, overwrite, namelist_args, seed])Returns a TurbulenceConvection.jl namelist, given a case and a list of namelist arguments.
Inputs:
case_name:: Name of the TurbulenceConvection.jl case considered.les_dir:: Directory with LES data to drive the SCM with, ifcase_nameisLES_driven_SCM.namelist_args:: Vector of non-default arguments to be used in the namelist, defined as a vector of tuples.seed:: If set, seed is an integer, and is the seed value to generate a TC namelist.
Outputs:
namelist:: The TurbulenceConvection.jl namelist.
CalibrateEDMF.ReferenceModels.ReferenceModelBatch — Typestruct ReferenceModelBatchA structure containing a batch of ReferenceModels and an evaluation order for ReferenceModels within the current epoch.
Fields
ref_models::Vector{CalibrateEDMF.ReferenceModels.ReferenceModel}: Vector containing all reference modelseval_order::Vector{Int64}: Vector of indices defining theReferenceModelevaluation order when batching
Constructors
ReferenceModelBatch(ref_models::Vector{ReferenceModel}, shuffling::Bool = true)ReferenceModelBatch constructor given a vector of ReferenceModels.
ReferenceModelBatch(kwarg_ld::Dict, shuffling::Bool = true)ReferenceModelBatch constructor given a dictionary of keyword argument lists.
Inputs:
kwarg_ld:: Dictionary of keyword argument listsshuffling:: Whether to shuffle the order of ReferenceModels.
CalibrateEDMF.ReferenceModels.get_minibatch! — Functionget_minibatch!(ref_models::ReferenceModelBatch, batch_size::Int)Returns a minibatch of ReferenceModels from a ReferenceModelBatch and updates the eval order.
The size of the minibatch is either the requested size, or the remainder of the elements in the eval_order for this epoch.
Inputs:
ref_model_batch:: A ReferenceModelBatch.batch_size:: The number ofReferenceModels to retrieve.
Outputs:
- A vector of 
ReferenceModels. - The indices of the returned 
ReferenceModels. 
CalibrateEDMF.ReferenceModels.reshuffle_on_epoch_end — FunctionRestarts a shuffled evaluation order if the current epoch has finished.