def plh_sum_proc():
    """Sum all datasets contained in plot 3"""
    from Reduction import reduction
    from Formats import output
    filename = str(plh_file.value)
    datasets = Plot3.ds
    approach = str(plh_sum_type.value)
    if approach == 'Ideal':
        newds = reduction.sum_datasets(datasets)
        send_to_plot(newds,Plot2,add=False)
    else:
        newds = reduction.merge_datasets(datasets)
        if approach == 'Cluster':
            cluster = float(plh_cluster.value)
            if cluster > 0:
                newds,info_string = reduction.debunch(newds,(cluster,''))
        send_to_plot(newds,Plot2,add=False)
    n_logger.log_plot(Plot2, footer = Plot2.title)
        # Write to file
    if filename != '':
            output.write_cif_data(newds,filename)
            if output_xyd.value:
                output.write_xyd_data(newds,filename)
            if output_fxye.value:
                output.write_fxye_data(newds,filename)
            if output_topas.value:
                output.write_xyd_data(newds,filename,comment_char="!")
Beispiel #2
0
 def testSumMerge(self):
     """Test that adding datasets together works"""
     output = reduction.sum_datasets([self.first_dataset,self.second_dataset,self.third_dataset])
     self.assertEqual(output[0], 6)
     self.assertEqual(output[1], 9)
     self.assertEqual(output[-1], 15)
     self.assertEqual(output.var[0], 3.5)
     self.assertEqual(output.axes[0],0.9)
Beispiel #3
0
def plh_sum_proc():
    """Sum all datasets contained in plot 3"""
    from Reduction import reduction
    from Formats import output
    filename = str(plh_file.value)
    datasets = Plot3.ds
    approach = str(plh_sum_type.value)
    if approach == 'Ideal':
        newds = reduction.sum_datasets(datasets)
        send_to_plot(newds, Plot2, add=False)
    else:
        newds = reduction.merge_datasets(datasets)
        if approach == 'Cluster':
            cluster = float(plh_cluster.value)
            if cluster > 0:
                newds = reduction.debunch(newds, cluster)
        send_to_plot(newds, Plot2, add=False)
        # Write to file
    if filename != '':
        output.write_cif_data(newds, filename)
        if output_xyd.value:
            output.write_xyd_data(newds, filename)
        if output_fxye.value:
            output.write_fxye_data(newds, filename)
Beispiel #4
0
def plh_sum_proc():
    """Sum all datasets contained in plot 3"""
    from Reduction import reduction
    from Formats import output
    filename = str(plh_file.value)
    datasets = Plot3.ds
    approach = str(plh_sum_type.value)
    if approach == 'Ideal':
        newds = reduction.sum_datasets(datasets)
        send_to_plot(newds,Plot2,add=False)
    else:
        newds = reduction.merge_datasets(datasets)
        if approach == 'Cluster':
            cluster = float(plh_cluster.value)
            if cluster > 0:
                newds = reduction.debunch(newds,cluster)
        send_to_plot(newds,Plot2,add=False)
        # Write to file
    if filename != '':
            output.write_cif_data(newds,filename)
            if output_xyd.value:
                output.write_xyd_data(newds,filename)
            if output_fxye.value:
                output.write_fxye_data(newds,filename)