| |
- __builtin__.list(__builtin__.object)
-
- WavelengthColour
- WaveLength
-
- RefractiveIndex
-
- InfoIndex
-
- AirIndex
- SimpleCauchyIndex
- Spectrum
-
- GaussianSpectrum
-
- PhotopicSpectrum
- ScotopicSpectrum
- TriColourSpectrum
class AirIndex(InfoIndex) |
|
Class for AirIndex, this is either fixed or a special cals of InfoIndex with fixed paramers.
Controlled by Global variiable
FixedAirIndex which defaults to False. |
|
- Method resolution order:
- AirIndex
- InfoIndex
- RefractiveIndex
- WaveLength
Methods defined here:
- __init__(self)
- No parameter conctructor.
- __repr__(self)
- __str__(self)
- # Set __str__ and __repr__
- copy(self)
- # Make copy
- getNewValue(self, wave)
- # Method to get the new value at specified wavelength
Methods inherited from RefractiveIndex:
- getNd(self)
- Method to get refrative inded as the Helium_d line.
- getNe(self)
- Method to get the refrative index at the Mercury_e line
- getType(self)
- Method to get the type number on nnnVVV for format using calculatedd
Nd and Vd numbers.
return 6 digit int
- getVd(self)
- Method to get the Abbe or Vd number, calculated Helium_d, Hydroden_F and Hydroden_C lines.
Will return zero if non-dispersive.
return the Vd number
- getVe(self)
- Method to get the Mercury Abbe or Ve number, cacaulted at the Mercury_e, Cadmium_F and Cadnium_C liens.
Will return zero if non-dispersive.
return the Ve
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class GaussianSpectrum(Spectrum) |
|
# Class to speify a Gaussian profile |
|
- Method resolution order:
- GaussianSpectrum
- Spectrum
- WaveLength
Methods defined here:
- __init__(self, peak, width, bright=1.0)
- # Constructor to spefify
- __str__(self)
- # The __str__ method
- getNewValue(self, wave)
- # get new value at specified wavelength
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class InfoIndex(RefractiveIndex) |
|
Implment a RefractiveIndex in the format suppled by RefratciveIndex.info website,
all have common calls. |
|
- Method resolution order:
- InfoIndex
- RefractiveIndex
- WaveLength
Methods defined here:
- __init__(self, formula, wrange, coef, name='InfoIndex')
- Constuctor
param formula int, formula type 5
param wrange, list of two float giving validity range
param coef, list of floats holding the coefficents.
param name or key (defaults to InfoIndex)
Format is same as in RefrativeIndex.info database.
- __repr__(self)
- Implement repr() to give full inpormation
- copy(self)
- Define copy method to give deep copy
- getNewValue(self, wave)
- Method to get the new value as specified wavelength
param wave float the wavelength
Methods inherited from RefractiveIndex:
- getNd(self)
- Method to get refrative inded as the Helium_d line.
- getNe(self)
- Method to get the refrative index at the Mercury_e line
- getType(self)
- Method to get the type number on nnnVVV for format using calculatedd
Nd and Vd numbers.
return 6 digit int
- getVd(self)
- Method to get the Abbe or Vd number, calculated Helium_d, Hydroden_F and Hydroden_C lines.
Will return zero if non-dispersive.
return the Vd number
- getVe(self)
- Method to get the Mercury Abbe or Ve number, cacaulted at the Mercury_e, Cadmium_F and Cadnium_C liens.
Will return zero if non-dispersive.
return the Ve
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class RefractiveIndex(WaveLength) |
|
Class RefrativeIndex which extends WaveLength to handle differnt types of
Refrative Index. Class is Abstract, need to be extended to be useful. |
|
Methods defined here:
- __init__(self)
- Default constuctor, same as WaveLength, does nothing but sets defaults.
- getNd(self)
- Method to get refrative inded as the Helium_d line.
- getNe(self)
- Method to get the refrative index at the Mercury_e line
- getType(self)
- Method to get the type number on nnnVVV for format using calculatedd
Nd and Vd numbers.
return 6 digit int
- getVd(self)
- Method to get the Abbe or Vd number, calculated Helium_d, Hydroden_F and Hydroden_C lines.
Will return zero if non-dispersive.
return the Vd number
- getVe(self)
- Method to get the Mercury Abbe or Ve number, cacaulted at the Mercury_e, Cadmium_F and Cadnium_C liens.
Will return zero if non-dispersive.
return the Ve
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getNewValue(self, wave)
- Abstract method to get the value at a new wavelength (needs to be defined)
param wave float, the wavelength
return float the value at this wavelength
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class SimpleCauchyIndex(RefractiveIndex) |
|
# Class to implement a Cauchy Index |
|
- Method resolution order:
- SimpleCauchyIndex
- RefractiveIndex
- WaveLength
Methods defined here:
- __init__(self, a, b=None, c=None)
- __repr__(self)
- __str__(self)
- # Define __str__ __repr__
- copy(self)
- # make copy
- getNewValue(self, wave)
- # Method to get the new value
# wave the wavelength
# return refrative index at specified wavelength
- set(self, a_or_nd, b_or_vd, c=None)
- # Method to set the Cauchy index with either 2 or 3 parameters
Methods inherited from RefractiveIndex:
- getNd(self)
- Method to get refrative inded as the Helium_d line.
- getNe(self)
- Method to get the refrative index at the Mercury_e line
- getType(self)
- Method to get the type number on nnnVVV for format using calculatedd
Nd and Vd numbers.
return 6 digit int
- getVd(self)
- Method to get the Abbe or Vd number, calculated Helium_d, Hydroden_F and Hydroden_C lines.
Will return zero if non-dispersive.
return the Vd number
- getVe(self)
- Method to get the Mercury Abbe or Ve number, cacaulted at the Mercury_e, Cadmium_F and Cadnium_C liens.
Will return zero if non-dispersive.
return the Ve
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class Spectrum(WaveLength) |
|
Base Sepectrum class, implments a constant spectrum |
|
Methods defined here:
- __init__(self, bright=1.0)
- Set only brighnness
param bright, float, the brighness,(defaults to 1.0)
- getNewValue(self, wave)
- Get the new value,also returns brighntess
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class TriColourSpectrum(Spectrum) |
|
# Tricolour spectrum |
|
- Method resolution order:
- TriColourSpectrum
- Spectrum
- WaveLength
Methods defined here:
- __init__(self, red, green, blue, bright=1.0)
- # Constructor
- getNewValue(self, wave)
- # getNextValue
Methods inherited from WaveLength:
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class WaveLength |
|
Define Abstract class to deal with functions of wavelength. This class also support
plotting of the class via a .draw call.
There are three local variable to control plotting and information
self.minWavelength = BlueLimit
self.maxWavelenth = Redlimit
self.plotPoints = 200
self.title = None |
|
Methods defined here:
- __init__(self)
- Default constructor to set defaults, typically called by extending classes only
No-parameters, it just initialises variables.
- draw(self, key='r')
- Method to get a matlibplot plot between self.minWavelenth and self.maxWavelength
param key string matlibplot plotting key, (defaults to 'r')
return matlibpolot "plot"
- getNewValue(self, wave)
- Abstract method to get the value at a new wavelength (needs to be defined)
param wave float, the wavelength
return float the value at this wavelength
- getValue(self, wave)
- Method to get the current value as the specified wavelength
param wave the wavelength, this is assumes be a float OR any object
that has .wavelength as a float variable.
This is the normal used call for all classes.
|
class WavelengthColour(__builtin__.list) |
|
Class to form as RGB list of floats to represent a wavelength colour.
Based on
<a href="http://www.cox-internet.com/ast305/color.html">fortran code</a>
by Dan Bruton, Stephen F Austin State University. |
|
- Method resolution order:
- WavelengthColour
- __builtin__.list
- __builtin__.object
Methods defined here:
- __init__(self, wave)
- parar wave, float is microns,
- hexString(self)
- Method to return as a HTML hex string in #rrggbb where rr / gg / bb are the colours in Hex
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.list:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iadd__(...)
- x.__iadd__(y) <==> x+=y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from __builtin__.list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |