[PyTopo for Linux]

PyTopo: Setting Up Your .pytopo File

In order to use pytopo, you need to create a file called .pytopo in your home directory to tell pytopo where you keep your maps and what format they're in. There are also some other variables you can customize in that file.

Collections

A Collection is a set of maps from one source, all in the same format. For instance, if I load the Topo! Death Valley CD into a directory, that would represent one collection.

You must have at least one collection in order to use pytopo (otherwise it won't know where to look for your map data).

Define your collections like this:

Collections = [
    Topo1MapCollection( "deathvalley", "/home/yourname/Maps/dvl_data", 7.5 ),
    GenericMapCollection( "pa-geo", "/home/yourname/Maps/pa-geo",
                          "pa-map-", ".png",
                          123, 37.5, 10742, 13120, 2, True, True )
]
This defines two collections. The first one is called "deathvalley", stored in the directory named /home/yourname/Maps/dvl_data, and uses the format Topo1MapCollection -- the simple format used in Topo! regional CD sets. The filenames already have latitude and longitude encoded into them, and they're all the same size, so you don't need to worry about any of those details.

The second collection, called "pa-geo" and stored in /home/yourname/Maps/pa-geo, is more complicated. GenericMapCollection is a much more general format suitable for map collections you create yourself. Suppose a sample map in the collection might have a filename like pa-map-03-17.png. Then the pieces of the GenericMapCollection are:

Field Value Description
Name pa-geo Name of the collection
Directory /home/yourname/Maps/pa-geo Directory where the files live
Prefix pa-map- Prefix prepended to every filename
Suffix .png Suffix appended to every filename
Longitude 123 Longitude of upper left corner
Latitude 37.5 Latitude of upper left corner
X scale 10742 X scale (pixels per degree)
Y scale 13120 Y scale (pixels per degree)
Num digits 2 Number of digits for each grid point in the filenames
Use dash? True Use a dash between X and Y grid point numbers in the file name? (E.g. pa-map-03-17.png vs. pa-map-0317.png.)
Latitude first? True Is the latitude the first grid point (e.g. 03) in the filename?

Map Collections are simply Python classes. If you have a weird type of map collection and you know some Python programming, you can define your own map collection type inside your .pytopo file. If you write a collection class that might be useful to someone else, please send it to me and I'll include it in the next version of pytopo.

Named Sites

Once you have one or more collections defined, you can start defining named sites which you can use as starting points when you run pytopo.

The format is:

[ sitename, longitude, latitude, collection_name ]
Coordinates are in degrees.decimal_minutes.

Example:

 KnownSites = [
     # San Francisco Bay Area
     [ "saratogagap", 122.0725, 37.155, "sfr" ],
     [ "lexington", 121.594, 37.12, "sfr" ],
     # Death Valley
     [ "zabriskie", 116.475, 36.245, "deathvalley" ],
     # From the Big Sur map:
     [ "pinnacles", 121.0865, 36.3247, "bigsur" ],
     ]

Other Useful Variables

You can customize pytopo by changing the values of these variables:

# Where to save generated maps. The default is fine for most people.
MapSaveDir = os.environ["HOME"] + "/Topo/"

# Size of the window: how many maplets will be shown at once?
# Don't get too attached to this one; it will eventually change
# to be window size in pixels, since maplet size can vary.
num_long = 3
num_lat = 2

PyTopo
Other Software
Shallowsky Home
mail me