| sections | images.imutil | sections |
sections -- expand an image template
sections images
The image template list images is expanded and the images are printed one per line on the standard output unless the "nolist" option is given. Other options allow selection of a portion of the image name. The number of images in the list is determined and stored in the parameter nimages .
This task is used for several purposes:
There is no check that the names are images and any name may be used. The thing which distinguishes an image template from a file template is that the special characters [ and ] are interpreted as image sections rather than a character class wildcard unless preceded by the escape character !. To explictly limit a wildcard template to images one should use an appropriate extension such as ".imh".
1. Calculate and print the number of images in a template:
cl> sections fits*.imh opti=no cl> = sections.nimages cl> 7
2. Expand an image template:
cl> sections fits*![3-9].imh[1:10,*] fits003.imh[1:10,*] fits004.imh[1:10,*] <etc.>
Note the use of the character class escape, image section appending, and explicit use of the .imh extension.
3. Create a new list of image names by adding the suffix "new":
cl> sections jan18???//new jan18001new jan18002new <etc.>
Note the use of the append syntax. Also there is no guarantee that the files are actually images.
4. Subtract two sets of images:
cl> sections objs*.imh[100:200,300:400] > objslist cl> sections skys*.imh[100:200,300:400] > skyslist cl> sections %objs%bck%* > bcklist cl> imarith @objslist - @skyslist @bcklist
Note the use of the substitution syntax.
The image list is not sorted.
files