rpparse (Aug2004) | rjtools | rpparse (Aug2004) |
Examples of valid plane/extension specifiers are:
[0], [1], ... , [256]Examples of valid regions (2-D image sections) are:
[*,*], [*,1:256], [1:256,*], [256:767,1:1024]
Note that *implicit* 1-D image sections, like "[1,1:256]", are not allowed by this task, and must be replaced by their *explicit* equivalent (e.g. "[1:1,1:256]"). Also, whereas wild-cards are allowed in the section specifier, they are not in the image plane/extension specifier.
This task and 'chkimg' were motivated in part by the fact that native IRAF file and image template facilities ('files' and 'sections') do not check whether file/image exists and whether a section given as part of an image template is indeed a valid image section.
rj> rpparse ("[1:256,513:1024]") rj> print ("Center: ("//str(rpparse.xcen)//","//str(rpparse.ycen)//")")
Capture a (common) mistake in a section specification:
rj> rpparse ("[1,1024:2,1022]") ERROR: unsupported 3-D section or switched comma and colon" "[1,1024:2,1022]"
Capture an implicit 1-D section specification:
rj> rpparse ("[1,2:997]", verbose+) ERROR: invalid x-range specifier "[1": missing colon!