コード例 #1
0
def printInfo(lbl_file_name):
    target = info.get_target(lbl_file_name)
    filter1, filter2 = info.get_filters(lbl_file_name)
    image_time = info.get_image_time(lbl_file_name)
    num_lines = info.get_num_lines(lbl_file_name)
    num_line_samples = info.get_num_line_samples(lbl_file_name)
    sample_bits = info.get_sample_bits(lbl_file_name)

    instrument = info.get_instrument_id(lbl_file_name)
    if instrument in ("ISSNA", "NARROW_ANGLE_CAMERA"):
        camera = "Narrow"
    elif instrument in ("ISSWA", "WIDE_ANGLE_CAMERA"):
        camera = "Wide"
    else:
        camera = "NA"


    print "%25s|%10s|%10s|%22s|%5s|%5s|%4s|%8s| %s"%(target,
                                                filter1,
                                                filter2,
                                                image_time.strftime('%Y-%m-%d %H:%M:%S'),
                                                num_lines,
                                                num_line_samples,
                                                sample_bits,
                                                camera,
                                                lbl_file_name)
コード例 #2
0
            print "File %s is not supported, skipping"%f
            continue
        target = None
        try:
            target = info.get_target(f)
        except:
            pass

        filter1, filter2 = None, None
        try:
            filter1, filter2 = info.get_filters(f)
        except:
            pass

        width = info.get_num_line_samples(f)
        height = info.get_num_lines(f)



        if len(targets) > 0 and  target.upper() not in targets:
            continue
        elif len(filters) > 0 and (filter1.upper() not in filters and filter2.upper() not in filters):
            continue
        elif len(require_width) > 0 and str(width) not in require_width:
            continue
        elif len(require_height) > 0 and str(height) not in require_height:
            continue
        else:
            matching_files.append(f)

    values = []
コード例 #3
0
 def test_get_num_lines_cub(self):
     assert info.get_num_lines(TestIsis3Galileo.CUB_FILE) == 800
コード例 #4
0
 def test_get_num_lines_lbl(self):
     assert info.get_num_lines(TestIsis3Galileo.LBL_FILE) == 800
コード例 #5
0
 def test_get_num_lines_cub(self):
     assert info.get_num_lines(TestIsis3Voyager.CUB_FILE) == 800
コード例 #6
0
 def test_get_num_lines_imq(self):
     assert info.get_num_lines(TestIsis3Voyager.IMQ_FILE) == 800
コード例 #7
0
def process_data_file(lbl_file_name, require_target, require_filters,
                      require_width, require_height, metadata_only, is_verbose,
                      skip_existing, init_spice, nocleanup,
                      additional_options):
    source = utils.guess_from_filename_prefix(lbl_file_name)
    source_dirname = os.path.dirname(source)
    if source_dirname == "":
        source_dirname = "."

    if not os.path.exists(source):
        print "File %s does not exist" % source
    else:
        print_if_verbose("Processing %s" % source, is_verbose)

    target = info.get_target(source)
    print_if_verbose("Target: %s" % target, is_verbose)

    product_id = info.get_product_id(source)
    print_if_verbose("Product ID: %s" % product_id, is_verbose)

    try:
        filter1, filter2 = info.get_filters(source)
    except:
        filter1, filter2 = (None, None)
    print_if_verbose("Filter #1: %s" % filter1, is_verbose)
    print_if_verbose("Filter #2: %s" % filter2, is_verbose)

    width = info.get_num_line_samples(source)
    height = info.get_num_lines(source)

    lines = info.get_num_lines(source)
    print_if_verbose("Lines: %s" % lines, is_verbose)

    line_samples = info.get_num_line_samples(source)
    print_if_verbose("Samples per line: %s" % line_samples, is_verbose)

    image_date = info.get_image_time(source)
    print_if_verbose("Image Date: %s" % image_date, is_verbose)

    out_file_base = utils.output_filename(source)

    out_file_tiff = "%s.tif" % out_file_base
    print_if_verbose("Output Tiff: %s" % out_file_tiff, is_verbose)

    out_file_cub = "%s.cub" % out_file_base
    print_if_verbose("Output Cube: %s" % out_file_cub, is_verbose)

    if metadata_only:
        return

    if skip_existing and os.path.exists(out_file_cub) and os.path.exists(
            out_file_tiff):
        print "Output exists, skipping."
        return

    if require_target is not None and not require_target.upper(
    ) == target.upper():
        print "Target mismatch, exiting."
        return

    if require_filters is not None and not (filter1 in require_filters
                                            or filter2 in require_filters):
        print "Filter mismatch, exiting."
        return

    if require_height is not None and not (str(height) in require_height):
        print "Height filter mismatch, exiting"

    if require_width is not None and not (str(width) in require_width):
        print "Width filter mismatch, exiting"

    utils.process_pds_data_file(source,
                                is_verbose=is_verbose,
                                init_spice=init_spice,
                                nocleanup=nocleanup,
                                additional_options=additional_options)
コード例 #8
0
 def test_get_num_lines_cub(self):
     assert info.get_num_lines(TestIsis3Info.CUB_FILE) == 1024
コード例 #9
0
 def test_get_num_lines_lbl(self):
     assert info.get_num_lines(TestIsis3Info.LBL_FILE) == 1024