SophieTh / und_Sophie_2016

Other
3 stars 3 forks source link

Refactor RadiationFactory #3

Open mark-glass opened 8 years ago

mark-glass commented 8 years ago

Consider refactoring RadiationFactory to improve readabilty:

-The interface of the energyradiated* methods takes parameters: trajectory, gamma, x, y, distance Can one or several be taken by constructor and saved on the object instead?

-move example code to somewhere else. Maybe an example directory and RadiationFactoryExample.py.

-The factory has around 7 methods to calculate the electrical field. Keep only the most important (near and far field) and move the others somewhere else. The somewhere else could be a subclass RadiationFactoryExperimental that enhances the normal RadiationFactory by these non standard methods.

srio commented 8 years ago
TO DO:  

photon_frequency_start,photon_frequency_end,photon_frequency_points go to method arguments self.trajectory self.source

   Examples and main go to a new RadiationFactoryExamples.py

  RadiationFactory returns a list of Radiation (with electric field)

Remove non used calculation routines. So, keep: RADIATION_METHOD_NEAR_FIELD = 0 # calls self.energy_radiated_near_field2 RADIATION_METHOD_APPROX_FARFIELD = 2 # calls self.energy_radiated_approximation_and_farfield2