Optical potential calculations for the 1s level in pionic atoms