Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, file_grib):
self.file_grib = file_grib
#get list of contents
self.jday = []
self.date = []
self.levs = []
self.nams = []
self.step = []
grbs = pg.open(self.file_grib)
grbs.seek(0)
self.lats = grbs[1].latlons()[0][:,0]
self.lons = grbs[1].latlons()[1][0,:]
for grb in grbs:
self.jday.append(pg.julian_to_datetime(grb.julianDay))
self.date.append(pg.julian_to_datetime(grb.julianDay) +
timedelta(hours=grb.step))
self.levs.append(grb.level)
self.nams.append(grb.name)
self.step.append(grb.step) #usually 0, 3/6/9/12 for accumulated
grbs.close()
self.nams = list(set(self.nams))
self.step = list(set(self.step))
self.date = list(set(self.date))
self.jday = list(set(self.jday))
self.levs = list(set(self.levs))
self.lats = list(set(self.lats))
self.lons = list(set(self.lons))
self.date.sort()
self.jday.sort()
self.levs.sort()
def __init__(self, file_grib):
self.file_grib = file_grib
#get list of contents
self.jday = []
self.date = []
self.levs = []
self.nams = []
self.step = []
grbs = pg.open(self.file_grib)
grbs.seek(0)
self.lats = grbs[1].latlons()[0][:,0]
self.lons = grbs[1].latlons()[1][0,:]
for grb in grbs:
self.jday.append(pg.julian_to_datetime(grb.julianDay))
self.date.append(pg.julian_to_datetime(grb.julianDay) +
timedelta(hours=grb.step))
self.levs.append(grb.level)
self.nams.append(grb.name)
self.step.append(grb.step) #usually 0, 3/6/9/12 for accumulated
grbs.close()
self.nams = list(set(self.nams))
self.step = list(set(self.step))
self.date = list(set(self.date))
self.jday = list(set(self.jday))
self.levs = list(set(self.levs))
self.lats = list(set(self.lats))
self.lons = list(set(self.lons))
self.date.sort()
self.jday.sort()
self.levs.sort()
self.lats.sort()
def __init__(self, file_grib):
self.file_grib = file_grib
#get list of contents
self.jday = []
self.date = []
self.levs = []
self.nams = []
self.step = []
grbs = pg.open(self.file_grib)
grbs.seek(0)
self.lats = grbs[1].latlons()[0][:,0]
self.lons = grbs[1].latlons()[1][0,:]
for grb in grbs:
self.jday.append(pg.julian_to_datetime(grb.julianDay))
self.date.append(pg.julian_to_datetime(grb.julianDay) +
timedelta(hours=grb.step))
self.levs.append(grb.level)
self.nams.append(grb.name)
self.step.append(grb.step) #usually 0, 3/6/9/12 for accumulated
grbs.close()
self.nams = list(set(self.nams))
self.step = list(set(self.step))
self.date = list(set(self.date))
self.jday = list(set(self.jday))
self.levs = list(set(self.levs))
self.lats = list(set(self.lats))
self.lons = list(set(self.lons))
self.date.sort()
self.jday.sort()
self.levs.sort()
self.lats.sort()
def __init__(self, file_grib):
self.file_grib = file_grib
#get list of contents
self.jday = []
self.date = []
self.levs = []
self.nams = []
self.step = []
grbs = pg.open(self.file_grib)
grbs.seek(0)
self.lats = grbs[1].latlons()[0][:,0]
self.lons = grbs[1].latlons()[1][0,:]
for grb in grbs:
self.jday.append(pg.julian_to_datetime(grb.julianDay))
self.date.append(pg.julian_to_datetime(grb.julianDay) +
timedelta(hours=grb.step))
self.levs.append(grb.level)
self.nams.append(grb.name)
self.step.append(grb.step) #usually 0, 3/6/9/12 for accumulated
grbs.close()
self.nams = list(set(self.nams))
self.step = list(set(self.step))
self.date = list(set(self.date))
self.jday = list(set(self.jday))
self.levs = list(set(self.levs))
self.lats = list(set(self.lats))
self.lons = list(set(self.lons))
self.date.sort()
self.jday.sort()
self.levs.sort()
def __init__(self, file_grib):
self.file_grib = file_grib
#get list of contents
self.jday = []
self.date = []
self.levs = []
self.nams = []
self.step = []
grbs = pg.open(self.file_grib)
grbs.seek(0)
self.lats = grbs[1].latlons()[0][:,0]
self.lons = grbs[1].latlons()[1][0,:]
for grb in grbs:
self.jday.append(pg.julian_to_datetime(grb.julianDay))
self.date.append(pg.julian_to_datetime(grb.julianDay) +
timedelta(hours=grb.step))
self.levs.append(grb.level)
self.nams.append(grb.name)
self.step.append(grb.step) #usually 0, 3/6/9/12 for accumulated
grbs.close()
self.nams = list(set(self.nams))
self.step = list(set(self.step))
self.date = list(set(self.date))
self.jday = list(set(self.jday))
self.levs = list(set(self.levs))
self.lats = list(set(self.lats))
self.lons = list(set(self.lons))
self.date.sort()
self.jday.sort()
self.levs.sort()
def __init__(self, file_grib):
self.file_grib = file_grib
#get list of contents
self.jday = []
self.date = []
self.levs = []
self.nams = []
self.step = []
grbs = pg.open(self.file_grib)
grbs.seek(0)
self.lats = grbs[1].latlons()[0][:,0]
self.lons = grbs[1].latlons()[1][0,:]
for grb in grbs:
self.jday.append(pg.julian_to_datetime(grb.julianDay))
self.date.append(pg.julian_to_datetime(grb.julianDay) +
timedelta(hours=grb.step))
self.levs.append(grb.level)
self.nams.append(grb.name)
self.step.append(grb.step) #usually 0, 3/6/9/12 for accumulated
grbs.close()
self.nams = list(set(self.nams))
self.step = list(set(self.step))
self.date = list(set(self.date))
self.jday = list(set(self.jday))
self.levs = list(set(self.levs))
self.lats = list(set(self.lats))
self.lons = list(set(self.lons))
self.date.sort()
self.jday.sort()
self.levs.sort()
self.lats.sort()