Changes in / [3a22ce7:0639476] in sasview


Ignore:
Files:
21 added
7 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    re04f87b rdf332d8  
    88# generated. 
    99# 
    10 # Feel free to add more stuff to this as and when it becomes an issue.  
     10# Feel free to add more stuff to this as and when it becomes an issue. 
    1111 
    1212.project 
     
    5050/test/sasdataloader/test/plugins.zip 
    5151/test/sasdataloader/test/test_log.txt 
     52/test/sasdataloader/test/isis_1_0_write_test.xml 
     53/test/sasdataloader/test/isis_1_1_write_test.xml 
     54/test/sasdataloader/test/write_test.xml 
    5255 
    5356# autogenerated scripts 
    5457/sasview/installer.iss 
    55  
  • docs/sphinx-docs/source/user/tools.rst

    rec860a8f rec860a8f  
    1010 
    1111   Data Operations Utility <sasgui/perspectives/calculator/data_operator_help> 
    12        
     12 
    1313   Density/Volume Calculator <sasgui/perspectives/calculator/density_calculator_help> 
    14     
     14 
    1515   Generic SANS Calculator <sasgui/perspectives/calculator/sas_calculator_help> 
    16     
     16 
    1717   Image Viewer <sasgui/perspectives/calculator/image_viewer_help> 
    18     
     18 
    1919   Kiessig Thickness Calculator <sasgui/perspectives/calculator/kiessig_calculator_help> 
    20     
     20 
    2121   SLD Calculator <sasgui/perspectives/calculator/sld_calculator_help> 
    22     
     22 
    2323   Slit Size Calculator <sasgui/perspectives/calculator/slit_calculator_help> 
    24     
     24 
    2525   Q Resolution Estimator <sasgui/perspectives/calculator/resolution_calculator_help> 
    26     
     26 
    2727   Python Shell <sasgui/perspectives/calculator/python_shell_help> 
    28     
     28 
     29   File Converter <sasgui/perspectives/file_converter/file_converter_help> 
  • run.py

    r832fea2 r18e7309  
    7272    platform = '%s-%s'%(get_platform(),sys.version[:3]) 
    7373    build_path = joinpath(root, 'build','lib.'+platform) 
    74      
    75     # Notify the help menu that the Sphinx documentation is in a different  
     74 
     75    # Notify the help menu that the Sphinx documentation is in a different 
    7676    # place than it otherwise would be. 
    7777    os.environ['SASVIEW_DOC_PATH'] = joinpath(build_path, "doc") 
     
    123123    # Compiled modules need to be pulled from the build directory. 
    124124    # Some packages are not where they are needed, so load them explicitly. 
     125    import sas.sascalc.file_converter 
     126    sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core', 
     127                                  joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))                     
     128 
     129    # Compiled modules need to be pulled from the build directory. 
     130    # Some packages are not where they are needed, so load them explicitly. 
    125131    import sas.sascalc.calculator 
    126132    sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core', 
  • sasview/sasview.py

    rcde6e52 rcde6e52  
    158158            logging.error(traceback.format_exc()) 
    159159 
     160        # File converter tool 
     161        try: 
     162            import sas.sasgui.perspectives.file_converter as module 
     163            converter_plug = module.Plugin() 
     164            self.gui.add_perspective(converter_plug) 
     165        except: 
     166            logging.error("%s: could not find File Converter plug-in module"% \ 
     167                                                        APP_NAME) 
     168            logging.error(traceback.format_exc()) 
     169 
    160170 
    161171        # Add welcome page 
  • setup.py

    rdb74ee8 r18e7309  
    99from distutils.command.build_ext import build_ext 
    1010from distutils.core import Command 
     11import numpy 
    1112 
    1213# Manage version number ###################################### 
     
    5455        print "Removing existing build directory", SASVIEW_BUILD, "for a clean build" 
    5556        shutil.rmtree(SASVIEW_BUILD) 
    56                      
     57 
    5758# 'sys.maxsize' and 64bit: Not supported for python2.5 
    5859is_64bits = False 
    5960if sys.version_info >= (2, 6): 
    6061    is_64bits = sys.maxsize > 2**32 
    61      
     62 
    6263enable_openmp = False 
    6364 
     
    118119        c = self.compiler.compiler_type 
    119120        print "Compiling with %s (64bit=%s)" % (c, str(is_64bits)) 
    120          
     121 
    121122        # OpenMP build options 
    122123        if enable_openmp: 
     
    127128                for e in self.extensions: 
    128129                    e.extra_link_args = lopt[ c ] 
    129                      
     130 
    130131        # Platform-specific build options 
    131132        if platform_lopt.has_key(c): 
     
    205206) 
    206207 
    207      
     208 
    208209# sas.sascalc.pr 
    209210srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") 
     
    217218                              include_dirs=[], 
    218219                              ) ) 
    219          
     220 
     221# sas.sascalc.file_converter 
     222mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext") 
     223package_dir["sas.sascalc.file_converter.core"] = mydir 
     224package_dir["sas.sascalc.file_converter"] = os.path.join("src","sas", "sascalc", "file_converter") 
     225packages.extend(["sas.sascalc.file_converter","sas.sascalc.file_converter.core"]) 
     226ext_modules.append( Extension("sas.sascalc.file_converter.core.bsl_loader", 
     227                              sources = [os.path.join(mydir, "bsl_loader.c")], 
     228                              include_dirs=[numpy.get_include()], 
     229                              ) ) 
     230 
    220231# sas.sascalc.fit 
    221232package_dir["sas.sascalc.fit"] = os.path.join("src", "sas", "sascalc", "fit") 
     
    239250packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"]) 
    240251package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] 
    241      
     252 
    242253# Data util 
    243254package_dir["sas.sascalc.data_util"] = os.path.join("src", "sas", "sascalc", "data_util") 
     
    294305                               'test/2d_data/*', 
    295306                               'test/save_states/*', 
    296                                'test/upcoming_formats/*',  
     307                               'test/upcoming_formats/*', 
    297308                                 'default_categories.json'] 
    298309packages.append("sas.sasview") 
     
    316327    required.extend(['pillow']) 
    317328 
    318 # Set up SasView     
     329# Set up SasView 
    319330setup( 
    320331    name="sasview", 
     
    341352                'docs': BuildSphinxCommand, 
    342353                'disable_openmp': DisableOpenMPCommand} 
    343     )    
     354    ) 
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r654e8e0 r654e8e0  
    11771177            written = written | self.write_node(pix, "z", item.pixel_size.z, 
    11781178                                                {"unit": item.pixel_size_unit}) 
    1179             written = written | self.write_node(det, "slit_length", 
    1180                                                 item.slit_length, 
    1181                                                 {"unit": item.slit_length_unit}) 
    11821179            if written == True: 
    11831180                self.append(pix, det) 
     1181            self.write_node(det, "slit_length", item.slit_length, 
     1182                {"unit": item.slit_length_unit}) 
     1183 
    11841184 
    11851185    def _write_process_notes(self, datainfo, entry_node): 
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    r479799c r5e906207  
    2323 
    2424    Any number of SASdata sets may be present in a SASentry and the data within can be either 1D I(Q) or 2D I(Qx, Qy). 
     25 
     26    Also supports reading NXcanSAS formatted HDF5 files 
    2527 
    2628    :Dependencies: 
     
    7678                ## Add the last data set to the list of outputs 
    7779                self.add_data_set() 
     80                ## Close the data file 
     81                self.raw_data.close() 
    7882        ## Return data set(s) 
    7983        return self.output 
     
    183187                    elif key == u'run': 
    184188                        self.current_datainfo.run.append(data_point) 
     189                        try: 
     190                            run_name = value.attrs['name'] 
     191                            run_dict = {data_point: run_name} 
     192                            self.current_datainfo.run_name = run_dict 
     193                        except: 
     194                            pass 
    185195                    elif key == u'title': 
    186196                        self.current_datainfo.title = data_point 
     
    189199 
    190200                    ## Sample Information 
    191                     elif key == u'Title' and self.parent_class == u'SASsample': 
     201                    elif key == u'Title' and self.parent_class == u'SASsample': # CanSAS 2.0 format 
     202                        self.current_datainfo.sample.name = data_point 
     203                    elif key == u'ID' and self.parent_class == u'SASsample': # NXcanSAS format 
    192204                        self.current_datainfo.sample.name = data_point 
    193205                    elif key == u'thickness' and self.parent_class == u'SASsample': 
     
    195207                    elif key == u'temperature' and self.parent_class == u'SASsample': 
    196208                        self.current_datainfo.sample.temperature = data_point 
     209                    elif key == u'transmission' and self.parent_class == u'SASsample': 
     210                        self.current_datainfo.sample.transmission = data_point 
     211                    elif key == u'x_position' and self.parent_class == u'SASsample': 
     212                        self.current_datainfo.sample.position.x = data_point 
     213                    elif key == u'y_position' and self.parent_class == u'SASsample': 
     214                        self.current_datainfo.sample.position.y = data_point 
     215                    elif key == u'polar_angle' and self.parent_class == u'SASsample': 
     216                        self.current_datainfo.sample.orientation.x = data_point 
     217                    elif key == u'azimuthal_angle' and self.parent_class == u'SASsample': 
     218                        self.current_datainfo.sample.orientation.z = data_point 
     219                    elif key == u'details' and self.parent_class == u'SASsample': 
     220                        self.current_datainfo.sample.details.append(data_point) 
    197221 
    198222                    ## Instrumental Information 
     
    204228                        self.detector.distance = float(data_point) 
    205229                        self.detector.distance_unit = unit 
     230                    elif key == u'slit_length' and self.parent_class == u'SASdetector': 
     231                        self.detector.slit_length = float(data_point) 
     232                        self.detector.slit_length_unit = unit 
     233                    elif key == u'x_position' and self.parent_class == u'SASdetector': 
     234                        self.detector.offset.x = float(data_point) 
     235                        self.detector.offset_unit = unit 
     236                    elif key == u'y_position' and self.parent_class == u'SASdetector': 
     237                        self.detector.offset.y = float(data_point) 
     238                        self.detector.offset_unit = unit 
     239                    elif key == u'polar_angle' and self.parent_class == u'SASdetector': 
     240                        self.detector.orientation.x = float(data_point) 
     241                        self.detector.orientation_unit = unit 
     242                    elif key == u'azimuthal_angle' and self.parent_class == u'SASdetector': 
     243                        self.detector.orientation.z = float(data_point) 
     244                        self.detector.orientation_unit = unit 
     245                    elif key == u'beam_center_x' and self.parent_class == u'SASdetector': 
     246                        self.detector.beam_center.x = float(data_point) 
     247                        self.detector.beam_center_unit = unit 
     248                    elif key == u'beam_center_y' and self.parent_class == u'SASdetector': 
     249                        self.detector.beam_center.y = float(data_point) 
     250                        self.detector.beam_center_unit = unit 
     251                    elif key == u'x_pixel_size' and self.parent_class == u'SASdetector': 
     252                        self.detector.pixel_size.x = float(data_point) 
     253                        self.detector.pixel_size_unit = unit 
     254                    elif key == u'y_pixel_size' and self.parent_class == u'SASdetector': 
     255                        self.detector.pixel_size.y = float(data_point) 
     256                        self.detector.pixel_size_unit = unit 
    206257                    elif key == u'SSD' and self.parent_class == u'SAScollimation': 
    207258                        self.collimation.length = data_point 
     
    213264                    elif key == u'name' and self.parent_class == u'SASprocess': 
    214265                        self.process.name = data_point 
    215                     elif key == u'Title' and self.parent_class == u'SASprocess': 
     266                    elif key == u'Title' and self.parent_class == u'SASprocess': # CanSAS 2.0 format 
     267                        self.process.name = data_point 
     268                    elif key == u'name' and self.parent_class == u'SASprocess': # NXcanSAS format 
    216269                        self.process.name = data_point 
    217270                    elif key == u'description' and self.parent_class == u'SASprocess': 
     
    230283                        self.trans_spectrum.wavelength.append(data_point) 
    231284 
    232                     ## Other Information 
     285                    ## Source 
    233286                    elif key == u'wavelength' and self.parent_class == u'SASdata': 
    234287                        self.current_datainfo.source.wavelength = data_point 
    235                         self.current_datainfo.source.wavelength.unit = unit 
     288                        self.current_datainfo.source.wavelength_unit = unit 
     289                    elif key == u'incident_wavelength' and self.parent_class == u'SASsource': 
     290                        self.current_datainfo.source.wavelength = data_point 
     291                        self.current_datainfo.source.wavelength_unit = unit 
     292                    elif key == u'wavelength_max' and self.parent_class == u'SASsource': 
     293                        self.current_datainfo.source.wavelength_max = data_point 
     294                        self.current_datainfo.source.wavelength_max_unit = unit 
     295                    elif key == u'wavelength_min' and self.parent_class == u'SASsource': 
     296                        self.current_datainfo.source.wavelength_min = data_point 
     297                        self.current_datainfo.source.wavelength_min_unit = unit 
     298                    elif key == u'wavelength_spread' and self.parent_class == u'SASsource': 
     299                        self.current_datainfo.source.wavelength_spread = data_point 
     300                        self.current_datainfo.source.wavelength_spread_unit = unit 
     301                    elif key == u'beam_size_x' and self.parent_class == u'SASsource': 
     302                        self.current_datainfo.source.beam_size.x = data_point 
     303                        self.current_datainfo.source.beam_size_unit = unit 
     304                    elif key == u'beam_size_y' and self.parent_class == u'SASsource': 
     305                        self.current_datainfo.source.beam_size.y = data_point 
     306                        self.current_datainfo.source.beam_size_unit = unit 
     307                    elif key == u'beam_shape' and self.parent_class == u'SASsource': 
     308                        self.current_datainfo.source.beam_shape = data_point 
    236309                    elif key == u'radiation' and self.parent_class == u'SASsource': 
    237310                        self.current_datainfo.source.radiation = data_point 
     
    376449        self.current_datainfo = DataInfo() 
    377450 
     451 
    378452    def _initialize_new_data_set(self, parent_list = None): 
    379453        """ 
Note: See TracChangeset for help on using the changeset viewer.