Changeset d00f8ff in sasview for DataLoader/readers
- Timestamp:
- Oct 1, 2008 10:54:19 AM (16 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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- cfbe9b5
- Parents:
- 57f3320
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/readers/cansas_reader.py
re390933 rd00f8ff 460 460 dx = numpy.zeros(0) 461 461 dy = numpy.zeros(0) 462 dxw = numpy.zeros(0) 463 dxl = numpy.zeros(0) 462 464 463 465 for item in nodes: 464 466 _x, attr = get_float('Q', item) 465 467 _dx, attr_d = get_float('Qdev', item) 468 _dxl, attr_l = get_float('dQl', item) 469 _dxw, attr_w = get_float('dQw', item) 466 470 if _dx == None: 467 471 _dx = 0.0 472 if _dxl == None: 473 _dxl = 0.0 474 if _dxw == None: 475 _dxw = 0.0 468 476 469 477 if attr.has_key('unit') and attr['unit'].lower() != data_info.x_unit.lower(): … … 478 486 raise ValueError, "CanSAS reader: unrecognized Q unit [%s]; expecting [%s]" \ 479 487 % (attr['unit'], data_info.x_unit) 488 # Error in Q 480 489 if attr_d.has_key('unit') and attr_d['unit'].lower() != data_info.x_unit.lower(): 481 490 if has_converter==True: … … 488 497 else: 489 498 raise ValueError, "CanSAS reader: unrecognized dQ unit [%s]; expecting [%s]" \ 499 % (attr['unit'], data_info.x_unit) 500 # Slit length 501 if attr_l.has_key('unit') and attr_l['unit'].lower() != data_info.x_unit.lower(): 502 if has_converter==True: 503 try: 504 data_conv_q = Converter(attr_l['unit']) 505 _dxl = data_conv_q(_dxl, units=data_info.x_unit) 506 except: 507 raise ValueError, "CanSAS reader: could not convert dQl unit [%s]; expecting [%s]\n %s" \ 508 % (attr['unit'], data_info.x_unit, sys.exc_value) 509 else: 510 raise ValueError, "CanSAS reader: unrecognized dQl unit [%s]; expecting [%s]" \ 511 % (attr['unit'], data_info.x_unit) 512 # Slit width 513 if attr_w.has_key('unit') and attr_w['unit'].lower() != data_info.x_unit.lower(): 514 if has_converter==True: 515 try: 516 data_conv_q = Converter(attr_w['unit']) 517 _dxw = data_conv_q(_dxw, units=data_info.x_unit) 518 except: 519 raise ValueError, "CanSAS reader: could not convert dQw unit [%s]; expecting [%s]\n %s" \ 520 % (attr['unit'], data_info.x_unit, sys.exc_value) 521 else: 522 raise ValueError, "CanSAS reader: unrecognized dQw unit [%s]; expecting [%s]" \ 490 523 % (attr['unit'], data_info.x_unit) 491 524 … … 522 555 dx = numpy.append(dx, _dx) 523 556 dy = numpy.append(dy, _dy) 557 dxl = numpy.append(dxl, _dxl) 558 dxw = numpy.append(dxw, _dxw) 559 524 560 525 561 data_info.x = x … … 527 563 data_info.dx = dx 528 564 data_info.dy = dy 565 data_info.dxl = dxl 566 data_info.dxw = dxw 529 567 530 568 data_conv_q = None
Note: See TracChangeset
for help on using the changeset viewer.