''' Just sum up without processing.
'''
import os
import pickle as pickle
import gzip
import numpy as np
import matplotlib.pyplot as plt
import irfpy.util.gridsphere
import mapinmedata
def main(dirname = 'mapinme2_360x180'):
'''Main script'''
m = irfpy.util.gridsphere.SimpleGridSphere()
lonc = m.lonc
latc = m.latc
datalist = m.datalist
ndat = len(lonc)
south_bound = -50. # Process limit in the southern hemisphere
matchcondition = (latc < south_bound)
fnlist = os.listdir(dirname)
for fn in fnlist:
if fn.startswith('orbit') and fn.endswith('sv2cnt.txt.gz'):
print('Processing %s' % fn)
m1 = mapinmedata.orbitdata_reader(os.path.join(dirname, fn))
if m1.nlon != 360 or m1.nlat != 180:
raise ValueError('Unsupported non 360,180 data (%s)' % fn)
continue
for i in range(ndat):
if matchcondition[i]:
datalist[i] = datalist[i] + m1.datalist[i]
m.datalist = datalist
if dirname.endswith('/'): dirname = dirname[:-1]
fp = gzip.open(dirname + '_fulldata.txt.gz', 'w')
pickle.dump(m, fp)
fp.close()
if __name__ == "__main__":
main(dirname=sys.argv[1])