c     mag=22.5-2.5log(aperFlux7)
c     fluxerr=1/flux_sigma^2
c     mag_sig=(22.5-2.5log(aperFlux7-flux_sigma))-(22.5-2.5log(aperFlux7))=-2.5log(aperFlux7-flux_sigma)+2.5log(aperFlux7)=-2.5log(1-flux_sigma/aperFlux7)=-2.5log(1-1/sqrt(fluxerr)/aperFlux7)
      character*1 fi(5)
      real flux(5),eflux(5),mag(5),emag(5)
      data flux/7.3578382,19.097273,28.38166,3.1378047,38.716625/
      data eflux/6.1296096,0.86904413,2.3910048,0.83910662,0.060724732/
      data fi/"g","i","r","u","z"/
      do i=1,5
         mag(i)=22.5-2.5*log10(flux(i))
         x=1-1./sqrt(eflux(i))/flux(i)
         emag(i)=-2.5*log10(1-1./sqrt(eflux(i))/flux(i))
         write(6,*)fi(i),mag(i),x,emag(i)
      enddo      
      end
