scripts.averaging.create_climo_files ==================================== .. py:module:: scripts.averaging.create_climo_files Functions --------- .. autoapisummary:: scripts.averaging.create_climo_files.my_formatwarning scripts.averaging.create_climo_files.get_time_slice_by_year scripts.averaging.create_climo_files.create_climo_files scripts.averaging.create_climo_files.process_variable scripts.averaging.create_climo_files.check_averaging_interval Module Contents --------------- .. py:function:: my_formatwarning(msg, *args, **kwargs) .. py:function:: get_time_slice_by_year(time, startyear, endyear) Function to get `slice` object from desired year range .. py:function:: create_climo_files(adf, clobber=False, search=None) 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 .. py:function:: process_variable(adf, ts_files, syr, eyr, output_file) Compute and save the climatology file. .. py:function:: check_averaging_interval(syear_in, eyear_in) Check whether given start and end years are valid Returns `None` if any of the years are not positive whole numbers