@@ -320,7 +320,6 @@ def noise(
320320 :param force: force definite-positive matrix with removal of negative eigen values
321321 :param control: control points (list of coords) for conditional simulations
322322 :param N: number of tracks to generate (returns track collection if N > 1)"""
323-
324323 if n == 1 :
325324 return __noise (track , sigma , kernel , distribution , mode , force , cycle , control , direction )
326325 else :
@@ -386,7 +385,7 @@ def __noise(
386385 # Zero-amplitude case
387386 if (sigma [ik ] == 0 ):
388387 continue
389-
388+
390389 # Building covariance matrix
391390 SIGMA_S = makeCovarianceMatrixFromKernel (kernel [ik ], noised_track , force = force , mode = mode , control = control )
392391 SIGMA_S += np .identity (SIGMA_S .shape [0 ]) * 1e-12
@@ -410,7 +409,7 @@ def __noise(
410409 Yy = np .matmul (L22 , __randomSampler (N , distribution )) + np .matmul (L12 , np .linalg .solve (L11 , Yc ))
411410 if (direction in [MODE_DIRECTION_Z , MODE_DIRECTION_YZ , MODE_DIRECTION_XZ , MODE_DIRECTION_XYZ , MODE_DIRECTION_ORTHO ]):
412411 Yz = np .matmul (L22 , __randomSampler (N , distribution )) + np .matmul (L12 , np .linalg .solve (L11 , Zc ))
413-
412+
414413 # Building noised track
415414 if (direction == MODE_DIRECTION_ORTHO ):
416415 for i in range (N - 1 ):
@@ -422,12 +421,18 @@ def __noise(
422421 else :
423422 for i in range (N ):
424423 noised_track .getObs (i ).position .translate (Yx [i ], Yy [i ], Yz [i ])
425-
424+
426425 if mode == 'circular' :
427426 noised_track .loop ()
428427
428+ # Cast to real float
429+ for p in noised_track :
430+ p .position .E = p .position .E .real
431+ p .position .N = p .position .N .real
432+ p .position .U = p .position .U .real
433+
429434 noised_track .removeAnalyticalFeature ("abs_curv" )
430-
435+
431436 return noised_track
432437
433438def randomizer (input , f , sigma = [7 ], kernel = [GaussianKernel (650 )], N = 10 ):
0 commit comments