NOAO >   KPNO Home >   KPNO Mountain >   Taping

Small NOAO Logo

Taping Data - Using WFITS and TAR


Writing images to exabyte or DAT tape can be done with the IRAF task wfits.

The following instructions where taken from An Observer's Guide to Taking CCD Data with ICE. For further detail please go to the link: Making a FITS tape.

Making a Fits Tape

So now that you have some data, you probably want to save it to tape. At each telescope there are both Exabyte and DAT tape drives; there are also a few 9-track dinosaurs still roaming some of the domes. Since all of our ICE systems subscribe to IRAF networking, and you can in fact use any tape drive in any dome, although you need to check with the appropriate astronomer if you want to use someone else's tape drive---be nice!

The first step is to allocate the appropriate tape drive. The 1600/6250 bpi drives are known as mta to IRAF; the Exabytes are known as mtb; and the DAT drives are known as mtc. (You can find these names printed on each drive unit; you can also run the command devices to list both the IRAF and Unix names of all the I/O devices on the mountain.) Thus you need to do an

allocate mta

to allocate the 1600/6250 bpi tape drive at your telescope; to allocate a drive elsewhere you might do something like a

allocate lapis!mta

The parameters for wfits are shown in Figure 7.

The crucial parameters are:

  • iraf_files : This refers to the image name(s) that you wish to save, e.g., ``a0002,a0005" if you wish to only save those two files. Instead, you can also substitute an ``at" file here (such as shown in the example). An ``at" file is simply a text file that contains the names (one per line) of each image. You can easily create such a file by files *.imh > savethisstuff.

  • fits_files This refers to the tape drive you wish to use. In the case of the Exabytes or DATS this can simply be the same as the device name that you used in allocate, but for the 1600/6250 bpi tape drives, you should explicitly specify the density you want by referring to it as either mta1600 or mta6250.

  • newtape This is, as you may well imagine, a critical parameter to get right. If you want to start at the beginning of the tape, writing over any data that might be present, then answer yes to this; otherwise it will search for the end of the data on the tape before writing.

  • blocking_fac : The default, 0, results in ``maximum" blocking (10) for both Exabyte and 9-track tapes. If you are planning to read the data with a non-IRAF FITS reader, you may want to reset this to 1; otherwise, leave it at 0 for maximum tape writing efficiency.

In order to check to see what is on the tape, you can list the titles quite easily. Simply do a

rfits mtb 1-999 make-- short+ old+

to see what's there. To direct this output into a file, you can add a > tapelist to the end, and then you can print that list on the lineprinter by a simple lprint tapelist. Alternatively, you could choose to read a single file back onto disk to examine:

rfits mtb 15 junk make+ old+

will create an image with the original name. (Note that even if you specify old+ you must still give the name of a legal temporary file in the output file position, i.e. junk in this example.) If the same image name already exists on disk, you should instead use old- to create an image named junk, or whatever you wish.

As you write your tape, you will get a file-by-file account of what is going on the tape. When you come to the end of the tape, you will find that there is a message saying that the file was NOT completely written to tape. An easy way to continue at this point is to edit your ``at" file to remove the names of the files that were successfully written to tape. Rewind the tape with rew mtb, mount the new tape, and then re-run wfits, remembering to set newtape=yes.

The new ``x" IRAF tool ``xtapemon" will allow you to see how much space is left on your tape, and to keep tabs on where on the tape you are; see Sec. A.2.

NOTE: If you do write additional files to an ``old tape" (one containing useful data but which had previously been removed from the drive), make certain that the software (IRAF and Unix) is aware that the tape has been rewound before starting to write to the tape----or your old data may be overwritten! To safeguard against this possibility we suggest that you ALWAYS swap tapes by first:

    • deallocate mta (or mtb or ...)
    • Physically swap tapes
    • allocate mta (or mtb or ...)

Using Tar to Write Tapes

In the following examples the device (st0) is used to represent any devicename.
Note: That, adding an n to the beginning of the device name, (ex. nst0) will prevent the tape from being rewound after the archive is written.

Write archive then rewind tape

    tar -cvf /dev/st0 *.fits

Write archive and leave marker at the end of the archive so that you can write another archive starting at that point

    tar -cvf /dev/nst0 *.fits
        Note the n at the beginning of the device name.

List files in archive and rewind tape

    tar -tvf /dev/st0

List archive and stop tape ready to read or, write next archive

    tar -tvf /dev/nst0

Using mt, the "Control Magnetic Tape Drive Operation"

Rewind tape

    mt -f /dev/st0 rewind

Move to end of archive in order to use tar for writing next archive

    mt -f /dev/st0 eod

Rewind and eject tape

    mt -f /dev/st1 rewoffl

For more information on using mt refer to the man page.

NOAO >   KPNO Home >   KPNO Mountain >   Taping