def _read_sgs_product_header(fp): hdr = dict() hdr['ImageProductHeaderVersion'] = rbin.read_uint1(fp.read(1)) fp.read(3) hdr['ImageProductHeaderLength'] = rbin.read_uint4(fp.read(4)) hdr['ImageProductVersion'] = rbin.read_uint1(fp.read(1)) #hdr['ImageProductHeaderData'] = fp.read() return hdr
def __init__(self, fp): self.rec_len = rbin.read_uint2(fp.read(2)) self.gp_sc_id = rbin.read_uint2(fp.read(2)) self.spectral_channel_id = rbin.read_uint1(fp.read(1)) self.seg_no = rbin.read_uint2(fp.read(2)) self.planned_start_seg_no = rbin.read_uint2(fp.read(2)) self.planned_end_seg_no = rbin.read_uint2(fp.read(2)) self.data_field_repr = rbin.read_uint1(fp.read(1))
def _read_sgs_common_header(fp): hdr = dict() hdr['CommonHeaderVersion'] = rbin.read_uint1(fp.read(1)) fp.read(3) hdr['NominalSGSProductTime'] = rbin.read_cds_time(fp.read(6)) hdr['SGSProductQuality'] = rbin.read_uint1(fp.read(1)) hdr['SGSProductCompleteness'] = rbin.read_uint1(fp.read(1)) hdr['SGSProductTimeliness'] = rbin.read_uint1(fp.read(1)) hdr['SGSProcessingInstanceId'] = rbin.read_uint1(fp.read(1)) hdr['BaseAlgorithmVersion'] = fp.read(16).strip() hdr['ProductAlgorithmVersion'] = fp.read(16).strip() return hdr
def __init__(self, fp): self.rec_len = rbin.read_uint2(fp.read(2)) a = [] nb = 3 while nb < (self.rec_len): ln = rbin.read_int4(fp.read(4)) stamp = rbin.read_cds_time(fp.read(6)) lv = rbin.read_uint1(fp.read(1)) lr = rbin.read_uint1(fp.read(1)) lg = rbin.read_uint1(fp.read(1)) a.append((ln, stamp, lv, lr, lg)) nb += 13 self.line_quality = a
def read_header(fp): hdr_type = rbin.read_uint1(fp.read(1)) if hdr_type != 0: raise mipp.DecodeError("first header has to be a Primary Header, this one is of type %d"%hdr_type) phdr = PrimaryHeader(fp) yield phdr current_size = phdr.rec_len while current_size < phdr.total_hdr_len: hdr_type = rbin.read_uint1(fp.read(1)) cls = header_map.get(hdr_type, None) if cls: hdr = cls(fp) else: hdr = UnknownHeader(hdr_type, fp) yield hdr current_size += hdr.rec_len
def __init__(self, fp): self.rec_len = rbin.read_uint2(fp.read(2)) self.nb = rbin.read_uint1(fp.read(1)) self.nc = rbin.read_uint2(fp.read(2)) self.nl = rbin.read_uint2(fp.read(2)) self.compress_flag = rbin.read_uint1(fp.read(1))
def __init__(self, fp): self.rec_len = rbin.read_uint2(fp.read(2)) self.file_type = rbin.read_uint1(fp.read(1)) self.total_hdr_len = rbin.read_uint4(fp.read(4)) self.data_field_len = rbin.read_uint8(fp.read(8))
def __init__(self, fp): self.rec_len = rbin.read_uint2(fp.read(2)) self.seg_no = rbin.read_uint1(fp.read(1)) self.planned_end_seg_no = rbin.read_uint1(fp.read(1)) self.planned_start_seg_no = 1 self.seg_line_no = rbin.read_uint2(fp.read(2))
def __init__(self, fp): self.rec_len = rbin.read_uint2(fp.read(2)) self.cds_p_field = rbin.read_uint1(fp.read(1)) self.time_stamp = rbin.read_cds_time(fp.read(6))