Skip to content

Commit

Permalink
Merge pull request #154 from revoltek/hedler_fix_tecrm
Browse files Browse the repository at this point in the history
faraday and tec fixes
  • Loading branch information
revoltek authored May 5, 2024
2 parents 931d9d8 + a04d07c commit d3b1f3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions losoto/operations/_faraday_timestep.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ def _run_timestep(t,coord_rr,coord_ll,weights,vals,solType,coord,maxResidual):
wav = c/freq

#fitresultrm_wav, success = scipy.optimize.leastsq(rmwavcomplex, [fitrmguess], args=(wav, phase_diff))
ranges = slice(-0.1, 0.1, 2e-4)
fitresultrm_wav = scipy.optimize.brute(costfunctionRM, (ranges,), finish=scipy.optimize.leastsq, args=(wav, phase_diff))

ranges = slice(-0.5, 0.5, 2e-4) # large range is necessary for IS observations, but slows things down.
fitresultrm_wav = scipy.optimize.brute(costfunctionRM, (ranges,), finish=scipy.optimize.leastsq, args=(wav, phase_diff))
# fractional residual
residual = np.nanmean(np.abs(np.mod((2.*fitresultrm_wav*wav*wav)-phase_diff + np.pi, 2.*np.pi) - np.pi))
if maxResidual == 0 or residual < maxResidual:
Expand Down
3 changes: 3 additions & 0 deletions losoto/operations/_fitClockTEC.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,9 @@ def doFit(
nF = data.shape[1]
nSt = data.shape[2]

# mask where data is NaN
data.mask = np.logical_or(data.mask,np.isnan(data))

if npol == 4:
data = data[:, :, :, (0, 3)]
npol = 2
Expand Down

0 comments on commit d3b1f3b

Please sign in to comment.