Пример #1
0
def ffmodelExplorer(odf, plotter, version="list"):
  """
    Instantiate the model explorer.
    
    Parameters
    ----------
    odf : Instance of OneDFit
        The model to be adapted.
    plotter : Instance of FFModelPlotFit or custom
        Class instance managing the actual plotting.
    version : string, {list}
        The version of model explorer. Currently, only
        'list' is supported.
    
    Returns
    -------
    ffmod : Model explorer
        An instance of the model explorer.
  """
  if version == "list":
    ffmod = FFModelExplorerList(odf, plotter)
    return ffmod
  elif version == "dropdown":
    PE.warn(PE.PyADeprecationError("Please note that the dropdown version is no longer supported. " + \
                                   "The list version will be called instead."))
    ffmod = FFModelExplorerList(odf, plotter)
    return ffmod
  else:
    raise(PE.PyAValError("Unknown version: '" + str(version) + "'", \
                         where="ffmodelExplorer", \
                         solution="Choose between 'list' and 'dropdown'."))
Пример #2
0
    def __init__(self, collisionCheck=False):
        _ZList.__init__(self, "keplerian", collisionCheck)
        fuf.OneDFit.__init__(self, [
            "p", "a", "i", "linLimb", "quadLimb", "tau", "per", "b", "w",
            "Omega", "e"
        ])
        self.freeze([
            "p", "a", "i", "linLimb", "quadLimb", "tau", "per", "b", "w",
            "Omega", "e"
        ])
        self.setRootName("Pal08")
        self["per"] = 1.0
        self["w"] = -90

        self._zlist = None

        if (not mpmath_imported) and (not boostEll_imported):
            raise (PE.PyARequiredImport(
                "Neither mpmath nor the elliptical integrals from the boost library could be found!",
                where="PalLC::__init__",
                solution=
                "Install mpmath or make Boost library available (more complicated - see documentation)"
            ))
        self.useBoost = False
        if boostEll_imported:
            self.useBoost = True
            self.ell = ell.ell()

        self.collisionCheck = collisionCheck

        # Wrap get/setitem to inform about change in parameter name
        T0paE = PE.PyADeprecationError(
            "The parameter 'T0pa' in PalLCKep had to be renamed 'tau'.",
            solution="Use 'tau' instead of 'T0pa'.")

        def getitem(specifier, **kwargs):
            if specifier == "T0pa":
                PE.warn(T0paE)
            return PalLC.__getitem__(self, specifier, **kwargs)

        self.__getitem__ = getitem

        def setitem(specifier, value):
            if specifier == "T0pa":
                PE.warn(T0paE)
            PalLC.__setitem__(self, specifier, value)

        self.__setitem__ = setitem
Пример #3
0
    def xyzNodes(self):
        """
        Calculate the nodes of the orbit.

        The nodes of the orbit are the points at which
        the orbit cuts the observing plane. In this case,
        these are the points at which the z-coordinate
        vanishes, i.e., the x-y plane is regarded the plane
        of observation.

        Returns
        -------
        Nodes : Tuple of two coordinate arrays
            Returns the xyz coordinates of both nodes. 
        """
        raise(PE.PyADeprecationError("xyzNodes is deprecated.",
                                     solution="Please use 'xyzNodes_LOSZ' instead."))
Пример #4
0
def vactoair(wave, depWarn=True):
    """
    Convert vacuum wavelengths to air wavelengths

    .. warning::
       The conversion implemented here is based on the older formulae
       given by Edlen 1953. Furthermore, it seems that wave numbers in air
       are used, where vacuum wave numbers should be used, which, however,
       produces only a second-order deviation. Consider using
       :py:func:`vactoair2` instead.

    Parameters
    ----------
    wave : float, array
        The wavelength in vacuum [Angstrom]
   
    Returns
    -------
    Wavelength : array,
        Wavelength in air [Angstrom]
    depWarn : boolean, optional
        If True (default), a deprecation warning will be
        given.
   
    Notes
    -----

    .. note:: This function was ported from the IDL Astronomy User's Library.
    
    :IDL - Documentation:

    NAME:
          VACTOAIR
    PURPOSE:
          Convert vacuum wavelengths to air wavelengths
    EXPLANATION:
          Corrects for the index of refraction of air under standard conditions.  
          Wavelength values below 2000 A will not be altered.  Accurate to 
          about 0.005 A 

    CALLING SEQUENCE:
          VACTOAIR, WAVE

    INPUT/OUTPUT:
          WAVE - Wavelength in Angstroms, scalar or vector
                  WAVE should be input as vacuum wavelength(s), it will be
                  returned as air wavelength(s).  WAVE is always converted to
                  double precision

    EXAMPLE:
          If the vacuum wavelength is  W = 2000, then 

          IDL> VACTOAIR, W 

          yields an air wavelength of W = 1999.353 Angstroms

    METHOD:
          An approximation to the 4th power of inverse wavenumber is used
          See IUE Image Processing Manual   Page 6-15.

    REVISION HISTORY
          Written, D. Lindler 1982 
          Documentation W. Landsman  Feb. 1989
          Converted to IDL V5.0   W. Landsman   September 1997
  """

    if depWarn:
        PE.warn(PE.PyADeprecationError("Note: vactoair is outdated; see documentation for reasons.", \
                                       solution="Consider using 'vactoair2'."))

    wave2 = wave**2.
    fact = 1. + 2.735182e-4 + 131.4182 / wave2 + 2.76249e8 / (wave2**2.)
    fact = fact * (wave >= 2000.) + 1. * (wave < 2000.)

    # Convert wavelengths

    wave = wave / fact

    return wave
Пример #5
0
def airtovac(wave, depWarn=True):
    """
    Convert air wavelengths to vacuum wavelengths 
    
    .. warning::
       The conversion implemented here is based on the older formulae
       given by Edlen 1953. Furthermore, it seems that wave numbers in air
       are used, where vacuum wave numbers should be used, which, however,
       produces only a second-order deviation. Consider using
       :py:func:`airtovac2` instead.
    
    Parameters
    ----------
    wave : float, array
        The wavelength in air [Angstrom]
    depWarn : boolean, optional
        If True (default), a deprecation warning will be
        given.
   
    Returns
    -------
    Wavelength : array
        Wavelength in vacuum [Angstrom]
   
    Notes
    -----

    .. note:: This function was ported from the IDL Astronomy User's Library.
    
    :IDL - Documentation:
    
    NAME:
          AIRTOVAC
    PURPOSE:
          Convert air wavelengths to vacuum wavelengths 
    EXPLANATION:
          Wavelengths are corrected for the index of refraction of air under 
          standard conditions.  Wavelength values below 2000 A will not be 
          altered.  Uses the IAU standard for conversion given in Morton 
          (1991 Ap.J. Suppl. 77, 119)
    
    CALLING SEQUENCE:
          AIRTOVAC, WAVE
    
    INPUT/OUTPUT:
          WAVE - Wavelength in Angstroms, scalar or vector
                 WAVE should be input as air wavelength(s), it will be
                 returned as vacuum wavelength(s).  WAVE is always converted to
                 double precision upon return.
    
    EXAMPLE:
          If the air wavelength is  W = 6056.125 (a Krypton line), then 
          AIRTOVAC, W yields an vacuum wavelength of W = 6057.8019
    
    METHOD:
          See Morton (Ap. J. Suppl. 77, 119) for the formula used
    
    REVISION HISTORY
          Written W. Landsman                   November 1991
          Converted to IDL V5.0   W. Landsman   September 1997
  """

    if depWarn:
        PE.warn(PE.PyADeprecationError("Note: airtovac is outdated; see documentation for reasons.", \
                                       solution="Consider using 'airtovac2'."))

    sigma2 = (1.e4 / wave)**2.  #Convert to wavenumber squared

    # Compute conversion factor

    fact = 1. + 6.4328e-5 + 2.94981e-2 / (146. - sigma2) + 2.5540e-4 / (41. -
                                                                        sigma2)

    fact = fact * (wave >= 2000.) + 1. * (wave < 2000.)

    wave = wave * fact  #Convert Wavelength

    return wave