Although Step 5 of field 1 succeeded in the test case, field 2 won't go alike! 😅 The log says that you must set the parameter bound of NordicARC.uvmultifit.
uvmultifit - INFO - started
measurement - INFO - number of antennas = 47
measurement - INFO - You selected to apply primary-beam correction.
PLEASE, remember that the beam is being approximated
with a Gaussian, so it may not be very accuracte far
from the pointing direction.
measurement - INFO - an antenna diameter of 12.000m will be applied
measurement - INFO - spectral index #0 (1 of 1)
measurement - INFO - reading scans for spw 0
measurement - INFO - reading scan #5 (1 of 2), field: 0
measurement - INFO - reading scan #8 (2 of 2), field: 0
measurement - INFO - reading took 0.11 seconds
measurement - INFO - there are 10 integrations (10350 visibs.) in spw 0
modeler - INFO - UVMultiFit compiled model(s) do not seem to exist yet.
modeler - INFO - going to compile models
modeler - INFO - executing: 'self.varfunc[0] = lambda p, nu: [0,0,p[0]]'
modeler - INFO - executing: 'self.compiledScaleFixed = lambda p, nu: 1.0 + 0.0'
modeler - INFO - going to run setModel
modeler - INFO - now fitting model
modeler - INFO - continuum mode fit
modeler - INFO - iteration #1: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #2: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #3: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #4: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #5: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #6: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #7: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #8: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #9: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #10: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #11: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #12: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #13: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #14: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #15: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #16: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #17: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #18: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #19: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #20: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #21: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #22: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #23: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #24: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #25: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #26: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #27: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #28: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #29: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #30: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #31: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #32: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #33: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #34: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #35: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #36: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #37: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #38: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #39: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #40: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #41: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #42: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #43: achieved ChiSq: 8.59808494e+06
modeler - INFO - iteration #44: achieved ChiSq: 8.59808494e+06
modeler - INFO - number of visibilities (deg.of freedom): 10350.0
modeler - INFO - the reduced Chi Squared will be set to 1 by re-scaling the visibility weights.
modeler - INFO - fit took 0.72 seconds
uvmultifit - INFO - fit done!
measurement - WARNING - writing to mosaics is experimental and may not work!
measurement - INFO - doing 'calibrated/uid___A002_Xd68367_X9885.ms.split.J2146-1525.spw_19.avg': spw 0, scan_id 5
measurement - INFO - doing 'calibrated/uid___A002_Xd68367_X9885.ms.split.J2146-1525.spw_19.avg': spw 0, scan_id 8
measurement - INFO - CORRECTED_DATA written successfully
uvmultifit - INFO - started
measurement - INFO - number of antennas = 47
measurement - INFO - You selected to apply primary-beam correction.
PLEASE, remember that the beam is being approximated
with a Gaussian, so it may not be very accuracte far
from the pointing direction.
measurement - INFO - an antenna diameter of 12.000m will be applied
measurement - INFO - spectral index #0 (1 of 1)
measurement - INFO - reading scans for spw 0
measurement - INFO - reading scan #5 (1 of 2), field: 0
measurement - INFO - reading scan #8 (2 of 2), field: 0
measurement - INFO - reading took 0.11 seconds
measurement - INFO - there are 10 integrations (10350 visibs.) in spw 0
modeler - INFO - UVMultiFit compiled model(s) do not seem to exist yet.
modeler - INFO - going to compile models
modeler - INFO - executing: 'self.varfunc[0] = lambda p, nu: [0,0,p[0]]'
modeler - INFO - executing: 'self.compiledScaleFixed = lambda p, nu: 1.0 + 0.0'
modeler - INFO - going to run setModel
modeler - INFO - now fitting model
modeler - INFO - continuum mode fit
modeler - INFO - iteration #1: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #2: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #3: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #4: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #5: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #6: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #7: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #8: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #9: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #10: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #11: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #12: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #13: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #14: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #15: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #16: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #17: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #18: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #19: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #20: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #21: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #22: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #23: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #24: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #25: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #26: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #27: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #28: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #29: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #30: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #31: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #32: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #33: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #34: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #35: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #36: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #37: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #38: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #39: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #40: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #41: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #42: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #43: achieved ChiSq: 8.60543791e+06
modeler - INFO - iteration #44: achieved ChiSq: 8.60543791e+06
modeler - INFO - number of visibilities (deg.of freedom): 10350.0
modeler - INFO - the reduced Chi Squared will be set to 1 by re-scaling the visibility weights.
modeler - INFO - fit took 0.79 seconds
uvmultifit - INFO - fit done!
measurement - WARNING - writing to mosaics is experimental and may not work!
measurement - INFO - doing 'calibrated/uid___A002_Xd68367_X9885.ms.split.J2146-1525.spw_19.avg': spw 0, scan_id 5
measurement - INFO - doing 'calibrated/uid___A002_Xd68367_X9885.ms.split.J2146-1525.spw_19.avg': spw 0, scan_id 8
measurement - INFO - CORRECTED_DATA written successfully
2024-11-20 13:16:09 WARN calibrater::setvi(bool,bool) Forcing use of OLD VisibilityIterator.
uvmultifit - INFO - started
measurement - INFO - number of antennas = 47
measurement - INFO - You selected to apply primary-beam correction.
PLEASE, remember that the beam is being approximated
with a Gaussian, so it may not be very accuracte far
from the pointing direction.
measurement - INFO - an antenna diameter of 12.000m will be applied
measurement - INFO - spectral index #0 (1 of 1)
measurement - INFO - reading scans for spw 0
measurement - INFO - reading scan #5 (1 of 2), field: 0
measurement - INFO - reading scan #8 (2 of 2), field: 0
measurement - INFO - reading took 0.21 seconds
measurement - INFO - there are 10 integrations (10350 visibs.) in spw 0
modeler - INFO - UVMultiFit compiled model(s) do not seem to exist yet.
modeler - INFO - going to compile models
modeler - INFO - executing: 'self.varfunc[0] = lambda p, nu: [0,0,p[0]]'
modeler - INFO - executing: 'self.compiledScaleFixed = lambda p, nu: 1.0 + 0.0'
modeler - INFO - going to run setModel
modeler - INFO - now fitting model
modeler - INFO - fitting channel 1 of 128 in spw 0
Traceback (most recent call last):
File "/usr/local/casa/casa-6.6.1-17-pipeline-2024.1.0.8/lib/py/lib/python3.8/site-packages/casashell/private/init_system.py", line 233, in __evprop__
run_path( args[0], init_globals=exec_globals, run_name='__main__' )
File "/usr/local/casa/casa-6.6.1-17-pipeline-2024.1.0.8/lib/py/lib/python3.8/runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "/usr/local/casa/casa-6.6.1-17-pipeline-2024.1.0.8/lib/py/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/local/casa/casa-6.6.1-17-pipeline-2024.1.0.8/lib/py/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/akimsans/almaqso/test/script_test_analysis.py", line 13, in <module>
analysis(
File "/home/akimsans/almaqso/../almaqso/almaqso/analysis.py", line 29, in analysis
obj.uvfit_run(plot=True)
File "/home/akimsans/almaqso/../almaqso/almaqso/QSOanalysis.py", line 769, in uvfit_run
print('step5-3 (3)')
File "/home/akimsans/almaqso/../almaqso/almaqso/QSOanalysis.py", line 407, in uvfit_uvmultifit
myfit = uvm.uvmultifit(
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/uvmultifit.py", line 468, in uvmultifit
results = mdl.fit(ms, write_model_index, cov_return)
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/modeler.py", line 1365, in fit
fit = self._perform_fit(write_model)
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/modeler.py", line 1234, in _perform_fit
fitsimp = _mod_simplex(self.chi_square, self.p_ini,
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/simplex.py", line 100, in _mod_simplex
fsim[0] = func(x0)
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/simplex.py", line 48, in function_wrapper
return function(x, *args)
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/modeler.py", line 1016, in chi_square
return self.residuals(p_comp, mode=-2, dof=False)
File "/home/akimsans/.local/lib/python3.8/site-packages/NordicARC/modeler.py", line 980, in residuals
raise ValueError("Invalid Chi Square!"
ValueError: Invalid Chi Square!Maybe the current fitted value of flux (and/or size) is negative!Please, set BOUNDS to the fit!
Although Step 5 of field 1 succeeded in the test case, field 2 won't go alike! 😅 The log says that you must set the parameter
bound
ofNordicARC.uvmultifit
.