ISIS Documentation

barscale

Creates a bar scale for an image

The barscale program creates a horizontal bar scale for a given image.

The bar scale is a bar graphic divided into portions and labeled with a unit measurement associated with corresponding ground length. It indicates, for example, the scale of an image or map. Many users find bar scales helpful to place on maps and images for publication so that observers can make a quick assessment of distance relationships.

How Barscale Works

This program uses the USGS standard as a guide for producing the bar scale. The USGS standard can be viewed at http://pubs.usgs.gov/of/1999/of99-430/of99-430_sec35.pdf. The program takes a projected or unprojected image file as input. If the image is unprojected, it must be initialized with SPICE information. This can be achieved by running the spiceinit program on the unprojected file. The pixel resolution (PIXRES) is obtained either from the CENTER or from a user defined location in the image file (USERLOC). The user determines the desired length of the bar scale and the unit of measurement, either METER or KILOMETER, to employ. The length of the bar scale is controlled using the LEFTLIMIT, LEFTSEGS, RIGHTLIMIT, and RIGHTSEGS parameters. The right side of a bar scale is used to provide larger divisions of measurement and the left side provides smaller divisions of measurement but is not required. The examples below are provided to demonstrate how these parameters are used.

Example 1: To create a bar scale with no left limit and a right limit of 20 kilometers with 4 divisions: LEFTLIMIT=0 LEFTSEGS=0 RIGHTLIMIT=20 RIGHTSEGS=4 UNIT=KILOMETER

Example 2: To create a bar scale with a left limit of 10 kilometers with 5 divisions and a right limit of 20 kilometers with 2 divisions: LEFTLIMIT=10 LEFTSEGS=5 RIGHTLIMIT=20 RIGHTSEGS=2 UNIT=KILOMETER

Important Facts to Remember

  • Ensure that the bar scale limits are set to a reasonable size based on the resolution of the image. If the limits are set too small, the bar scale will not be useful. For example, if an image has a resolution of 153 meters/pixel, then the result of setting the limit to 10 times greater than the resolution will produce a bar scale that is only 10 pixels wide; this may or may not be considered a useful bar scale.
  • The vertical height (in pixels) of the bar scale must be provided along with the font size (in pixels).
  • The width of the bar scale is dependent upon the resolution of the image and the RIGHTLIMIT and LEFTLIMIT set by the user. It should be noted that the TEXTHEIGHT provided by the user to specify font height does not mean that the characters will be exactly that number of pixels tall. The height of the text will only be about 75% of what is specified. This is because of the way that fonts are defined. Each font has a certain number of pixels devoted to the ascent above its baseline and to the descent below its baseline. Keep this in mind when specifying the height of the text for the bar scale.
  • The BACKGROUND of the bar scale can be set to either BLACK or WHITE.
  • The text that goes with the bar scale can either go ABOVE the bar scale or BELOW it.

How to Place the Bar Scale in the Image File:

There are two options for placing the bar scale in the image file.

1) Set the PADIMAGE option to false if the bar scale should be placed on the image at a specified line and sample. The CORNERLINE and CORNERSAMPLE parameters need to be set to the upper left corner at the bar scale's insertion point.

2) Set the PADIMAGE option to true if the bar scale should be appended to the bottom of the image file. The bar scale will be justified LEFT, CENTER, or RIGHT within the padding depending on the user's choice.

Please note that this program is designed to generate bar scales for localized images. This program should not be used to generate a bar scale for a global image because of the drastic resolution changes that occur across the expanse of a global image.


Categories


History

Janet Barrett2013-01-22 Original version.
Janet Richie2013-02-22 Documentation review.
Janet Barrett2013-03-07 Updated code to meet standards. References #575.