Go to the documentation of this file.
5 from netCDF4
import Dataset
7 __version__ =
'0.1.0_2020-12-04'
12 from netCDF4
import Dataset
14 nc_fid = Dataset(file,
'r')
15 ngid = nc_fid.groups[group]
16 data = ngid.variables[object][:].data
26 nc_fid = Dataset(args.input_file,
'r')
28 print(
"Problem reading L1A file.")
37 print(
"Writing output file: %s" % args.output)
38 output = open(args.output,
'w')
39 output.write(
"# Info for %s\n" % args.input_file)
42 stime = getattr(nc_fid,
'time_coverage_start')
43 print(
"start_time=%sZ" % stime)
45 output.write(
"start_time=%sZ\n" % stime)
50 etime = getattr(nc_fid,
'time_coverage_end')
51 print(
"stop_time=%sZ" % etime)
54 output.write(
"\nstop_time=%sZ\n" % etime)
60 nRec = getattr(nc_fid,
'number_of_filled_scans')
61 print(
"number_of_records=%s" % nRec)
64 output.write(
"\number_of_records=%s\n" % nRec)
71 print(
"quality_flag=%d" % quality_flag)
73 output.write(
"\quality_flag=%d\n" % quality_flag)
80 parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,description=\
81 'Reads OCI L1A science data and reports related info',epilog=
"""
83 0 : All is well in the world
84 1 : File not accessible
85 120 : Problem reading info from metadata
87 parser.add_argument(
'--version', action=
'version', version=
'%(prog)s ' + __version__)
88 parser.add_argument(
'input_file', type=str, help=
'path to the input L1a file')
89 parser.add_argument(
'--output', type=str, help=
'path to the optional output text file')
90 parser.add_argument(
'--verbose',
'-v', action=
'store_true')
92 args = parser.parse_args()
98 if __name__ ==
'__main__':
def get_ncdf_object(file, group, object)