Hauptinhalt

FITS-Dateien

Flexible Image Transport System (FITS)

Das Flexible Image Transport System (FITS) ist ein offener Standard, der ein digitales Dateiformat definiert, das sich für Speicherung, Übertragung und Verarbeitung von Daten, die als multidimensionale Arrays oder Tabellen formatiert sind, eignet. Zur Interaktion mit FITS-Dateien gibt es zwei Methoden:

  • Die MATLAB® High-Level-Funktionen für FITS bieten eine vereinfachte programmatische Benutzeroberfläche zum Auslesen von Daten aus FITS-Dateien und Schreiben von Daten aus dem MATLAB Workspace in FITS-Dateien.

  • Die MATLAB Low-Level-Funktionen für FITS bieten mehr Kontrolle über den Lese- und Schreibvorgang bei FITS-Dateien, da sie Zugriff auf mehr als 50 Funktionen der C-Bibliothek von CFITSIO gewähren. Um diese Funktionen in MATLAB zu verwenden, setzen Sie ein Präfix mit dem matlab.io.fits Namespace-Pfad vor den Funktionsnamen oder verwenden Sie die import-Funktion, um den Namespace der aktuellen Importliste vor Aufruf der Funktion hinzuzufügen. Beispiel:

    import matlab.io.*;
    fptr = fits.openFile("tst0012.fits");
    

    Um die MATLAB Low-Level-Funktionen für FITS zu nutzen, müssen Sie mit den Programmierkonzepten für das C-API von CFITSIO vertraut sein, die unter https://fits.gsfc.nasa.gov/ beschrieben werden.

MATLAB verwendet die FITS C Bibliothek Version 4.5.0. (seit R2026a)

Vor R2026a: MATLAB verwendet die FITS C-Bibliothek Version 4.1.0.

Vor R2023a: MATLAB verwendet die FITS C Bibliothek Version 3.45.

Funktionen

alle erweitern

fitsdispDisplay FITS metadata
fitsinfoInformation about FITS file
fitsreadRead data from FITS file
fitswriteWrite image to FITS file

Dateizugriff

matlab.io.fits.closeFileClose FITS file
matlab.io.fits.createFileCreate FITS file
matlab.io.fits.deleteFileDelete FITS file
matlab.io.fits.fileModeGet I/O mode of FITS file
matlab.io.fits.fileNameGet name of FITS file
matlab.io.fits.openDiskFileOpen FITS file
matlab.io.fits.openFileOpen FITS file (extended-filename syntax)

Bildbearbeitung

matlab.io.fits.createImgCreate FITS image
matlab.io.fits.getImgSizeGet size of FITS image
matlab.io.fits.getImgTypeGet data type of FITS image
matlab.io.fits.insertImgInsert FITS image after current HDU
matlab.io.fits.readImgRead FITS image data
matlab.io.fits.setBscaleSet FITS image scaling
matlab.io.fits.writeImgWrite FITS image data

Schlüsselwörter

matlab.io.fits.deleteKeyDelete keyword by name
matlab.io.fits.deleteRecordDelete keyword by record number
matlab.io.fits.getHdrSpaceGet number of records in header
matlab.io.fits.readCardRead header record of keyword
matlab.io.fits.readKeyRead key value
matlab.io.fits.readKeyCmplxRead key as complex scalar value
matlab.io.fits.readKeyDblRead key as double-precision value
matlab.io.fits.readKeyLongLongRead key as 64-bit integer value
matlab.io.fits.readKeyLongStrRead key as long string value
matlab.io.fits.readKeyUnitRead physical units string from keyword
matlab.io.fits.readRecordRead header record specified by number
matlab.io.fits.writeCommentWrite COMMENT keyword to current HDU
matlab.io.fits.writeDateWrite DATE keyword to current HDU
matlab.io.fits.writeHistoryWrite HISTORY keyword to current HDU
matlab.io.fits.writeKeyAdd or update keyword in current HDU
matlab.io.fits.writeKeyUnitWrite physical units string

Header Data Unit (HDU)-Zugriff

matlab.io.fits.copyHDUCopy current HDU from one file to another
matlab.io.fits.deleteHDUDelete current HDU in FITS file
matlab.io.fits.getHDUnumGet number of current HDU in FITS file
matlab.io.fits.getHDUtypeGet type of current HDU in FITS file
matlab.io.fits.getNumHDUsGet number of HDUs in FITS file
matlab.io.fits.movAbsHDUMove to absolute HDU number
matlab.io.fits.movNamHDUMove to first HDU having specific type and keyword values
matlab.io.fits.movRelHDUMove relative number of HDUs from current HDU
matlab.io.fits.writeChecksumCompute and write checksum for current HDU

Bildkompression

matlab.io.fits.imgCompressCompress HDU from one file into another
matlab.io.fits.isCompressedImgDetermine if current image is compressed
matlab.io.fits.setCompressionTypeSet image compression type
matlab.io.fits.setHCompScaleSet scale parameter for images compressed with HCOMPRESS algorithm
matlab.io.fits.setHCompSmoothSet smoothing parameter for images compressed with HCOMPRESS algorithm
matlab.io.fits.setTileDimSet tile dimensions

ASCII- und Binär-Tabellen

matlab.io.fits.createTblCreate new ASCII or binary table extension
matlab.io.fits.insertColInsert column into table
matlab.io.fits.insertRowsInsert rows into table
matlab.io.fits.insertATblInsert ASCII table after current HDU
matlab.io.fits.insertBTblInsert binary table after current HDU
matlab.io.fits.deleteColDelete column from table
matlab.io.fits.deleteRowsDelete rows from table
matlab.io.fits.getAColParmsGet ASCII table information
matlab.io.fits.getBColParmsGet binary table information
matlab.io.fits.getColNameGet table column name
matlab.io.fits.getColTypeGet scaled column data type, repeat value, and width
matlab.io.fits.getEqColTypeGet column data type, repeat value, and width
matlab.io.fits.getNumColsGet number of columns in table
matlab.io.fits.getNumRowsGet number of rows in table
matlab.io.fits.readATblHdrRead header information from current ASCII table
matlab.io.fits.readBTblHdrRead header information from current binary table
matlab.io.fits.readColRead rows of ASCII or binary table column
matlab.io.fits.setTscaleSet table column scaling
matlab.io.fits.writeColWrite elements into ASCII or binary table column

Dienstprogramme

matlab.io.fits.getConstantValueGet numeric value of named constant
matlab.io.fits.getVersionGet revision number of CFITSIO library
matlab.io.fits.getOpenFilesGet list of open FITS files

Themen