IRAF help page for package dataio, program reblock

from NOAO reblock -- copy a file on tape or disk with optional reblockingUSAGEPARAMETERSDESCRIPTIONEXAMPLES

reblock -- copy a file on tape or disk with optional reblocking


USAGE

reblock (infiles, outfiles, file_list)


PARAMETERS

infiles

File or device name e.g. "mta1600[2]" or "mta800" or "file1".

outfiles

If multiple file to disk is requested, the ouput file names will be generated by concatenating the tape file number onto the output file name.

file_list

List of tape file numbers or ranges delimited by whitespace or commas, e.g. "1-3, 5_8". File_list is requested only if the magtape input device is specified. Files will be read in ascending order regardless of the ordering of the list. Reading will terminate silently if EOT is reached, thus a list such as "1-999" may be used to read all files on the tape.

newtape

If the output device is magtape, newtape specifies whether the tape is blank or contains data. Newtape is requested only if no tape file number is specified, e.g. "mta1600".

outblock = INDEF

Size of the output block bytes. In the default case and for disk output, the output block size is set to the file i/o disk default buffer size.

inrecord = INDEF, outrecord = INDEF

The sizes of the input and output logical records in bytes. The default input and output record sizes are set equal to the input and output block sizes respectively. If inrecord > outrecord, records are trimmed; if inrecord < outrecord, records are padded; if inrecord = outrecord, records are simply counted. If only one of inrecord or outrecord is set, the undefined parameter defaults to the value of the other.

nskip = 0

The number of input blocks (tape input) or records (disk input, size inrecord) to be skipped.

ncopy = INDEF

The number of input blocks (tape input) or records (disk input, size inrecord) to be copied. Ncopy defaults to a very large number.

byteswap = no

Swap every other byte.

wordswap = no

Swap every other word.

pad_block = no

If pad_block is set, reblock pads trailing blocks until they are outblock bytes long, otherwise trailing blocks may be short.

padchar = 0

Single character used to pad blocks or records. Padchar is only requested if pad_record or pad_block is set. If padchar equals one of the digits 0 through nine, records and blocks are padded with the face value of the character, otherwise the ASCII value is used.

verbose = yes

Print messages about files, blocks copied etc.


DESCRIPTION

REBLOCK is a procedure to copy disk or tape resident files to disk or tape. Multiple tape files or a single disk input file may be specified. If multiple files are output to disk the output file names will be generated by concatenating the tape file number onto the output file name. The user may request magnetic tape output to begin at a specific file on tape, e.g. mta1600[5] in which case file five will be overwritten if it exists, or at BOT or EOT. If no file number is specified REBLOCK asks whether the tape is new or old and begin writing at BOT or EOT as appropriate.

Before beginning the copy, the user may request reblock to skip n (default 0) blocks (tape input) or logical records (disk input). The user can also specify that only n (default all) blocks (tape input) or records (disk input) are to be copied. Before the copy the data may be optionally word-swapped (default no) and/or byte-swapped (default no). If verbose is specified (default yes) reblock prints the input and output file names, the number of blocks read and written and the number of records read and written.

Reblock uses the default buffer sizes supplied by mtio and file i/o to determine the maximum number of bytes which can be read in a single read call. For tapes this corresponds to the maximum number of bytes per block permitted by the device. Mtio will not read more than one block per read call. Therefore the actual number of bytes read will be less than or equal to the mtio buffer size. For disk files the default buffer size set by IRAF is a multiple of the disk block size. If the disk file is smaller than one block or the last block is partially full, the number of bytes read will be less than the default buffer size. All magtape and disk reads are done with the file i/o read procedure and a call to fstati determines the number of bytes actually read.

If all the defaults are set, a binary copy is performed. In tape to tape copies the block and record sizes are preserved, but the density may be changed by specifying the appropriate output file name e.g. mta800 or mta1600. Reblocking occurs in tape to disk transfers, if records, are trimmed, padded or counted, or if blocks are padded. If a disk to tape transfer is requested the output block size will be the default file i/o buffer size. The last block in a file may be short. If uniform sized blocks are desired, pad_block must be set, in which case trailing partially filled blocks will be padded with padchar.

Logical records are distinguished from blocks (physical records). The input and output record sizes default to the size of the input and output blocks respectively. Logical records may be shorter or longer than the block sizes.


EXAMPLES

Copy a magnetic tape preserving the record sizes but changing the density from 800 bpi to 1600 bpi.

	da> reblock mtb800, "mta1600[1]", "1-999"

Reblock a magnetic tape changing the block size from 4000 bytes to 8000 bytes and padding the last block.

	da> reblock mtb1600, "mta1600[1]", "1-999", outb=8000, padb+

Trim the records of a disk file.

	da> reblock input, output, inrec=80, outrec=72

Pad the records of a disk file with blanks.

	da> reblock input, output, inrec=81, outrec=82, padchar=" "


This page automatically generated from the iraf .hlp file. If you would like your local iraf package .hlp files converted into HTML please contact Dave Mills at NOAO.

dmills@noao.edu