anchor.diff:      integer,intent(in) :: im ! sub-image to bin into
       real(dp) :: log10_nu_image
       integer :: ix,iy,ir,inu,io ! Bins
  -    real(dp) :: stokes_vector(4)
   
       if(img%compute_image.and..not.allocated(img%img)) call error('bin_photon','Image not allocated')
       if(img%compute_sed.and..not.allocated(img%sed)) call error('bin_photon','SED not allocated')
  
positive.code:      ! emissivity of the dust types, binned to the image spectral resolution
  
       real(dp),allocatable :: tmp_spectrum(:)
  
       character(len=10) :: track_origin
       logical :: uncertainties
  
negative.code:        if(img%compute_sed) then
            call find_sed_bin(img,x_image,y_image,ir)
            if(ir >= 1 .and. ir <= img%n_ap) then
               img%sed(inu,ir,im,io,:) = img%sed(inu,ir,im,io,:) + img%tmp_stokes * p%energy
               if(img%uncertainties) then
                  img%sed2(inu,ir,im,io,:) = img%sed2(inu,ir,im,io,:) + img%tmp_stokes**2._dp * p%energy**2._dp
                  img%sedn(inu,ir,im,io,:) = img%sedn(inu,ir,im,io,:) + 1._dp
               end if
            end if
  