matlab.io.fits.movRelHDU
현재 HDU에서 HDU의 상대 수 이동
구문
htype = moveRelHDU(fptr,nmove)
설명
htype = moveRelHDU(fptr,nmove)
는 현재 HDU에서 HDU의 상대 수를 앞으로 또는 뒤로 이동하고, 그 결과로 생긴 HDU의 HDU 유형인 htype
을 반환합니다. htype
으로 가능한 값은 다음과 같습니다.
'IMAGE_HDU' |
'ASCII_TBL' |
'BINARY_TBL' |
이 함수는 CFITSIO 라이브러리 C API의 fits_movrel_hdu (ffmrhd)
함수에 대응합니다.
예제
각 HDU를 연달아 이동하고 두 HDU씩 뒤로 두 번 이동합니다.
import matlab.io.* fptr = fits.openFile('tst0012.fits'); n = fits.getNumHDUs(fptr); for j = 1:n htype = fits.movAbsHDU(fptr,j); fprintf('HDU %d: "%s"\n',j,htype); end htype = fits.movRelHDU(fptr,-2); n = fits.getHDUnum(fptr); fprintf('HDU %d: "%s"\n',n,htype); htype = fits.movRelHDU(fptr,-2); n = fits.getHDUnum(fptr); fprintf('HDU %d: "%s"\n',n,htype); fits.closeFile(fptr);