Changeset d26f025 in sasview for src/sas/sascalc/dataloader/manipulations.py
- Timestamp:
- Apr 9, 2017 8:48:35 AM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- b6b81a3, 7b15990, 24b3821, cbb9551, 8d891d1, ecdd132, 115eb7e, 2e17ee4, 0657b10
- Parents:
- ea45bfe (diff), 4342fed0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/manipulations.py
r959eb01 r7432acb 210 210 y[i_q] += frac * data[npts] 211 211 212 if err_data ==None or err_data[npts] == 0.0:212 if err_data is None or err_data[npts] == 0.0: 213 213 if data[npts] < 0: 214 214 data[npts] = -data[npts] … … 333 333 continue 334 334 y += frac * data[npts] 335 if err_data ==None or err_data[npts] == 0.0:335 if err_data is None or err_data[npts] == 0.0: 336 336 if data[npts] < 0: 337 337 data[npts] = -data[npts] … … 422 422 423 423 # Get the dq for resolution averaging 424 if data2D.dqx_data != None and data2D.dqy_data !=None:424 if data2D.dqx_data is not None and data2D.dqy_data is not None: 425 425 # The pinholes and det. pix contribution present 426 426 # in both direction of the 2D which must be subtracted when … … 462 462 463 463 #q_data_max = numpy.max(q_data) 464 if len(data2D.q_data) ==None:464 if len(data2D.q_data) is None: 465 465 msg = "Circular averaging: invalid q_data: %g" % data2D.q_data 466 466 raise RuntimeError, msg … … 502 502 # Take dqs from data to get the q_average 503 503 x[i_q] += frac * q_value 504 if err_data ==None or err_data[npt] == 0.0:504 if err_data is None or err_data[npt] == 0.0: 505 505 if data_n < 0: 506 506 data_n = -data_n … … 508 508 else: 509 509 err_y[i_q] += frac * frac * err_data[npt] * err_data[npt] 510 if dq_data !=None:510 if dq_data is not None: 511 511 # To be consistent with dq calculation in 1d reduction, 512 512 # we need just the averages (not quadratures) because … … 523 523 err_y[n] = -err_y[n] 524 524 err_y[n] = math.sqrt(err_y[n]) 525 #if err_x !=None:525 #if err_x is not None: 526 526 # err_x[n] = math.sqrt(err_x[n]) 527 527 … … 532 532 idx = (numpy.isfinite(y)) & (numpy.isfinite(x)) 533 533 534 if err_x !=None:534 if err_x is not None: 535 535 d_x = err_x[idx] / y_counts[idx] 536 536 else: … … 623 623 phi_bins[i_phi] += frac * data[npt] 624 624 625 if err_data ==None or err_data[npt] == 0.0:625 if err_data is None or err_data[npt] == 0.0: 626 626 if data_n < 0: 627 627 data_n = -data_n … … 777 777 778 778 # Get the dq for resolution averaging 779 if data2D.dqx_data != None and data2D.dqy_data !=None:779 if data2D.dqx_data is not None and data2D.dqy_data is not None: 780 780 # The pinholes and det. pix contribution present 781 781 # in both direction of the 2D which must be subtracted when … … 888 888 y[i_bin] += frac * data_n 889 889 x[i_bin] += frac * q_value 890 if err_data[n] ==None or err_data[n] == 0.0:890 if err_data[n] is None or err_data[n] == 0.0: 891 891 if data_n < 0: 892 892 data_n = -data_n … … 895 895 y_err[i_bin] += frac * frac * err_data[n] * err_data[n] 896 896 897 if dq_data !=None:897 if dq_data is not None: 898 898 # To be consistent with dq calculation in 1d reduction, 899 899 # we need just the averages (not quadratures) because … … 925 925 y_err[y_err == 0] = numpy.average(y_err) 926 926 idx = (numpy.isfinite(y) & numpy.isfinite(y_err)) 927 if x_err !=None:927 if x_err is not None: 928 928 d_x = x_err[idx] / y_counts[idx] 929 929 else:
Note: See TracChangeset
for help on using the changeset viewer.