diff --git a/cfel_crystfel.py b/cfel_crystfel.py index 8a8781460922907bfa8661faa6e754d302579cbf..9df4d454bb7f46f458b84e55bdde8c879580d4da 100644 --- a/cfel_crystfel.py +++ b/cfel_crystfel.py @@ -18,21 +18,19 @@ Utilities for interoperability with the CrystFEL software package. This module contains reimplementation of Crystfel functions and utilities. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) +import re from collections import OrderedDict from copy import deepcopy from math import sqrt -import re def _assplode_algebraic(value): items = [item for item in re.split('([+-])', value.strip()) if item != ''] - if len(items) != 0 and items[0] not in ('+', '-'): + if items and items[0] not in ('+', '-'): items.insert(0, '+') return [''.join((items[x], items[x + 1])) for x in range(0, len(items), 2)] @@ -43,7 +41,7 @@ def _dir_conv(direction_x, direction_y, direction_z, value): items = _assplode_algebraic(value) - if len(items) == 0: + if items: raise RuntimeError('Invalid direction: {}.'.format(value)) for item in items: @@ -78,7 +76,7 @@ def _set_dim_structure_entry(key, value, panel): dim_index = int(key[3]) if dim_index > len(dim) - 1: - for index in range(len(dim), dim_index + 1): + for _ in range(len(dim), dim_index + 1): dim.append(None) if value == 'ss' or value == 'fs' or value == '%': @@ -331,21 +329,20 @@ def _find_min_max_d(detector): def load_crystfel_geometry(filename): """Loads a CrystFEL geometry file into a dictionary. - + Reimplements the get_detector_geometry_2 function from CrystFEL amost verbatim. Returns a dictionary with the geometry information. Entries in the geometry file appears as keys in the returned dictionary. For a full documentation on the CrystFEL geometry format, see: - + tfel/manual-crystfel_geometry.html - + Args: - + filename (str): filename of the geometry file - + Returns: - + detector (dict): dictionary with the geometry loaded from the file - """ fh = open(filename, 'r') @@ -460,7 +457,7 @@ def load_crystfel_geometry(filename): else: _parse_field_bad(path[1], value, curr_bad) - if len(detector['panels']) == 0: + if not detector['panels']: raise RuntimeError("No panel descriptions in geometry file.") num_placeholders_in_panels = None @@ -534,26 +531,23 @@ def load_crystfel_geometry(filename): if dim_length == 1: raise RuntimeError('Number of dim coordinates must be at least two.') - for panel_name, panel in detector['panels'].items(): + for panel in detector['panels'].values(): - if 'origin_min_fs' not in panel: - raise RuntimeError('Please specify the minimum fs coordinate for panel {}.'.format(panel_name)) + if panel['origin_min_fs'] < 0: + raise RuntimeError('Please specify the minimum fs coordinate for panel {}.'.format(panel['name'])) - if 'origin_max_fs' not in panel: - raise RuntimeError('Please specify the maximum fs coordinate for panel {}.'.format(panel_name)) + if panel['origin_max_fs'] < 0: + raise RuntimeError('Please specify the maximum fs coordinate for panel {}.'.format(panel['name'])) - if 'origin_min_ss' not in panel: - raise RuntimeError('Please specify the minimum ss coordinate for panel {}.'.format(panel_name)) + if panel['origin_min_ss'] < 0: + raise RuntimeError('Please specify the minimum ss coordinate for panel {}.'.format(panel['name'])) - if 'origin_max_ss' not in panel: - raise RuntimeError('Please specify the maximum ss coordinate for panel {}.'.format(panel_name)) + if panel['origin_max_ss'] < 0: + raise RuntimeError('Please specify the maximum ss coordinate for panel {}.'.format(panel['name'])) if panel['cnx'] is None: - raise RuntimeError('Please specify the corner X coordinate for panel {}.'.format(panel_name)) + raise RuntimeError('Please specify the corner X coordinate for panel {}.'.format(panel['name'])) - if panel['cny'] is None: - raise RuntimeError('Please specify the corner Y coordinate for panel {}.'.format(panel_name)) - if panel['clen'] is None and panel['clen_from'] is None: raise RuntimeError('Please specify the camera length for panel {}.'.format(panel['name'])) @@ -583,12 +577,12 @@ def load_crystfel_geometry(filename): if bad_region['is_fsss'] == 99: raise RuntimeError('Please specify the coordinate ranges for bad region {}.'.format(bad_region['name'])) - for group in detector['rigid_groups'].keys(): + for group in detector['rigid_groups']: for name in detector['rigid_groups'][group]: if name not in detector['panels']: raise RuntimeError('Cannot add panel to rigid_group. Panel not found: {}'.format(name)) - for group_collection in detector['rigid_group_collections'].keys(): + for group_collection in detector['rigid_group_collections']: for name in detector['rigid_group_collections'][group_collection]: if name not in detector['rigid_groups']: raise RuntimeError('Cannot add rigid_group to collection. Rigid group not found: {}'.format(name)) diff --git a/cfel_cxi.py b/cfel_cxi.py index 5a2293e816afef7ccdfb6bdd339e5a17ed65b7e6..99d36b489c4a10876c27f468ff76995c14b0358c 100644 --- a/cfel_cxi.py +++ b/cfel_cxi.py @@ -15,20 +15,20 @@ """ Utilities for writing multi-event files in the CXIDB format. -This module contains utilities to write files that adhere to the CXIDB file format: +This module contains utilities to write files that adhere to the CXIDB file format: http://www.cxidb.org/cxi.html . """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) from collections import namedtuple + import h5py import numpy + _CXISimpleEntry = namedtuple('SimpleEntry', ['path', 'data', 'overwrite']) @@ -64,11 +64,7 @@ class _Stack: self._chunk_size = chunk_size def is_there_data_to_write(self): - - if self._data_to_write is not None: - return True - else: - return False + return self._data_to_write is not None def write_initial_slice(self, file_handle, max_num_slices): @@ -132,27 +128,27 @@ class CXIWriter: """Writing of multi-event CXIDB files. Implements a simple low-level CXIDB file format writer for multi event files. it allows the user to write data - "stacks" in the CXIDB files, making sure that the entries in all stacks are synchronized. - + "stacks" in the CXIDB files, making sure that the entries in all stacks are synchronized. + A CXI Writer instance manages one file. A user can add a stack to a CXI Writer instance with the - add_stack_to_writer function, which also writes the first entry in the stack. The user can then add to the writer + add_stack_to_writer function, which also writes the first entry in the stack. The user can then add to the writer all the stacks that he wants in the file. Once all stacks are added, the user initializes them with the initialize_stacks function. After initialization, no more stacks can be added. Instead, entries can be appended to - the existing stacks, using the append_data_to_stack function. - + the existing stacks, using the append_data_to_stack function. + A "slice" (a set of synced entries in all the stacks in the file) can be written to the a file only after an entry has been appended to all stacks in the file. Conversely, after an entry has been appended to a stack, the user cannot append another entry before a slice is written. This ensures synchronization of the data in all the stacks. - + A file can be closed at any time. In any case, the writer will not allow a file to contain more than the number_of_entries specified during instantiation. - + Simple non-stack entries can be written to the file at any time, before or after stack initialization (provided of course that the file is open). Entries and stacks will general never be overwritten unless the overwrite parameter is set to True. - + Example of usage of the stack API: - + c1 = 0 c2 = 0 @@ -197,13 +193,13 @@ class CXIWriter: def __init__(self, filename, max_num_slices=5000): """Instantiates a CXI Writer, managing one file. - + Instantiates a CXI Writer, responsible for writing data into one file. - + Args: - + filename (str): name of the file managed by the CXI Writer - + max_num_slices (int): maximum number of slices for the stacks in the file (default 5000) """ @@ -236,31 +232,31 @@ class CXIWriter: def add_stack_to_writer(self, name, path, initial_data, axes=None, compression=True, chunk_size=None, overwrite=True): """Adds a new stack to the file. - + Adds a new stack to the CXI Writer instance. The user must provide a name for the stack, that will identify the stack in all subsequents operations. The user must also provide the data that will be written as the initial entry in the stack (initial_data). This initial entry is used to set the size and type of data that the stack will hold and these parameters are in turn be used to validate all data that is subsequently appended to the stack. - + Args: - + name (str): stack name. - + path (str): path in the hdf5 file where the stack will be written. - - initial_data (Union[numpy.ndarray, bytes, int, float]: initial entry in the stack. It gets written to the + + initial_data (Union[numpy.ndarray, bytes, int, float]: initial entry in the stack. It gets written to the stack as slice 0. Its characteristics are used to validate all data subsequently appended to the stack. - + axes (bytes): the 'axes' attribute for the stack, as defined by the CXIDB file format. - + compression (Union[None, bool,str]): compression parameter for the stack. This parameters works in the same way as the normal compression parameter from h5py. The default value of this parameter is True. - + chunk_size (Union[None, tuple]): HDF5 chuck size for the stack. If this parameter is set to None, the - CXI writer will compute a chuck size automatically (this is the default behavior). Otherwise, the writer + CXI writer will compute a chuck size automatically (this is the default behavior). Otherwise, the writer will use the provided tuple to set the chunk size. - + overwrite (bool): if set to True, a stack already existing at the same location will be overwritten. If set to False, an attempt to overwrite a stack will raise an error. """ @@ -276,7 +272,7 @@ class CXIWriter: for entry in self._cxi_stacks: if path == self._cxi_stacks[entry].path: if overwrite is True: - del (self._cxi_stacks[entry]) + del self._cxi_stacks[entry] else: raise RuntimeError('Cannot write the entry. Data is already present at the specified path.') @@ -285,19 +281,19 @@ class CXIWriter: def write_simple_entry(self, name, path, data, overwrite=False): """Writes a simple, non-stack entry in the file. - + Writes a simple, non-stack entry in the file, at the specified path. A simple entry can be written at all times, before or after the stack initialization. The user must provide a name that identifies the entry for further operations (for example, creating a link). - + Args: - + name (str): entry name - + path (str): path in the hdf5 file where the entry will be written. - + data (Union[numpy.ndarray, bytes, int, float]): data to write - + overwrite (bool): if set to True, an entry already existing at the same location will be overwritten. If set to False, an attempt to overwrite an entry will raise an error. """ @@ -309,7 +305,7 @@ class CXIWriter: if path in self._fh: if overwrite is True: - del (self._fh[path]) + del self._fh[path] else: raise RuntimeError('Cannot create the the entry. An entry already exists at the specified path.') @@ -324,24 +320,24 @@ class CXIWriter: def create_link(self, name, path, overwrite=False): """Creates a link to a stack or entry. - + Creates a link in the file, at the path specified, pointing to the stack or the entry identified by the provided name. If a link or entry already exists at the specified path, it is deleted and replaced only if the value of the overwrite parameter is True. - + Args: - + name (str): name of the stack or entry to which the link points. - + path (str): path in the hdf5 where the link is created. - + overwrite (bool): if set to True, an entry already existing at the same location will be overwritten. If set to False, an attempt to overwrite an entry will raise an error. """ if path in self._fh: if overwrite is True: - del (self._fh[path]) + del self._fh[path] else: raise RuntimeError('Cannot create the link. An entry already exists at the specified path.') @@ -357,23 +353,23 @@ class CXIWriter: def create_link_to_group(self, group, path, overwrite=False): """Creates a link to an HDF5 group. - + Creates a link to an HDF5 group (as opposed to a simple entry or stack). If a link or entry already exists at the specified path, it is deleted and replaced only if the value of the overwrite parameter is True. - Args: + Args: group (str): internal HDF5 path of the group to which the link points. - + path (str): path in the hdf5 where the link is created. - + overwrite (bool): if set to True, an entry already existing at the same location will be overwritten. If set to False, an attempt to overwrite an entry will raise an error. """ if path in self._fh: if overwrite is True: - del (self._fh[path]) + del self._fh[path] else: raise RuntimeError('Cannot create the link. An entry already exists at the specified path.') @@ -411,8 +407,8 @@ class CXIWriter: def initialize_stacks(self): """Initializes the stacks. - - Initializes the stacks in the CXI Writer instance. This fixes the number and type of stacks in the file. No + + Initializes the stacks in the CXI Writer instance. This fixes the number and type of stacks in the file. No stacks can be added to the CXI Writer after initialization. """ @@ -435,15 +431,15 @@ class CXIWriter: def append_data_to_stack(self, name, data): """Appends data to a stack. - + Appends data to a stack, validating the data to make sure that the data type and size match the previous entries in the stack. Only one entry can be appended to each stack before writing a slice across all stacks with the write_slice_and_increment. - + Args: - + name (str): stack name, defining the stack to which the data will be appended. - + data (Union[numpy.ndarray, bytes, int, float]: data to write. The data will be validated against the type and size of previous entries in the stack. """ @@ -463,10 +459,10 @@ class CXIWriter: def write_stack_slice_and_increment(self): """Writes a slice across all stacks and resets the writer for the next slice. - + Writes a slice across all stacks in the file. It checks that an entry has been appended to each stack, and writes all the entries on top of the relevant stacks in one go. If an entry is missing in a stack, the function - will raise an error. After writing the slice, the function resets the writer to allow again appending data to + will raise an error. After writing the slice, the function resets the writer to allow again appending data to the stacks. """ @@ -491,12 +487,12 @@ class CXIWriter: def get_file_handle(self): """Access to the naked h5py file handle. - + This function allows access to the a naked h5py handle for the file managed by the CXI Writer. This allowa operations on the file that are not covered by CXI Writer API. Use it at your own risk. - + Returns: - + fh (h5py.File): an h5py file handle to the file managed by the writer. """ @@ -507,11 +503,11 @@ class CXIWriter: def stacks_are_initialized(self): """Checks if stacks are initialized. - + Checks the status of the stacks in the file and returns the status to the user. - + Returns: - + status (bool): True if the stacks are initialized, False otherwise """ @@ -533,21 +529,16 @@ class CXIWriter: """ - if path in self._fh: - ret = True - else: - ret = False - - return ret + return path in self._fh def file_is_full(self): """Checks if the file is full. - + Checks if the file is full (i.e. the maximum number of slices have already been written), and returns the information to the user. - + Returns: - + status (bool): True if the file is full, False otherwise. """ @@ -569,7 +560,7 @@ class CXIWriter: def close_file(self): """Closes the file. - + Closes the file for writing, ending all writing operations. """ diff --git a/cfel_fabio.py b/cfel_fabio.py index 9785064b0cee6fe67dfa5918cdf84a478fdf16f0..eac468bccf0c46d75a580ddf2b9ee17c1b6d1ad2 100644 --- a/cfel_fabio.py +++ b/cfel_fabio.py @@ -19,13 +19,11 @@ This module contains utilities based on the fabio python module. files. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) -import numpy import fabio.cbfimage +import numpy def read_cbf_from_stream(stream): @@ -58,8 +56,8 @@ def read_cbf_from_stream(stream): print("%s: %s" % kv) raise RuntimeError(err) if cbf_obj.cif[cbf_obj.CIF_BINARY_BLOCK_KEY] == "CIF Binary Section": - cbf_obj.cbs += infile.read(len(cbf_obj.STARTER) + int(cbf_obj.header["X-Binary-Size"]) - - len(cbf_obj.cbs) + cbf_obj.start_binary) + cbf_obj.cbs += infile.read(len(cbf_obj.STARTER) + int(cbf_obj.header["X-Binary-Size"]) - + len(cbf_obj.cbs) + cbf_obj.start_binary) else: if len(cbf_obj.cif[cbf_obj.CIF_BINARY_BLOCK_KEY]) > int( cbf_obj.header["X-Binary-Size"]) + cbf_obj.start_binary + len(cbf_obj.STARTER): diff --git a/cfel_geom.py b/cfel_geom.py index 4048220a9174bf42bd5aa859649a8578277f50d0..4a864829384625296857ffdf57cd132c3f87c93f 100644 --- a/cfel_geom.py +++ b/cfel_geom.py @@ -19,12 +19,11 @@ This module contains utilities for the processing of CrystFEL-style geometry files. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) from collections import namedtuple + import numpy from cfelpyutils.cfel_crystfel import load_crystfel_geometry @@ -34,7 +33,6 @@ ImageShape = namedtuple('ImageShape', ['ss', 'fs']) def _find_minimum_image_shape(x, y): - # find the smallest size of cspad_geom that contains all # xy values but is symmetric about the origin n = 2 * int(max(abs(y.max()), abs(y.min()))) + 2 @@ -42,6 +40,7 @@ def _find_minimum_image_shape(x, y): return n, m + def apply_geometry_from_file(data_as_slab, geometry_filename): """Parses a geometry file and applies the geometry to data. @@ -61,7 +60,7 @@ def apply_geometry_from_file(data_as_slab, geometry_filename): detector, with the origin of the reference system at the beam interaction point. """ - x, y, slab_shape, img_shape = pixel_maps_for_image_view(geometry_filename) + x, y, _, img_shape = pixel_maps_for_image_view(geometry_filename) im_out = numpy.zeros(img_shape, dtype=data_as_slab.dtype) im_out[y, x] = data_as_slab.ravel() @@ -136,7 +135,7 @@ def pixel_maps_for_image_view(geometry_filename): def get_image_shape(geometry_filename): """Parses a geometry file and returns the minimum size of an image that can represent the detector. - + Parses the geometry file and return a numpy shape object representing the minimum size of an image that can contain the physical representation of the detector. The representation is centered at the point where the beam hits the detector according to the geometry in the file. @@ -160,8 +159,6 @@ def get_image_shape(geometry_filename): return img_shape - - def pixel_maps_from_geometry_file(fnam): """Parses a geometry file and creates pixel maps. @@ -189,17 +186,19 @@ def pixel_maps_from_geometry_file(fnam): for p in detector['panels']: # get the pixel coords for this asic - i, j = numpy.meshgrid(numpy.arange(detector['panels'][p]['max_ss'] - detector['panels'][p]['min_ss'] + 1), - numpy.arange(detector['panels'][p]['max_fs'] - detector['panels'][p]['min_fs'] + 1), - indexing='ij') + i, j = numpy.meshgrid( + numpy.arange(detector['panels'][p]['max_ss'] - detector['panels'][p]['min_ss'] + 1), + numpy.arange(detector['panels'][p]['max_fs'] - detector['panels'][p]['min_fs'] + 1), + indexing='ij' + ) # make the y-x ( ss, fs ) vectors, using complex notation dx = detector['panels'][p]['fsy'] + 1J * detector['panels'][p]['fsx'] dy = detector['panels'][p]['ssy'] + 1J * detector['panels'][p]['ssx'] r_0 = detector['panels'][p]['cny'] + 1J * detector['panels'][p]['cnx'] - # + r = i * dy + j * dx + r_0 - # + y[detector['panels'][p]['min_ss']: detector['panels'][p]['max_ss'] + 1, detector['panels'][p]['min_fs']: detector['panels'][p]['max_fs'] + 1] = r.real diff --git a/cfel_hdf5.py b/cfel_hdf5.py index e961a6657dd1fe2b4ae3eedf7f5c5fc63e890885..5daeb79811ff4e1ec76d033d62072c8154577488 100644 --- a/cfel_hdf5.py +++ b/cfel_hdf5.py @@ -19,10 +19,8 @@ This module contains utilities for the processing of HDF5. This module builds on what the h5py module already provides. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) import h5py import numpy diff --git a/cfel_optarg.py b/cfel_optarg.py index 052168768b8b93b8924ce6fd0f71937641237c72..f85245f10d9900152c96e82214c5da34b41c69dd 100644 --- a/cfel_optarg.py +++ b/cfel_optarg.py @@ -19,10 +19,8 @@ This module contains utilities for parsing of command line options and configuration files. """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) import ast diff --git a/cfel_psana.py b/cfel_psana.py index f17d8e9f73bfff48878b53effddb1020894b27d1..736db618d62cd65b053e29177f5cd77ea9d8d774 100644 --- a/cfel_psana.py +++ b/cfel_psana.py @@ -12,19 +12,14 @@ # # You should have received a copy of the GNU General Public License # along with cfelpyutils. If not, see <http://www.gnu.org/licenses/>. - - """ Utilities based on the psana python module. This module provides utilities that build on the functionality provided by the psana python module. """ - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals +from __future__ import (absolute_import, division, print_function, + unicode_literals) def psana_obj_from_string(name): @@ -112,7 +107,7 @@ def dirname_from_source_runs(source): stop = len(source) runs = source[start:stop] nums = runs.split(',') - if len(nums) == 0: + if not nums: nums = runs dirname = 'run_' + '_'.join(nums) return dirname diff --git a/cfel_vtk.py b/cfel_vtk.py index f562d04669225fa735eb4ec049d7111f08ab2ab0..a2726e203646c8d3b60556871aee9898aa5d5842 100644 --- a/cfel_vtk.py +++ b/cfel_vtk.py @@ -15,9 +15,13 @@ """ Utilities for 3d data visualization using the Visualization Toolkit (VTK). """ + + import numpy + import vtk + VTK_VERSION = vtk.vtkVersion().GetVTKMajorVersion() @@ -25,14 +29,20 @@ def get_lookup_table(minimum_value, maximum_value, log=False, colorscale="jet", """Create a vtkLookupTable with a specified range, and colorscale. Args: + minimum_value (float): Lowest value the lookup table can display, lower values will be displayed as this value + maximum_value (float): Highest value the lookup table can display, higher values will be displayed as this value + log (Optional[bool]): True if the scale is logarithmic + colorscale (Optional[string]): Accepts the name of any matplotlib colorscale. The lookuptable will replicate this scale. + number_of_colors (Optional[int]): The length of the table. Higher values corresponds to a smoother color scale. Returns: + lookup_table (vtk.vtkLookupTable): A vtk lookup table """ @@ -58,13 +68,17 @@ def array_to_float_array(array_in, dtype=None): This flattens the array and thus the shape is lost. Args: + array_in (numpy.ndarray): The array to convert. + dtype (Optional[type]): Optionaly convert the array to the specified data. Otherwise the original - type will be preserved. + type will be preserved. Returns: + float_array (vtk.vtkFloatArray): A float array of the specified type. """ + if dtype is None: dtype = array_in.dtype if dtype == "float32": @@ -87,13 +101,17 @@ def array_to_vtk(array_in, dtype=None): """Convert a numpy array into a vtk array of the specified type. This flattens the array and thus the shape is lost. Args: + array_in (numpy.ndarray): The array to convert. + dtype (Optional[type]): Optionaly convert the array to the specified data. Otherwise the original type - will be preserved. + will be preserved. Returns: + vtk_array (vtk.vtkFloatArray): A float array of the specified type. """ + if dtype is None: dtype = numpy.dtype(array_in.dtype) else: @@ -119,13 +137,17 @@ def array_to_image_data(array_in, dtype=None): """Convert a numpy array to vtkImageData. Image data is a 3D object, thus the input must be 3D. Args: + array_in (numpy.ndarray): Array to convert to vtkImageData. Must be 3D. + dtype (Optional[type]): Optionaly convert the array to the specified data. Otherwise the original - type will be preserved. + type will be preserved. Returns: + image_data (vtk.vtkImageData): Image data containing the data from the array. """ + if len(array_in.shape) != 3: raise ValueError("Array must be 3D for conversion to vtkImageData") array_flat = array_in.flatten() @@ -140,10 +162,14 @@ def window_to_png(render_window, file_name, magnification=1): """Take a screen shot of a specific vt render window and save it to file. Args: + render_window (vtk.vtkRenderWindow): The render window window to capture. + file_name (string): A png file with this name will be created from the provided window. + magnification (Optional[int]): Increase the resolution of the output file by this factor """ + magnification = int(magnification) window_to_image_filter = vtk.vtkWindowToImageFilter() window_to_image_filter.SetInput(render_window) @@ -162,12 +188,16 @@ def poly_data_to_actor(poly_data, lut): using a very basic vtkMapper Args: + poly_data (vtk.vtkPolyData): vtkPolyData object. + lut (vtk.vtkLookupTable): The vtkLookupTable specifies the colorscale to use for the maper. Returns: + actor (vtk.vtkActor): Actor to display the provided vtkPolyData """ + mapper = vtk.vtkPolyDataMapper() mapper.SetInputData(poly_data) mapper.SetLookupTable(lut) @@ -181,9 +211,12 @@ class IsoSurface(object): """Create and plot isosurfaces. Args: + volume (numpy.ndimage): 3D floating point array. + level (float or list of float): The threshold level for the isosurface, or a list of such levels. """ + def __init__(self, volume, level=None): self._surface_algorithm = None self._renderer = None @@ -216,8 +249,10 @@ class IsoSurface(object): """Create the numpy array self._volume_array and vtk array self._float_array and make them share data. Args: + volume (numpy.ndimage): This data will populate both the created numpy and vtk objects. """ + self._volume_array = numpy.zeros(volume.shape, dtype="float32", order="C") self._volume_array[:] = volume self._float_array.SetNumberOfValues(numpy.product(volume.shape)) @@ -229,8 +264,10 @@ class IsoSurface(object): """Set the renderer of the isosurface and remove any existing renderer. Args: + renderer (vtk.vtkRenderer): Give this renderer controll over all the surface actors. """ + if self._actor is None: raise RuntimeError("Actor does not exist.") if self._renderer is not None: @@ -242,8 +279,10 @@ class IsoSurface(object): """Remova any current surface levels and add the ones from the provided list. Args: + levels (list of float): Levels for the isosurface, in absolute values (not e.g. ratios) """ + self._surface_algorithm.SetNumberOfContours(0) for index, this_level in enumerate(levels): self._surface_algorithm.SetValue(index, this_level) @@ -253,8 +292,10 @@ class IsoSurface(object): """Return a list of the current surface levels. Returns: + levels (list of floats): The current surface levels. """ + return [self._surface_algorithm.GetValue(index) for index in range(self._surface_algorithm.GetNumberOfContours())] @@ -262,8 +303,10 @@ class IsoSurface(object): """Add a single surface level. Args: + level (float): The level of the new surface. """ + self._surface_algorithm.SetValue(self._surface_algorithm.GetNumberOfContours(), level) self._render() @@ -271,11 +314,13 @@ class IsoSurface(object): """Remove a singel surface level at the provided index. Args: + index (int): The index of the level. If levels were added one by one this corresponds - to the order in which they were added. + to the order in which they were added. """ - for index in range(index, self._surface_algorithm.GetNumberOfContours()-1): - self._surface_algorithm.SetValue(index, self._surface_algorithm.GetValue(index+1)) + + for idx in range(index, self._surface_algorithm.GetNumberOfContours()-1): + self._surface_algorithm.SetValue(idx, self._surface_algorithm.GetValue(idx+1)) self._surface_algorithm.SetNumberOfContours(self._surface_algorithm.GetNumberOfContours()-1) self._render() @@ -287,15 +332,19 @@ class IsoSurface(object): the order in which they were added. level (float): The new level of the surface. """ + self._surface_algorithm.SetValue(index, level) self._render() def set_cmap(self, cmap): - """Set the colormap. The color is a function of surface level and mainly of relevance when plotting multiple surfaces. + """Set the colormap. The color is a function of surface level and mainly of relevance when plotting multiple + surfaces. Args: + cmap (string): Name of the colormap to use. Supports all colormaps provided by matplotlib. """ + self._mapper.ScalarVisibilityOn() self._mapper.SetLookupTable(get_lookup_table(self._volume_array.min(), self._volume_array.max(), colorscale=cmap)) @@ -305,8 +354,10 @@ class IsoSurface(object): """Plot all surfaces in this provided color. Args: + color (length 3 iterable): The RGB value of the color. """ + self._mapper.ScalarVisibilityOff() self._actor.GetProperty().SetColor(color[0], color[1], color[2]) self._render() @@ -315,13 +366,16 @@ class IsoSurface(object): """Set the opacity of all surfaces. (seting it individually for each surface is not supported) Args: + opacity (float): Value between 0. and 1. where 0. is completely transparent and 1. is completely opaque. """ + self._actor.GetProperty().SetOpacity(opacity) self._render() def _render(self): """Render if a renderer is set, otherwise do nothing.""" + if self._renderer is not None: self._renderer.GetRenderWindow().Render() @@ -329,7 +383,9 @@ class IsoSurface(object): """Change the data displayed. Args: + volume (numpy.ndarray): The new array. Must have the same shape as the old array.""" + if volume.shape != self._volume_array.shape: raise ValueError("New volume must be the same shape as the old one") self._volume_array[:] = volume @@ -341,8 +397,11 @@ def plot_isosurface(volume, level=None, opacity=1.): """Plot isosurfaces of the provided module. Args: + volume (numpy.ndarray): The 3D numpy array that will be plotted. + level (float or list of floats): Levels can be iterable or singel value. + opacity (float): Float between 0. and 1. where 0. is completely transparent and 1. is completely opaque. """ @@ -371,10 +430,14 @@ def plot_planes(array_in, log=False, cmap=None): """Plot the volume at two interactive planes that cut the volume. Args: + array_in (numpy.ndarray): Input array must be 3D. + log (bool): If true the data will be plotted in logarithmic scale. + cmap (string): Name of the colormap to use. Supports all colormaps provided by matplotlib. """ + array_in = numpy.float64(array_in) renderer = vtk.vtkRenderer() render_window = vtk.vtkRenderWindow() @@ -429,14 +492,20 @@ def setup_window(size=(400, 400), background=(1., 1., 1.)): """Create a renderer, render_window and interactor and setup connections between them. Args: + size (Optional[length 2 iterable of int]): The size of the window in pixels. + background (Optional[length 3 iterable of float]): RGB value of the background color. Returns: + renderer (vtk.vtkRenderer): A standard renderer connected to the window. + render_window (vtk.vtkRenderWindow): With dimensions given in the arguments, or oterwise 400x400 pixels. + interactor (vtk.vtkRenderWindowInteractor): The interactor will be given the rubber band pick interactor style. """ + renderer = vtk.vtkRenderer() render_window = vtk.vtkRenderWindow() render_window.AddRenderer(renderer) @@ -452,24 +521,24 @@ def setup_window(size=(400, 400), background=(1., 1., 1.)): return renderer, render_window, interactor -def scatterplot_3d(data, color=None, point_size=None, cmap="jet", point_shape=None): +def scatterplot_3d(data, color=None, point_size=None, point_shape=None): """3D scatter plot. Args: + data (numpy.ndimage): The array must have shape Nx3 where N is the number of points. color (Optional[numpy.ndimage]): 1D Array of floating points with same length as the data array. - These numbers give the color of each point. - + These numbers give the color of each point. + point_size (Optional[float]): The size of each points. Behaves differently depending on the point_shape. - If shape is spheres the size is relative to the scene and if squares the size is relative to the window. - - cmap (Optional[str]): Color map - + If shape is spheres the size is relative to the scene and if squares the size is relative to the window. + point_shape (Optional["spheres" or "squares"]): "spheres" plots each point as a sphere, recommended for - small data sets. "squares" plot each point as a square without any 3D structure, recommended for - large data sets. + small data sets. "squares" plot each point as a square without any 3D structure, recommended for + large data sets. """ + if len(data.shape) != 2 or data.shape[1] != 3: raise ValueError("data must have shape (n, 3) where n is the number of points.") if point_shape is None: diff --git a/doc/build/doctrees/cfelpyutils.doctree b/doc/build/doctrees/cfelpyutils.doctree index a41051f8809eafee804847961801c5089599379d..5fce9a4c8fbd504c632809e2236a786e14a3748d 100644 Binary files a/doc/build/doctrees/cfelpyutils.doctree and b/doc/build/doctrees/cfelpyutils.doctree differ diff --git a/doc/build/doctrees/environment.pickle b/doc/build/doctrees/environment.pickle index 28a677e6662fda797590dfab93a4c446cbe70796..a4ed16141619c2a0bb75154cd86c47aadef2da2a 100644 Binary files a/doc/build/doctrees/environment.pickle and b/doc/build/doctrees/environment.pickle differ diff --git a/doc/build/doctrees/index.doctree b/doc/build/doctrees/index.doctree index 9db84027a9f779c6ec4bde99bfe5912fdacdd3ee..f5d0ebcaece3d183b097316574c19a550ef50061 100644 Binary files a/doc/build/doctrees/index.doctree and b/doc/build/doctrees/index.doctree differ diff --git a/doc/build/doctrees/modules.doctree b/doc/build/doctrees/modules.doctree index b23b0f6f2f27d7ed87b7762d7b0684225843b8f9..80d31ec402191e61cafbd19f4dcc0483376048ab 100644 Binary files a/doc/build/doctrees/modules.doctree and b/doc/build/doctrees/modules.doctree differ diff --git a/doc/build/html/.buildinfo b/doc/build/html/.buildinfo index 1e094d712f497bcf81c66772784939e1bebd9ae7..7be85be2182c078f7ddf99f9c0c96ad0d3ddddd9 100644 --- a/doc/build/html/.buildinfo +++ b/doc/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 2dd7d55b090045f2190c3a6867000ee1 +config: 588c1a44f724000c460bdf543d2999af tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/doc/build/html/_static/basic.css b/doc/build/html/_static/basic.css index 7ed0e58edb31c235c086d98790de21cabd63f3ec..6df76b0a6c56968b5e521311839cf4139adba1cc 100644 --- a/doc/build/html/_static/basic.css +++ b/doc/build/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -398,6 +398,13 @@ table.field-list td, table.field-list th { margin: 0; } +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + /* -- other body styles ----------------------------------------------------- */ ol.arabic { diff --git a/doc/build/html/_static/css3-mediaqueries.js b/doc/build/html/_static/css3-mediaqueries.js index 3b906524529d159f4cfb10d0d6b470e941750fd5..59735f59dcb97f8d892a786ab94a33120254db9d 100644 --- a/doc/build/html/_static/css3-mediaqueries.js +++ b/doc/build/html/_static/css3-mediaqueries.js @@ -1 +1 @@ -if(typeof Object.create!=="function"){Object.create=function(e){function t(){}t.prototype=e;return new t}}var ua={toString:function(){return navigator.userAgent},test:function(e){return this.toString().toLowerCase().indexOf(e.toLowerCase())>-1}};ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];ua.webkit=ua.test("webkit");ua.gecko=ua.test("gecko")&&!ua.webkit;ua.opera=ua.test("opera");ua.ie=ua.test("msie")&&!ua.opera;ua.ie6=ua.ie&&document.compatMode&&typeof document.documentElement.style.maxHeight==="undefined";ua.ie7=ua.ie&&document.documentElement&&typeof document.documentElement.style.maxHeight!=="undefined"&&typeof XDomainRequest==="undefined";ua.ie8=ua.ie&&typeof XDomainRequest!=="undefined";var domReady=function(){var e=[];var t=function(){if(!arguments.callee.done){arguments.callee.done=true;for(var t=0;t<e.length;t++){e[t]()}}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",t,false)}if(ua.ie){(function(){try{document.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,50);return}t()})();document.onreadystatechange=function(){if(document.readyState==="complete"){document.onreadystatechange=null;t()}}}if(ua.webkit&&document.readyState){(function(){if(document.readyState!=="loading"){t()}else{setTimeout(arguments.callee,10)}})()}window.onload=t;return function(t){if(typeof t==="function"){e[e.length]=t}return t}}();var cssHelper=function(){var e={BLOCKS:/[^\s{;][^{;]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,WHITESPACE_IN_PARENTHESES:/\(\s*(\S*)\s*\)/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};var t,n=false;var r=[];var s=function(e){if(typeof e==="function"){r[r.length]=e}};var o=function(){for(var e=0;e<r.length;e++){r[e](t)}};var u={};var a=function(e,t){if(u[e]){var n=u[e].listeners;if(n){for(var r=0;r<n.length;r++){n[r](t)}}}};var f=function(e,t,n){if(ua.ie&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}if(!XMLHttpRequest){return""}var r=new XMLHttpRequest;try{r.open("get",e,true);r.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest")}catch(i){n();return}var s=false;setTimeout(function(){s=true},5e3);document.documentElement.style.cursor="progress";r.onreadystatechange=function(){if(r.readyState===4&&!s){if(!r.status&&location.protocol==="file:"||r.status>=200&&r.status<300||r.status===304||navigator.userAgent.indexOf("Safari")>-1&&typeof r.status==="undefined"){t(r.responseText)}else{n()}document.documentElement.style.cursor="";r=null}};r.send("")};var l=function(t){t=t.replace(e.REDUNDANT_COMPONENTS,"");t=t.replace(e.REDUNDANT_WHITESPACE,"$1");t=t.replace(e.WHITESPACE_IN_PARENTHESES,"($1)");t=t.replace(e.MORE_WHITESPACE," ");t=t.replace(e.FINAL_SEMICOLONS,"}");return t};var c={stylesheet:function(t){var n={};var r=[],i=[],s=[],o=[];var u=t.cssHelperText;var a=t.getAttribute("media");if(a){var f=a.toLowerCase().split(",")}else{var f=["all"]}for(var l=0;l<f.length;l++){r[r.length]=c.mediaQuery(f[l],n)}var h=u.match(e.BLOCKS);if(h!==null){for(var l=0;l<h.length;l++){if(h[l].substring(0,7)==="@media "){var p=c.mediaQueryList(h[l],n);s=s.concat(p.getRules());i[i.length]=p}else{s[s.length]=o[o.length]=c.rule(h[l],n,null)}}}n.element=t;n.getCssText=function(){return u};n.getAttrMediaQueries=function(){return r};n.getMediaQueryLists=function(){return i};n.getRules=function(){return s};n.getRulesWithoutMQ=function(){return o};return n},mediaQueryList:function(t,n){var r={};var i=t.indexOf("{");var s=t.substring(0,i);t=t.substring(i+1,t.length-1);var o=[],u=[];var a=s.toLowerCase().substring(7).split(",");for(var f=0;f<a.length;f++){o[o.length]=c.mediaQuery(a[f],r)}var l=t.match(e.BLOCKS_INSIDE);if(l!==null){for(f=0;f<l.length;f++){u[u.length]=c.rule(l[f],n,r)}}r.type="mediaQueryList";r.getMediaQueries=function(){return o};r.getRules=function(){return u};r.getListText=function(){return s};r.getCssText=function(){return t};return r},mediaQuery:function(t,n){t=t||"";var r,i;if(n.type==="mediaQueryList"){r=n}else{i=n}var s=false,o;var u=[];var a=true;var f=t.match(e.NOT_WHITESPACE);for(var l=0;l<f.length;l++){var c=f[l];if(!o&&(c==="not"||c==="only")){if(c==="not"){s=true}}else if(!o){o=c}else if(c.charAt(0)==="("){var h=c.substring(1,c.length-1).split(":");u[u.length]={mediaFeature:h[0],value:h[1]||null}}}return{getQueryText:function(){return t},getAttrStyleSheet:function(){return i||null},getList:function(){return r||null},getValid:function(){return a},getNot:function(){return s},getMediaType:function(){return o},getExpressions:function(){return u}}},rule:function(e,t,n){var r={};var i=e.indexOf("{");var s=e.substring(0,i);var o=s.split(",");var u=[];var a=e.substring(i+1,e.length-1).split(";");for(var f=0;f<a.length;f++){u[u.length]=c.declaration(a[f],r)}r.getStylesheet=function(){return t||null};r.getMediaQueryList=function(){return n||null};r.getSelectors=function(){return o};r.getSelectorText=function(){return s};r.getDeclarations=function(){return u};r.getPropertyValue=function(e){for(var t=0;t<u.length;t++){if(u[t].getProperty()===e){return u[t].getValue()}}return null};return r},declaration:function(e,t){var n=e.indexOf(":");var r=e.substring(0,n);var i=e.substring(n+1);return{getRule:function(){return t||null},getProperty:function(){return r},getValue:function(){return i}}}};var h=function(e){if(typeof e.cssHelperText!=="string"){return}var n={stylesheet:null,mediaQueryLists:[],rules:[],selectors:{},declarations:[],properties:{}};var r=n.stylesheet=c.stylesheet(e);var s=n.mediaQueryLists=r.getMediaQueryLists();var o=n.rules=r.getRules();var u=n.selectors;var a=function(e){var t=e.getSelectors();for(var n=0;n<t.length;n++){var r=t[n];if(!u[r]){u[r]=[]}u[r][u[r].length]=e}};for(i=0;i<o.length;i++){a(o[i])}var f=n.declarations;for(i=0;i<o.length;i++){f=n.declarations=f.concat(o[i].getDeclarations())}var l=n.properties;for(i=0;i<f.length;i++){var h=f[i].getProperty();if(!l[h]){l[h]=[]}l[h][l[h].length]=f[i]}e.cssHelperParsed=n;t[t.length]=e;return n};var p=function(e,t){return;e.cssHelperText=l(t||e.innerHTML);return h(e)};var d=function(){n=true;t=[];var r=[];var i=function(){for(var e=0;e<r.length;e++){h(r[e])}var t=document.getElementsByTagName("style");for(e=0;e<t.length;e++){p(t[e])}n=false;o()};var s=document.getElementsByTagName("link");for(var u=0;u<s.length;u++){var a=s[u];if(a.getAttribute("rel").indexOf("style")>-1&&a.href&&a.href.length!==0&&!a.disabled){r[r.length]=a}}if(r.length>0){var c=0;var d=function(){c++;if(c===r.length){i()}};var v=function(t){var n=t.href;f(n,function(r){r=l(r).replace(e.RELATIVE_URLS,"url("+n.substring(0,n.lastIndexOf("/"))+"/$1)");t.cssHelperText=r;d()},d)};for(u=0;u<r.length;u++){v(r[u])}}else{i()}};var v={stylesheets:"array",mediaQueryLists:"array",rules:"array",selectors:"object",declarations:"array",properties:"object"};var m={stylesheets:null,mediaQueryLists:null,rules:null,selectors:null,declarations:null,properties:null};var g=function(e,t){if(m[e]!==null){if(v[e]==="array"){return m[e]=m[e].concat(t)}else{var n=m[e];for(var r in t){if(t.hasOwnProperty(r)){if(!n[r]){n[r]=t[r]}else{n[r]=n[r].concat(t[r])}}}return n}}};var y=function(e){m[e]=v[e]==="array"?[]:{};for(var n=0;n<t.length;n++){var r=e==="stylesheets"?"stylesheet":e;g(e,t[n].cssHelperParsed[r])}return m[e]};var b=function(e){if(typeof window.innerWidth!="undefined"){return window["inner"+e]}else if(typeof document.documentElement!=="undefined"&&typeof document.documentElement.clientWidth!=="undefined"&&document.documentElement.clientWidth!=0){return document.documentElement["client"+e]}};return{addStyle:function(e,t,n){var r=document.createElement("style");r.setAttribute("type","text/css");if(t&&t.length>0){r.setAttribute("media",t.join(","))}document.getElementsByTagName("head")[0].appendChild(r);if(r.styleSheet){r.styleSheet.cssText=e}else{r.appendChild(document.createTextNode(e))}r.addedWithCssHelper=true;if(typeof n==="undefined"||n===true){cssHelper.parsed(function(t){var n=p(r,e);for(var i in n){if(n.hasOwnProperty(i)){g(i,n[i])}}a("newStyleParsed",r)})}else{r.parsingDisallowed=true}return r},removeStyle:function(e){return e.parentNode.removeChild(e)},parsed:function(e){if(n){s(e)}else{if(typeof t!=="undefined"){if(typeof e==="function"){e(t)}}else{s(e);d()}}},stylesheets:function(e){cssHelper.parsed(function(t){e(m.stylesheets||y("stylesheets"))})},mediaQueryLists:function(e){cssHelper.parsed(function(t){e(m.mediaQueryLists||y("mediaQueryLists"))})},rules:function(e){cssHelper.parsed(function(t){e(m.rules||y("rules"))})},selectors:function(e){cssHelper.parsed(function(t){e(m.selectors||y("selectors"))})},declarations:function(e){cssHelper.parsed(function(t){e(m.declarations||y("declarations"))})},properties:function(e){cssHelper.parsed(function(t){e(m.properties||y("properties"))})},broadcast:a,addListener:function(e,t){if(typeof t==="function"){if(!u[e]){u[e]={listeners:[]}}u[e].listeners[u[e].listeners.length]=t}},removeListener:function(e,t){if(typeof t==="function"&&u[e]){var n=u[e].listeners;for(var r=0;r<n.length;r++){if(n[r]===t){n.splice(r,1);r-=1}}}},getViewportWidth:function(){return b("Width")},getViewportHeight:function(){return b("Height")}}}();domReady(function(){var t;var n={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/};var r=[];var i=function(){var e="css3-mediaqueries-test";var t=document.createElement("div");t.id=e;var n=cssHelper.addStyle("@media all and (width) { #"+e+" { width: 1px !important; } }",[],false);document.body.appendChild(t);var r=t.offsetWidth===1;n.parentNode.removeChild(n);t.parentNode.removeChild(t);i=function(){return r};return r};var s=function(){t=document.createElement("div");t.style.cssText="position:absolute;top:-9999em;left:-9999em;"+"margin:0;border:none;padding:0;width:1em;font-size:1em;";document.body.appendChild(t);if(t.offsetWidth!==16){t.style.fontSize=16/t.offsetWidth+"em"}t.style.width=""};var o=function(e){t.style.width=e;var n=t.offsetWidth;t.style.width="";return n};var u=function(e,t){var r=e.length;var i=e.substring(0,4)==="min-";var s=!i&&e.substring(0,4)==="max-";if(t!==null){var u;var a;if(n.LENGTH_UNIT.exec(t)){u="length";a=o(t)}else if(n.RESOLUTION_UNIT.exec(t)){u="resolution";a=parseInt(t,10);var f=t.substring((a+"").length)}else if(n.ASPECT_RATIO.exec(t)){u="aspect-ratio";a=t.split("/")}else if(n.ABSOLUTE_VALUE){u="absolute";a=t}else{u="unknown"}}var l,c;if("device-width"===e.substring(r-12,r)){l=screen.width;if(t!==null){if(u==="length"){return i&&l>=a||s&&l<a||!i&&!s&&l===a}else{return false}}else{return l>0}}else if("device-height"===e.substring(r-13,r)){c=screen.height;if(t!==null){if(u==="length"){return i&&c>=a||s&&c<a||!i&&!s&&c===a}else{return false}}else{return c>0}}else if("width"===e.substring(r-5,r)){l=document.documentElement.clientWidth||document.body.clientWidth;if(t!==null){if(u==="length"){return i&&l>=a||s&&l<a||!i&&!s&&l===a}else{return false}}else{return l>0}}else if("height"===e.substring(r-6,r)){c=document.documentElement.clientHeight||document.body.clientHeight;if(t!==null){if(u==="length"){return i&&c>=a||s&&c<a||!i&&!s&&c===a}else{return false}}else{return c>0}}else if("device-aspect-ratio"===e.substring(r-19,r)){return u==="aspect-ratio"&&screen.width*a[1]===screen.height*a[0]}else if("color-index"===e.substring(r-11,r)){var h=Math.pow(2,screen.colorDepth);if(t!==null){if(u==="absolute"){return i&&h>=a||s&&h<a||!i&&!s&&h===a}else{return false}}else{return h>0}}else if("color"===e.substring(r-5,r)){var p=screen.colorDepth;if(t!==null){if(u==="absolute"){return i&&p>=a||s&&p<a||!i&&!s&&p===a}else{return false}}else{return p>0}}else if("resolution"===e.substring(r-10,r)){var d;if(f==="dpcm"){d=o("1cm")}else{d=o("1in")}if(t!==null){if(u==="resolution"){return i&&d>=a||s&&d<a||!i&&!s&&d===a}else{return false}}else{return d>0}}else{return false}};var a=function(e){var t=e.getValid();var n=e.getExpressions();var r=n.length;if(r>0){for(var i=0;i<r&&t;i++){t=u(n[i].mediaFeature,n[i].value)}var s=e.getNot();return t&&!s||s&&!t}return t};var f=function(e,t){var n=e.getMediaQueries();var i={};for(var s=0;s<n.length;s++){var o=n[s].getMediaType();if(n[s].getExpressions().length===0){continue}var u=true;if(o!=="all"&&t&&t.length>0){u=false;for(var f=0;f<t.length;f++){if(t[f]===o){u=true}}}if(u&&a(n[s])){i[o]=true}}var l=[],c=0;for(var h in i){if(i.hasOwnProperty(h)){if(c>0){l[c++]=","}l[c++]=h}}if(l.length>0){r[r.length]=cssHelper.addStyle("@media "+l.join("")+"{"+e.getCssText()+"}",t,false)}};var l=function(e,t){for(var n=0;n<e.length;n++){f(e[n],t)}};var c=function(e){var t=e.getAttrMediaQueries();var n=false;var i={};for(var s=0;s<t.length;s++){if(a(t[s])){i[t[s].getMediaType()]=t[s].getExpressions().length>0}}var o=[],u=[];for(var f in i){if(i.hasOwnProperty(f)){o[o.length]=f;if(i[f]){u[u.length]=f}if(f==="all"){n=true}}}if(u.length>0){r[r.length]=cssHelper.addStyle(e.getCssText(),u,false)}var c=e.getMediaQueryLists();if(n){l(c)}else{l(c,o)}};var h=function(e){for(var t=0;t<e.length;t++){c(e[t])}if(ua.ie){document.documentElement.style.display="block";setTimeout(function(){document.documentElement.style.display=""},0);setTimeout(function(){cssHelper.broadcast("cssMediaQueriesTested")},100)}else{cssHelper.broadcast("cssMediaQueriesTested")}};var p=function(){for(var e=0;e<r.length;e++){cssHelper.removeStyle(r[e])}r=[];cssHelper.stylesheets(h)};var d=0;var v=function(){var e=cssHelper.getViewportWidth();var t=cssHelper.getViewportHeight();if(ua.ie){var n=document.createElement("div");n.style.position="absolute";n.style.top="-9999em";n.style.overflow="scroll";document.body.appendChild(n);d=n.offsetWidth-n.clientWidth;document.body.removeChild(n)}var r;var s=function(){var n=cssHelper.getViewportWidth();var s=cssHelper.getViewportHeight();if(Math.abs(n-e)>d||Math.abs(s-t)>d){e=n;t=s;clearTimeout(r);r=setTimeout(function(){if(!i()){p()}else{cssHelper.broadcast("cssMediaQueriesTested")}},500)}};window.onresize=function(){var e=window.onresize||function(){};return function(){e();s()}}()};var m=document.documentElement;m.style.marginLeft="-32767px";setTimeout(function(){m.style.marginLeft=""},5e3);return function(){if(!i()){cssHelper.addListener("newStyleParsed",function(e){c(e.cssHelperParsed.stylesheet)});cssHelper.addListener("cssMediaQueriesTested",function(){if(ua.ie){m.style.width="1px"}setTimeout(function(){m.style.width="";m.style.marginLeft=""},0);cssHelper.removeListener("cssMediaQueriesTested",arguments.callee)});s();p()}else{m.style.marginLeft=""}v()}}());try{document.execCommand("BackgroundImageCache",false,true)}catch(e){} \ No newline at end of file +if(typeof Object.create!=="function"){Object.create=function(e){function t(){}t.prototype=e;return new t}}var ua={toString:function(){return navigator.userAgent},test:function(e){return this.toString().toLowerCase().indexOf(e.toLowerCase())>-1}};ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];ua.webkit=ua.test("webkit");ua.gecko=ua.test("gecko")&&!ua.webkit;ua.opera=ua.test("opera");ua.ie=ua.test("msie")&&!ua.opera;ua.ie6=ua.ie&&document.compatMode&&typeof document.documentElement.style.maxHeight==="undefined";ua.ie7=ua.ie&&document.documentElement&&typeof document.documentElement.style.maxHeight!=="undefined"&&typeof XDomainRequest==="undefined";ua.ie8=ua.ie&&typeof XDomainRequest!=="undefined";var domReady=function(){var e=[];var t=function(){if(!arguments.callee.done){arguments.callee.done=true;for(var t=0;t<e.length;t++){e[t]()}}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",t,false)}if(ua.ie){(function(){try{document.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,50);return}t()})();document.onreadystatechange=function(){if(document.readyState==="complete"){document.onreadystatechange=null;t()}}}if(ua.webkit&&document.readyState){(function(){if(document.readyState!=="loading"){t()}else{setTimeout(arguments.callee,10)}})()}window.onload=t;return function(t){if(typeof t==="function"){e[e.length]=t}return t}}();var cssHelper=function(){var e={BLOCKS:/[^\s{;][^{;]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,WHITESPACE_IN_PARENTHESES:/\(\s*(\S*)\s*\)/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};var t,n=false;var r=[];var s=function(e){if(typeof e==="function"){r[r.length]=e}};var o=function(){for(var e=0;e<r.length;e++){r[e](t)}};var u={};var a=function(e,t){if(u[e]){var n=u[e].listeners;if(n){for(var r=0;r<n.length;r++){n[r](t)}}}};var f=function(e,t,n){if(ua.ie&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}if(!XMLHttpRequest){return""}var r=new XMLHttpRequest;try{r.open("get",e,true);r.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest")}catch(i){n();return}var s=false;setTimeout(function(){s=true},5e3);document.documentElement.style.cursor="progress";r.onreadystatechange=function(){if(r.readyState===4&&!s){if(!r.status&&location.protocol==="file:"||r.status>=200&&r.status<300||r.status===304||navigator.userAgent.indexOf("Safari")>-1&&typeof r.status==="undefined"){t(r.responseText)}else{n()}document.documentElement.style.cursor="";r=null}};r.send("")};var l=function(t){t=t.replace(e.REDUNDANT_COMPONENTS,"");t=t.replace(e.REDUNDANT_WHITESPACE,"$1");t=t.replace(e.WHITESPACE_IN_PARENTHESES,"($1)");t=t.replace(e.MORE_WHITESPACE," ");t=t.replace(e.FINAL_SEMICOLONS,"}");return t};var c={stylesheet:function(t){var n={};var r=[],i=[],s=[],o=[];var u=t.cssHelperText;var a=t.getAttribute("media");if(a){var f=a.toLowerCase().split(",")}else{var f=["all"]}for(var l=0;l<f.length;l++){r[r.length]=c.mediaQuery(f[l],n)}var h=u.match(e.BLOCKS);if(h!==null){for(var l=0;l<h.length;l++){if(h[l].substring(0,7)==="@media "){var p=c.mediaQueryList(h[l],n);s=s.concat(p.getRules());i[i.length]=p}else{s[s.length]=o[o.length]=c.rule(h[l],n,null)}}}n.element=t;n.getCssText=function(){return u};n.getAttrMediaQueries=function(){return r};n.getMediaQueryLists=function(){return i};n.getRules=function(){return s};n.getRulesWithoutMQ=function(){return o};return n},mediaQueryList:function(t,n){var r={};var i=t.indexOf("{");var s=t.substring(0,i);t=t.substring(i+1,t.length-1);var o=[],u=[];var a=s.toLowerCase().substring(7).split(",");for(var f=0;f<a.length;f++){o[o.length]=c.mediaQuery(a[f],r)}var l=t.match(e.BLOCKS_INSIDE);if(l!==null){for(f=0;f<l.length;f++){u[u.length]=c.rule(l[f],n,r)}}r.type="mediaQueryList";r.getMediaQueries=function(){return o};r.getRules=function(){return u};r.getListText=function(){return s};r.getCssText=function(){return t};return r},mediaQuery:function(t,n){t=t||"";var r,i;if(n.type==="mediaQueryList"){r=n}else{i=n}var s=false,o;var u=[];var a=true;var f=t.match(e.NOT_WHITESPACE);for(var l=0;l<f.length;l++){var c=f[l];if(!o&&(c==="not"||c==="only")){if(c==="not"){s=true}}else if(!o){o=c}else if(c.charAt(0)==="("){var h=c.substring(1,c.length-1).split(":");u[u.length]={mediaFeature:h[0],value:h[1]||null}}}return{getQueryText:function(){return t},getAttrStyleSheet:function(){return i||null},getList:function(){return r||null},getValid:function(){return a},getNot:function(){return s},getMediaType:function(){return o},getExpressions:function(){return u}}},rule:function(e,t,n){var r={};var i=e.indexOf("{");var s=e.substring(0,i);var o=s.split(",");var u=[];var a=e.substring(i+1,e.length-1).split(";");for(var f=0;f<a.length;f++){u[u.length]=c.declaration(a[f],r)}r.getStylesheet=function(){return t||null};r.getMediaQueryList=function(){return n||null};r.getSelectors=function(){return o};r.getSelectorText=function(){return s};r.getDeclarations=function(){return u};r.getPropertyValue=function(e){for(var t=0;t<u.length;t++){if(u[t].getProperty()===e){return u[t].getValue()}}return null};return r},declaration:function(e,t){var n=e.indexOf(":");var r=e.substring(0,n);var i=e.substring(n+1);return{getRule:function(){return t||null},getProperty:function(){return r},getValue:function(){return i}}}};var h=function(e){if(typeof e.cssHelperText!=="string"){return}var n={stylesheet:null,mediaQueryLists:[],rules:[],selectors:{},declarations:[],properties:{}};var r=n.stylesheet=c.stylesheet(e);var s=n.mediaQueryLists=r.getMediaQueryLists();var o=n.rules=r.getRules();var u=n.selectors;var a=function(e){var t=e.getSelectors();for(var n=0;n<t.length;n++){var r=t[n];if(!u[r]){u[r]=[]}u[r][u[r].length]=e}};for(i=0;i<o.length;i++){a(o[i])}var f=n.declarations;for(i=0;i<o.length;i++){f=n.declarations=f.concat(o[i].getDeclarations())}var l=n.properties;for(i=0;i<f.length;i++){var h=f[i].getProperty();if(!l[h]){l[h]=[]}l[h][l[h].length]=f[i]}e.cssHelperParsed=n;t[t.length]=e;return n};var p=function(e,t){return;e.cssHelperText=l(t||e.innerHTML);return h(e)};var d=function(){n=true;t=[];var r=[];var i=function(){for(var e=0;e<r.length;e++){h(r[e])}var t=document.getElementsByTagName("style");for(e=0;e<t.length;e++){p(t[e])}n=false;o()};var s=document.getElementsByTagName("link");for(var u=0;u<s.length;u++){var a=s[u];if(a.getAttribute("rel").indexOf("style")>-1&&a.href&&a.href.length!==0&&!a.disabled){r[r.length]=a}}if(r.length>0){var c=0;var d=function(){c++;if(c===r.length){i()}};var v=function(t){var n=t.href;f(n,function(r){r=l(r).replace(e.RELATIVE_URLS,"url("+n.substring(0,n.lastIndexOf("/"))+"/$1)");t.cssHelperText=r;d()},d)};for(u=0;u<r.length;u++){v(r[u])}}else{i()}};var v={stylesheets:"array",mediaQueryLists:"array",rules:"array",selectors:"object",declarations:"array",properties:"object"};var m={stylesheets:null,mediaQueryLists:null,rules:null,selectors:null,declarations:null,properties:null};var g=function(e,t){if(m[e]!==null){if(v[e]==="array"){return m[e]=m[e].concat(t)}else{var n=m[e];for(var r in t){if(t.hasOwnProperty(r)){if(!n[r]){n[r]=t[r]}else{n[r]=n[r].concat(t[r])}}}return n}}};var y=function(e){m[e]=v[e]==="array"?[]:{};for(var n=0;n<t.length;n++){var r=e==="stylesheets"?"stylesheet":e;g(e,t[n].cssHelperParsed[r])}return m[e]};var b=function(e){if(typeof window.innerWidth!="undefined"){return window["inner"+e]}else if(typeof document.documentElement!=="undefined"&&typeof document.documentElement.clientWidth!=="undefined"&&document.documentElement.clientWidth!=0){return document.documentElement["client"+e]}};return{addStyle:function(e,t,n){var r=document.createElement("style");r.setAttribute("type","text/css");if(t&&t.length>0){r.setAttribute("media",t.join(","))}document.getElementsByTagName("head")[0].appendChild(r);if(r.styleSheet){r.styleSheet.cssText=e}else{r.appendChild(document.createTextNode(e))}r.addedWithCssHelper=true;if(typeof n==="undefined"||n===true){cssHelper.parsed(function(t){var n=p(r,e);for(var i in n){if(n.hasOwnProperty(i)){g(i,n[i])}}a("newStyleParsed",r)})}else{r.parsingDisallowed=true}return r},removeStyle:function(e){return e.parentNode.removeChild(e)},parsed:function(e){if(n){s(e)}else{if(typeof t!=="undefined"){if(typeof e==="function"){e(t)}}else{s(e);d()}}},stylesheets:function(e){cssHelper.parsed(function(t){e(m.stylesheets||y("stylesheets"))})},mediaQueryLists:function(e){cssHelper.parsed(function(t){e(m.mediaQueryLists||y("mediaQueryLists"))})},rules:function(e){cssHelper.parsed(function(t){e(m.rules||y("rules"))})},selectors:function(e){cssHelper.parsed(function(t){e(m.selectors||y("selectors"))})},declarations:function(e){cssHelper.parsed(function(t){e(m.declarations||y("declarations"))})},properties:function(e){cssHelper.parsed(function(t){e(m.properties||y("properties"))})},broadcast:a,addListener:function(e,t){if(typeof t==="function"){if(!u[e]){u[e]={listeners:[]}}u[e].listeners[u[e].listeners.length]=t}},removeListener:function(e,t){if(typeof t==="function"&&u[e]){var n=u[e].listeners;for(var r=0;r<n.length;r++){if(n[r]===t){n.splice(r,1);r-=1}}}},getViewportWidth:function(){return b("Width")},getViewportHeight:function(){return b("Height")}}}();domReady(function(){var t;var n={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/};var r=[];var i=function(){var e="css3-mediaqueries-test";var t=document.createElement("div");t.id=e;var n=cssHelper.addStyle("@media all and (width) { #"+e+" { width: 1px !important; } }",[],false);document.body.appendChild(t);var r=t.offsetWidth===1;n.parentNode.removeChild(n);t.parentNode.removeChild(t);i=function(){return r};return r};var s=function(){t=document.createElement("div");t.style.cssText="position:absolute;top:-9999em;left:-9999em;"+"margin:0;border:none;padding:0;width:1em;font-size:1em;";document.body.appendChild(t);if(t.offsetWidth!==16){t.style.fontSize=16/t.offsetWidth+"em"}t.style.width=""};var o=function(e){t.style.width=e;var n=t.offsetWidth;t.style.width="";return n};var u=function(e,t){var r=e.length;var i=e.substring(0,4)==="min-";var s=!i&&e.substring(0,4)==="max-";if(t!==null){var u;var a;if(n.LENGTH_UNIT.exec(t)){u="length";a=o(t)}else if(n.RESOLUTION_UNIT.exec(t)){u="resolution";a=parseInt(t,10);var f=t.substring((a+"").length)}else if(n.ASPECT_RATIO.exec(t)){u="aspect-ratio";a=t.split("/")}else if(n.ABSOLUTE_VALUE){u="absolute";a=t}else{u="unknown"}}var l,c;if("device-width"===e.substring(r-12,r)){l=screen.width;if(t!==null){if(u==="length"){return i&&l>=a||s&&l<a||!i&&!s&&l===a}else{return false}}else{return l>0}}else if("device-height"===e.substring(r-13,r)){c=screen.height;if(t!==null){if(u==="length"){return i&&c>=a||s&&c<a||!i&&!s&&c===a}else{return false}}else{return c>0}}else if("width"===e.substring(r-5,r)){l=document.documentElement.clientWidth||document.body.clientWidth;if(t!==null){if(u==="length"){return i&&l>=a||s&&l<a||!i&&!s&&l===a}else{return false}}else{return l>0}}else if("height"===e.substring(r-6,r)){c=document.documentElement.clientHeight||document.body.clientHeight;if(t!==null){if(u==="length"){return i&&c>=a||s&&c<a||!i&&!s&&c===a}else{return false}}else{return c>0}}else if("device-aspect-ratio"===e.substring(r-19,r)){return u==="aspect-ratio"&&screen.width*a[1]===screen.height*a[0]}else if("color-index"===e.substring(r-11,r)){var h=Math.pow(2,screen.colorDepth);if(t!==null){if(u==="absolute"){return i&&h>=a||s&&h<a||!i&&!s&&h===a}else{return false}}else{return h>0}}else if("color"===e.substring(r-5,r)){var p=screen.colorDepth;if(t!==null){if(u==="absolute"){return i&&p>=a||s&&p<a||!i&&!s&&p===a}else{return false}}else{return p>0}}else if("resolution"===e.substring(r-10,r)){var d;if(f==="dpcm"){d=o("1cm")}else{d=o("1in")}if(t!==null){if(u==="resolution"){return i&&d>=a||s&&d<a||!i&&!s&&d===a}else{return false}}else{return d>0}}else{return false}};var a=function(e){var t=e.getValid();var n=e.getExpressions();var r=n.length;if(r>0){for(var i=0;i<r&&t;i++){t=u(n[i].mediaFeature,n[i].value)}var s=e.getNot();return t&&!s||s&&!t}return t};var f=function(e,t){var n=e.getMediaQueries();var i={};for(var s=0;s<n.length;s++){var o=n[s].getMediaType();if(n[s].getExpressions().length===0){continue}var u=true;if(o!=="all"&&t&&t.length>0){u=false;for(var f=0;f<t.length;f++){if(t[f]===o){u=true}}}if(u&&a(n[s])){i[o]=true}}var l=[],c=0;for(var h in i){if(i.hasOwnProperty(h)){if(c>0){l[c++]=","}l[c++]=h}}if(l.length>0){r[r.length]=cssHelper.addStyle("@media "+l.join("")+"{"+e.getCssText()+"}",t,false)}};var l=function(e,t){for(var n=0;n<e.length;n++){f(e[n],t)}};var c=function(e){var t=e.getAttrMediaQueries();var n=false;var i={};for(var s=0;s<t.length;s++){if(a(t[s])){i[t[s].getMediaType()]=t[s].getExpressions().length>0}}var o=[],u=[];for(var f in i){if(i.hasOwnProperty(f)){o[o.length]=f;if(i[f]){u[u.length]=f}if(f==="all"){n=true}}}if(u.length>0){r[r.length]=cssHelper.addStyle(e.getCssText(),u,false)}var c=e.getMediaQueryLists();if(n){l(c)}else{l(c,o)}};var h=function(e){for(var t=0;t<e.length;t++){c(e[t])}if(ua.ie){document.documentElement.style.display="block";setTimeout(function(){document.documentElement.style.display=""},0);setTimeout(function(){cssHelper.broadcast("cssMediaQueriesTested")},100)}else{cssHelper.broadcast("cssMediaQueriesTested")}};var p=function(){for(var e=0;e<r.length;e++){cssHelper.removeStyle(r[e])}r=[];cssHelper.stylesheets(h)};var d=0;var v=function(){var e=cssHelper.getViewportWidth();var t=cssHelper.getViewportHeight();if(ua.ie){var n=document.createElement("div");n.style.position="absolute";n.style.top="-9999em";n.style.overflow="scroll";document.body.appendChild(n);d=n.offsetWidth-n.clientWidth;document.body.removeChild(n)}var r;var s=function(){var n=cssHelper.getViewportWidth();var s=cssHelper.getViewportHeight();if(Math.abs(n-e)>d||Math.abs(s-t)>d){e=n;t=s;clearTimeout(r);r=setTimeout(function(){if(!i()){p()}else{cssHelper.broadcast("cssMediaQueriesTested")}},500)}};window.onresize=function(){var e=window.onresize||function(){};return function(){e();s()}}()};var m=document.documentElement;m.style.marginLeft="-32767px";setTimeout(function(){m.style.marginLeft=""},5e3);return function(){if(!i()){cssHelper.addListener("newStyleParsed",function(e){c(e.cssHelperParsed.stylesheet)});cssHelper.addListener("cssMediaQueriesTested",function(){if(ua.ie){m.style.width="1px"}setTimeout(function(){m.style.width="";m.style.marginLeft=""},0);cssHelper.removeListener("cssMediaQueriesTested",arguments.callee)});s();p()}else{m.style.marginLeft=""}v()}}());try{document.execCommand("BackgroundImageCache",false,true)}catch(e){} diff --git a/doc/build/html/_static/doctools.js b/doc/build/html/_static/doctools.js index 816349563588e87ca99c7cf2d6e54268e52e761d..56549772348502981be27d8a3196baf789b40794 100644 --- a/doc/build/html/_static/doctools.js +++ b/doc/build/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/doc/build/html/_static/pygments.css b/doc/build/html/_static/pygments.css index 8213e90bed399b1ddc4914808df328f5803e953f..20c4814dcf0d3f437ee9a46f5957e3165aa5fb17 100644 --- a/doc/build/html/_static/pygments.css +++ b/doc/build/html/_static/pygments.css @@ -47,8 +47,10 @@ .highlight .mh { color: #208050 } /* Literal.Number.Hex */ .highlight .mi { color: #208050 } /* Literal.Number.Integer */ .highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ .highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ @@ -59,7 +61,9 @@ .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ .highlight .ss { color: #517918 } /* Literal.String.Symbol */ .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/doc/build/html/_static/searchtools.js b/doc/build/html/_static/searchtools.js index bbfb3ac1450393053f44a2d291a80895936e44cd..c82157380b008f641a14e50619a23cc5c0b4b04d 100644 --- a/doc/build/html/_static/searchtools.js +++ b/doc/build/html/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/doc/build/html/_static/websupport.js b/doc/build/html/_static/websupport.js index 98e7f40b6327e673e382068cdfb3bf3674a06cca..53f6a4525cd3db79b5076e557b0d4c89d810fcae 100644 --- a/doc/build/html/_static/websupport.js +++ b/doc/build/html/_static/websupport.js @@ -4,7 +4,7 @@ * * sphinx.websupport utilities for all documentation. * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/doc/build/html/cfelpyutils.html b/doc/build/html/cfelpyutils.html index 7d2a7f39a1a17bcc53b8ee8d78af287ffd06353d..1845ab949fe2e133bc3a03f1ac76260ff7c2615b 100644 --- a/doc/build/html/cfelpyutils.html +++ b/doc/build/html/cfelpyutils.html @@ -2,16 +2,12 @@ <!doctype html> - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>cfelpyutils package — cfelpyutils 0.5 documentation</title> - <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', @@ -33,7 +29,7 @@ <script type="text/javascript" src="_static/css3-mediaqueries.js"></script> <![endif]--> </head> - <body role="document"> + <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> @@ -110,7 +106,7 @@ documentation on the CrystFEL geometry format, see:</p> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<em>str</em>) – filename of the geometry file</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<em>str</em>) – filename of the geometry file</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">dictionary with the geometry loaded from the file</td> </tr> @@ -132,13 +128,13 @@ documentation on the CrystFEL geometry format, see:</p> <dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p> <p>Writing of multi-event CXIDB files.</p> <p>Implements a simple low-level CXIDB file format writer for multi event files. it allows the user to write data -“stacks” in the CXIDB files, making sure that the entries in all stacks are synchronized.</p> +“stacks†in the CXIDB files, making sure that the entries in all stacks are synchronized.</p> <p>A CXI Writer instance manages one file. A user can add a stack to a CXI Writer instance with the add_stack_to_writer function, which also writes the first entry in the stack. The user can then add to the writer all the stacks that he wants in the file. Once all stacks are added, the user initializes them with the initialize_stacks function. After initialization, no more stacks can be added. Instead, entries can be appended to the existing stacks, using the append_data_to_stack function.</p> -<p>A “slice” (a set of synced entries in all the stacks in the file) can be written to the a file only after an entry +<p>A “slice†(a set of synced entries in all the stacks in the file) can be written to the a file only after an entry has been appended to all stacks in the file. Conversely, after an entry has been appended to a stack, the user cannot append another entry before a slice is written. This ensures synchronization of the data in all the stacks.</p> <p>A file can be closed at any time. In any case, the writer will not allow a file to contain more than the @@ -149,32 +145,32 @@ is set to True.</p> <p>Example of usage of the stack API:</p> <p>c1 = 0 c2 = 0</p> -<p>f1 = CXIWriter(‘test1.h5’, ) -f2 = CXIWriter(‘test2.h5’, )</p> +<p>f1 = CXIWriter(‘test1.h5’, ) +f2 = CXIWriter(‘test2.h5’, )</p> <dl class="docutils"> -<dt>f1.add_stack_to_writer(‘detector1’, ‘/entry_1/detector_1/data’, numpy.random.rand(2, 2),</dt> -<dd>‘frame:y:x’)</dd> -<dt>f2.add_stack_to_writer(‘detector2’, ‘/entry_1/detector_1/data’, numpy.random.rand(3, 2),</dt> -<dd>‘frame:y:x’, compression=False, chunk_size=(1,3,2))</dd> +<dt>f1.add_stack_to_writer(‘detector1’, ‘/entry_1/detector_1/data’, numpy.random.rand(2, 2),</dt> +<dd>‘frame:y:x’)</dd> +<dt>f2.add_stack_to_writer(‘detector2’, ‘/entry_1/detector_1/data’, numpy.random.rand(3, 2),</dt> +<dd>‘frame:y:x’, compression=False, chunk_size=(1,3,2))</dd> </dl> -<p>f1.add_stack_to_writer(‘counter1’, ‘/entry_1/detector_1/count’, c1) -f2.add_stack_to_writer(‘counter2’, ‘/entry_1/detector_1/count’, c2)</p> -<p>f1.write_simple_entry(‘detectorname1’, ‘/entry_1/detector_1/name’, ‘FrontCSPAD’) -f2.write_simple_entry(‘detectorname2’, ‘/entry_1/detector_1/name’, ‘BackCSPAD’)</p> +<p>f1.add_stack_to_writer(‘counter1’, ‘/entry_1/detector_1/count’, c1) +f2.add_stack_to_writer(‘counter2’, ‘/entry_1/detector_1/count’, c2)</p> +<p>f1.write_simple_entry(‘detectorname1’, ‘/entry_1/detector_1/name’, ‘FrontCSPAD’) +f2.write_simple_entry(‘detectorname2’, ‘/entry_1/detector_1/name’, ‘BackCSPAD’)</p> <p>f1.initialize_stacks() f2.initialize_stacks()</p> <p>a = numpy.random.rand(2, 2) b = numpy.random.rand(3, 2)</p> <p>c1 += 1 c2 += 2</p> -<p>f1.append_data_to_stack(‘detector1’, a) -f2.append_data_to_stack(‘detector2’, b)</p> -<p>f1.append_data_to_stack(‘counter1’, c1) -f2.append_data_to_stack(‘counter2’, c2)</p> +<p>f1.append_data_to_stack(‘detector1’, a) +f2.append_data_to_stack(‘detector2’, b)</p> +<p>f1.append_data_to_stack(‘counter1’, c1) +f2.append_data_to_stack(‘counter2’, c2)</p> <p>f1.write_stack_slice_and_increment() f2.write_stack_slice_and_increment()</p> -<p>f1.create_link(‘detectorname1’, ‘/name’) -f2.create_link(‘detectorname2’, ‘/name’)</p> +<p>f1.create_link(‘detectorname1’, ‘/name’) +f2.create_link(‘detectorname2’, ‘/name’)</p> <p>f1.close_file() f2.close_file()</p> <dl class="method"> @@ -191,18 +187,18 @@ the stack.</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> -<li><strong>name</strong> (<em>str</em>) – stack name.</li> -<li><strong>path</strong> (<em>str</em>) – path in the hdf5 file where the stack will be written.</li> -<li><strong></strong><strong>(</strong><strong>Union</strong><strong>[</strong><strong>numpy.ndarray</strong><strong>, </strong><strong>bytes</strong><strong>, </strong><strong>int</strong><strong>, </strong><strong>float</strong><strong>]</strong><strong></strong> (<em>initial_data</em>) – initial entry in the stack. It gets written to the</li> -<li><strong>as slice 0. Its characteristics are used to validate all data subsequently appended to the stack.</strong> (<em>stack</em>) – </li> -<li><strong>axes</strong> (<em>bytes</em>) – the ‘axes’ attribute for the stack, as defined by the CXIDB file format.</li> -<li><strong>compression</strong> (<em>Union</em><em>[</em><em>None</em><em>, </em><em>bool</em><em>,</em><em>str</em><em>]</em><em></em>) – compression parameter for the stack. This parameters works in the same</li> -<li><strong>as the normal compression parameter from h5py. The default value of this parameter is True.</strong> (<em>way</em>) – </li> -<li><strong>chunk_size</strong> (<em>Union</em><em>[</em><em>None</em><em>, </em><em>tuple</em><em>]</em><em></em>) – HDF5 chuck size for the stack. If this parameter is set to None, the</li> -<li><strong>writer will compute a chuck size automatically</strong> (<em>CXI</em>) – </li> -<li><strong>use the provided tuple to set the chunk size.</strong> (<em>will</em>) – </li> -<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, a stack already existing at the same location will be overwritten. If set</li> -<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite a stack will raise an error.</strong> (<em>to</em>) – </li> +<li><strong>name</strong> (<em>str</em>) – stack name.</li> +<li><strong>path</strong> (<em>str</em>) – path in the hdf5 file where the stack will be written.</li> +<li><strong>(</strong><strong>Union</strong><strong>[</strong><strong>numpy.ndarray</strong><strong>, </strong><strong>bytes</strong><strong>, </strong><strong>int</strong><strong>, </strong><strong>float</strong><strong>]</strong> (<em>initial_data</em>) – initial entry in the stack. It gets written to the</li> +<li><strong>as slice 0. Its characteristics are used to validate all data subsequently appended to the stack.</strong> (<em>stack</em>) – </li> +<li><strong>axes</strong> (<em>bytes</em>) – the ‘axes’ attribute for the stack, as defined by the CXIDB file format.</li> +<li><strong>compression</strong> (<em>Union</em><em>[</em><em>None</em><em>, </em><em>bool</em><em>,</em><em>str</em><em>]</em>) – compression parameter for the stack. This parameters works in the same</li> +<li><strong>as the normal compression parameter from h5py. The default value of this parameter is True.</strong> (<em>way</em>) – </li> +<li><strong>chunk_size</strong> (<em>Union</em><em>[</em><em>None</em><em>, </em><em>tuple</em><em>]</em>) – HDF5 chuck size for the stack. If this parameter is set to None, the</li> +<li><strong>writer will compute a chuck size automatically</strong> (<em>CXI</em>) – </li> +<li><strong>use the provided tuple to set the chunk size.</strong> (<em>will</em>) – </li> +<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, a stack already existing at the same location will be overwritten. If set</li> +<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite a stack will raise an error.</strong> (<em>to</em>) – </li> </ul> </td> </tr> @@ -222,9 +218,9 @@ the write_slice_and_increment.</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> -<li><strong>name</strong> (<em>str</em>) – stack name, defining the stack to which the data will be appended.</li> -<li><strong></strong><strong>(</strong><strong>Union</strong><strong>[</strong><strong>numpy.ndarray</strong><strong>, </strong><strong>bytes</strong><strong>, </strong><strong>int</strong><strong>, </strong><strong>float</strong><strong>]</strong><strong></strong> (<em>data</em>) – data to write. The data will be validated against the type</li> -<li><strong>size of previous entries in the stack.</strong> (<em>and</em>) – </li> +<li><strong>name</strong> (<em>str</em>) – stack name, defining the stack to which the data will be appended.</li> +<li><strong>(</strong><strong>Union</strong><strong>[</strong><strong>numpy.ndarray</strong><strong>, </strong><strong>bytes</strong><strong>, </strong><strong>int</strong><strong>, </strong><strong>float</strong><strong>]</strong> (<em>data</em>) – data to write. The data will be validated against the type</li> +<li><strong>size of previous entries in the stack.</strong> (<em>and</em>) – </li> </ul> </td> </tr> @@ -251,10 +247,10 @@ value of the overwrite parameter is True.</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> -<li><strong>name</strong> (<em>str</em>) – name of the stack or entry to which the link points.</li> -<li><strong>path</strong> (<em>str</em>) – path in the hdf5 where the link is created.</li> -<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, an entry already existing at the same location will be overwritten. If set</li> -<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite an entry will raise an error.</strong> (<em>to</em>) – </li> +<li><strong>name</strong> (<em>str</em>) – name of the stack or entry to which the link points.</li> +<li><strong>path</strong> (<em>str</em>) – path in the hdf5 where the link is created.</li> +<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, an entry already existing at the same location will be overwritten. If set</li> +<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite an entry will raise an error.</strong> (<em>to</em>) – </li> </ul> </td> </tr> @@ -273,10 +269,10 @@ the specified path, it is deleted and replaced only if the value of the overwrit <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> -<li><strong>group</strong> (<em>str</em>) – internal HDF5 path of the group to which the link points.</li> -<li><strong>path</strong> (<em>str</em>) – path in the hdf5 where the link is created.</li> -<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, an entry already existing at the same location will be overwritten. If set</li> -<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite an entry will raise an error.</strong> (<em>to</em>) – </li> +<li><strong>group</strong> (<em>str</em>) – internal HDF5 path of the group to which the link points.</li> +<li><strong>path</strong> (<em>str</em>) – path in the hdf5 where the link is created.</li> +<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, an entry already existing at the same location will be overwritten. If set</li> +<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite an entry will raise an error.</strong> (<em>to</em>) – </li> </ul> </td> </tr> @@ -328,6 +324,42 @@ operations on the file that are not covered by CXI Writer API. Use it at your o stacks can be added to the CXI Writer after initialization.</p> </dd></dl> +<dl class="method"> +<dt id="cfelpyutils.cfel_cxi.CXIWriter.is_entry_in_file"> +<code class="descname">is_entry_in_file</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_cxi.CXIWriter.is_entry_in_file" title="Permalink to this definition">¶</a></dt> +<dd><p>Checks if an entry is already present in the file.</p> +<p>Checks if an entry is already present in the file at the path provided by the user. It will return True if +either a dataset or a group are present at the specified path</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<em>str</em>) – the path where to check for a dataset or group</td> +</tr> +</tbody> +</table> +<p>Results:</p> +<blockquote> +<div>ret (bool): True if a group or dataset can be found in the file, False otherwise</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="cfelpyutils.cfel_cxi.CXIWriter.num_slices_in_file"> +<code class="descname">num_slices_in_file</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_cxi.CXIWriter.num_slices_in_file" title="Permalink to this definition">¶</a></dt> +<dd><p>Returns the number of slices already written in the file</p> +<p>Returns the number of slices that have already been written in the file.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">number of writter slices</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">status (num_slices)</td> +</tr> +</tbody> +</table> +</dd></dl> + <dl class="method"> <dt id="cfelpyutils.cfel_cxi.CXIWriter.stacks_are_initialized"> <code class="descname">stacks_are_initialized</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_cxi.CXIWriter.stacks_are_initialized" title="Permalink to this definition">¶</a></dt> @@ -357,11 +389,11 @@ operations (for example, creating a link).</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> -<li><strong>name</strong> (<em>str</em>) – entry name</li> -<li><strong>path</strong> (<em>str</em>) – path in the hdf5 file where the entry will be written.</li> -<li><strong>data</strong> (<em>Union</em><em>[</em><em>numpy.ndarray</em><em>, </em><em>bytes</em><em>, </em><em>int</em><em>, </em><em>float</em><em>]</em><em></em>) – data to write</li> -<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, an entry already existing at the same location will be overwritten. If set</li> -<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite an entry will raise an error.</strong> (<em>to</em>) – </li> +<li><strong>name</strong> (<em>str</em>) – entry name</li> +<li><strong>path</strong> (<em>str</em>) – path in the hdf5 file where the entry will be written.</li> +<li><strong>data</strong> (<em>Union</em><em>[</em><em>numpy.ndarray</em><em>, </em><em>bytes</em><em>, </em><em>int</em><em>, </em><em>float</em><em>]</em>) – data to write</li> +<li><strong>overwrite</strong> (<em>bool</em>) – if set to True, an entry already existing at the same location will be overwritten. If set</li> +<li><strong>False</strong><strong>, </strong><strong>an attempt to overwrite an entry will raise an error.</strong> (<em>to</em>) – </li> </ul> </td> </tr> @@ -397,7 +429,7 @@ it (See the documentation of the fabio python module).</p> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>stream</strong> (<em>str</em>) – a data string buffer received from the PETRAIII P11 sender.</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>stream</strong> (<em>str</em>) – a data string buffer received from the PETRAIII P11 sender.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils"> <dt>a cbfimage object containing the data extracted</dt> @@ -417,11 +449,53 @@ it (See the documentation of the fabio python module).</p> <p>Utilities for CrystFEL-style geometry files.</p> <p>This module contains utilities for the processing of CrystFEL-style geometry files.</p> +<dl class="class"> +<dt id="cfelpyutils.cfel_geom.ImageShape"> +<em class="property">class </em><code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">ImageShape</code><span class="sig-paren">(</span><em>ss</em>, <em>fs</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.ImageShape" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">tuple</span></code></p> +<dl class="attribute"> +<dt id="cfelpyutils.cfel_geom.ImageShape.fs"> +<code class="descname">fs</code><a class="headerlink" href="#cfelpyutils.cfel_geom.ImageShape.fs" title="Permalink to this definition">¶</a></dt> +<dd><p>Alias for field number 1</p> +</dd></dl> + +<dl class="attribute"> +<dt id="cfelpyutils.cfel_geom.ImageShape.ss"> +<code class="descname">ss</code><a class="headerlink" href="#cfelpyutils.cfel_geom.ImageShape.ss" title="Permalink to this definition">¶</a></dt> +<dd><p>Alias for field number 0</p> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="cfelpyutils.cfel_geom.PixelMaps"> +<em class="property">class </em><code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">PixelMaps</code><span class="sig-paren">(</span><em>x</em>, <em>y</em>, <em>r</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.PixelMaps" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">tuple</span></code></p> +<dl class="attribute"> +<dt id="cfelpyutils.cfel_geom.PixelMaps.r"> +<code class="descname">r</code><a class="headerlink" href="#cfelpyutils.cfel_geom.PixelMaps.r" title="Permalink to this definition">¶</a></dt> +<dd><p>Alias for field number 2</p> +</dd></dl> + +<dl class="attribute"> +<dt id="cfelpyutils.cfel_geom.PixelMaps.x"> +<code class="descname">x</code><a class="headerlink" href="#cfelpyutils.cfel_geom.PixelMaps.x" title="Permalink to this definition">¶</a></dt> +<dd><p>Alias for field number 0</p> +</dd></dl> + +<dl class="attribute"> +<dt id="cfelpyutils.cfel_geom.PixelMaps.y"> +<code class="descname">y</code><a class="headerlink" href="#cfelpyutils.cfel_geom.PixelMaps.y" title="Permalink to this definition">¶</a></dt> +<dd><p>Alias for field number 1</p> +</dd></dl> + +</dd></dl> + <dl class="function"> <dt id="cfelpyutils.cfel_geom.apply_geometry_from_file"> <code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">apply_geometry_from_file</code><span class="sig-paren">(</span><em>data_as_slab</em>, <em>geometry_filename</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.apply_geometry_from_file" title="Permalink to this definition">¶</a></dt> <dd><p>Parses a geometry file and applies the geometry to data.</p> -<p>Parses a geometry file and applies the geometry to detector data in ‘slab’ format. Turns a 2d array of pixel +<p>Parses a geometry file and applies the geometry to detector data in ‘slab’ format. Turns a 2d array of pixel values into an array containing a representation of the physical layout of the detector, keeping the origin of the reference system at the beam interaction point.</p> <table class="docutils field-list" frame="void" rules="none"> @@ -429,8 +503,8 @@ the reference system at the beam interaction point.</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> -<li><strong>data_as_slab</strong> (<em>numpy.ndarray</em>) – the pixel values to which geometry is to be applied.</li> -<li><strong>geometry_filename</strong> (<em>str</em>) – geometry filename.</li> +<li><strong>data_as_slab</strong> (<em>numpy.ndarray</em>) – the pixel values to which geometry is to be applied.</li> +<li><strong>geometry_filename</strong> (<em>str</em>) – geometry filename.</li> </ul> </td> </tr> @@ -447,9 +521,9 @@ detector, with the origin of the reference system at the beam interaction point <dl class="function"> <dt id="cfelpyutils.cfel_geom.apply_geometry_from_pixel_maps"> -<code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">apply_geometry_from_pixel_maps</code><span class="sig-paren">(</span><em>data_as_slab</em>, <em>yx</em>, <em>im_out=None</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.apply_geometry_from_pixel_maps" title="Permalink to this definition">¶</a></dt> +<code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">apply_geometry_from_pixel_maps</code><span class="sig-paren">(</span><em>data_as_slab</em>, <em>y</em>, <em>x</em>, <em>im_out=None</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.apply_geometry_from_pixel_maps" title="Permalink to this definition">¶</a></dt> <dd><p>Applies geometry in pixel map format to data.</p> -<p>Applies geometry, in the form of pixel maps, to detector data in ‘slab’ format. Turns a 2d array of pixel values +<p>Applies geometry, in the form of pixel maps, to detector data in ‘slab’ format. Turns a 2d array of pixel values into an array containing a representation of the physical layout of the detector, keeping the origin of the reference system at the beam interaction point.</p> <table class="docutils field-list" frame="void" rules="none"> @@ -457,10 +531,11 @@ reference system at the beam interaction point.</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> -<li><strong>data_as_slab</strong> (<em>numpy.ndarray</em>) – the pixel values to which geometry is to be applied.</li> -<li><strong>yx</strong> (<em>tuple</em>) – the yx pixel maps describing the geometry of the detector; each map is a numpy.ndarray.</li> -<li><strong>im_out</strong> (<em>Optional</em><em>[</em><em>numpy.ndarray</em><em>]</em><em></em>) – array to hold the output; if not provided, one will be generated</li> -<li><strong>automatically.</strong> – </li> +<li><strong>data_as_slab</strong> (<em>numpy.ndarray</em>) – the pixel values to which geometry is to be applied.</li> +<li><strong>y</strong> (<em>numpy.ndarray</em>) – the y pixel map describing the geometry of the detector</li> +<li><strong>x</strong> (<em>numpy.ndarray</em>) – the x pixel map describing the geometry of the detector</li> +<li><strong>im_out</strong> (<em>Optional</em><em>[</em><em>numpy.ndarray</em><em>]</em>) – array to hold the output; if not provided, one will be generated</li> +<li><strong>automatically.</strong> – </li> </ul> </td> </tr> @@ -475,27 +550,47 @@ detector, with the origin of the reference system at the beam interaction point </table> </dd></dl> +<dl class="function"> +<dt id="cfelpyutils.cfel_geom.get_image_shape"> +<code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">get_image_shape</code><span class="sig-paren">(</span><em>geometry_filename</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.get_image_shape" title="Permalink to this definition">¶</a></dt> +<dd><p>Parses a geometry file and returns the minimum size of an image that can represent the detector.</p> +<p>Parses the geometry file and return a numpy shape object representing the minimum size of an image that +can contain the physical representation of the detector. The representation is centered at the point where the beam +hits the detector according to the geometry in the file.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>geometry_filename</strong> (<em>str</em>) – geometry filename.</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">shape of the array needed to contain the representation of the physical layout +of the detector.</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">img_shape tuple (int, int)</td> +</tr> +</tbody> +</table> +</dd></dl> + <dl class="function"> <dt id="cfelpyutils.cfel_geom.pixel_maps_for_image_view"> <code class="descclassname">cfelpyutils.cfel_geom.</code><code class="descname">pixel_maps_for_image_view</code><span class="sig-paren">(</span><em>geometry_filename</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_geom.pixel_maps_for_image_view" title="Permalink to this definition">¶</a></dt> <dd><p>Parses a geometry file and creates pixel maps for pyqtgraph visualization.</p> -<p>Parse the geometry file and creates pixel maps for an array in ‘slab’ format containing pixel values. The pixel +<p>Parses the geometry file and creates pixel maps for an array in ‘slab’ format containing pixel values. The pixel maps can be used to create a representation of the physical layout of the detector in a pyqtgraph ImageView widget (i.e. they apply the detector geometry setting the origin of the reference system is in the top left corner -of the output array).</p> +of the output array). The representation is centered at the point where the beam hits the detector according to +the geometry in the file.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>geometry_filename</strong> (<em>str</em>) – geometry filename.</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>geometry_filename</strong> (<em>str</em>) – geometry filename.</td> </tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">pixel maps<p>slab_shape tuple (int, int): shape of the original geometry uncorrected array (the pixel values in “slab” -format).</p> -<p>img_shape tuple (int, int): shape of the array needed to contain the representation of the physical layout -of the detector.</p> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">pixel map for x coordinate<p>y (numpy.ndarray int): pixel map for x coordinate</p> </td> </tr> -<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">(y, x) (numpy.ndarray int, numpy.ndarray int)</td> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#cfelpyutils.cfel_geom.PixelMaps.x" title="cfelpyutils.cfel_geom.PixelMaps.x">x</a> (numpy.ndarray int)</td> </tr> </tbody> </table> @@ -512,12 +607,12 @@ point.</p> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fnam</strong> (<em>str</em>) – geometry filename.</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>fnam</strong> (<em>str</em>) – geometry filename.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">slab-like pixel maps with respectively x, y coordinates of the pixel and distance of the pixel from the center of the reference system.</td> </tr> -<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">x,y,r (numpy.ndarray float, numpy.ndarray float, numpy.ndarray float)</td> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#cfelpyutils.cfel_geom.PixelMaps.x" title="cfelpyutils.cfel_geom.PixelMaps.x">x</a>,<a class="reference internal" href="#cfelpyutils.cfel_geom.PixelMaps.y" title="cfelpyutils.cfel_geom.PixelMaps.y">y</a>,<a class="reference internal" href="#cfelpyutils.cfel_geom.PixelMaps.r" title="cfelpyutils.cfel_geom.PixelMaps.r">r</a> (numpy.ndarray float, numpy.ndarray float, numpy.ndarray float)</td> </tr> </tbody> </table> @@ -538,8 +633,8 @@ on what the h5py module already provides.</p> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> -<li><strong>data_filename</strong> (<em>str</em>) – filename of the file to read.</li> -<li><strong>data_group</strong> (<em>str</em>) – internal HDF5 path of the data block to read.</li> +<li><strong>data_filename</strong> (<em>str</em>) – filename of the file to read.</li> +<li><strong>data_group</strong> (<em>str</em>) – internal HDF5 path of the data block to read.</li> </ul> </td> </tr> @@ -599,7 +694,7 @@ the parser tries to interpret the entry in order as:</p> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>config</strong> (<em>class RawConfigParser</em>) – ConfigParser instance.</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>config</strong> (<em>class RawConfigParser</em>) – ConfigParser instance.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">dictionary with the same structure as the input dictionary, but with correct types assigned to each entry.</td> @@ -619,13 +714,13 @@ assigned to each entry.</td> <dt id="cfelpyutils.cfel_psana.dirname_from_source_runs"> <code class="descclassname">cfelpyutils.cfel_psana.</code><code class="descname">dirname_from_source_runs</code><span class="sig-paren">(</span><em>source</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_psana.dirname_from_source_runs" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a directory name based on a psana source string.</p> -<p>Takes a psana source string (e.g exp=CXI/cxix....) and returns a string that can be used as a subdirectory name or +<p>Takes a psana source string (e.g exp=CXI/cxix….) and returns a string that can be used as a subdirectory name or a prefix for files and directories.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source</strong> (<em>str</em>) – a psana source string (e.g. exp=CXI/cxi....).</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source</strong> (<em>str</em>) – a psana source string (e.g. exp=CXI/cxi….).</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a string that can be used as a filename or a prefix .</td> </tr> @@ -639,13 +734,13 @@ a prefix for files and directories.</p> <dt id="cfelpyutils.cfel_psana.psana_event_inspection"> <code class="descclassname">cfelpyutils.cfel_psana.</code><code class="descname">psana_event_inspection</code><span class="sig-paren">(</span><em>source</em><span class="sig-paren">)</span><a class="headerlink" href="#cfelpyutils.cfel_psana.psana_event_inspection" title="Permalink to this definition">¶</a></dt> <dd><p>Prints the structure of psana events.</p> -<p>Takes a psana source string (e.g. exp=CXI/cxix....) and inspects the structure of the first event in the data, +<p>Takes a psana source string (e.g. exp=CXI/cxix….) and inspects the structure of the first event in the data, printing information about the the content of the event.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source</strong> (<em>str</em>) – a psana source string (e.g. exp=CXI/cxix....).</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>source</strong> (<em>str</em>) – a psana source string (e.g. exp=CXI/cxix….).</td> </tr> </tbody> </table> @@ -660,7 +755,7 @@ printing information about the the content of the event.</p> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<em>str</em>) – a string describing a python type.</td> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<em>str</em>) – a string describing a python type.</td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the python type described by the string.</td> </tr> @@ -705,7 +800,7 @@ python to work with several file format used in x-ray imaging).</p> </div> <div class="footer" role="contentinfo"> © Copyright 2016, CFEL Team. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.3. </div> </body> </html> \ No newline at end of file diff --git a/doc/build/html/genindex.html b/doc/build/html/genindex.html index 0fba7bfb94fd95cfa307cf464eb716dc0504c376..0d9e62509be8ea035d5cdd14ce09a3e28e23c599 100644 --- a/doc/build/html/genindex.html +++ b/doc/build/html/genindex.html @@ -3,16 +3,12 @@ <!doctype html> - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Index — cfelpyutils 0.5 documentation</title> - <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', @@ -34,7 +30,7 @@ <script type="text/javascript" src="_static/css3-mediaqueries.js"></script> <![endif]--> </head> - <body role="document"> + <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> @@ -81,10 +77,13 @@ | <a href="#G"><strong>G</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#L"><strong>L</strong></a> + | <a href="#N"><strong>N</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#W"><strong>W</strong></a> + | <a href="#X"><strong>X</strong></a> + | <a href="#Y"><strong>Y</strong></a> </div> <h2 id="A">A</h2> @@ -147,6 +146,10 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="cfelpyutils.html#cfelpyutils.cfel_cxi.CXIWriter.file_is_full">file_is_full() (cfelpyutils.cfel_cxi.CXIWriter method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.ImageShape.fs">fs (cfelpyutils.cfel_geom.ImageShape attribute)</a> </li> </ul></td> </tr></table> @@ -155,14 +158,24 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="cfelpyutils.html#cfelpyutils.cfel_cxi.CXIWriter.get_file_handle">get_file_handle() (cfelpyutils.cfel_cxi.CXIWriter method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.get_image_shape">get_image_shape() (in module cfelpyutils.cfel_geom)</a> </li> </ul></td> </tr></table> <h2 id="I">I</h2> <table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.ImageShape">ImageShape (class in cfelpyutils.cfel_geom)</a> +</li> + </ul></td> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="cfelpyutils.html#cfelpyutils.cfel_cxi.CXIWriter.initialize_stacks">initialize_stacks() (cfelpyutils.cfel_cxi.CXIWriter method)</a> +</li> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_cxi.CXIWriter.is_entry_in_file">is_entry_in_file() (cfelpyutils.cfel_cxi.CXIWriter method)</a> </li> </ul></td> </tr></table> @@ -179,16 +192,26 @@ </ul></td> </tr></table> +<h2 id="N">N</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_cxi.CXIWriter.num_slices_in_file">num_slices_in_file() (cfelpyutils.cfel_cxi.CXIWriter method)</a> +</li> + </ul></td> +</tr></table> + <h2 id="P">P</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="cfelpyutils.html#cfelpyutils.cfel_optarg.parse_parameters">parse_parameters() (in module cfelpyutils.cfel_optarg)</a> </li> <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.pixel_maps_for_image_view">pixel_maps_for_image_view() (in module cfelpyutils.cfel_geom)</a> +</li> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.pixel_maps_from_geometry_file">pixel_maps_from_geometry_file() (in module cfelpyutils.cfel_geom)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.pixel_maps_from_geometry_file">pixel_maps_from_geometry_file() (in module cfelpyutils.cfel_geom)</a> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.PixelMaps">PixelMaps (class in cfelpyutils.cfel_geom)</a> </li> <li><a href="cfelpyutils.html#cfelpyutils.cfel_psana.psana_event_inspection">psana_event_inspection() (in module cfelpyutils.cfel_psana)</a> </li> @@ -199,6 +222,10 @@ <h2 id="R">R</h2> <table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.PixelMaps.r">r (cfelpyutils.cfel_geom.PixelMaps attribute)</a> +</li> + </ul></td> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="cfelpyutils.html#cfelpyutils.cfel_fabio.read_cbf_from_stream">read_cbf_from_stream() (in module cfelpyutils.cfel_fabio)</a> </li> @@ -207,6 +234,10 @@ <h2 id="S">S</h2> <table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.ImageShape.ss">ss (cfelpyutils.cfel_geom.ImageShape attribute)</a> +</li> + </ul></td> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="cfelpyutils.html#cfelpyutils.cfel_cxi.CXIWriter.stacks_are_initialized">stacks_are_initialized() (cfelpyutils.cfel_cxi.CXIWriter method)</a> </li> @@ -225,6 +256,22 @@ </ul></td> </tr></table> +<h2 id="X">X</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.PixelMaps.x">x (cfelpyutils.cfel_geom.PixelMaps attribute)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="Y">Y</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="cfelpyutils.html#cfelpyutils.cfel_geom.PixelMaps.y">y (cfelpyutils.cfel_geom.PixelMaps attribute)</a> +</li> + </ul></td> +</tr></table> + </div> @@ -246,7 +293,7 @@ </div> <div class="footer" role="contentinfo"> © Copyright 2016, CFEL Team. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.3. </div> </body> </html> \ No newline at end of file diff --git a/doc/build/html/index.html b/doc/build/html/index.html index a6a7ca4d6281db6f6763ecfdc406b37c3b1b589c..24135d0eb7bb17327d312836c72c2f691b8469da 100644 --- a/doc/build/html/index.html +++ b/doc/build/html/index.html @@ -2,16 +2,12 @@ <!doctype html> - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Welcome to cfelpyutils’s documentation! — cfelpyutils 0.5 documentation</title> - <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', @@ -33,7 +29,7 @@ <script type="text/javascript" src="_static/css3-mediaqueries.js"></script> <![endif]--> </head> - <body role="document"> + <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> @@ -50,7 +46,7 @@ <div class="sphinxsidebarwrapper"> <h3><a href="#">Table Of Contents</a></h3> <ul> -<li><a class="reference internal" href="#">Welcome to cfelpyutils’s documentation!</a></li> +<li><a class="reference internal" href="#">Welcome to cfelpyutils’s documentation!</a></li> <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li> </ul> @@ -80,7 +76,7 @@ <div class="body" role="main"> <div class="section" id="welcome-to-cfelpyutils-s-documentation"> -<h1>Welcome to cfelpyutils’s documentation!<a class="headerlink" href="#welcome-to-cfelpyutils-s-documentation" title="Permalink to this headline">¶</a></h1> +<h1>Welcome to cfelpyutils’s documentation!<a class="headerlink" href="#welcome-to-cfelpyutils-s-documentation" title="Permalink to this headline">¶</a></h1> <p>Contents:</p> <div class="toctree-wrapper compound"> </div> @@ -114,7 +110,7 @@ </div> <div class="footer" role="contentinfo"> © Copyright 2016, CFEL Team. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.3. </div> </body> </html> \ No newline at end of file diff --git a/doc/build/html/modules.html b/doc/build/html/modules.html index f1a6dd50f40f30aa21fda4888bb0a0a80fc802a0..ab88216f0725e91869fe2357ab8104473d840683 100644 --- a/doc/build/html/modules.html +++ b/doc/build/html/modules.html @@ -2,16 +2,12 @@ <!doctype html> - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>cfelpyutils — cfelpyutils 0.5 documentation</title> - <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', @@ -33,7 +29,7 @@ <script type="text/javascript" src="_static/css3-mediaqueries.js"></script> <![endif]--> </head> - <body role="document"> + <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> @@ -113,7 +109,7 @@ </div> <div class="footer" role="contentinfo"> © Copyright 2016, CFEL Team. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.3. </div> </body> </html> \ No newline at end of file diff --git a/doc/build/html/objects.inv b/doc/build/html/objects.inv index 8ee46f78e15a12170b6850d5ea93acc4751f053c..58c022b672f3c592ec4e297d5730487d69699b63 100644 Binary files a/doc/build/html/objects.inv and b/doc/build/html/objects.inv differ diff --git a/doc/build/html/py-modindex.html b/doc/build/html/py-modindex.html index 47a2c1ee4c90d853858e64bbba5b9081c8a39c52..d314a49d0013f3dd3cba782cd6eb581a496a05e3 100644 --- a/doc/build/html/py-modindex.html +++ b/doc/build/html/py-modindex.html @@ -2,16 +2,12 @@ <!doctype html> - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Python Module Index — cfelpyutils 0.5 documentation</title> - <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', @@ -36,7 +32,7 @@ </head> - <body role="document"> + <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> @@ -143,7 +139,7 @@ </div> <div class="footer" role="contentinfo"> © Copyright 2016, CFEL Team. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.3. </div> </body> </html> \ No newline at end of file diff --git a/doc/build/html/search.html b/doc/build/html/search.html index 0132947af697b6d8b23bed92265396fcd297ed6a..69f4a4c178783e1dd69a9750f50a27c11c81201c 100644 --- a/doc/build/html/search.html +++ b/doc/build/html/search.html @@ -2,16 +2,12 @@ <!doctype html> - <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Search — cfelpyutils 0.5 documentation</title> - <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', @@ -41,7 +37,7 @@ <![endif]--> </head> - <body role="document"> + <body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> @@ -107,7 +103,7 @@ </div> <div class="footer" role="contentinfo"> © Copyright 2016, CFEL Team. - Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. + Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.3. </div> </body> </html> \ No newline at end of file diff --git a/doc/build/html/searchindex.js b/doc/build/html/searchindex.js index 113258da890dc1ef5cd7ef0914a44db75df01198..87f178a9efff29a4ffa72ae45d52eca2dc7c8706 100644 --- a/doc/build/html/searchindex.js +++ b/doc/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["cfelpyutils","index","modules"],envversion:51,filenames:["cfelpyutils.rst","index.rst","modules.rst"],objects:{"":{cfelpyutils:[0,0,0,"-"]},"cfelpyutils.cfel_crystfel":{load_crystfel_geometry:[0,1,1,""]},"cfelpyutils.cfel_cxi":{CXIWriter:[0,2,1,""]},"cfelpyutils.cfel_cxi.CXIWriter":{add_stack_to_writer:[0,3,1,""],append_data_to_stack:[0,3,1,""],close_file:[0,3,1,""],create_link:[0,3,1,""],create_link_to_group:[0,3,1,""],file_is_full:[0,3,1,""],get_file_handle:[0,3,1,""],initialize_stacks:[0,3,1,""],stacks_are_initialized:[0,3,1,""],write_simple_entry:[0,3,1,""],write_stack_slice_and_increment:[0,3,1,""]},"cfelpyutils.cfel_fabio":{read_cbf_from_stream:[0,1,1,""]},"cfelpyutils.cfel_geom":{apply_geometry_from_file:[0,1,1,""],apply_geometry_from_pixel_maps:[0,1,1,""],pixel_maps_for_image_view:[0,1,1,""],pixel_maps_from_geometry_file:[0,1,1,""]},"cfelpyutils.cfel_hdf5":{load_nparray_from_hdf5_file:[0,1,1,""]},"cfelpyutils.cfel_optarg":{parse_parameters:[0,1,1,""]},"cfelpyutils.cfel_psana":{dirname_from_source_runs:[0,1,1,""],psana_event_inspection:[0,1,1,""],psana_obj_from_string:[0,1,1,""]},cfelpyutils:{cfel_crystfel:[0,0,0,"-"],cfel_cxi:[0,0,0,"-"],cfel_fabio:[0,0,0,"-"],cfel_geom:[0,0,0,"-"],cfel_hdf5:[0,0,0,"-"],cfel_optarg:[0,0,0,"-"],cfel_psana:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method"},terms:{"boolean":0,"byte":0,"case":0,"class":0,"default":0,"float":0,"function":0,"import":0,"int":0,"new":0,"return":0,"true":0,For:0,Its:0,THe:0,The:0,Use:0,about:0,access:0,accord:0,across:0,add:0,add_stack_to_writ:0,added:0,adher:0,after:0,again:0,against:0,all:0,allow:0,allowa:0,alreadi:0,also:0,amost:0,ani:0,anoth:0,api:0,appear:0,append:0,append_data_to_stack:0,appli:0,apply_geometry_from_fil:0,apply_geometry_from_pixel_map:0,are_stacks_initi:[],argument:0,arrai:0,assign:0,attempt:0,attribut:0,automat:0,axes:0,backcspad:0,base:0,beam:0,been:0,befor:0,block:0,bool:0,brace:0,bracket:0,buffer:0,build:0,can:0,cannot:0,cbf_obj:0,cbfimag:0,center:0,cfel:0,cfel_crystfel:2,cfel_cxi:2,cfel_fabio:2,cfel_geom:2,cfel_hdf5:2,cfel_optarg:2,cfel_psana:2,cfelfabio:0,cfelgeom:0,cfelhdf5:0,cfeloptarg:0,cfelpsana:0,chang:0,characterist:0,check:0,choic:0,chuck:0,chunk:0,chunk_siz:0,close:0,close_fil:0,command:0,compress:0,comput:0,config:0,configpars:0,configur:0,contain:0,content:[1,2],convers:0,convert:0,coordin:0,corner:0,correct:0,count:0,counter1:0,counter2:0,cours:0,cover:0,creat:0,create_link:0,create_link_to_group:0,crystfel:0,crystfel_geometri:0,cxi:0,cxidb:0,cxiwrit:0,cxix:0,data:0,data_as_slab:0,data_filenam:0,data_group:0,defin:0,delet:0,describ:0,detector1:0,detector2:0,detector:0,detector_1:0,detectorname1:0,detectorname2:0,determin:0,dict:0,dictionari:0,directori:0,dirnam:0,dirname_from_source_run:0,distanc:0,document:0,doubl:0,dtype:0,dure:0,each:0,end:0,ensur:0,entri:0,entry_1:0,error:0,etc:0,event:0,exampl:0,exist:0,exp:0,expand:0,extract:0,fabio:0,fals:0,file:0,file_is_ful:0,filenam:0,first:0,fix:0,fnam:0,follow:0,form:0,format:0,frame:0,from:0,frontcspad:0,full:0,further:0,gener:0,geometri:0,geometry_filenam:0,get:0,get_detector_geometry_2:0,get_file_handl:0,group:0,h5py:0,handl:0,has:0,have:0,hdf5:0,hold:0,html:0,http:0,identifi:0,im_out:0,imag:0,imageview:0,img_shap:0,implement:0,index:1,inform:0,initi:0,initial_data:0,initialize_stack:0,input:0,inspect:0,instanc:0,instanti:0,instead:0,integ:0,interact:0,intern:0,interoper:0,interpret:0,keep:0,kei:0,layout:0,left:0,level:0,like:0,line:0,link:0,list:0,load:0,load_crystfel_geometri:0,load_nparray_from_hdf5_fil:0,locat:0,low:0,make:0,manag:0,mani:0,manual:0,map:0,match:0,max_num_slic:0,maximum:0,miss:0,mod:0,modul:[1,2],monitor_param:0,more:0,multi:0,must:0,nake:0,name:0,ndarrai:0,need:0,never:0,next:0,non:0,none:0,nonetyp:0,normal:0,nparrai:0,number:0,number_of_entri:0,numpi:0,object:0,onc:0,one:0,onli:0,open:0,oper:0,oppos:0,option:0,order:0,org:0,origin:0,otherwis:0,out:0,output:0,overwrit:0,overwritten:0,own:0,p11:0,packag:2,page:1,paramet:0,pars:0,parse_paramet:0,parser:0,path:0,payload:0,petraiii:0,physic:0,pixel:0,pixel_maps_for_image_view:0,pixel_maps_from_geometry_fil:0,point:0,prefix:0,previou:0,print:0,process:0,project:0,provid:0,psana:0,psana_event_inspect:0,psana_obj_from_str:0,pyqtgraph:0,python:0,quot:0,rai:0,rais:0,rand:0,random:0,rang:[],rawconfigpars:0,read:0,read_cbf_from_stream:0,receiv:0,refer:0,reimplement:0,relev:0,replac:0,represent:0,reset:0,respect:0,risk:0,rule:0,same:0,search:1,see:0,sender:0,set:0,sever:0,shape:0,simpl:0,singl:0,size:0,slab:0,slab_shap:0,slice:0,softwar:0,sourc:0,specifi:0,squar:0,stack:0,stacks_are_initi:0,start:0,statu:0,str:0,stream:0,string:0,structur:0,style:0,subdirectori:0,submodul:2,subsequ:0,succe:0,sure:0,sync:0,synchron:0,system:0,take:0,test1:0,test2:0,tfel:0,than:0,thei:0,them:0,thi:0,time:0,top:0,tri:0,tupl:0,turn:0,type:0,uncorrect:0,union:0,unless:0,usag:0,use:0,used:0,user:0,using:0,util:0,valid:0,valu:0,verbatim:0,visual:0,wai:0,want:0,what:0,where:0,which:0,widget:0,without:0,word:0,work:0,write:0,write_simple_entri:0,write_slice_and_incr:0,write_stack_slice_and_incr:0,writer:0,written:0,www:0,your:0},titles:["cfelpyutils package","Welcome to cfelpyutils’s documentation!","cfelpyutils"],titleterms:{cfel_crystfel:0,cfel_cxi:0,cfel_fabio:0,cfel_geom:0,cfel_hdf5:0,cfel_optarg:0,cfel_psana:0,cfelfabio:[],cfelgeom:[],cfelhdf5:[],cfeloptarg:[],cfelpsana:[],cfelpyutil:[0,1,2],content:0,document:1,indic:1,modul:0,packag:0,submodul:0,tabl:1,welcom:1}}) \ No newline at end of file +Search.setIndex({docnames:["cfelpyutils","index","modules"],envversion:53,filenames:["cfelpyutils.rst","index.rst","modules.rst"],objects:{"":{cfelpyutils:[0,0,0,"-"]},"cfelpyutils.cfel_crystfel":{load_crystfel_geometry:[0,1,1,""]},"cfelpyutils.cfel_cxi":{CXIWriter:[0,2,1,""]},"cfelpyutils.cfel_cxi.CXIWriter":{add_stack_to_writer:[0,3,1,""],append_data_to_stack:[0,3,1,""],close_file:[0,3,1,""],create_link:[0,3,1,""],create_link_to_group:[0,3,1,""],file_is_full:[0,3,1,""],get_file_handle:[0,3,1,""],initialize_stacks:[0,3,1,""],is_entry_in_file:[0,3,1,""],num_slices_in_file:[0,3,1,""],stacks_are_initialized:[0,3,1,""],write_simple_entry:[0,3,1,""],write_stack_slice_and_increment:[0,3,1,""]},"cfelpyutils.cfel_fabio":{read_cbf_from_stream:[0,1,1,""]},"cfelpyutils.cfel_geom":{ImageShape:[0,2,1,""],PixelMaps:[0,2,1,""],apply_geometry_from_file:[0,1,1,""],apply_geometry_from_pixel_maps:[0,1,1,""],get_image_shape:[0,1,1,""],pixel_maps_for_image_view:[0,1,1,""],pixel_maps_from_geometry_file:[0,1,1,""]},"cfelpyutils.cfel_geom.ImageShape":{fs:[0,4,1,""],ss:[0,4,1,""]},"cfelpyutils.cfel_geom.PixelMaps":{r:[0,4,1,""],x:[0,4,1,""],y:[0,4,1,""]},"cfelpyutils.cfel_hdf5":{load_nparray_from_hdf5_file:[0,1,1,""]},"cfelpyutils.cfel_optarg":{parse_parameters:[0,1,1,""]},"cfelpyutils.cfel_psana":{dirname_from_source_runs:[0,1,1,""],psana_event_inspection:[0,1,1,""],psana_obj_from_string:[0,1,1,""]},cfelpyutils:{cfel_crystfel:[0,0,0,"-"],cfel_cxi:[0,0,0,"-"],cfel_fabio:[0,0,0,"-"],cfel_geom:[0,0,0,"-"],cfel_hdf5:[0,0,0,"-"],cfel_optarg:[0,0,0,"-"],cfel_psana:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:attribute"},terms:{"boolean":0,"byte":0,"case":0,"class":0,"default":0,"float":0,"function":0,"import":0,"int":0,"new":0,"return":0,"true":0,For:0,Its:0,THe:0,The:0,Use:0,about:0,access:0,accord:0,across:0,add:0,add_stack_to_writ:0,added:0,adher:0,after:0,again:0,against:0,alia:0,all:0,allow:0,allowa:0,alreadi:0,also:0,amost:0,ani:0,anoth:0,api:0,appear:0,append:0,append_data_to_stack:0,appli:0,apply_geometry_from_fil:0,apply_geometry_from_pixel_map:0,argument:0,arrai:0,assign:0,attempt:0,attribut:0,automat:0,axes:0,backcspad:0,base:0,beam:0,been:0,befor:0,block:0,bool:0,brace:0,bracket:0,buffer:0,build:0,can:0,cannot:0,cbf_obj:0,cbfimag:0,center:0,cfel:0,cfel_crystfel:2,cfel_cxi:2,cfel_fabio:2,cfel_geom:2,cfel_hdf5:2,cfel_optarg:2,cfel_psana:2,cfelfabio:0,cfelgeom:0,cfelhdf5:0,cfeloptarg:0,cfelpsana:0,chang:0,characterist:0,check:0,choic:0,chuck:0,chunk:0,chunk_siz:0,close:0,close_fil:0,command:0,compress:0,comput:0,config:0,configpars:0,configur:0,contain:0,content:[1,2],convers:0,convert:0,coordin:0,corner:0,correct:0,count:0,counter1:0,counter2:0,cours:0,cover:0,creat:0,create_link:0,create_link_to_group:0,crystfel:0,crystfel_geometri:0,cxi:0,cxidb:0,cxiwrit:0,cxix:0,data:0,data_as_slab:0,data_filenam:0,data_group:0,dataset:0,defin:0,delet:0,describ:0,detector1:0,detector2:0,detector:0,detector_1:0,detectorname1:0,detectorname2:0,determin:0,dict:0,dictionari:0,directori:0,dirnam:0,dirname_from_source_run:0,distanc:0,document:0,doubl:0,dtype:0,dure:0,each:0,either:0,end:0,ensur:0,entri:0,entry_1:0,error:0,etc:0,event:0,exampl:0,exist:0,exp:0,expand:0,extract:0,fabio:0,fals:0,field:0,file:0,file_is_ful:0,filenam:0,first:0,fix:0,fnam:0,follow:0,form:0,format:0,found:0,frame:0,from:0,frontcspad:0,full:0,further:0,gener:0,geometri:0,geometry_filenam:0,get:0,get_detector_geometry_2:0,get_file_handl:0,get_image_shap:0,group:0,h5py:0,handl:0,has:0,have:0,hdf5:0,hit:0,hold:0,html:0,http:0,identifi:0,im_out:0,imag:0,imageshap:0,imageview:0,img_shap:0,implement:0,index:1,inform:0,initi:0,initial_data:0,initialize_stack:0,input:0,inspect:0,instanc:0,instanti:0,instead:0,integ:0,interact:0,intern:0,interoper:0,interpret:0,is_entry_in_fil:0,keep:0,kei:0,layout:0,left:0,level:0,like:0,line:0,link:0,list:0,load:0,load_crystfel_geometri:0,load_nparray_from_hdf5_fil:0,locat:0,low:0,make:0,manag:0,mani:0,manual:0,map:0,match:0,max_num_slic:0,maximum:0,minimum:0,miss:0,mod:0,modul:[1,2],monitor_param:0,more:0,multi:0,must:0,nake:0,name:0,ndarrai:0,need:0,never:0,next:0,non:0,none:0,nonetyp:0,normal:0,nparrai:0,num_slic:0,num_slices_in_fil:0,number:0,number_of_entri:0,numpi:0,object:0,onc:0,one:0,onli:0,open:0,oper:0,oppos:0,option:0,order:0,org:0,origin:0,otherwis:0,out:0,output:0,overwrit:0,overwritten:0,own:0,p11:0,packag:2,page:1,paramet:0,pars:0,parse_paramet:0,parser:0,path:0,payload:0,petraiii:0,physic:0,pixel:0,pixel_maps_for_image_view:0,pixel_maps_from_geometry_fil:0,pixelmap:0,point:0,prefix:0,present:0,previou:0,print:0,process:0,project:0,provid:0,psana:0,psana_event_inspect:0,psana_obj_from_str:0,pyqtgraph:0,python:0,quot:0,rai:0,rais:0,rand:0,random:0,rawconfigpars:0,read:0,read_cbf_from_stream:0,receiv:0,refer:0,reimplement:0,relev:0,replac:0,repres:0,represent:0,reset:0,respect:0,result:0,ret:0,risk:0,rule:0,same:0,search:1,see:0,sender:0,set:0,sever:0,shape:0,simpl:0,singl:0,size:0,slab:0,slice:0,softwar:0,sourc:0,specifi:0,squar:0,stack:0,stacks_are_initi:0,start:0,statu:0,str:0,stream:0,string:0,structur:0,style:0,subdirectori:0,submodul:2,subsequ:0,succe:0,sure:0,sync:0,synchron:0,system:0,take:0,test1:0,test2:0,tfel:0,than:0,thei:0,them:0,thi:0,time:0,top:0,tri:0,tupl:0,turn:0,type:0,union:0,unless:0,usag:0,use:0,used:0,user:0,using:0,util:0,valid:0,valu:0,verbatim:0,visual:0,wai:0,want:0,what:0,where:0,which:0,widget:0,without:0,word:0,work:0,write:0,write_simple_entri:0,write_slice_and_incr:0,write_stack_slice_and_incr:0,writer:0,written:0,writter:0,www:0,your:0},titles:["cfelpyutils package","Welcome to cfelpyutils\u2019s documentation!","cfelpyutils"],titleterms:{cfel_crystfel:0,cfel_cxi:0,cfel_fabio:0,cfel_geom:0,cfel_hdf5:0,cfel_optarg:0,cfel_psana:0,cfelpyutil:[0,1,2],content:0,document:1,indic:1,modul:0,packag:0,submodul:0,tabl:1,welcom:1}}) \ No newline at end of file