We measure the I-V curve of a p-n diode on a range of currents where the well known Shockley model exhibits its shortcoming. We show that the behavior of the I-V curve, on the whole range of currents, can be captured by a modified four parameter Shockley model; the parameters of the model are obtained by a numerical procedure, consisting of an iterative rapidly converging nonlinear fitting algorithm. The fit returns sound estimates of the parameters for I-V curves, as function of temperature. The method is validated on a well known 1N4148 diode, but it can also be applied to any other devices described by single-diode models such as solar cells. We also show that the knowledge of the temperature dependence of the parameters can be used to obtain a quantitative estimate of other physical properties of the system, such as the energy gap of junction materials.