Documentation

matlab.io.fits.readKeyUnit

Physical units string from keyword

Syntax

units = readKeyUnit(fptr,keyname)

Description

units = readKeyUnit(fptr,keyname) returns the physical units string from an existing keyword. If no units are defined, units is returned as an empty string.

This function corresponds to the fits_read_key_unit" (ffgunt) function in the CFITSIO library C API.

Examples

import matlab.io.*
fptr = fits.createFile('myfile.fits');
fits.createImg(fptr,'long_img',[10 20]);
fits.writeKey(fptr,'VELOCITY',12.3,'orbital speed');
fits.writeKeyUnit(fptr,'VELOCITY','km/s');
units = fits.readKeyUnit(fptr,'VELOCITY');
fits.closeFile(fptr);

See Also

|

Was this topic helpful?