melodies_monet.util.tools

Functions

calc_24hr_ave(df[, col])

calc_3hr_ave(df[, col])

calc_8hr_rolling_max(df[, col, window])

calc_annual_ave(df[, col])

find_obs_time_bounds([files, time_var])

Function to read a series of ict files and print a list of min and max times for each.

findclosest(list, value)

Return (index, value) of the closest value in list to value.

get_epa_region_bounds([index, acronym])

get_epa_region_df(df)

get_giorgi_region_bounds([index, acronym])

get_giorgi_region_df(df)

get_relhum(temp, press, vap)

kolmogorov_zurbenko_filter(df, col, window, ...)

KZ filter implementation series is a pandas series window is the filter window m in the units of the data (m = 2q+1) iterations is the number of times the moving average is evaluated

linregress(x, y)

list_contains(list1, list2)

Return True if any item in list1 is also in list2.

long_to_wide(df)

loop_pairing(control[, file_pairs_yaml, ...])

Function to loop over sets of pairings and save them out as multiple netcdf files.

mobile_and_ground_pair(ds_model, df_obs, ...)

resample_stratify(da, levels, vertical[, ...])

search_listinlist(array1, array2)

vert_interp(ds_model, df_obs, var_name_list)

wsdir2uv(ws, wdir)

melodies_monet.util.tools.find_obs_time_bounds(files=[], time_var=None)

Function to read a series of ict files and print a list of min and max times for each.

Parameters
  • files (str or iterable) – str or list of str containing filenames that should be read.

  • time_var (str) – Optional, variable name that should be assumed to be time when reading aircaft csv files.

Returns

bounds (dict) – Dict containing time bounds for each file.

melodies_monet.util.tools.findclosest(list, value)

Return (index, value) of the closest value in list to value.

melodies_monet.util.tools.kolmogorov_zurbenko_filter(df, col, window, iterations)

KZ filter implementation series is a pandas series window is the filter window m in the units of the data (m = 2q+1) iterations is the number of times the moving average is evaluated

melodies_monet.util.tools.list_contains(list1, list2)

Return True if any item in list1 is also in list2.

melodies_monet.util.tools.loop_pairing(control, file_pairs_yaml='', file_pairs={}, save_types=['paired'])

Function to loop over sets of pairings and save them out as multiple netcdf files.

Parameters
  • control (str) – str containing path to control file.

  • file_pairs (dict (optional)) – Dict containing filenames for obs and models. This should be specified if file_pairs_yaml is not. An example can be found below:

    file_pairs = {'0722':{'model':{'wrfchem_v4.2':'/wrk/users/charkins/melodies-monet_data/wrfchem/run_CONUS_fv19_BEIS_1.0xISO_RACM_v4.2.2_racm_berk_vcp_noI_phot/0722/*'},
                  'obs':{'firexaq':'/wrk/d2/rschwantes/obs/firex-aq/R1/10s_merge/firexaq-mrg10-dc8_merge_20190722_R1.ict'}},
        '0905':{'model':{'wrfchem_v4.2':'/wrk/users/charkins/melodies-monet_data/wrfchem/run_CONUS_fv19_BEIS_1.0xISO_RACM_v4.2.2_racm_berk_vcp_noI_phot_soa/0905/*'},
                'obs':{'firexaq':'/wrk/d2/rschwantes/obs/firex-aq/R1/10s_merge/firexaq-mrg10-dc8_merge_20190905_R1.ict'}}
        }
    
  • file_pairs_yaml (str (optional)) – str containing path to a yaml file with file pairings. An example of the yaml file can be found in examples/yaml/supplementary_yaml/aircraft_looping_file_pairs.yaml

  • save_types (list (optional)) – List containing the types of data to save to netcdf. Can include any of ‘paired’, ‘models’, and ‘obs’

Returns

None