def write_np_array_as_binary_string(np_array, use_pickle):
    """Write numpy array as binary string with start and end identifier."""
    serialized_np_array = serialize_numpy_array(
        np_array, use_pickle=use_pickle
    )
    serialized_string = serialize_string(BINARY_START_IDENTIFIER_STR) + b"\n"
    serialized_string += serialized_np_array + b"\n"
    serialized_string += serialize_string(BINARY_END_IDENTIFIER_STR) + b"\n"
    return serialized_string
Write numpy array as binary string with start and end identifier.
photogrammetry_importer/process_communication/pipe_communication.py