Commit 896575bd authored by bepinat's avatar bepinat

add ratio constraints for extra lines

parent 4a199cef
......@@ -125,9 +125,8 @@ def readconfig(filename, config):
value = value
if (key == 'EXTRAL') & (value is not None):
if count_extral == 0:
conf[key] = np.array([value])
else:
conf[key] = np.append(conf[key], value)
conf[key] = list()
conf[key].append([value])
count_extral += 1
else:
conf[key] = value
......@@ -681,7 +680,21 @@ def buildmaps(conf, cube, hdr, var=None, plot=False, debug=False, free_ratio=Fal
if conf['EXTRAL'] is not None:
for i in np.arange(np.shape(conf['EXTRAL'])[0]):
els.append(line('EXTRAL%i'%(i+1), conf['EXTRAL'][i], fit=True))
if np.shape(conf['EXTRAL'][i])[0] == 1:
print(1)
els.append(line('EXTRAL%i'%(i+1), float(conf['EXTRAL'][i][0]), fit=True))
if np.shape(conf['EXTRAL'][i])[0] == 2:
print(2)
els.append(line('EXTRAL%i'%(i+1), float(conf['EXTRAL'][i][0]), fit=True, ref=conf['EXTRAL'][i][1]))
if np.shape(conf['EXTRAL'][i])[0] == 3:
print(3)
els.append(line('EXTRAL%i'%(i+1), float(conf['EXTRAL'][i][0]), fit=True, ref=conf['EXTRAL'][i][1], th=float(conf['EXTRAL'][i][2])))
if np.shape(conf['EXTRAL'][i])[0] == 4:
print(4)
els.append(line('EXTRAL%i'%(i+1), float(conf['EXTRAL'][i][0]), fit=True, ref=conf['EXTRAL'][i][1], th=float(conf['EXTRAL'][i][2]), low=float(conf['EXTRAL'][i][3])))
if np.shape(conf['EXTRAL'][i])[0] == 5:
print(5)
els.append(line('EXTRAL%i'%(i+1), float(conf['EXTRAL'][i][0]), fit=True, ref=conf['EXTRAL'][i][1], th=float(conf['EXTRAL'][i][2]), low=float(conf['EXTRAL'][i][3]), up=float(conf['EXTRAL'][i][4])))
#Construction of wavelength index
wave0, lconvfac, sclp = waveindgen(hdr) # wavelength array in Angstrom and convertion factor
......@@ -1295,7 +1308,8 @@ def main(argv):
parser.add_argument('--HEI5876', action="store_true", dest="HeI5876", default=None, help="keyword to fit HeI@5876 line")
parser.add_argument('--HEII4686', action="store_true", dest="HeII4686", default=None, help="keyword to fit HeII@4686 line")
parser.add_argument('--NEIII3868', action="store_true", dest="NeIII3868", default=None, help="keyword to fit NeIII@3868 line")
parser.add_argument('--EXTRAL', action="append", dest="EXTRAL", default=None, type=float, help="keyword to add a new line (wavelength in angstrom) - multiple extra wavelengths can be added")
#parser.add_argument('--EXTRAL', action="append", dest="EXTRAL", default=None, type=float, help="keyword to add a new line (wavelength in angstrom) - multiple extra wavelengths can be added")
parser.add_argument('--EXTRAL', action="append", nargs='*', default=None, help="keyword to add a new line. Can be provided, in this order: wavelength in Angstroms, reference line, theoretical, lower and upper ratios - multiple extra wavelengths can be added")
parser.add_argument('--COMMW', action="store_true", dest="COMMW", default=None, help="keyword to fix common widths (in velocity) between several fitted lines")
parser.add_argument('--REDSHIFT', action="store", dest="REDSHIFT", default=None, type=float, help="mean redshift of the object")
parser.add_argument('--REDMIN', action="store", dest="REDMIN", default=None, type=float, help="minimum redshift allowed for fitting")
......
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