Exemplo n.º 1
0
import numpy as np
import almsgs
import alfunc_base
msgs = almsgs.msgs()


class ThAr(alfunc_base.Base):
    """
    Returns a 1-dimensional gaussian of form:
    p[0] = amplitude
    p[1] = centroid of the gaussian
    p[2] = FWHM
    """
    def __init__(self, prgname="", getinst=False, atomic=None, verbose=2):
        self._idstr = 'thar'  # ID string for this class
        self._pnumr = 3  # Total number of parameters fed in
        self._keywd = dict(
            {
                'specid': [],
                'continuum': False,
                'blind': False
            }
        )  # Additional arguments to describe the model --- 'input' cannot be used as a keyword
        self._keych = dict({
            'specid': 0,
            'continuum': 0,
            'blind': 0
        })  # Require keywd to be changed (1 for yes, 0 for no)
        self._keyfm = dict({
            'specid': "",
            'continuum': "",
Exemplo n.º 2
0
import os
import numpy as np
import almsgs
import alfunc_voigt
#import pycuda.driver as cuda
#import pycuda.autoinit
#from pycuda.compiler import SourceModule
msgs=almsgs.msgs()

class LineEmission(alfunc_voigt.Voigt) :
	"""
	Returns an emission line profile that has the combined effects
	of natural, collisional, thermal, and turbulent broadening:
	p[0] = 
	p[1] = 
	p[2] = 
	p[3] = 
	"""
	def __init__(self, prgname="", getinst=False, atomic=None, verbose=2):
		self._idstr   = 'lineemission'															# ID string for this class
		self._pnumr   = 5																		# Total number of parameters fed in
		self._keywd   = dict({'specid':[], 'blind':False, 'ion':'',      'logF':True})			# Additional arguments to describe the model --- 'input' cannot be used as a keyword
		self._keych   = dict({'specid':0,  'blind':0,     'ion':1,       'logF':0})				# Require keywd to be changed (1 for yes, 0 for no)
		self._keyfm   = dict({'specid':"", 'blind':"",    'ion':"{1:7}", 'logF':""})			# Format for the keyword. "" is the Default setting
		self._parid   = ['IntFlux',   'redshift', 'bturb',   'temperature', 'ColFreq']			# Name of each parameter
		self._defpar  = [ 8.1,         0.0,        7.0,       1.0E2,         0.0 ]				# Default values for parameters that are not provided
		self._fixpar  = [ None,        None,       None,      None,          True ]				# By default, should these parameters be fixed?
		self._limited = [ [1  ,0  ],  [0  ,0  ],  [1  ,0  ], [1  ,0],        [0  ,0 ] ]			# Should any of these parameters be limited from below or above
		self._limits  = [ [0.0,0.0],  [0.0,0.0],  [0.5,0.0], [0.0,0.0],      [0.0,0.0] ]		# What should these limiting values be
		self._svfmt   = [ "{0:.7g}", "{0:.10g}", "{0:.6g}", "{0:.7g}",      "{0:.7g}"]			# Specify the format used to print or save output
		self._prekw   = [ 'ion' ]																# Specify the keywords to print out before the parameters