Description

This notebook allows you to combine all the images you selected. Those images are grouped n by n via any of the following algorithms:

  • Arithmetic mean

 

  • Geometric mean

  • Add
  • Median

Not seeing the algorithm you want to use? Please contact Jean Bilheux to get it added.

Example

Let’s pretend you selected the following 21 images

Input

  • data_000_010_000.fits
  • data_000_010_001.fits
  • data_000_010_002.fits
  • data_000_010_003.fits
  • data_000_020_004.fits
  • data_000_020_005.fits
  • data_000_020_006.fits
  • data_000_020_007.fits
  • data_000_030_008.fits
  • data_000_030_009.fits
  • data_000_030_010.fits
  • data_000_030_011.fits
  • data_000_040_012.fits
  • data_000_040_013.fits
  • data_000_040_014.fits
  • data_000_040_015.fits
  • data_000_050_016.fits
  • data_000_050_017.fits
  • data_000_050_018.fits
  • data_000_050_019.fits
  • data_000_060_020.fits

and you decide to combine the first images, then the next 4, and so on.

This will produce 5 files with 3 options of naming convention to use

Option 1 – using new names

  • image_000.tif
  • image_001.tif
  • image_002.tif
  • image_003.tif
  • image_004.tif

Option 2 – using the original base name

  • data_000_010_000.tif
  • data_000_020_001.tif
  • data_000_030_002.tif
  • data_000_040_003.tif
  • data_000_050_004.tif

Option 3 – using first name of each group

  • data_000_010_000.tif
  • data_000_020_004.tif
  • data_000_020_008.tif
  • data_000_020_0012.tif
  • data_000_020_0016.tif

where the first one will be the combination of data_000_010_000.fitsdata_000_010_001.fitsdata_000_010_002.fits, and data_000_010_003.fits

NB: Because there were 21 images to start with, the last image was dropped (data_000_060_020.fits) as 21 can not be evenly divided by 4!

 

 

 

How does the notebook work?

Select your IPTS

Need help using the IPTS selector?

Select the images to combine

Using the file selection tool, select all the images you want to combine.

Sorting the files

In this cell, you can choose to sort the files by using their full name, or only using the file index. Simply select, and review, the tab corresponding to the sorting method you want to use.

Merging Arithmetic Method

It’s now time to select your merging algorithm.

How many files do you want to combine together?

Select how you want to combine your files.

Preview of how the files will be combined and renamed

This is where you can check that the files are correctly grouped. This is where you can also select how the new combined files will be named

  • using a whole new name image_####.ext
  • using part of the original name <original_name>_####.ext
  • using the name of the first file of the group

The new name will show up below the list of files for the corresponding group selected.

If for each group, at least one of the files doesn’t have the same base file name, the group is automatically excluded from the process and will show up in the tab groups with errors. If you don’t see that tab, it means that none of the groups got rejected. 

Select output location

Using the folder selection tool, select the output folder.

Once you have selected the output folder, the images will be automatically merged and a progress bar will show up. Then finally the notebook displays a message to inform you that the process is completed.

Working with TOF data

In the case where you are working with TOF data set, where a _Spectra.txt file is present, the notebook will automatically create a new _Spectra.txt file according to the merging parameters you selected.

  • the first column of the file, time, will be the average of the corresponding row/files combines
  • the second column, total counts, will use the same algorithm as the one you selected in the notebook

If a spectra file has been located and a new one created, the full path to that file will be displayed in the notebook.

If the output folder already exists, the current date and time will be prefixed to the new folder name to make sure the previous folder is not replaced!