melodies_monet.util.tools
Functions
|
|
|
|
|
|
|
|
|
Function to read a series of ict files and print a list of min and max times for each. |
|
Return (index, value) of the closest value in list to value. |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|
Return True if any item in list1 is also in list2. |
|
|
|
Function to loop over sets of pairings and save them out as multiple netcdf files. |
|
|
|
|
|
|
|
|
|
- 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
oriterable
) – 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 inexamples/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