SPIRou products: Files Structure

Last update: December 2023

1. Raw Data

This section describes the file structure of the SPIRou science raw data.



File (odometer)r.fits

The *r.fits file is the so-called ramp file. It is a 4096x4096xNREADS image cube, where NREADS is the number of reads taken during the integration (one read being done every 5.571s). One read produces a 4096x4096 image of about 34Mb. The file structure is simple - only the Primary Array, no Extensions - but the ramp file being a stack of individual 4096x4096 images, it easily becomes quite big, up to a 4 Gb for the longest exposure, the exposure time (1200s) being limited by the available RAM on the detector system.



File (odometer)o.fits

From the signal recorded in the ramp file and increasing from one read to the next, the flux ADU/s is calculated for each pixel and stored in the *o.fits file. All *o.files have the same size, 235Mb.

HDU # Name Type Description
1 Primary Header
2 Slope Image Slope in ADU/s from ramp linear fit
3 Intercept Image ADU for NREADS=0 from ramp linear fit
4 Errslope Image Error estimate on slope
5 Count Image Number of reads involved in slope measurement (before SATURATE=60000 is reached)


File (odometer)g.fits

The guiding file is an image cube of the 32x32 guiding images recorded during the science exposure. It contains typically thousand of guiding images, the guiding loop working up to 50Hz.

HDU # Name Type Description
1 Primary Header
2 IMAGE Image Image cube
3 METADATA ASCII Table 16 columns x number of rows, one row per image

The ASCII table mostly contains engineering data, only GD_XOFF and GD_YOFF may be of interest for the analysis of the image sequence. The table has the following format:

Col # Name Units Format Description
1 UNIXTIME s D14.3 Unix timestamp expressed as seconds since January 1st, 1970 GMT
2 SEQNUM I8 Incrementing sequence number for the frame. Sequence is reset to 0 when the guide host is rebooted
3 ISUERR_X mrad D7.2 ISU raw X error before PID adjustment
4 ISUERR_Y mrad D7.2 ISU raw Y error before PID adjustment
5 GD_XOFF pixel D7.2 Guide star offset in X from the null position
6 GD_YOFF pixel D7.2 Guide star offset in Y from the null position
7 SMRAD_X mrad D7.2 X position sent to the ISU - Note the X & Y axis is rotated by 45 degrees from the focal plane
8 SMRAD_Y mrad D7.2 Y position sent to the ISU
9 SMRAD_X mrad D7.2 X position read from the ISU
10 SMRAD_Y mrad D7.2 Y position read from the ISU
11 RISUAS_X arcsec D9.4 Translated (rotated) X position read from the ISU
12 RISUAS_Y arcsec D9.4 Translated (rotated) Y position read from the ISU
13 TCS_X arcsec D7.2 Last correction in RA sent to the TCS
14 TCS_Y arcsec D7.2 Last correction in DEC sent to the TCS
15 SEEING arcsec D7.2 Seeing estimate
16 STARMAG mag D7.2 Magnitude estimate




2. Reduced Data

This section describes the file structure of the SPIRou science products.



File (odometer)e.fits

2D extracted spectra that use the instrument profile and order localization and performs optimal extraction. There is one extracted spectrum for channels A, B, combined AB, and C; these spectra are respectively saved into different extensions of the e files, each with its proper header. The Blaze function is not removed from these spectra, so that the flux distribution along each order is unchanged. Each extension contains 49 orders of 4088 pixels.

HDU # Name Type Description
1 Primary Header
2 FluxAB Image Flux for fibers AB combined
3 FluxA Image Flux for fiber B
4 FluxB Image Flux for fiber A
5 FluxC Image Flux for fiber C
6 WaveAB Image Wavelength vector for fibers AB combined
7 WaveA Image Wavelength vector for fiber A
8 WaveB Image Wavelength vector for fiber B
9 WaveC Image Wavelength vector for fiber C
10 BlazeAB Image Blaze function for fibers AB combined
11 BlazeA Image Blaze function for fiber A
12 BlazeB Image Blaze function for fiber B
13 BlazeC Image Blaze function for fiber C


File (odometer)s.fits

FITS table containing the 1D extracted and rebinned spectra, for each channel (AB, A, B, C). The spectrum is corrected from the Blaze function, which provides a first-order continuum subtraction, and overlapping parts in the contiguous orders are merged. There are two versions of the 1D file: they both have wavelength units from 965 to 2500 nm, but one has the flux rebinned in regular wavelength bins, while the other has a constant velocity bin. The table for each channel contains about 300,000 pixels (NAXIS2). There is also a telluric corrected version (only for the AB fiber).

HDU # Name Type Description
1 Primary Header
2 UniformWavelength Binary Table Flux rebinned in regular wavelength bins
3 UniformVelocity Binary Table Flux rebinned with a constant velocity bin

Both UniformVelocity and UniformWavelength binary tables are in the following format:

Col # Name Units Format Description
1 Wave nm D Wavelength vector
2 FluxAB Relative Flux D Flux for fibers AB combined
3 FluxErrAB Relative Flux D Error on FluxAB
4 FluxA Relative Flux D Flux for fiber A
5 FluxErrA Relative Flux D Error on FluxA
6 FluxB Relative Flux D Flux for fiber B
7 FluxErrB Relative Flux D Error on FluxB
8 FluxC Relative Flux D Flux for fiber C
9 FluxErrC Relative Flux D Error on FluxC
10* FluxABTelluCorrected Relative Flux D Telluric corrected flux for fibers AB combined
11* FluxErrABTelluCorrected Relative Flux D Error on FluxABTelluCorrected

Format D = Double-precision floating-point

*Columns 10 and 11 will only be present for telluric corrected exposures.



File (odometer)t.fits

2D spectra in the same format as the e spectra, after the correction of telluric lines has been applied. This correction uses the library of empirical spectra of fast-rotating A stars used as telluric standards and the PCA method to optimally remove the contribution of the Earth atmosphere. Parts of the spectrum are replaced by NaNs because the telluric absorption in this location is too intense and correction residuals will be too large. The correction is applied only on the combined AB channel, so there is only one Flux extension of 49 orders times 4088 pixels. This telluric-corrected spectrum is used for the RV measurement.

HDU # Name Type Description
1 Primary Header
2 FluxAB Image The flux for the AB science channel
3 WaveAB Image The wavelength vector for the AB science channel
4 BlazeAB Image The Blaze function for the AB science channel
5 Recon Image The spectrum of the Earth atmosphere which has been used in the correction


File (odometer)v.fits

FITS table containing the radial velocity of the star extracted from the CCF. One cross-correlation mask is used per default, corresponding to an M3 spectral type, so it is not optimized for other types of stars. The velocity range of [-100,100] km/s is searched and a step of 1 km/s is used.

HDU # Name Type
1 Primary Header
2 CCF Binary Table

CCF table is in the following format:

Col # Name Units Format Description
1 Velocity km/s D Radial velocity step
2 Order0 D Cross-correlation calculated for the individual order
3 Order1 D Cross-correlation calculated for the individual order
...
50 Order48 D Cross-correlation calculated for the individual order
51 Combined D Weighted mean of all orders, on which the velocity is modeled and measured

Format D = Double-precision floating-point



File (odometer)p.fits

Polarimetric products are only available for observations taken in polarimetric mode, from the combination of 4 consecutive exposures. Each extension contains 49 orders of 4088 pixels in image format.

HDU # Name Type Description
1 Primary Header
2 Pol Image The polarized spectrum in the required Stokes configuration
3 PolErr Image The error on the polarized spectrum
4 StokesI Image The combined Stokes I (intensity) spectrum
5 StokesIErr Image The error on the Stokes I spectrum
6 Null1 Image One null spectrum used to check the polarized signal (see Donati et al 1997)
7 Null2 Image The other null spectrum used to check the polarized signal
8 WaveAB Image The wavelength vector for the AB science channel
9 BlazeAB Image The Blaze function for AB (useful for Stokes I)


astropy examples:

Below are examples of accessing data in each product in Python using astropy.io.fits. Note that starting with DRS 0.6, the SNR fits keyword changes from SNRxx to EXTSN0xx for order xx, so EXTSN034 for DRS order 34 for example.

from astropy.io import fits

e = fits.open('1234567e.fits')
# looking at science data channel (AB)
snr_order34 = e[1].header['SNR34']
flux_order34 = e[1].data[34]
wavelength_order34 = e[5].data[34]

t = fits.open('1234567t.fits')
tellu_corr_flux_order34 = t[1].data[34]

p = fits.open('1234567p.fits')
polarization_order34 = p[1].data[34]

v = fits.open('1234567v.fits')
rv_steps = v[1].data.field(0)
ccf_order34 = v[1].data.field(35)
ccf_combined = v[1].data.field(50)
drift_corrected_rv = v[1].header['CCFRVC']

s = fits.open('1234567s.fits')
# using uniform wavelength bins
wavelength_combined = s[1].data.field(0)
flux_combined = s[1].data.field(1)
tellu_corr_flux_combined = s[1].data.field(9)

IDL examples:

Accessing data needs MRDFITS from idlastro.gsfc.nasa.gov. Note that starting with DRS 0.6, the SNR fits keyword changes from SNRxx to EXTSN0xx for order xx, so EXTSN034 for DRS order 34 for example.

; e files
fluxAB=MRDFITS('1234567e.fits',1,header1)    ; FluxAB is the first Image Array 
print,'EXTNAME= ',SXPAR(header1, 'EXTNAME')  ; extension name
print,'OBSDATE= ',SXPAR(header1, 'OBSDATE')
print,'SNR34= ',SXPAR(header1, 'SNR34')      ; SNR for order34  - keyword goes from SNR0 to SNR48, or EXTSN001 to 048 if DRV version >=0.6
waveAB=MRDFITS('1234567e.fits',5,header5)    ; WaveAB is the fifth Image Array
print,'EXTNAME: ',SXPAR(header5, 'EXTNAME')
order=34                                     ;spectral order to be displayed, orders range from 0 to 48
plot,waveAB[*,order],fluxAB[*,order],xtitle='Wavelength (nm)',ytitle='FluxAB'

; s files
s=MRDFITS('1234567s.fits',1,header1)
print,'EXTNAME= ',SXPAR(header1, 'EXTNAME') ; First binary table 
plot,s.Wave,s.FluxAB,xtitle='Wavelength (nm), uniform wavelength sampling',ytitle='FluxAB '
oplot,s.Wave,s.FluxABTelluCorrected         ; Overplot the telluric-corrected spectrum
sv=MRDFITS('1234567s.fits',2,header2)
print,'EXTNAME= ',SXPAR(header2, 'EXTNAME') ; Second binary table
plot,sv.Wave,sv.FluxAB,xtitle='Wavelength (nm), uniform velocity sampling',ytitle='FluxAB '
oplot,sv.Wave,sv.FluxABTelluCorrected       ; Overplot the telluric-corrected spectrum