Changeset 1c0e3b0 in sasview


Ignore:
Timestamp:
Mar 21, 2016 8:30:32 AM (9 years ago)
Author:
awashington
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:
25427d9
Parents:
76d905f
Message:

Better reading of units in sesans_reader

File:
1 edited

Legend:

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

    r3689302 r1c0e3b0  
    142142                default_p_unit = " " 
    143143                lam_unit = lam_header[1].replace("[","").replace("]","") 
    144                 for i,x_val in output.x: 
    145                     output.x[i], output.x_unit = self._unit_conversion(x_val, lam_unit, default_z_unit) 
    146                 for i,y_val in output.y: 
    147                     output.y[i], output.y_unit = self._unit_conversion(y_val, " ", default_p_unit) 
    148144                varheader=[zvals[0],dzvals[0],lamvals[0],dlamvals[0],Pvals[0],dPvals[0]] 
    149145                valrange=range(1, len(zvals)) 
     
    163159                input_f.close() 
    164160 
    165                 #Data 
    166                 output.x = x #[x != 0] 
    167                 output.y = y #[x != 0] 
     161                output.x, output.x_unit = self._unit_conversion(x, lam_unit, default_z_unit) 
     162                output.y = y 
     163                output.dx, output.dx_unit = self._unit_conversion(dx, lam_unit, default_z_unit) 
    168164                output.dy = dy 
    169                 output.dx = dx 
    170                 output.lam = lam 
    171                 output.dlam = dlam 
     165                output.lam, output.lam_unit = self._unit_conversion(lam, lam_unit, default_z_unit) 
     166                output.dlam, output.dlam_unit = self._unit_conversion(dlam, lam_unit, default_z_unit) 
    172167 
    173168                output.xaxis("\rm{z}", output.x_unit) 
     
    182177                if zaccept_unit.strip() == '\AA^-1': 
    183178                    zaccept_unit = "1/A" 
    184                 output.sample.zacceptance=float(paramvals[7]) 
    185                 output.sample.zacceptance=self._unit_conversion(output.sample.zacceptance, 
    186                                                                 zaccept_unit, "1/" + default_z_unit) 
     179                output.sample.zacceptance=(float(paramvals[7]),zaccept_unit) 
    187180                output.vars=varheader 
    188181 
Note: See TracChangeset for help on using the changeset viewer.