Commit c08b2f43 authored by bepinat's avatar bepinat

Additionnal input arguments

parent cc32be35
......@@ -17,7 +17,7 @@ import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('CAMEL')
def create_config(path, cubefile, varfile, catfile, lines, suffixeout, commonw=True, dv=1000., dxy=15, initw=50., wmin=30., wmax=250., dfit=100, degcont=0, sclip=10, xyclip=3, nclip=3, wsmooth=0, ssmooth=2):
def create_config(path, cubefile, varfile, catfile, lines, suffixeout, commonw=True, dv=1000., dxy=15, initw=50., wmin=30., wmax=250., dfit=100., degcont=0, sclip=10, xyclip=3, nclip=3, wsmooth=0, ssmooth=2.):
'''
This function enables to create a configuration file for camel.
......@@ -48,7 +48,7 @@ def create_config(path, cubefile, varfile, catfile, lines, suffixeout, commonw=T
wmax: float
maximum width allowed in km/s
dfit: float
interval step for fitting the line position in km/s. Large values speed up the computation but could miss the true position.
interval step for fitting the line position in km/s. Large values speed up the computation but could miss the true position
degcont: int
degree of the polynomial used to fit the continuum
sclip: int
......@@ -248,8 +248,23 @@ def main(argv):
parser.add_argument('--cat', '-c', action="store", dest="catfile", default="", help="path of the catalogue with respect to initial path")
parser.add_argument('--data', '-d', action="store", dest="cubefile", default="", help="path of the cube with respect to initial path")
parser.add_argument('--var', '-v', action="store", dest="varfile", default=None, help="path of the variance with respect to initial path")
parser.add_argument('--dxy', action="store", dest="dxy", default='15', help="size in pixels around the center")
#parser.add_argument('--dv', action="store", dest="dv", default='1000.', help="velocity difference in km/s to determine redshift range for fit")
#parser.add_argument('--dxy', action="store", dest="dxy", default='15', help="size in pixels around the center")
parser.add_argument('--commonw', action="store", dest="commonw", default='True', help="parameter to use a common width in velocity for the various lines")
parser.add_argument('--dv', action="store", dest="dv", default='1000.', help="velocity difference in km/s to determine redshift range for fit")
parser.add_argument('--dxy', action="store", dest="dxy", default='15', help="size in pixels around the center")
parser.add_argument('--initw', action="store", dest="initw", default='50.', help="initial guess for the line width (dispersion) in km/s")
parser.add_argument('--wmin', action="store", dest="wmin", default='30.', help="minimum width allowed in km/s")
parser.add_argument('--wmax', action="store", dest="wmax", default='250.', help="maximum width allowed in km/s")
parser.add_argument('--dfit', action="store", dest="dfit", default='100.', help="interval step for fitting the line position in km/s. Large values speed up the computation but could miss the true position")
parser.add_argument('--degcont', action="store", dest="degcont", default='0', help="degree of the polynomial used to fit the continuum")
parser.add_argument('--sclip', action="store", dest="sclip", default='10', help="sigma clipping threshold (sclip * sigma) to clean the cube")
parser.add_argument('--xyclip', action="store", dest="xyclip", default='3', help="size of the local box for the sigma-clipping (in pixels)")
parser.add_argument('--nclip', action="store", dest="nclip", default='3', help="number of passes for the sigma-clipping")
parser.add_argument('--wsmooth', action="store", dest="wsmooth", default='0', help="spectral smooth method")
parser.add_argument('--ssmooth', action="store", dest="ssmooth", default='2.', help="Gaussian spatial smooth FWHM in pixels")
try:
options = parser.parse_args()
except:
......@@ -262,8 +277,17 @@ def main(argv):
if opts['varfile'] is None:
opts['varfile'] = opts['cubefile']
create_config(opts['pathb'], opts['cubefile'], opts['varfile'], opts['catfile'], opts['lines'], opts['suffixeout'], dxy=int(opts['dxy']), dv=float(opts['dv']))
#create_config(opts['pathb'], opts['cubefile'], opts['varfile'], opts['catfile'], opts['lines'], opts['suffixeout'], dv=float(opts['dv']), dxy=int(opts['dxy']))
create_config(opts['pathb'], opts['cubefile'], opts['varfile'], opts['catfile'], opts['lines'], opts['suffixeout'],
commonw=(opts['commonw'] == 'True'), dv=float(opts['dv']), dxy=int(opts['dxy']),
initw=float(opts['initw']), wmin=float(opts['wmin']), wmax=float(opts['wmax']),
dfit=float(opts['dfit']), degcont=int(opts['degcont']),
sclip=int(opts['sclip']), xyclip=int(opts['xyclip']), nclip=int(opts['nclip']),
wsmooth=int(opts['wsmooth']), ssmooth=float(opts['ssmooth'])
)
# Faire un REDMIN, REDMAX (VELMIN/VELMAX, VLOTH/VUPTH, ...) pour les pixels spectraux à considérer autours des raies et utiliser un VMIN, VMAX ou DV pour les bornes du fit. Du coup, y aurait plus besoin de faire la conversion DV -> Redmin, Redmax dans create_config.
#Eventuellement faire une condition dans CAMEL: si on a qu'un des deux paramètres (REDMIN/REDMAX ou VMIN/VMAX ou peu importe le choix de nom final) faire une condition telle qu'actuellement
if __name__ == "__main__":
main(sys.argv[1:])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment