#! /usr/bin/env python
# ALMA - Atacama Large Millimeter Array
# (c) European Southern Observatory, 2002
# (c) Associated Universities Inc., 2002
# Copyright by ESO (in the framework of the ALMA collaboration),
# Copyright by AUI (in the framework of the ALMA collaboration),
# All rights reserved.
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307  USA
# 
# /////////////////////////////////////////////////////////////////
# // WARNING!  DO NOT MODIFY THIS FILE!                          //
# //  =========================================================  //
# // | This is generated code!  Do not modify this file.       | //
# // | Any changes will be lost when the file is re-generated. | //
# //  =========================================================  //
# /////////////////////////////////////////////////////////////////
#
# File __init__.py
#


from WindowFunctionMod import *
from ACSErrTypeCommon import BadParameterEx

def fromString(stringVersionOfEnumeration):
	try:
		return {
			'UNIFORM': UNIFORM,
			'HANNING': HANNING,
			'HAMMING': HAMMING,
			'BARTLETT': BARTLETT,
			'BLACKMANN': BLACKMANN,
			'BLACKMANN_HARRIS': BLACKMANN_HARRIS,
			'WELCH': WELCH,
		}[stringVersionOfEnumeration]
	except KeyError:
		raise BadParameterEx('stringVersionOfEnumeration')
		
def WindowFunctionSet():
	return [
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
 	]
"""
Although this method could be simpler, the strings are listed explicity
to ensure consistency between this and other language mappings.
"""
def toString(valueVersionOfEnumeration):
	return {
		UNIFORM: 'UNIFORM',
		HANNING: 'HANNING',
		HAMMING: 'HAMMING',
		BARTLETT: 'BARTLETT',
		BLACKMANN: 'BLACKMANN',
		BLACKMANN_HARRIS: 'BLACKMANN_HARRIS',
		WELCH: 'WELCH',
 	}[valueVersionOfEnumeration]

def hasHelp():
	return True
	
def help(valueVersionOfEnumeration):
	return {
		UNIFORM: """!< No windowing """,
		HANNING: """!< Raised cosine: \f$0.5*(1-cos(x))\f$ where \f$x = 2*\pi*i/(N-1)\f$ """,
		HAMMING: """!< The classic Hamming window is \f$W_M(x) = 0.54 - 0.46*\cos(x)\f$. This is generalized to \f$W_M(x) = \beta - (1-\beta)*\cos(x)\f$ where \f$\beta\f$ can take any value in the range \f$[0,1]\f$. \f$\beta=0.5\f$ corresponds to the Hanning window. """,
		BARTLETT: """!< The Bartlett (triangular) window is \f$1 - |x/\pi|\f$, where \f$x = 2*\pi*i/(N-1)\f$. """,
		BLACKMANN: """!< The window function is \f$W_B(x) = (0.5 - \beta) - 0.5*\cos(x_j) + \beta*\cos(2x_j)\f$, where \f$x_j=2*\pi*j/(N-1)\f$. The classic Blackman window is given by \f$\beta=0.08\f$. """,
		BLACKMANN_HARRIS: """!< The BLACKMANN_HARRIS window is \f$1.0 - 1.36109*\cos(x) + 0.39381*\cos(2*x) - 0.032557*\cos(3*x)\f$, where \f$x = 2*\pi*i/(N-1)\f$. """,
		WELCH: """!< The Welch window (parabolic) is \f$1 - (2*i/N)^2\f$. """,
	}

def hasAssociatedNumber():
 	return False
 	
def newWindowFunction(p):
     if type(p) is str:
         return fromString(p)
     return None

5e0ede4154854096f9e0c6997107b52e39da461a
<mask token>


def fromString(stringVersionOfEnumeration):
    try:
        return {'UNIFORM': UNIFORM, 'HANNING': HANNING, 'HAMMING': HAMMING,
            'BARTLETT': BARTLETT, 'BLACKMANN': BLACKMANN,
            'BLACKMANN_HARRIS': BLACKMANN_HARRIS, 'WELCH': WELCH}[
            stringVersionOfEnumeration]
    except KeyError:
        raise BadParameterEx('stringVersionOfEnumeration')


def WindowFunctionSet():
    return ['WindowFunction', 'WindowFunction', 'WindowFunction',
        'WindowFunction', 'WindowFunction', 'WindowFunction', 'WindowFunction']


<mask token>


def hasHelp():
    return True


<mask token>

<mask token>


def fromString(stringVersionOfEnumeration):
    try:
        return {'UNIFORM': UNIFORM, 'HANNING': HANNING, 'HAMMING': HAMMING,
            'BARTLETT': BARTLETT, 'BLACKMANN': BLACKMANN,
            'BLACKMANN_HARRIS': BLACKMANN_HARRIS, 'WELCH': WELCH}[
            stringVersionOfEnumeration]
    except KeyError:
        raise BadParameterEx('stringVersionOfEnumeration')


def WindowFunctionSet():
    return ['WindowFunction', 'WindowFunction', 'WindowFunction',
        'WindowFunction', 'WindowFunction', 'WindowFunction', 'WindowFunction']


<mask token>


def hasHelp():
    return True


def help(valueVersionOfEnumeration):
    return {UNIFORM: '!< No windowing ', HANNING:
        '!< Raised cosine: \x0c$0.5*(1-cos(x))\x0c$ where \x0c$x = 2*\\pi*i/(N-1)\x0c$ '
        , HAMMING:
        '!< The classic Hamming window is \x0c$W_M(x) = 0.54 - 0.46*\\cos(x)\x0c$. This is generalized to \x0c$W_M(x) = \x08eta - (1-\x08eta)*\\cos(x)\x0c$ where \x0c$\x08eta\x0c$ can take any value in the range \x0c$[0,1]\x0c$. \x0c$\x08eta=0.5\x0c$ corresponds to the Hanning window. '
        , BARTLETT:
        '!< The Bartlett (triangular) window is \x0c$1 - |x/\\pi|\x0c$, where \x0c$x = 2*\\pi*i/(N-1)\x0c$. '
        , BLACKMANN:
        '!< The window function is \x0c$W_B(x) = (0.5 - \x08eta) - 0.5*\\cos(x_j) + \x08eta*\\cos(2x_j)\x0c$, where \x0c$x_j=2*\\pi*j/(N-1)\x0c$. The classic Blackman window is given by \x0c$\x08eta=0.08\x0c$. '
        , BLACKMANN_HARRIS:
        '!< The BLACKMANN_HARRIS window is \x0c$1.0 - 1.36109*\\cos(x) + 0.39381*\\cos(2*x) - 0.032557*\\cos(3*x)\x0c$, where \x0c$x = 2*\\pi*i/(N-1)\x0c$. '
        , WELCH: '!< The Welch window (parabolic) is \x0c$1 - (2*i/N)^2\x0c$. '
        }


def hasAssociatedNumber():
    return False


<mask token>

<mask token>


def fromString(stringVersionOfEnumeration):
    try:
        return {'UNIFORM': UNIFORM, 'HANNING': HANNING, 'HAMMING': HAMMING,
            'BARTLETT': BARTLETT, 'BLACKMANN': BLACKMANN,
            'BLACKMANN_HARRIS': BLACKMANN_HARRIS, 'WELCH': WELCH}[
            stringVersionOfEnumeration]
    except KeyError:
        raise BadParameterEx('stringVersionOfEnumeration')


def WindowFunctionSet():
    return ['WindowFunction', 'WindowFunction', 'WindowFunction',
        'WindowFunction', 'WindowFunction', 'WindowFunction', 'WindowFunction']


<mask token>


def hasHelp():
    return True


def help(valueVersionOfEnumeration):
    return {UNIFORM: '!< No windowing ', HANNING:
        '!< Raised cosine: \x0c$0.5*(1-cos(x))\x0c$ where \x0c$x = 2*\\pi*i/(N-1)\x0c$ '
        , HAMMING:
        '!< The classic Hamming window is \x0c$W_M(x) = 0.54 - 0.46*\\cos(x)\x0c$. This is generalized to \x0c$W_M(x) = \x08eta - (1-\x08eta)*\\cos(x)\x0c$ where \x0c$\x08eta\x0c$ can take any value in the range \x0c$[0,1]\x0c$. \x0c$\x08eta=0.5\x0c$ corresponds to the Hanning window. '
        , BARTLETT:
        '!< The Bartlett (triangular) window is \x0c$1 - |x/\\pi|\x0c$, where \x0c$x = 2*\\pi*i/(N-1)\x0c$. '
        , BLACKMANN:
        '!< The window function is \x0c$W_B(x) = (0.5 - \x08eta) - 0.5*\\cos(x_j) + \x08eta*\\cos(2x_j)\x0c$, where \x0c$x_j=2*\\pi*j/(N-1)\x0c$. The classic Blackman window is given by \x0c$\x08eta=0.08\x0c$. '
        , BLACKMANN_HARRIS:
        '!< The BLACKMANN_HARRIS window is \x0c$1.0 - 1.36109*\\cos(x) + 0.39381*\\cos(2*x) - 0.032557*\\cos(3*x)\x0c$, where \x0c$x = 2*\\pi*i/(N-1)\x0c$. '
        , WELCH: '!< The Welch window (parabolic) is \x0c$1 - (2*i/N)^2\x0c$. '
        }


def hasAssociatedNumber():
    return False


def newWindowFunction(p):
    if type(p) is str:
        return fromString(p)
    return None

from WindowFunctionMod import *
from ACSErrTypeCommon import BadParameterEx


def fromString(stringVersionOfEnumeration):
    try:
        return {'UNIFORM': UNIFORM, 'HANNING': HANNING, 'HAMMING': HAMMING,
            'BARTLETT': BARTLETT, 'BLACKMANN': BLACKMANN,
            'BLACKMANN_HARRIS': BLACKMANN_HARRIS, 'WELCH': WELCH}[
            stringVersionOfEnumeration]
    except KeyError:
        raise BadParameterEx('stringVersionOfEnumeration')


def WindowFunctionSet():
    return ['WindowFunction', 'WindowFunction', 'WindowFunction',
        'WindowFunction', 'WindowFunction', 'WindowFunction', 'WindowFunction']


<mask token>


def toString(valueVersionOfEnumeration):
    return {UNIFORM: 'UNIFORM', HANNING: 'HANNING', HAMMING: 'HAMMING',
        BARTLETT: 'BARTLETT', BLACKMANN: 'BLACKMANN', BLACKMANN_HARRIS:
        'BLACKMANN_HARRIS', WELCH: 'WELCH'}[valueVersionOfEnumeration]


def hasHelp():
    return True


def help(valueVersionOfEnumeration):
    return {UNIFORM: '!< No windowing ', HANNING:
        '!< Raised cosine: \x0c$0.5*(1-cos(x))\x0c$ where \x0c$x = 2*\\pi*i/(N-1)\x0c$ '
        , HAMMING:
        '!< The classic Hamming window is \x0c$W_M(x) = 0.54 - 0.46*\\cos(x)\x0c$. This is generalized to \x0c$W_M(x) = \x08eta - (1-\x08eta)*\\cos(x)\x0c$ where \x0c$\x08eta\x0c$ can take any value in the range \x0c$[0,1]\x0c$. \x0c$\x08eta=0.5\x0c$ corresponds to the Hanning window. '
        , BARTLETT:
        '!< The Bartlett (triangular) window is \x0c$1 - |x/\\pi|\x0c$, where \x0c$x = 2*\\pi*i/(N-1)\x0c$. '
        , BLACKMANN:
        '!< The window function is \x0c$W_B(x) = (0.5 - \x08eta) - 0.5*\\cos(x_j) + \x08eta*\\cos(2x_j)\x0c$, where \x0c$x_j=2*\\pi*j/(N-1)\x0c$. The classic Blackman window is given by \x0c$\x08eta=0.08\x0c$. '
        , BLACKMANN_HARRIS:
        '!< The BLACKMANN_HARRIS window is \x0c$1.0 - 1.36109*\\cos(x) + 0.39381*\\cos(2*x) - 0.032557*\\cos(3*x)\x0c$, where \x0c$x = 2*\\pi*i/(N-1)\x0c$. '
        , WELCH: '!< The Welch window (parabolic) is \x0c$1 - (2*i/N)^2\x0c$. '
        }


def hasAssociatedNumber():
    return False


def newWindowFunction(p):
    if type(p) is str:
        return fromString(p)
    return None

#! /usr/bin/env python
# ALMA - Atacama Large Millimeter Array
# (c) European Southern Observatory, 2002
# (c) Associated Universities Inc., 2002
# Copyright by ESO (in the framework of the ALMA collaboration),
# Copyright by AUI (in the framework of the ALMA collaboration),
# All rights reserved.
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307  USA
# 
# /////////////////////////////////////////////////////////////////
# // WARNING!  DO NOT MODIFY THIS FILE!                          //
# //  =========================================================  //
# // | This is generated code!  Do not modify this file.       | //
# // | Any changes will be lost when the file is re-generated. | //
# //  =========================================================  //
# /////////////////////////////////////////////////////////////////
#
# File __init__.py
#


from WindowFunctionMod import *
from ACSErrTypeCommon import BadParameterEx

def fromString(stringVersionOfEnumeration):
	try:
		return {
			'UNIFORM': UNIFORM,
			'HANNING': HANNING,
			'HAMMING': HAMMING,
			'BARTLETT': BARTLETT,
			'BLACKMANN': BLACKMANN,
			'BLACKMANN_HARRIS': BLACKMANN_HARRIS,
			'WELCH': WELCH,
		}[stringVersionOfEnumeration]
	except KeyError:
		raise BadParameterEx('stringVersionOfEnumeration')
		
def WindowFunctionSet():
	return [
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
		'WindowFunction',
 	]
"""
Although this method could be simpler, the strings are listed explicity
to ensure consistency between this and other language mappings.
"""
def toString(valueVersionOfEnumeration):
	return {
		UNIFORM: 'UNIFORM',
		HANNING: 'HANNING',
		HAMMING: 'HAMMING',
		BARTLETT: 'BARTLETT',
		BLACKMANN: 'BLACKMANN',
		BLACKMANN_HARRIS: 'BLACKMANN_HARRIS',
		WELCH: 'WELCH',
 	}[valueVersionOfEnumeration]

def hasHelp():
	return True
	
def help(valueVersionOfEnumeration):
	return {
		UNIFORM: """!< No windowing """,
		HANNING: """!< Raised cosine: \f$0.5*(1-cos(x))\f$ where \f$x = 2*\pi*i/(N-1)\f$ """,
		HAMMING: """!< The classic Hamming window is \f$W_M(x) = 0.54 - 0.46*\cos(x)\f$. This is generalized to \f$W_M(x) = \beta - (1-\beta)*\cos(x)\f$ where \f$\beta\f$ can take any value in the range \f$[0,1]\f$. \f$\beta=0.5\f$ corresponds to the Hanning window. """,
		BARTLETT: """!< The Bartlett (triangular) window is \f$1 - |x/\pi|\f$, where \f$x = 2*\pi*i/(N-1)\f$. """,
		BLACKMANN: """!< The window function is \f$W_B(x) = (0.5 - \beta) - 0.5*\cos(x_j) + \beta*\cos(2x_j)\f$, where \f$x_j=2*\pi*j/(N-1)\f$. The classic Blackman window is given by \f$\beta=0.08\f$. """,
		BLACKMANN_HARRIS: """!< The BLACKMANN_HARRIS window is \f$1.0 - 1.36109*\cos(x) + 0.39381*\cos(2*x) - 0.032557*\cos(3*x)\f$, where \f$x = 2*\pi*i/(N-1)\f$. """,
		WELCH: """!< The Welch window (parabolic) is \f$1 - (2*i/N)^2\f$. """,
	}

def hasAssociatedNumber():
 	return False
 	
def newWindowFunction(p):
     if type(p) is str:
         return fromString(p)
     return None
