Generating electron density from protein coordinate (PDB)
For the more recent structures, you can view the density (based on measured diffraction data and the model, so-called 2Fo-Fc density) directly in the protein data bank, e.g. http://www.rcsb.org/3d-view/6QU9?preset=electronDensityMaps:



For a theoretical model or a model without deposited diffraction data, you would first have to generate structure factors, and then calculate the electron density. In the simplest case, the electron density would just reflect the density of isolated atoms (i.e. no deformation density). Program suites such as CCP4 (originally in Fortran) or Phenix (in python) are available to do these steps.

In these calculations, the electron density of individual atoms is encoded in so-called atomic form factors (see e.g. http://lampx.tugraz.at/~hadley/ss1/crystaldiffraction/atomicformfactors/formfactors.php), which are fourier transform coefficients of the model electron density for each atom.