ISIS Application Documentation
maptrim | Standard View | TOC | Home |
Trim edges of a map projected image
Description
Categories
Groups
Examples
History
This program trims map projected images and sets valid pixels that fall outside a specified bounding box to NULL. By default, the pixels that fall outside the minimum and maximum latitude and longitude found within the Mapping Group of the input cube's label are set to NULL.
The values entered for minimum and maximum latitude and longitude must be in the same longitude domain, longitude direction, and latitude type as the settings in the input image labels within the Mapping Group. If the values entered are in a different longitude domain, they will be interpreted as the domain setting in the image labels, and the entire output cube could contain only NULL pixels. For example, if the input cube's Mapping Group has a longitude direction of positive east and the user specifies values in west longitude, the longitude direction will be interpreted as positive east.
Option | Result |
---|---|
Trim | The image is resized. The pixel dimensions of the file are retained; therefore, the number of pixels is the same. The pixels that fall outside the default or specified latitude and longitude range are set to NULL. |
Crop | The image is resampled and trimmed to the exact latitude and longitude range specified for the bounding box. The pixels that fall outside the specified range are not set to NULL. |
Both | The image is resampled and trimmed to the exact latitude and longitude range specified for the bounding box. The pixels that fall outside the bounding box are set to NULL. |
Warnings:
Mapping information updated after image is cropped:
When the "crop" or "both" option is used, the keywords MinimumLatitude,
MaximumLatitude, MinimumLongitude, and MaximumLongitude are removed
from the labels. The values that the uncropped image contains have become
inaccurate to use for the cropped image because after an image has been
cropped, the UpperLeftCornerX and UpperLeftCornerY keywords, where these
values begin, have been updated in the labels. Once the labels are updated,
and if displayed with an image viewer, such as qview, the latitude and
longitude values can be reported accurately.
Mosaicking cropped images:
The cropped images can be mosaicked into an existing output mosaic file
using mapmos, or can be included in the input file list for automos.
If automos is used, the "grange=user" parameter may have to be entered along
with the latitude and longitude range of the mosaic depending on the ISIS version.
The option to automatically determine the minimum and maximum latitude and
longitude range from the input list in automos may be used but the Mapping Group
will only have the UpperLeftCornerX and UpperLeftCornerY keywords.
Note: This application does not handle non-projected images (i.e. images that are not Level2 or a mosaic). To trim a Level1 image, please refer to camtrim.
Name | Description |
---|---|
FROM | Input cube to trim |
TO | Output cube filename |
Name | Description |
---|---|
MODE | Trim Option (TRIM, CROP, or BOTH) |
Name | Description |
---|---|
MINLAT | Starting latitude |
MAXLAT | Ending latitude |
MINLON | Starting longitude |
MAXLON | Ending longitude |
Use this parameter to specify the input filename. The selected option will be applied to all the bands in the file by default, or the selected bands.
Type | cube |
---|---|
File Mode | input |
Filter | *.cub |
This output file will contain the results of the selected MODE option.
Type | cube |
---|---|
File Mode | output |
Filter | *.cub |
This parameter allows the user to select a trim option. By default, all pixels outside the default or specified latitude and longitude range are set to NULL. To override the default, select CROP or BOTH.
Type | string | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default | TRIM | ||||||||||||
Option List: |
|
Specify the starting latitude of range to exclude from processing. Any pixel whose latitude is less than this value will be set to NULL and/or trimmed.
Type | double |
---|---|
Internal Default | Minimum latitude in labels |
Minimum | -90 (inclusive) |
Maximum | 90 (inclusive) |
Less Than |
|
Specify the ending latitude of range to exclude from processing. Any pixel whose latitude is greater than this value will be set to NULL and/or trimmed.
Type | double |
---|---|
Internal Default | Maximum latitude in labels |
Minimum | -90 (inclusive) |
Maximum | 90 (inclusive) |
Greater Than |
|
Specify the starting longitude of range to exclude from processing. Any pixel whose longitude is less than this value will be set to NULL and/or trimmed.
Type | double |
---|---|
Internal Default | Minimum longitude in labels |
Minimum | -360 (inclusive) |
Maximum | 360 (inclusive) |
Less Than |
|
Specify the ending longitude of range to exclude from processing. Any pixels whose longitude is greater than this value will be set to NULL and/or trimmed.
Type | double |
---|---|
Internal Default | Maximum longitude in labels |
Minimum | -360 (inclusive) |
Maximum | 360 (inclusive) |
Greater Than |
|
Trim a projected image
Input cube
Parameter Name:
FROM This is the input cube to trim. |
Output cube
Parameter Name:
TO This is the trimmed cube. Notice that all pixels that fell outside the user-specified range were set to NULL. |
Trim a projected image using CROP and BOTH options
Input cube
Parameter Name:
FROM This is the input cube to trim. |
Output cube
Parameter Name:
TO This is the cropped cube. Notice that only the specified bounding box was extracted out of the input cube. |
|
Output cube
Parameter Name:
TO The image cube shown above was cropped and trimmed to
create the image cube shown on the left. Notice that all
the pixels outside the specified latitude and longitude range have
been set to NULL in this example. |
Tracie Sucharski | 2003-02-28 | Original version |
Tracie Sucharski | 2003-04-03 | Changed brief description, added error check for no values entered for slat,elat,slon,elon. |
Stuart Sides | 2003-05-16 | Modified schema location from astrogeology... to isis.astrogeology..." |
Stuart Sides | 2003-07-29 | Modified filename parameters to be cube parameters where necessary |
Brendan George | 2005-11-21 | Added application test |
Sean Crosby | 2007-03-16 | Added cropping and crop+trim ability; modified apptest |
Christopher Austin | 2009-01-27 | Fixed parameter names |
Travis Addair | 2009-08-10 | Mapping group parameters are now placed into the print file. |
Mackenzie Boyd | 2009-08-12 | Modified call to crop to handle from and to parameters with spaces in directories. |
Jai Rideout | 2011-01-11 | Updated documentation and testing with Ella Lee in preparation for the 3.4.0 release. Fixed various inconsistencies in the documentation and rewrote some parts to make it clearer. Added an example. Added two new tests to test getting the lat/lon range from the cube labels and the processing of level 1 images. |
Debbie A. Cook | 2012-12-06 | Changed to use TProjection instead of Projection. References #775 |
Kimberly Oyama | 2013-01-14 | Changed the temporary file name to be unique between executions so there are no conflicts when multiple instances of the program are running. Added an app test to exercise this change. Fixes #1216. |
Ella Mae Lee | 2013-11-13 | Updated the documentation to clarify the results of the different trim options and added new example , fixes #1621. |