# Path: condor/utils/log.py
# def log(logger, message, lvl, exception=None, rollback=1):
# def log_execution_time(logger):
#     def st_time(func):
#         def st_func(*args, **keyArgs):


    from urllib2 import urlopen
    from urllib.request import urlopen
    from StringIO import StringIO ## for Python 2
    from io import BytesIO as StringIO ## for Python 3
from .log import log_and_raise_error,log_warning,log_info,log_debug
import gzip
import numpy
import scipy.ndimage
import scipy.stats
import scipy.ndimage.measurements
import logging
        #24      NSYMBT          Number of bytes used for storing symmetry operators
        NSYMBT = temp_int32[23]
        if NSYMBT > 0:
            log_and_raise_error(logger, "Omitting symmetry operations in map file.")
            f.read(NSYMBT)
        # The remaining bytes are data
        raw_data = f.read()
        raw_data = numpy.frombuffer(raw_data, dtype=dtype)
        # Now we need to project onto the right Z-Y-X array grid
        S,R,C = numpy.meshgrid(numpy.arange(NS), numpy.arange(NR), numpy.arange(NC), indexing='ij')
        S = S.flatten()
        R = R.flatten()
        C = C.flatten()
        if MAPC == 1:
            X = C
            Xlen = NC
        elif MAPC == 2:
            Y = C
            Ylen = NC
        elif MAPC == 3:
            Z = C
            Zlen = NC
        if MAPR == 1:
            X = R
            Xlen = NR
        elif MAPR == 2:
            Y = R
            Ylen = NR
        elif MAPR == 3:
            Z = R

# Path: condor/utils/log.py
# def log(logger, message, lvl, exception=None, rollback=1):
# def log_execution_time(logger):
#     def st_time(func):
#         def st_func(*args, **keyArgs):


# Path: condor/utils/emdio.py
    from urllib2 import urlopen
    from urllib.request import urlopen
    from StringIO import StringIO ## for Python 2
    from io import BytesIO as StringIO ## for Python 3
from .log import log_and_raise_error,log_warning,log_info,log_debug
import gzip
import numpy
import scipy.ndimage
import scipy.stats
import scipy.ndimage.measurements
import logging

        #24      NSYMBT          Number of bytes used for storing symmetry operators
        NSYMBT = temp_int32[23]
        if NSYMBT > 0:
            log_and_raise_error(logger, "Omitting symmetry operations in map file.")
            f.read(NSYMBT)
        # The remaining bytes are data
        raw_data = f.read()
        raw_data = numpy.frombuffer(raw_data, dtype=dtype)
        # Now we need to project onto the right Z-Y-X array grid
        S,R,C = numpy.meshgrid(numpy.arange(NS), numpy.arange(NR), numpy.arange(NC), indexing='ij')
        S = S.flatten()
        R = R.flatten()
        C = C.flatten()
        if MAPC == 1:
            X = C
            Xlen = NC
        elif MAPC == 2:
            Y = C
            Ylen = NC
        elif MAPC == 3:
            Z = C
            Zlen = NC
        if MAPR == 1:
            X = R
            Xlen = NR
        elif MAPR == 2:
            Y = R
            Ylen = NR
        elif MAPR == 3:
            Z = R

            Zlen = NR