Commit 4c1e2f7a authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

xyz (nexus) testing and verification

parent 1c3cf82a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ NSE_FILE_TYPES = {
"application/nse-magnetic"       : '.dat'   ,
"application/nse-echo-hdf"       : '.h5'    ,
"application/nexus-nse-echo"     : '.nxs.h5',
"application/nexus-nse-xyz"      : '.nxs.h5',
"application/nexus-nse-transmission" : '.nxs.h5',
"application/nexus-nse-diffraction"  : '.nxs.h5',
}
@@ -60,6 +61,8 @@ def get_hdf_filetype(filename):
                    return "application/nexus-nse-transmission"
                if 'scan=diffraction' in notes:
                    return "application/nexus-nse-diffraction"
                if 'scan=xyz' in notes:
                    return "application/nexus-nse-xyz"
                if 'scan=echo' in notes:
                    return "application/nexus-nse-echo"
            except KeyError:
+3 −3
Original line number Diff line number Diff line
@@ -501,9 +501,9 @@ def add_datreat_options(subparser, parents=None):

def add_plotmap_options(subparser, parents=None):
    "map plot"
    pars = subparser.add_parser('map', parents=parents,
                      help='map',
                      description='create map plots')
    pars = subparser.add_parser('maps', parents=parents,
                      help='maps',
                      description='create maps plots')
    pars.set_defaults(map_type='up',)
    pars.add_argument('file', metavar='filename', help='file to process', nargs='+')
    add_extend_argument(pars, '--tau', dest='taus', metavar='tau',  type=int, nargs='*',
+9 −4
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import matplotlib.pyplot as plt
from   matplotlib import colors

from .. import config, get_q, ANGSTROM
from ..inout   import XYZScan
from ..inout   import XYZScan, get_nsefiletype
from .plotutil import norm_pix, get_pix


@@ -456,13 +456,18 @@ def plot_xyz_nexus_data(data, info, **kwargs):

def plot_xyz_nexus(filename, **kwargs):
    "plot NeXus NSE XYZ scan file"
    log = logging.getLogger()
    if 'nexus-nse-xyz' not in get_nsefiletype(filename):
        log.error("%s: is not a NeXuS XYZ scan", filename)
        return

    scan = XYZScan()
    scan.read_nexus(filename, **kwargs)
    if not scan.read_nexus(filename, **kwargs):
        log.error("%s: count nor read XYZ scan file", filename)
        return

    plot_xyz_nexus_data(scan.data, scan.info, **kwargs)

    log = logging.getLogger()

    rates = {}
    base  = scan.info['base']
    for key, data in scan.data.items():
+28.6 MiB

File added.

No diff preview for this file type.

+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ class IOUtilsTestCase(unittest.TestCase):
            ( 'ResHo2Ti2O7_4K.xyz', 'application/nse-xyz'  ),
            ( 's4863.h5'          , 'application/nse-echo-hdf'),
            ( 'NSE_15617.nxs.h5'  , 'application/nexus-nse-echo'),
            ( 'NSE_15774.nxs.h5'  , 'application/nexus-nse-xyz'),
            ( 'NSE_16247.nxs.h5'  , 'application/nexus-nse-diffraction'),
            ( 'NSE_16250.nxs.h5'  , 'application/nexus-nse-transmission'),
            ( 'HoneyComb_21615_004K_x_dn.dat', 'application/nse-magnetic'),