Home

User Documentation

Getting Started
Learn More
Explore in Detail
Get Inspired

Contributor Documentation

Getting Started
Learn More
Explore in Detail
Get Inspired

Quick Links

Software Manual
AstroDiscuss
GitHub
API Reference

Documentation Versions

Public Release
8.1.0
8.0.0
7.2.0
7.1.0
7.0.0
6.0.0
3.9.0
3.5.0

ISIS 2

Documentation
Tutorials
Technical Documents
USGS

ISIS Application Documentation


map2map

Printer Friendly View | TOC | Home

Modify a cube's map projection

Overview Parameters Example 1 Example 2

Description

This program will alter the projection of a cube which is already in a map projection (ISIS level2 cube). Pixels are physically moved using either a nearest neighbor, bilinear, or cubic convolution interpolator. Usage examples of this program include:
      1.  Converting from Sinusodial to Mercator or any other
          supported projection
      2.  No projection change but altering projection parameters
          such as center longitude or standard parallels
      3.  No projection change but altering pixel resolution
      4.  No projection change but altering latitude/ longitude window
      5.  No projection change but altering latitude types,
          longitude domains, or longitude direction
      6.  Match the mapping parameters of another ISIS leve2 cube for
          comparison.
    

If you need to generate your own map file you can use the maptemplate program or alternatively, hand create a file using your favorite editor. The map file need only specify the ProjectionName as defaults will be computed for the remaining map file parameters.

The map file can be an existing map projected (level2) cube. A level2 cube has PVL labels and contains the Mapping group. Depending on the values of the input parameters, the output cube can use some or all of the keyword values of the map file. For instance, setting MATCHMAP = true causes all of the mapping parameters to come from the map file, resulting in an output cube having the same number of lines and samples as the map file. If MATCHMAP = true and the map file is missing a keyword like PixelResolution, the application will fail with a PVL error. Setting MATCHMAP=false allows for some of the mapping components to be overridden by the user or computed from the FROM cube.

To learn more about using map projections in ISIS, refer to the ISIS Workshop "Learning About Map Projections".


Categories


Related Applications to Previous Versions of ISIS

This program replaces the following applications existing in previous versions of ISIS:
  • nuproj
  • newmap
  • lev2tolev2

History

Kay Edwards1986-09-27 Original version
Jeff Anderson2003-01-15 Converted to Isis 3.0
Stuart Sides2003-05-16 Modified schema location from astogeology... to isis.astrogeology...
Stuart Sides2003-05-30 Fixed compiler error with uninitialized variable after adding -O1 flag
Stuart Sides2003-07-29 Modified filename parameters to be cube parameters where necessary
Jacob Danton2005-12-05 Added appTest
Elizabeth Miller2006-05-18 Depricated CubeProjection and ProjectionManager to ProjectionFactory
Steven Lambright2007-06-22 Fixed typo in user documentation
Steven Lambright2007-06-27 Expanded options, fixed conversions when switching measurement systems (such as from planetographic to planetocentric)
Steven Lambright2007-07-31 Fixed bug with changing resolutions
Steven Lambright2007-08-09 Rewrote resolution handling code to be simpler and fix yet another bug.
Steven Lambright2007-08-14 Fixed method of getting cube specific projection group parameters, such as the scale and resolution.
Jeff Anderson2007-11-08 Fixed bug trimming longitudes
Stuart Sides2007-11-16 Fixed bug when TRIM option was used and most if not all data was being NULLed.
Steven Lambright2007-12-05 Fixed bug where user-entered resolutions could be ignored
Christopher Austin2008-04-18 Added the MATCHMAP option.
Steven Lambright2008-05-13 Removed references to CubeInfo
Steven Lambright2008-06-13 The rotation keyword will no longer automatically propagate
Steven Lambright2008-06-23 Added helper button and improved error message
Steven Lambright2008-08-04 Changed MATCHMAP to default off and added exclusions. If MATCHMAP is true, the ground range and pixel resolution can not be set because they are to be taken from the map file.
Steven Lambright2008-11-12 Moved the MATCHMAP parameter to the "FILES" parameter group. Fixed a problem with this program that caused null output images when the input longitude domain was inconsistent with the input longitude range in equatorial cylindrical projections.
Christopher Austin2008-12-11 Changed the parameters SLAT, ELAT, SLON, ELON to MINLAT, MAXLAT, MINLON, MAXLON in correlation with autimos.
Christopher Austin2008-03-12 Added a default path as well as a helper function for the MAP parameter.
Steven Lambright2010-08-27 Made automatic calculation of longitude range more likely to succeed
Lynn Weller and Debbie A. Cook2012-01-05 Updated documentation text, added glossary links, and improved compatability with Isis documentation.
Tracie Sucharski2012-12-06 Changed to use TProjection instead of Projection. References #775
David L Miller2015-08-10 Fixed bug where map2map fails when missing Scale keyword in the MAP file. Fixes #2151

Parameter Groups

Files

Name Description
FROM Input cube to remap
MAP File containing mapping parameters
TO Newly mapped cube
MATCHMAPMatch the map file

Output Map Resolution

Name Description
PIXRESDefines how the pixel resolution in the output map file is obtained
RESOLUTIONPixel resolution

Output Map Ground Range

Name Description
DEFAULTRANGEDefines how the default ground range is determined
MINLATMinimum Latitude
MAXLATMaximum Latitude
MINLONMinimum Longitude
MAXLONMaximum Longitude
TRIM Null all pixels outside lat/lon boundaries

Options

Name Description
INTERPType of interpolation
X

Files: FROM


Description

The specification of the input cube to be remapped. The cube must contain a valid Mapping group in the labels.

Type cube
File Mode input
Filter *.cub
Close Window
X

Files: MAP


Description

A file containing the desired output mapping parameters in PVL. This file can be a simple label file, hand produced or created via the maptemplate program. It can also be an existing cube or cube label which contains a Mapping group. In the latter case the FROM cube will be transformed into the same map projection, resolution, etc.

Type filename
File Mode input
Default Path $ISISROOT/appdata/templates/maps
Default $ISISROOT/appdata/templates/maps/sinusoidal.map
Filter *.map *.cub
Close Window
X

Files: TO


Description

This file will contain the results of the remapping.

Type cube
File Mode output
Filter *.cub
Close Window
X

Files: MATCHMAP


Description

This forces all of the mapping parameters to come from the map file. Additionally, when the map file is an image the TO file will have the same number of lines and samples as the map file.

Type boolean
Default FALSE
Exclusions
  • PIXRES
  • RESOLUTION
  • DEFAULTRANGE
  • MINLAT
  • MAXLAT
  • MINLON
  • MAXLON
Close Window
X

Output Map Resolution: PIXRES


Description

This parameter is used to specify how the pixel resolution is obtained for the output map projected cube.

Type string
Default FROM
Option List:
Option Brief Description
FROMRead resolution from input cube This option will automatically determine the resolution from the input cube.

Exclusions

  • RESOLUTION
MAPRead resolution from input map file This option will use either the PixelResolution (meters/pixel) or Scale (pixels/degree) in the map file.

Exclusions

  • RESOLUTION
MPP Get resolution from user in meters per pixel This option allows the user to specify the resolution in meters per pixel using the RESOLUTION parameter

Inclusions

  • RESOLUTION
PPD Get resolution from user in pixels per degree This option allows the user to specify the resolution in pixels per degree using the RESOLUTION parameter

Inclusions

  • RESOLUTION
Close Window
X

Output Map Resolution: RESOLUTION


Description

Specifies the resolution in either meters per pixel or pixels per degree

Type double
Minimum 0.0 (exclusive)
Close Window
X

Output Map Ground Range: DEFAULTRANGE


Description

This parameter is used to specify how the default latitude/longitude ground range for the output map projected image is obtained. The ground range can be obtained from the input cube or map file. Note the user can overide the default using the MINLAT, MAXLAT, MINLON, MAXLON parameters. The purpose of the ground range is to define the coverage of the map projected image. Essentially, the ground range and pixel resolution are used to compute the size (samples and line) of the output image.

Type string
Default FROM
Option List:
Option Brief Description
FROMRead default range from input cube This option will automatically determine the mininum/maximum latitude/longitude from the input cube specified using the FROM parameter.
MAP Read default range from map file This option will read the mininum/maximum latitude/longitude from the input map file.
Close Window
X

Output Map Ground Range: MINLAT


Description

The minimum latitude of the output map. If this is entered by the user it will override the default input cube or map value.

Type double
Internal Default Use default range
Minimum -90.0 (inclusive)
Maximum 90.0 (inclusive)
Close Window
X

Output Map Ground Range: MAXLAT


Description

The maximum latitude of the ground range. If this is entered by the user it will override the default input cube or map value.

Type double
Internal Default Use default range
Minimum -90.0 (inclusive)
Maximum 90.0 (inclusive)
Greater Than MINLAT
Close Window
X

Output Map Ground Range: MINLON


Description

The minimum longitude of the ground range. If this is entered by the user it will override the default input cube or map value.

Type double
Internal Default Use default range
Close Window
X

Output Map Ground Range: MAXLON


Description

The maximum longitude of the ground range. If this is entered by the user it will override the default input cube or map value.

Type double
Internal Default Use default range
Greater Than MINLON
Close Window
X

Output Map Ground Range: TRIM


Description

If this option is selected, pixels outside the latitude/longtiude range will be trimmed or set to null. This is useful for certain projections whose lines of latitude and longitude are not parallel to image lines and sample columns.

Type boolean
Default FALSE
Close Window
X

Options: INTERP


Description

This is the type of interpolation to be performed on the input.

Type string
Default CUBICCONVOLUTION
Option List:
Option Brief Description
NEARESTNEIGHBORNearest Neighbor Each output pixel will be set to the pixel nearest the calculated input pixel.
BILINEARBi-Linear interpolation Each output pixel will be set to the value calculated by a bi-linear interpolation of the calculated input pixel.
CUBICCONVOLUTIONCubic Convolution interpolation Each output pixel will be set to the value calculated by a cubic convolution interpolation of the calculated input pixel.
Close Window

Example 1

map2map example demonstrating use of MATCHMAP

Description

This example shows how to use map2map to match a system LOLA DEM to a Clementine 750 base tile available from PDS.

Command Line

map2map map2map from=/usgs/cpkgs/Isis3/data/base/dems/LRO_LOLA_LDEM_global_128ppd_20100915_0002.cub map=clembase_30s135_256ppd.cub matchmap=yes to=LOLA_clembase_30s135_256ppd.cub
Command line to extract and reproject part of a dem to match a level 2 image.

GUI Screenshot

map2map MATCHMAP example GUI top

Top of GUI for map2map MATCHMAP example

The from file is a system LOLA dem. The MAP is an Isis level 2 image. The output file will be a section of the dem extracted out and remapped into the same state as the level 2 image entered as MAP. Because MATCHMAP is checked, all mapping parameters will be determined from MAP, and any listed in the GUI are grayed out.

map2map MATCHMAP example GUI top

Middle of GUI for map2map MATCHMAP example

This is the middle of the GUI for the map2map MATCHMAP example. It shows everything grayed out in the output map ground range box because MATCHMAP was checked in the previous image. The default INTERP is selected.

map2map MATCHMAP example GUI top

Bottom of GUI for map2map MATCHMAP example

This is the bottom of the GUI for the map2map MATCHMAP example. It shows the state of the GUI when the application has completed.

Input Images

Input image (dem) to be reprojected

FROM for map2map MATCHMAP example

Parameter Name: FROM

This is a LOLA global dem stored in the Isis system. A section of this file matching the coverage of MAP will be extracted and reprojected to match MAP.

Isis level 2 MAP

MAP for map2map MATCHMAP example

Parameter Name: MAP

This is a base tile from the PDS Clementine 750.

Output Image

MATCHMAP example TO

TO for map2map MATCHMAP example

Parameter Name: TO

This is a section of the LOLA global dem extracted and remapped to match a base tile of the PDS Clementine 750. Notice how the geometry matches the geometry of the second input image above (MAP).


Example 2

map2map example demonstrating projection change, resolution change, and use of TRIM

Description

In this example the polar portion of a Messenger/Mariner10 global mosaic is extracted and transformed to a PolarStereographic projection. The pixel resolution is reduced from 500 m/pix to 1000 m/pix. Also the trim option is exercised to null the pixels outside of the lat/lon boundary and generate a circular output image instead of a square.

Command Line

map2map map2map from=MessengerFlyby_Mariner10_blobal.cub map=npola.map to=MessengerFlyby_Mariner10_north_polar.cub pixres=map defaultrange=map trim=yes
Command line for map2map TRIM example.

GUI Screenshot

map2map MATCHMAP example GUI top

Top of GUI for map2map TRIM example

The FROM file is a Messenger/Mariner10 global Equirectangular mosaic. The MAP file defines a PolarStereographic projection. The TO file will be the polar section of the FROM extracted out and transformed into a PolarStereographic projection. Notice that PIXRES specifies that the resolution is to be read from the MAP. If the pixel resolution is missing from the map file, the application will throw an error.

map2map MATCHMAP example GUI top

Bottom of GUI for map2map TRIM example

This is the bottom of the GUI for the map2map TRIM example. It shows that the default map ground range will be read from the MAP. If the ranges are not in MAP, the application will throw an error. Also notice that the TRIM option has been selected.

Input Image

Input image (dem) to be reprojected

FROM for map2map TRIM example

Parameter Name: FROM

This is a Messenger/Mariner10 global mosaice in an Equirectangular map projection. The north polar section of this file will be extracted and transformed to a Polar Stereographic projection and trimmed to the exact lat/lon range specified in the map file, forming a circle.

Data File

Links open in a new window.
View PVL mapping file The is the mapping file that defines the output map projection. Since the default range is set to MAP as well, it also contains the desired lat/lon range of the output level 2 image.

Output Image

Output PolarStereographic projection of north pole

TO for map2map TRIM example

Parameter Name: TO

This is the north polar section of the Messenger/Mariner10 global mosaic of Mercury in an Polar Stereographic projection and trimmed to the exact lat/lon range specified in the map file to form a circle.