  Gamma-ray bursts (GRBs) are known to be highly collimated events, and are
mostly detectable when they are seen on-axis or very nearly on-axis. However,
GRBs can be seen from off-axis angles, and the recent detection of a short GRB
associated to a gravitational wave event has conclusively shown such a
scenario. The observer viewing angle plays an important role in the observable
spectral shape and the energetic of such events. We present a numerical model
which is based on the single-pulse approximation with emission from a top-hat
jet and has been developed to investigate the effects of the observer viewing
angle. We assume a conical jet parametrized by a radius $R_{\rm jet}$,
half-opening angle $\theta_{\rm jet}$, a comoving-frame emissivity law and an
observer viewing angle $\theta_{\rm obs}$, and then study the effects for the
conditions $\theta_{\rm obs} < \theta_{\rm jet}$ and $\theta_{\rm obs}
>\theta_{\rm jet}$. We present results considering a smoothly broken power-law
emissivity law in jet comoving frame, albeit the model implementation easily
allows to consider other emissivity laws. We find that the relation $E^{\rm
i}_{\rm p} \propto E_{\rm iso}^{0.5}$ (Amati relation) is naturally obtained
from pure relativistic kinematic when $\Gamma \gtrsim 10$ and $\theta_{\rm obs}
< \theta_{\rm jet}$; on the contrary, when $\theta_{\rm obs} > \theta_{\rm
jet}$ it results $E^{\rm i}_{\rm p} \propto E_{\rm iso}^{0.25}$. Using data
from literature for a class of well-know sub-energetic GRBs, we show that their
position in the $E^{\rm i}_{\rm p}-E_{\rm iso}$ plane is consistent with event
observed off-axis. The presented model is developed as a module to be
integrated in spectral fitting software package XSPEC and can be used by the
scientific community.
