Changeset 952ea1f in sasview for src/sas/sascalc/calculator
- Timestamp:
- Oct 11, 2018 1:33:22 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249
- Children:
- 7ba6470
- Parents:
- 67ed543
- git-author:
- Paul Kienzle <pkienzle@…> (10/11/18 13:22:07)
- git-committer:
- Paul Kienzle <pkienzle@…> (10/11/18 13:33:22)
- Location:
- src/sas/sascalc/calculator
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/c_extensions/sld2i_module.c
ra1daf86 r952ea1f 2 2 SLD2I module to perform point and I calculations 3 3 */ 4 #include <stdio.h> 5 6 //#define Py_LIMITED_API 0x03020000 4 7 #include <Python.h> 5 #include <stdio.h> 8 6 9 #include "sld2i.h" 7 10 … … 160 163 161 164 #define MODULE_DOC "Sld2i C Library" 162 #define MODULE_NAME " sld2i"163 #define MODULE_INIT2 init sld2i164 #define MODULE_INIT3 PyInit_ sld2i165 #define MODULE_NAME "_sld2i" 166 #define MODULE_INIT2 init_sld2i 167 #define MODULE_INIT3 PyInit__sld2i 165 168 #define MODULE_METHODS module_methods 166 169 -
src/sas/sascalc/calculator/sas_gen.py
r144e032a r952ea1f 14 14 import numpy as np 15 15 16 from . core import sld2i as mod16 from . import _sld2i 17 17 from .BaseComponent import BaseComponent 18 18 … … 145 145 self.params['Up_frac_out'], 146 146 self.params['Up_theta']) 147 model = mod.new_GenI(*args)147 model = _sld2i.new_GenI(*args) 148 148 if len(qy): 149 149 qx, qy = _vec(qx), _vec(qy) 150 150 I_out = np.empty_like(qx) 151 151 #print("npoints", qx.shape, "npixels", pos_x.shape) 152 mod.genicomXY(model, qx, qy, I_out)152 _sld2i.genicomXY(model, qx, qy, I_out) 153 153 #print("I_out after", I_out) 154 154 else: 155 155 qx = _vec(qx) 156 156 I_out = np.empty_like(qx) 157 mod.genicom(model, qx, I_out)157 _sld2i.genicom(model, qx, I_out) 158 158 vol_correction = self.data_total_volume / self.params['total_volume'] 159 159 result = (self.params['scale'] * vol_correction * I_out … … 304 304 z_dir2 *= z_dir2 305 305 mask = (x_dir2 + y_dir2 + z_dir2) <= 1.0 306 except Exception :307 logger.error( sys.exc_value)306 except Exception as exc: 307 logger.error(exc) 308 308 self.output = MagSLD(self.pos_x[mask], self.pos_y[mask], 309 309 self.pos_z[mask], self.sld_n[mask], … … 600 600 y_lines.append(y_line) 601 601 z_lines.append(z_line) 602 except Exception :603 logger.error( sys.exc_value)602 except Exception as exc: 603 logger.error(exc) 604 604 605 605 output = MagSLD(pos_x, pos_y, pos_z, sld_n, sld_mx, sld_my, sld_mz) … … 691 691 _vol_pix = float(toks[7]) 692 692 vol_pix = np.append(vol_pix, _vol_pix) 693 except Exception :693 except Exception as exc: 694 694 vol_pix = None 695 except Exception :695 except Exception as exc: 696 696 # Skip non-data lines 697 logger.error( sys.exc_value)697 logger.error(exc) 698 698 output = MagSLD(pos_x, pos_y, pos_z, sld_n, 699 699 sld_mx, sld_my, sld_mz)
Note: See TracChangeset
for help on using the changeset viewer.