faitdivers / pyao

PyAO - Adaptive Optics simulation package
6 stars 0 forks source link

[WFR] select geometry #64

Closed JaccovdS closed 10 years ago

JaccovdS commented 10 years ago

In WFR we will have different geometries available for the reconstruction. My suggestion is that an extra parameter will be passed to the WFR function in order to select a geometry. I propose to use an int as parameter. With the following convention: 1) Fried 2) Southwell 3) Modified Hudgin

Does everybody agree or do you have smarter solutions?

faitdivers commented 10 years ago

I was thinking that an 'enum' kind of variable would be nice. do you know if it exists in Python?

The 'enum' in C basically converts your key word to an int (if I'm not mistaken) and so you improve readability.

On 6 June 2014 20:14, Jacco van der Spek notifications@github.com wrote:

In WFR we will have different geometries available for the reconstruction. My suggestion is that an extra parameter will be passed to the WFR function in order to select a geometry. I propose to use an int as parameter. With the following convention: 1) Fried 2) Southwell 3) Modified Hudgin

Does everybody agree or do you have smarter solutions?

— Reply to this email directly or view it on GitHub https://github.com/faitdivers/pyao/issues/64.

JaccovdS commented 10 years ago

Yes that would be nice, I'm going to Google that :)

JaccovdS commented 10 years ago

http://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python

faitdivers commented 10 years ago

Yeah, but our Python is 2.7. Oh well, I think an int is good enough.

On 6 June 2014 23:35, Jacco van der Spek notifications@github.com wrote:

http://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python

— Reply to this email directly or view it on GitHub https://github.com/faitdivers/pyao/issues/64#issuecomment-45386802.

forcaeluz commented 10 years ago

Apparently is has been backported to 2.7. So we can use it.

JaccovdS commented 10 years ago

Solved by adding an extra 'geometry' parameter to simulation parameters. Then using just string comparison which is sufficient for the moment.