Changeset bcabf4e in sasview for src


Ignore:
Timestamp:
Feb 7, 2017 1:29:56 PM (8 years ago)
Author:
krzywon
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:
b61bd57
Parents:
5e6df0e
Message:

2D masking loaded properly and mask is now saved as 1s and 0s as per CanSAS specification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r5e6df0e rbcabf4e  
    298298                    self.current_dataset.dqy_data = np.fromstring(data_point, dtype=float, sep=",") 
    299299                elif tagname == 'Mask': 
    300                     inter = data_point.split(",") 
     300                    inter = [item == "1" for item in data_point.split(",")] 
    301301                    self.current_dataset.mask = np.asarray(inter, dtype=bool) 
    302302 
     
    10801080        if datainfo.mask is not None: 
    10811081            mask = ','.join( 
    1082                 [str(datainfo.mask[i]) for i in xrange(len(datainfo.mask))]) 
     1082                ["1" if datainfo.mask[i] else "0" 
     1083                 for i in xrange(len(datainfo.mask))]) 
    10831084            self.write_node(point, "Mask", mask) 
    10841085 
Note: See TracChangeset for help on using the changeset viewer.