lottoqert.blogg.se

Pixave documentation
Pixave documentation










pixave documentation

move_geo ( 'QUAD:V1', 2, - 100, 0, 0 ) #geo.get_geo('QUAD:V1', 3).print_geo() print 'Time to load geometry %.3f sec from file \n %s ' % ( time () - t0_sec, fname_geo ) return arr, geo #. size ,) # (32*185*388,) # retrieve geometry t0_sec = time () geo = GeometryAccess ( fname_geo ) geo. def data_geo ( ntest ) : """Returns test data numpy array and geometry object """ from time import time from PSCalib.NDArrIO import save_txt, load_txt from PSCalib.GeometryAccess import GeometryAccess dir = '/reg/g/psdm/detector/alignment/cspad/calib-cxi-camera2-' #fname_nda = '%s/nda-water-ring-cxij4716-r0022-e000001-CxiDs2-0-Cspad-0-ave.txt' % dir fname_nda = ' %s /nda-water-ring-cxij4716-r0022-e014636-CxiDs2-0-Cspad-0-ave.txt' % dir fname_geo = ' %s /calib/CsPad::CalibV1/CxiDs2.0:Cspad.0/geometry/geo-cxi01516-Ag-behenate-tuned.data' % dir #fname_geo = '%s/geo-cxi02416-r0010-.txt' % dir fname_gain = ' %s /calib/CsPad::CalibV1/CxiDs2.0:Cspad.0/pixel_gain/cxi01516-r0016-FeKalpha.data' % dir # load n-d array with averaged water ring arr = load_txt ( fname_nda ) #arr *= load_txt(fname_gain) #print_ndarr(arr,'water ring') arr. shape = shape return nda #- #- #- TEST - #- #.

pixave documentation

pixel_avrg_interpol ( nda, method, verb ) nda. shape = shape return nda def subtract_bkgd_interpol ( self, ndarr, method = 'linear', verb = False ) : """Returns 1-d numpy array of per-pixel interpolated-background subtracted input data.""" shape = ndarr. _init_ ( self, xarr, yarr, mask, radedges, nradbins, phiedges, nphibins ) def subtract_bkgd ( self, ndarr ) : """Returns 1-d numpy array of per-pixel background subtracted input data.""" shape = ndarr.

pixave documentation pixave documentation

default=(0,360) Difference of the edge limits should not exceed +/-360 degree - nphibins - number of angular bins default=32 - bin size equal to 1 rhumb for default phiedges """ HPolar. Dubrovin """ #- _version_ = "$Revision: 12490 $" #- #import math #import numpy as np #from pyimgalgos.HBins import HBins from pyimgalgos.HPolar import HPolar, polarization_factor, divide_protected, cart2polar, polar2cart, bincount #- class RadialBkgd ( HPolar ) : def _init_ ( self, xarr, yarr, mask = None, radedges = None, nradbins = 100, phiedges = ( 0, 360 ), nphibins = 32 ) : """Parameters - mask - n-d array with mask - xarr - n-d array with pixel x coordinates in any units - yarr - n-d array with pixel y coordinates in the same units as xarr - radedges - radial bin edges for corrected region in the same units of xarr default=None - all radial range - nradbins - number of radial bins - phiedges - phi ange bin edges for corrected region. If you use all or part of it, please give an appropriate acknowledgment.

#Pixave documentation software

:py:class:`pyimgalgos.HSpectrum` This software was developed for the SIT project. Usage:: # Import # - from pyimgalgos.RadialBkgd import RadialBkgd # Initialization # - rb = RadialBkgd(xarr, yarr, mask=None, radedges=None, nradbins=100, phiedges=(0,360), nphibins=32) # Access methods # - orb = rb.obj_radbins() # returns HBins object for radial bins opb = rb.obj_phibins() # returns HBins object for angular bins rad = rb.pixel_rad() irad = rb.pixel_irad() phi0 = rb.pixel_phi0() phi = rb.pixel_phi() iphi = rb.pixel_iphi() iseq = rb.pixel_iseq() npix = rb.bin_number_of_pixels() int = rb.bin_intensity(nda) arr1d = rb.bin_avrg(nda) arr2d = rb.bin_avrg_rad_phi(nda, do_transp=True) pixav = rb.pixel_avrg(nda) pixav = rb.pixel_avrg_interpol(nda, method='linear') # method='nearest' 'cubic' cdata = rb.subtract_bkgd(nda) cdata = rb.subtract_bkgd_interpol(nda, method='linear') # Print attributes and n-d arrays # - rb.print_attrs() rb.print_ndarrs() # Global methods # - from pyimgalgos.RadialBkgd import polarization_factor, divide_protected, cart2polar, polar2cart, bincount polf = polarization_factor(rad, phi, z) result = divide_protected(num, den, vsub_zero=0) r, theta = cart2polar(x, y) x, y = polar2cart(r, theta) bin_values = bincount(map_bins, map_weights=None, length=None) :py:class:`pyimgalgos.HPolar` :py:class:`pyimgalgos.HBins` See `Radial background `_. #!/usr/bin/env python #- """:py:class:`RadialBkgd` - radial background subtraction for imaging detector n-d array data, extension of the base class :py:class:`HPolar` for methods subtract_bkgd and subtract_bkgd_interpol.












Pixave documentation