# Wiki

Clone wiki# supernu / output

# SUPERNU OUTPUT

All output is written to files named *output.**.
Two special groups of output are the flux grid (*output.flx_**) and the transport grid (*output.grd_**) based variables.
The grid cell sizes of these two grids are defined in the *output.flx_grid* and *output.grd_grid*, respectively, using the cell edge positions.

The flux grid is 4 dimensional:

1. wavelength

2. polar angle

3. azimuthal angle

4. time

The transport grid size is 3 dimensional:

1. x

2. y

3. z

here (x,y,z) are the 3D coordinates of the chosen geometry, either spherical (*igeom*=1), cylindrical (*igeom*=2), or cartesian (*igeom*=3).

## Flux:

SuperNu writes flux output in ascii (*output.flx_luminos*) as a sequence of spectra, one spectrum per line, one line per viewing angle, repeated in each time step.
So the number of columns equals the number of wl-bins, and the number of rows equals nmu*nphi*ntimestep, where mu=cos(theta).
The luminos values are in units [erg/s].
The *output.flx_grid* file describes the wavelength, viewing angle, and time bins.

## Energy totals:

SuperNu writes output of energy totals in ascii (*output.tot_energy*) each time step, with each column corresponding to a particular energy value.
The first column is energy conservation error.
These values can be used to find unintended energy leaks or sources in simulations.

## Grid-based variables:

Using parameter *in_io_nogriddump*, SuperNu optionally writes grid-based variables in ascii (*output.grd_**).
Grid variables include material temperature (*output.grd_temp*), radiation energy density (*output.grd_eraddens*), and Planck opacity (*output.grd_capgrey*).
The grid variables can be mapped to spatial cells (with an (i,j,k) index) with *output.grd_grid*.
As headers, *output.grd_grid* has (in row order) the geometry index (*grd_igeom*), the number of cells along each dimension (*grd_nx*,*grd_ny*,*grd_nz*), and the total number of array cells used to yield an optimal row size (ncpr), column size (nrow) to minimize padding cells per write (the final header has nrow*ncpr,nrow,ncpr).
The next 3 rows are space or velocity values at the cell edges in the x,y,z dimensions.
The integers that follow the cell edge values are the cell indices of grid values for spatial index locations (i,j,k), where the column index is the x-dimension (i), and the row index is the serialized index for the y (j) and z (k) dimensions (the row index is j+(k-1)*ny).
Thus, the cell padding information can be used to remove extra padding values from the grid output, and the grid index mapping to the (i,j,k) spatial cell index can used to reconstruct spatial profiles of the padding-stripped grid data.

Updated