averaging.create_climo_files module

scripts.averaging.create_climo_files.check_averaging_interval(syear_in, eyear_in)[source]

Check whether given start and end years are valid

Returns None if any of the years are not positive whole numbers

scripts.averaging.create_climo_files.create_climo_files(adf, clobber=False, search=None)[source]

This is an example function showing how to set-up a time-averaging method for calculating climatologies from CAM time series files using multiprocessing for parallelization.

Description of needed inputs from ADF:

case_name -> Name of CAM case provided by “cam_case_name” input_ts_loc -> Location of CAM time series files provided by “cam_ts_loc” output_loc -> Location to write CAM climo files to, provided by “cam_climo_loc” var_list -> List of CAM output variables provided by “diag_var_list”

Optional keyword arguments:

clobber -> whether to overwrite existing climatology files. Defaults to False (do not delete).

search -> optional; if supplied requires a string used as a template to find the time series files

using {CASE} and {VARIABLE} and otherwise an arbitrary shell-like globbing pattern: example 1: provide the string “{CASE}.*.{VARIABLE}.*.nc” this is the default example 2: maybe CASE is not necessary because post-process destroyed the info “post_process_text-{VARIABLE}.nc” example 3: order does not matter “{VARIABLE}.{CASE}.*.nc” Only CASE and VARIABLE are allowed because they are arguments to the averaging function

scripts.averaging.create_climo_files.get_time_slice_by_year(time, startyear, endyear)[source]

Function to get slice object from desired year range

scripts.averaging.create_climo_files.process_variable(adf, ts_files, syr, eyr, output_file)[source]

Compute and save the climatology file.