Magmax.pro calculates the apparent magnitude of a supernova at maximum light for given z, ,
,
w and filter. For more information on w, check the documentation of calc_dm.pro at http://panisse.lbl.gov/groupwork/documentation/cosmo/index.html
The function checks if the passed parameters would result in a bouncing universe which means that the universe has a turning point in its past, that is, it collapsed from infinite size to a finite radius and is now reexpanding. If the functions detects parameters which describe such a bouncing universe, it returns a large negative number (see section 2.2 below).