shapepipe.modules.get_images_package.get_images

shapepipe.modules.get_images_package.get_images

GET IMAGES.

This module copies all images required for processing.

Author

Martin Kilbinger <martin.kilbinger@cea.fr>

read_image_numbers(path)[source]

Read Image Numbers.

Read image numbers from file.

Parameters

path (str) – Input file path

Returns

Image numbers

Return type

list

in2out_pattern(number)[source]

Get In2out Pattern.

Transform input to output number pattern or image ID.

Parameters

number (str) – Input number

Returns

Output number

Return type

str

class GetImages(retrieve_method, retrieve_options, input_file_list, input_numbering, input_file_pattern, input_file_ext, output_file_pattern, w_log, check_existing_dir=None, n_expected=None, n_try=3)[source]

Bases: object

Get Images.

Class handling retrieval of input images.

Parameters
  • retrieve_method (str) – Copy/download method

  • retrieve_option (str) – Retrieve options

  • input_file_list (list) – Input files

  • input_numbering (str) – Numbering scheme, python regexp

  • input_file_pattern (list) – File pattern including input number template of input files

  • input_file_ext (list) – Input file extensions

  • output_file_pattern (list) – Output file patterns

  • w_log (logging.Logger) – Log file

  • check_existing_dir (str, optional) – If not None, only retrieve image if not existing at this path (recursively)

  • n_expected (int, optional) – Number of expected files per type and ID to download/check for existence

  • n_try (int, optional) – Number of attempts for VOs download, default is 3

process(input_dir, output_dir)[source]

Process.

Main function to process GetImages.

Parameters
  • input_dir (str) – Input directory

  • output_dir (str) – Output directory

get_file_list(image_number_list, dest_dir, use_output_file_pattern=False)[source]

Get File List.

Return lists of file paths to retrieve.

Parameters
  • image_number_list (list) – Image numbers

  • dest_dir (list) – Input directory or url

  • use_output_file_pattern (bool, optional) – If True, use output file base patterns excluding numbering scheme; if False, use input file patterns; default is False

Returns

Complete file paths, one list for each input file type

Return type

list

retrieve(all_inputs, all_outputs)[source]

Retrieve.

Retrieve all files.

Parameters
  • all_inputs (list) – Input file paths, one list for each input file type

  • all_outputs (list) – Output file paths, one list for each input file type

retrieve_one(in_path, out_path)[source]

Retrieve One.

Retrieve one file.

Parameters
  • in_path (str) – Input path

  • out_path (str) – Output path