Пример #1
0
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
Пример #2
0
 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))
Пример #3
0
 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))
Пример #4
0
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
Пример #5
0
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
Пример #6
0
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
Пример #7
0
 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        
Пример #8
0
 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
Пример #9
0
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
Пример #10
0
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
Пример #11
0
 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))
Пример #12
0
 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))
Пример #13
0
 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))
Пример #14
0
 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))
Пример #15
0
 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))
Пример #16
0
 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))
Пример #17
0
Файл: H8.py Проект: pytroll/mipp
 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))
Пример #18
0
 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))