Geometry
index
/mnt/common/python/d64py/d64py/Geometry.py

#======================================================================
# Geometry.py
#======================================================================

 
Functions
       
getBamBytesPerTrack(imageType: d64py.Constants.ImageType) -> int
For a given image type, return the number of bytes used
to store the block availability map for a single track.
:param imageType:
:return: The number of bytes.
getBamSize(imageType: d64py.Constants.ImageType) -> int
For a given image type, return the number of bytes in the
Block Availability Map.
:param imageType: The image type.
:return: The size of the BAM.
getDirHeaderTrackSector(imageType: d64py.Constants.ImageType) -> d64py.TrackSector.TrackSector
For a given image type, get the track and sector of the directory header.
:param imageType: The image type.
:return: A TrackSector object.
getDirectoryTrack(imageType: d64py.Constants.ImageType) -> int
For a given image type, get the track in which the directory is stored.
:param imageType: The image type.
:return: The track containing the directory.
getDiskNameOffset(imageType: d64py.Constants.ImageType) -> int
For a given image type, get the offset to the disk name
in the directory header.
:param imageType: The image type.
:return: The offset to the disk name.
getErrorOffset(imageType: d64py.Constants.ImageType) -> int
Get the offset to the image's error table.
Only valid for images of type D64_ERROR.
:param imageType: The image type.
:return: The offset to the error table.
getFirstDirTrackSector(imageType: d64py.Constants.ImageType) -> d64py.TrackSector.TrackSector
For a given image type, get the track and sector where the
directory starts.
:param imageType: The image type.
:return: A TrackSector object.
getMaxBlocksFree(imageType: d64py.Constants.ImageType) -> int
Get the maximum number of free blocks for an image type.
:param imageType: The image type.
:return: The number of free blocks.
getMaxSector(imageType: d64py.Constants.ImageType, track: int) -> int
Get the highest sector number for a track in the given image type.
:param imageType: The image type.
:param track: The track.
:return: The highest sector number.
getMaxTrack(imageType: d64py.Constants.ImageType) -> int
Get the highest track number for an image type.
:param imageType: The image type.
:return: The highest track number.
getOffsetSector(offset: int, imageType: d64py.Constants.ImageType) -> d64py.TrackSector.TrackSector
Given a byte offset into an image, return the track and sector.
:param offset: The offset in bytes.
:param imageType: The image's type.
:return: A TrackSector object.
getSectorByteOffset(ts: d64py.TrackSector.TrackSector, imageType: d64py.Constants.ImageType) -> int
For a given image type, get the offset in bytes to a track and sector.
:param ts: A TrackSector object.
:param imageType: The image type.
:return: The byte offset.
getSectorOffset(ts: d64py.TrackSector.TrackSector, imageType: d64py.Constants.ImageType) -> int
Given a track and sector, return the sector offset into the image
(i.e. the total number of sectors from the start of the image).
:param ts: A TrackSector object.
:param imageType: The image's type.
:return: The byte offset of the track and sector.
getSectorSize(imageType: d64py.Constants.ImageType) -> int
Get the sector size for an image type.
:param imageType: The image type.
:return: The sector size.
getZone(imageType: d64py.Constants.ImageType, track: int) -> int
For D64 images, get the density zone in which a track appears.
:param imageType: The image type (only D64 and D64_ERROR are valid).
:param track: The track.
:return: The zone in which the track appears (0-3).
imageLength(imageType: d64py.Constants.ImageType) -> int
Get the expected length for an image type.
:param imageType: The type of disk image.
:return: The expected length.
isValidTrackSector(ts: d64py.TrackSector.TrackSector, imageType: d64py.Constants.ImageType) -> bool
Test whether a track and sector is valid for the image type.
:param ts: A TrackSector object.
:param imageType: The image type.
:return: True if the TrackSector is valid, False otherwise.