def test_with_file(self): _root = os.path.join(os.path.dirname(__file__), '..', '..') _folder = os.path.join(_root, "test_data", "data", "test_l1bs", "temp") output_file = os.path.join(_folder, "output.nc") inspect_l1b_product(output_file)
def test_without_file(self): with self.assertRaises(ValueError) as e: inspect_l1b_product(None) self.assertEqual(str(e.exception), 'product_file_path must be given')
def test_it(self): # Ok, not really a test yet, but at least we import L1bInspector with self.assertRaises(ValueError) as e: inspect_l1b_product(None, False) self.assertEquals(str(e.exception), 'output_path must be given')
args = sys.argv[1:] if len(args) not in [2, 3]: print('usage: %s L1B_FILE OUT_FILE [FORMAT]' % prog) print(' with FORMAT being "png" or "dir"') exit(1) l1b_file = args[0] out_file = args[1] out_format = args[2] if len(args) == 3 else None ############################################################################### # The actual analysis insp = inspect_l1b_product(l1b_file, output_path=out_file, output_format=out_format) insp.plot.locations() insp.plot.waveform_3d_surf() insp.plot.waveform_3d_poly() insp.plot.waveform_3d_line() insp.plot.waveform_im() insp.plot.waveform_line(ind=0) insp.plot.waveform_line(ind=2) insp.plot.waveform_line(ind=101, ref_ind=100) insp.plot.waveform_hist(vmax=1e7) insp.plot.im_line(z='i2q2_meas_ku_l1b_echo_sar_ku') insp.plot.im_line(z='i2q2_meas_ku_l1b_echo_sar_ku', xind=100) insp.plot.im_line(z='i2q2_meas_ku_l1b_echo_sar_ku', yind=100)
prog = sys.argv[0] args = sys.argv[1:] if len(args) not in [2, 3]: print("usage: %s L1B_FILE OUT_FILE [FORMAT]" % prog) print(' with FORMAT being "png" or "dir"') exit(1) l1b_file = args[0] out_file = args[1] out_format = args[2] if len(args) == 3 else None ############################################################################### # The actual analysis insp = inspect_l1b_product(l1b_file, output_path=out_file, output_format=out_format) insp.plot.locations() insp.plot.waveform_3d_surf() insp.plot.waveform_3d_poly() insp.plot.waveform_3d_line() insp.plot.waveform_im() insp.plot.waveform_line(ind=0) insp.plot.waveform_line(ind=2) insp.plot.waveform_line(ind=101, ref_ind=100) insp.plot.waveform_hist(vmax=1e7) insp.plot.im_line(z="i2q2_meas_ku_l1b_echo_sar_ku") insp.plot.im_line(z="i2q2_meas_ku_l1b_echo_sar_ku", xind=100) insp.plot.im_line(z="i2q2_meas_ku_l1b_echo_sar_ku", yind=100) insp.plot.im_line(z="i2q2_meas_ku_l1b_echo_sar_ku", xind=100, yind=100)
def test_with_file(self): inspect_l1b_product("test_data/data/test_l1b/temp/output.nc")