Software for modelling spectrographs