# -*- coding: utf-8 -*- """ Created on Wed Jun 16 09:41:21 2021 @author: ppantina """ # -*- coding: utf-8 -*- """ Created on Wed Dec 30 10:17:26 2020 @author: ppantina """ import os import sub_params import glob import numpy as np ##Copied from DataProcessing routines. ##This is just a way to read the file paths from the config file radName = input('Which radar? CRS, EXRAD, HIWRAP (any answer will process all data): ') flightDate = input('Which date?: yyyymmdd (any answer will process all data): ') ##Choose the correct paths based on the working computer fileNameParams = 'radar_params_irma.xlsx' ##Define some more variables config = sub_params.sub_params(fileNameParams, flightDate, radName) ##Directories of hrrr data dir_grib = config['Directory_hrrr'] + 'original/' dir_nc = config['Directory_hrrr'] + 'nc_with_mixing/' dir_nc3d = config['Directory_hrrr'] + 'nc3d_with_mixing/' ##Isolate files files_grib = np.sort(glob.glob(dir_grib + '*.grib2')) ##Convert files sequentially for i, j in enumerate(files_grib): ##Isolate filename filename = j.split('/')[-1] ##Run wgrib command. Select variables to save string = '/data10/cnhelms/lib/grib2/wgrib2/wgrib2 ' + dir_grib + filename + ' -netcdf ' + dir_nc + filename + '.nc -match ":(CLWMR|CIMIXR|RWMR|SNMR|GRLE|REFC):"' ##Run command os.system(string)