import numpy as np #Manik Bali, NOAA manik.bali@noaa.gov def rsrinc(parf): ptitl = 'rsrinc_abi' verv = '2023apr20' dtop = '/work2/slim/' ssrc = dtop + 'src/' fild = '/spect/vendor/' lead = 'FM4_ch' file3 = '.csv' sp = 'C' qq = ['16', '17'] bnum = ['1', '2', '3', '4', '5', '6'] bame = ['B0' + b for b in bnum] nomw = [470, 640, 865, 1378, 1610, 2250] files = ['047', '064', '086', '138', '161', '225'] acorn = parf[0] + parf[1] + parf[2] print('Acronym =', acorn) j = int(input('0 for GOES-16 else 17 > ')) if j != 0: j = 1 scn = qq[j - 1] idir = ssrc + acorn + fild file1 = idir + lead ncol = 5 jx = 0 jy = 4 ns = 4 mrow = 8800 nw = 16550 nb = len(files) rsr = np.zeros((nw, 2)) npea = np.zeros(nb, dtype=int) i2 = -1 for k in range(nb): infile = file1 + files[k] + file3 sss = np.loadtxt(infile, delimiter=sp, skiprows=ns, usecols=range(ncol), max_rows=mrow) xx = 1000. * sss[:, jx] yy = sss[:, jy] nx = len(xx) npea[k] = nx q = np.argmax(yy) loc = np.argmax(yy) print(q, loc, np.min(yy)) i1 = i2 + 1 i2 = i2 + nx rsr[i1:i2, 0] = xx rsr[i1:i2, 1] = yy return bame, nomw, npea, rsr # Example usage: parf = ["some", "example", "parameters"] bame, nomw, npea, rsr = rsrinc(parf)