Project

General

Profile

Revision 808:9dda39dd51cb

ID9dda39dd51cb
Parent 807:786ef26df9c4
Child 809:e12ac8c88c25

Added by Maarten Sneep about 2 years ago

Make script externally callable (in the dirtiest way possible)

View differences:

src/plot_s5p_spectrum.py
209 209
        for idx in range(length):
210 210
            print(",".join([str(data[k][idx]) for k in keys]), file=ref)
211 211

  
212
def main():
212
def main(argv):
213 213
    parser = argparse.ArgumentParser(description="Plot spectrum")
214 214
    parser.add_argument('-V', '--version', action='version', version='%(prog)s 1.0')
215 215
    parser.add_argument('-p', '--pixel', dest='pixel', type=int,
......
231 231

  
232 232
    parser.add_argument('files', nargs="+", metavar="FILE",
233 233
                        help="The files to process")
234
    args = parser.parse_args()
234
    args = parser.parse_args(argv)
235 235

  
236 236
    radiances = [f for f in args.files if "L1B_RA_BD{0:1d}".format(args.band) in f]
237 237
    irradiances = [f for f in args.files if "L1B_IR" in f]
......
362 362
                       irr_noise=irr_noise[idx], rad_noise=rad_noise[idx], refl_noise=refl_noise,
363 363
                       sza=rad_sza, lat=lat, lon=lon, time=time, fresco=fresco_data)
364 364
if __name__ == "__main__":
365
    main()
365
    main(sys.argv)

Also available in: Unified diff