import icebear import icebear.utils as utils """ Example : level 1 processing with default configuration By design there is two strong couplings through out the package. That is Config and Time classes. This is used to ensure the metadata for any computation done is stream lined as it all comes from two places. """ # (configuration file, settings file) config = utils.Config('dat/default.yml', '') # [year, month, day, hour, minute, second, microsecond] config.update_attr('processing_start', [2019, 11, 20, 3, 0, 0, 0]) # [year, month, day, hour, minute, second, microsecond] config.update_attr('processing_stop', [2019, 11, 20, 23, 0, 0, 0]) # [day, hour, minute, second, microsecond] config.update_attr('processing_step', [0, 0, 0, 1, 0]) config.update_attr('snr_cutoff', 3.0) # Set snr cutoff to 3.0 dB for processing config.add_attr(key='key', value='value') # We can add/remove attributes also icebear.generate_level1(config) # Run the processing function
# 'ib3d_normal_swht_01deg_2020_06_16_11_prelate_bakker.h5','ib3d_normal_swht_01deg_2020_06_16_23_prelate_bakker.h5'] pack_name = 'demo_ib3d_level3_20200616.h5' rf_distance = np.array([]) snr_db = np.array([]) doppler_shift = np.array([]) azimuth = np.array([]) elevation = np.array([]) elevation_extent = np.array([]) azimuth_extent = np.array([]) area = np.array([]) t = np.array([]) for file in files: # file = filepath + '2020_06_16/' + file f = h5py.File(file, 'r') config = utils.Config(file) # config = Config(file) print(file) group = f['data'] date = f['date'] keys = group.keys() for key in keys: data = group[f'{key}'] # Filter out dropped samples if np.any(data['rf_distance'][()] < 250): continue et = data['time'][()] et = np.append(date, et) et[5] = int(et[5] / 1000) et = epoch_time(et) t = np.append(t, np.repeat(et, len(data['rf_distance'][()])))
import icebear import icebear.utils as util import os # Set plotting step size plotting_step = [0, 0, 0, 1, 0] plotting_spacing = 5 # Gather all the level1 data file paths filepath = '/beaver/backup/level1/' files = util.get_all_data_files(filepath, '2017_12_06', '2020_11_16') # Create plots for file in files: config = util.Config(file) config.add_attr('number_ranges', 2000) config.add_attr('range_resolution', 1.5) config.add_attr('timestamp_correction', 30) # timestamp_corr config.add_attr('clutter_gates', 100) config.add_attr('code_length', 20000) config.plotting_source = '/'.join(file.split('/')[0:-1])+'/' config.plotting_destination = config.plotting_source + f'plots/{plotting_spacing}sec/' os.makedirs(config.plotting_source + f'plots/{plotting_spacing}sec', exist_ok=True) plotting_start, plotting_stop = util.get_data_file_times(file) print(config.plotting_destination, plotting_start, plotting_stop) time = util.Time(plotting_start, plotting_stop, plotting_step) icebear.plotting.plot.range_doppler_snr(config, time, plotting_spacing)
from matplotlib import rc rc('font', **{'family': 'serif', 'serif': ['DejaVu Serif']}) SMALL_SIZE = 10 MEDIUM_SIZE = 12 BIGGER_SIZE = 12 plt.rc('font', size=MEDIUM_SIZE) # controls default text sizes plt.rc('axes', titlesize=BIGGER_SIZE) # fontsize of the axes title plt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labelsa plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels plt.rc('legend', fontsize=SMALL_SIZE) # legend fontsize plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title path = Path(__file__).parent.parent.parent / "dat/default.yml" config = utils.Config(str(path)) # Change this to your swht_coeffs local save # coeffs_file = '/beaver/backup/icebear/swhtcoeffs_ib3d_2021_01_26_360az_180el_1res_85lmax.h5' # coeffs_file = 'X:/PythonProjects/icebear/swhtcoeffs_ib3d_2020-9-22_360-180-10-85.h5' # config.fov = np.array([[0, 360], [0, 180]]) # config.fov_center = np.array([0, 0]) # config.lmax = 85 # config.resolution = 1 # coeffs_file = '/beaver/backup/icebear/swhtcoeffs_ib3d_2021_02_09_090az_045el_01res_85lmax.h5' coeffs_file = '/beaver/backup/icebear/swhtcoeffs_ib3d_2021_07_28_090az_045el_01res_85lmax.h5' # coeffs_file = 'X:/PythonProjects/icebear/swhtcoeffs_ib3d_2021_02_09_090az_045el_01res_85lmax.h5' config.update_config(coeffs_file) config.lmax = 85 config.fov_center = np.array([270, 90])