code: def scale(mask, mag_scale, outfile=None):
      
      msg = "'mask.scale': ADW 2018-05-05"
      DeprecationWarning(msg)
      mask_new = hp.UNSEEN * np.ones(len(mask))
      mask_new[mask == 0.] = 0.
      mask_new[mask > 0.] = mask[mask > 0.] + mag_scale
  
      if outfile is not None:
          pix = np.nonzero(mask_new > 0.)[0]
          data_dict = {'MAGLIM': mask_new[pix]}
          nside = hp.npix2nside(len(mask_new))
          ugali.utils.skymap.writeSparseHealpixMap(pix, data_dict, nside, outfile)
  
      return mask_new
docs: Scale the completeness depth of a mask such that mag_new = mag + mag_scale.
      Input is a full HEALPix map.
      Optionally write out the scaled mask as an sparse HEALPix map.