Effective magnetic fields for photons in waveguide and coupled resonator lattices.