Esempio n. 1
0
def TransmissionCan(can, direct, reload=True, period_t=-1, period_d=-1):
    """
    Specify the transmission and direct runs for the can
    @param can: the transmission run
    @param direct: direct run
    @param reload: if to replace the workspace if it is already there
    @param period_t: the entry number of the transmission run (default single entry file)
    @param period_d: the entry number of the direct run (default single entry file)
    """
    _ = reload  # noqa
    # First of all the default for all periods used to be -1. If we encounter this then set periods to ALL_PERIODS
    period_t = int(period_t)
    period_d = int(period_d)
    period_t = ALL_PERIODS if period_t == -1 else period_t
    period_d = ALL_PERIODS if period_d == -1 else period_d

    print_message('TransmissionCan("' + str(can) + '","' + str(direct) + '")')

    # Get the full file name of the run
    trans_file_name = find_sans_file(can)
    direct_file_name = find_sans_file(direct)

    # Set the command
    trans_command = DataCommand(command_id=DataCommandId.CAN_TRANSMISSION, file_name=trans_file_name, period=period_t)
    direct_command = DataCommand(command_id=DataCommandId.CAN_DIRECT, file_name=direct_file_name, period=period_d)
    director.add_command(trans_command)
    director.add_command(direct_command)
Esempio n. 2
0
def TransmissionCan(can, direct, reload=True, period_t=-1, period_d=-1):
    """
    Specify the transmission and direct runs for the can
    @param can: the transmission run
    @param direct: direct run
    @param reload: if to replace the workspace if it is already there
    @param period_t: the entry number of the transmission run (default single entry file)
    @param period_d: the entry number of the direct run (default single entry file)
    """
    _ = reload  # noqa
    # First of all the default for all periods used to be -1. If we encounter this then set periods to ALL_PERIODS
    period_t = int(period_t)
    period_d = int(period_d)
    period_t = ALL_PERIODS if period_t == -1 else period_t
    period_d = ALL_PERIODS if period_d == -1 else period_d

    print_message('TransmissionCan("' + str(can) + '","' + str(direct) + '")')

    # Get the full file name of the run
    trans_file_name = find_sans_file(can)
    direct_file_name = find_sans_file(direct)

    # Set the command
    trans_command = DataCommand(command_id=DataCommandId.can_transmission, file_name=trans_file_name, period=period_t)
    direct_command = DataCommand(command_id=DataCommandId.can_direct, file_name=direct_file_name, period=period_d)
    director.add_command(trans_command)
    director.add_command(direct_command)
Esempio n. 3
0
def AssignCan(can_run, reload=True, period=ALL_PERIODS):
    """
    Sets the can scatter data.

    @param can_run: run number to analysis e.g. SANS2D7777.nxs
    @param reload: must be set to True
    @param period: the period (entry) number to load, default is the first period
    """
    _ = reload  # noqa
    # First of all the default for all periods used to be -1. If we encounter this then set periods to ALL_PERIODS
    period = int(period)
    period = ALL_PERIODS if period == -1 else period

    # Print the output
    message = 'AssignCan("' + str(can_run) + '"'
    if period != ALL_PERIODS:
        message += ', ' + str(period)
    message += ')'
    print_message(message)

    # Get the full file name of the run
    file_name = find_sans_file(can_run)

    # Set the command
    data_command = DataCommand(command_id=DataCommandId.CAN_SCATTER, file_name=file_name, period=period)
    director.add_command(data_command)
Esempio n. 4
0
def AssignCan(can_run, reload=True, period=ALL_PERIODS):
    """
    Sets the can scatter data.

    @param can_run: run number to analysis e.g. SANS2D7777.nxs
    @param reload: must be set to True
    @param period: the period (entry) number to load, default is the first period
    """
    _ = reload  # noqa
    # First of all the default for all periods used to be -1. If we encounter this then set periods to ALL_PERIODS
    period = int(period)
    period = ALL_PERIODS if period == -1 else period

    # Print the output
    message = 'AssignCan("' + str(can_run) + '"'
    if period != ALL_PERIODS:
        message += ', ' + str(period)
    message += ')'
    print_message(message)

    # Get the full file name of the run
    file_name = find_sans_file(can_run)

    # Set the command
    data_command = DataCommand(command_id=DataCommandId.can_scatter, file_name=file_name, period=period)
    director.add_command(data_command)