qsmearing

sans.models.qsmearing

class sans.models.qsmearing.QSmearer

Bases: sans.models.qsmearing._QSmearer

Adaptor for Gaussian Q smearing class and SANS data

__call__()

Perform smearing

__class__

alias of type

__deepcopy__()

Return a valid copy of self. Avoid copying the _smearer C object and force a matrix recompute when the copy is used.

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x02933CD0>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Assumption: equally spaced bins of increasing q-values.

Parameters:data1D – data used to set the smearing parameters
__module__ = 'sans.models.qsmearing'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_compute_matrix()
_get_extrapolated_bin()

Get extrapolated first bin and the last bin

: param first_bin: unextrapolated first_bin : param last_bin: unextrapolated last_bin

: return first_bin, last_bin: extrapolated first and last bin

_get_unextrapolated_bin()

Get unextrapolated first bin and the last bin

: param first_bin: extrapolated first_bin : param last_bin: extrapolated last_bin

: return fist_bin, last_bin: unextrapolated first and last bin

_initialize_smearer()

Initialize the C++ smearer object. This method HAS to be called before smearing

get_bin_range()
Parameters:
  • q_min – minimum q-value to smear
  • q_max – maximum q-value to smear
get_unsmeared_range()

Determine the range needed in unsmeared-Q to cover the smeared Q range Take 3 sigmas as the offset between smeared and unsmeared space

class sans.models.qsmearing.SlitSmearer

Bases: sans.models.qsmearing._SlitSmearer

Adaptor for slit smearing class and SANS data

__call__()

Perform smearing

__class__

alias of type

__deepcopy__()

Return a valid copy of self. Avoid copying the _smearer C object and force a matrix recompute when the copy is used.

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x02933CB0>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Assumption: equally spaced bins of increasing q-values.

Parameters:data1D – data used to set the smearing parameters
__module__ = 'sans.models.qsmearing'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_compute_matrix()
_get_extrapolated_bin()

Get extrapolated first bin and the last bin

: param first_bin: unextrapolated first_bin : param last_bin: unextrapolated last_bin

: return first_bin, last_bin: extrapolated first and last bin

_get_unextrapolated_bin()

Get unextrapolated first bin and the last bin

: param first_bin: extrapolated first_bin : param last_bin: extrapolated last_bin

: return fist_bin, last_bin: unextrapolated first and last bin

_initialize_smearer()

Initialize the C++ smearer object. This method HAS to be called before smearing

get_bin_range()
Parameters:
  • q_min – minimum q-value to smear
  • q_max – maximum q-value to smear
get_unsmeared_range()

Determine the range needed in unsmeared-Q to cover the smeared Q range

class sans.models.qsmearing._BaseSmearer

Bases: object

__call__()

Perform smearing

__class__

alias of type

__deepcopy__()

Return a valid copy of self. Avoid copying the _smearer C object and force a matrix recompute when the copy is used.

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x026EAB70>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()
__module__ = 'sans.models.qsmearing'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_compute_matrix()
_get_extrapolated_bin()

Get extrapolated first bin and the last bin

: param first_bin: unextrapolated first_bin : param last_bin: unextrapolated last_bin

: return first_bin, last_bin: extrapolated first and last bin

_get_unextrapolated_bin()

Get unextrapolated first bin and the last bin

: param first_bin: extrapolated first_bin : param last_bin: extrapolated last_bin

: return fist_bin, last_bin: unextrapolated first and last bin

_initialize_smearer()
get_bin_range()
Parameters:
  • q_min – minimum q-value to smear
  • q_max – maximum q-value to smear
class sans.models.qsmearing._QSmearer

Bases: sans.models.qsmearing._BaseSmearer

Perform Gaussian Q smearing

__call__()

Perform smearing

__class__

alias of type

__deepcopy__()

Return a valid copy of self. Avoid copying the _smearer C object and force a matrix recompute when the copy is used.

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x02933890>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Initialization

Parameters:
  • nbins – number of Q bins
  • width – array standard deviation in Q [A-1]
  • min – Q_min [A-1]
  • max – Q_max [A-1]
__module__ = 'sans.models.qsmearing'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_compute_matrix()
_get_extrapolated_bin()

Get extrapolated first bin and the last bin

: param first_bin: unextrapolated first_bin : param last_bin: unextrapolated last_bin

: return first_bin, last_bin: extrapolated first and last bin

_get_unextrapolated_bin()

Get unextrapolated first bin and the last bin

: param first_bin: extrapolated first_bin : param last_bin: extrapolated last_bin

: return fist_bin, last_bin: unextrapolated first and last bin

_initialize_smearer()

Initialize the C++ smearer object. This method HAS to be called before smearing

get_bin_range()
Parameters:
  • q_min – minimum q-value to smear
  • q_max – maximum q-value to smear
get_unsmeared_range()

Determine the range needed in unsmeared-Q to cover the smeared Q range Take 3 sigmas as the offset between smeared and unsmeared space

class sans.models.qsmearing._SlitSmearer

Bases: sans.models.qsmearing._BaseSmearer

Slit smearing for I(q) array

__call__()

Perform smearing

__class__

alias of type

__deepcopy__()

Return a valid copy of self. Avoid copying the _smearer C object and force a matrix recompute when the copy is used.

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x01926250>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Initialization

Parameters:
  • iq – I(q) array [cm-1]
  • width – slit width [A-1]
  • height – slit height [A-1]
  • min – Q_min [A-1]
  • max – Q_max [A-1]
__module__ = 'sans.models.qsmearing'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

x.__repr__() <==> repr(x)

__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_compute_matrix()
_get_extrapolated_bin()

Get extrapolated first bin and the last bin

: param first_bin: unextrapolated first_bin : param last_bin: unextrapolated last_bin

: return first_bin, last_bin: extrapolated first and last bin

_get_unextrapolated_bin()

Get unextrapolated first bin and the last bin

: param first_bin: extrapolated first_bin : param last_bin: extrapolated last_bin

: return fist_bin, last_bin: unextrapolated first and last bin

_initialize_smearer()

Initialize the C++ smearer object. This method HAS to be called before smearing

get_bin_range()
Parameters:
  • q_min – minimum q-value to smear
  • q_max – maximum q-value to smear
get_unsmeared_range()

Determine the range needed in unsmeared-Q to cover the smeared Q range

sans.models.qsmearing.get_qextrapolate()

Make fake data_x points extrapolated outside of the data_x points

: param width: array of std of q resolution : param Data1D.x: Data1D.x array

: return new_width, data_x_ext: extrapolated width array and x array

: assumption1: data_x is ordered from lower q to higher q : assumption2: len(data) = len(width) : assumption3: the distance between the data points is more compact

than the size of width

: Todo1: Make sure that the assumptions are correct for Data1D : Todo2: This fixes the edge problem in Qsmearer but still needs to make

smearer interface
sans.models.qsmearing.smear_selection()

Creates the right type of smearer according to the data.

The canSAS format has a rule that either slit smearing data OR resolution smearing data is available.

For the present purpose, we choose the one that has none-zero data. If both slit and resolution smearing arrays are filled with good data (which should not happen), then we choose the resolution smearing data.

Parameters:
  • data1D – Data1D object
  • model – sans.model instance

Table Of Contents

Previous topic

ProlateModel

Next topic

ReflAdvModel

This Page