User Tools

Site Tools


Simple manipulations

Top: Frida handbook
Up: Tutorial
Previous: Basic usage
Next: Elementary fitting

In this tutorial session, we will learn some basic data manipulations: selecting, binning, reorganizing. We use the same test data set as before (see the introduction of the tutorial).

A simple manipulation: delete some spectra

Launch Frida in the directory that contains the test data set, and perform the following actions one by one. Take your time to understand Frida's reaction to each single command. To do so, use the inspection and plot commands you learned in session 1.

command action recommended inspection
? > fl gly180 load one data file
0 > msd 0:3 manipulate_spectra_delete: delete spectra 0 to 3
1 > 0:1 dz inspect old and new file

In general, manipulations leave the original file intact; they act upon a copy of the file that is stored at the end of the internal memory, with a new internal file number. In this example, a manipulation on file 0 yielded a new file 1.

Average spectra

0:1 > 1 msa 0,3,6 manipulate_spectra_add: average over groups of spectra: spectra 0 to 2 become new spectrum 0; spectra 3 to 5 become new spectrum 1; spectra 6 to 8 become new spetrum 2
2 > 1 msa ::3 short-hand for the same: ::3 means every third, starting from 0

Use dz to see the effect of the binning. Use plot commands to verify that the averaged spectra have better statistics than the original ones.

Delete files from internal memory

From now on, directory and plot commands are no longer prescribed in the listings. Use them on your own to investigate the effects of the manipulations introduced in the following. Try also variations of the commands presented here.

Your activities will create new files in the internal memory. To clean up, and to restore standard conditions for the next example, use the deletion command:

1: > fdel deletes all inline files starting with file 1

In the following, we always assume that file 0 is gly180 as read from disk.

Bin channels

0 > mpa ::3 manipulate-points-add: within each spectrum, bin three data points into one

Plot input and output to see the improved statistics after binning.

Reduce dimension

? > 0 msa 0 average all spectra into one
? > 0 msr 6 manipulate-spectra-retain: delete all spectra except spectrum 6

Each of these two commands creates a file that contains just one spectrum. Use the inspection commands df, dc, dr to see the effect of this dimension reduction: z0 is automatically converted into a rpar.

Merge files, and save to disk

? > : fdel empty the internal memory (or start new Frida session)
? > fl gly??? load five test files
0:4 > msr 6 retain spectrum 6 of each file
5:9 > mfj manipulate-file-join: merge five files into one
10 > dz old rpar has become z0
10 > fs save to disk, using the autogenerated file name gly
10 > mpa ::3 channel binning, as explained above
11 > fso save, overwriting the existing file gly

Last updated for Frida2.3.0c.