Changeset 9ddffe0 in sasview


Ignore:
Timestamp:
Aug 23, 2016 8:31:46 AM (8 years ago)
Author:
lewis
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
0836f77
Parents:
ac3353d
Message:

Correctly write orientation vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/file_converter/nxcansas_writer.py

    rac3353d r9ddffe0  
    118118                    data=_h5_float(getattr(data_info.sample, key))) 
    119119        _write_h5_vector(sample_entry, data_info.sample.position) 
     120        # NXcanSAS doesn't save information about pitch, only roll 
     121        # and yaw. The _write_h5_vector method writes vector.y, but we 
     122        # need to write vector.z for yaw 
     123        data_info.sample.orientation.y = data_info.orientation.z 
    120124        _write_h5_vector(sample_entry, data_info.sample.orientation, 
    121125            names=['polar_angle', 'azimuthal_angle']) 
     
    169173                    detector_entry['slit_length'].attrs['units'] = det_info.slit_length_unit 
    170174                _write_h5_vector(detector_entry, det_info.offset) 
     175                # NXcanSAS doesn't save information about pitch, only roll 
     176                # and yaw. The _write_h5_vector method writes vector.y, but we 
     177                # need to write vector.z for yaw 
     178                det_info.orientation.y = det_info.orientation.z 
    171179                _write_h5_vector(detector_entry, det_info.orientation, 
    172180                    names=['polar_angle', 'azimuthal_angle']) 
Note: See TracChangeset for help on using the changeset viewer.