AOT-biomaps 2.9.377__py3-none-any.whl → 2.9.378__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AOT_biomaps/AOT_Acoustic/_mainAcoustic.py +41 -22
- AOT_biomaps/__init__.py +2 -1
- {aot_biomaps-2.9.377.dist-info → aot_biomaps-2.9.378.dist-info}/METADATA +1 -1
- {aot_biomaps-2.9.377.dist-info → aot_biomaps-2.9.378.dist-info}/RECORD +6 -6
- {aot_biomaps-2.9.377.dist-info → aot_biomaps-2.9.378.dist-info}/WHEEL +0 -0
- {aot_biomaps-2.9.377.dist-info → aot_biomaps-2.9.378.dist-info}/top_level.txt +0 -0
|
@@ -513,7 +513,7 @@ class AcousticField(ABC):
|
|
|
513
513
|
dx = self.params['dx']
|
|
514
514
|
air_margin = 20
|
|
515
515
|
if dx >= self.params['element_width']:
|
|
516
|
-
dx = self.params['element_width']
|
|
516
|
+
dx = self.params['element_width']/2
|
|
517
517
|
if self.params['width_phantom'] is not None:
|
|
518
518
|
pva_nx = int(np.round((self.params['width_phantom'])/dx))
|
|
519
519
|
Nx = pva_nx + 2 * air_margin
|
|
@@ -530,29 +530,46 @@ class AcousticField(ABC):
|
|
|
530
530
|
else:
|
|
531
531
|
Nx = int(round((self.params['Xrange'][1] - self.params['Xrange'][0]) / self.params['dx']))
|
|
532
532
|
if self.params['height_phantom'] is not None:
|
|
533
|
-
Nz = int(np.round((self.params['height_phantom'])/self.params['
|
|
533
|
+
Nz = int(np.round((self.params['height_phantom'])/self.params['dx']))
|
|
534
534
|
else:
|
|
535
|
-
Nz = int(round((self.params['Zrange'][1] - self.params['Zrange'][0]) / self.params['
|
|
536
|
-
|
|
535
|
+
Nz = int(round((self.params['Zrange'][1] - self.params['Zrange'][0]) / self.params['dx']))
|
|
536
|
+
|
|
537
|
+
Nx_final = int(round((self.params['Xrange'][1] - self.params['Xrange'][0]) / self.params['dx']))
|
|
538
|
+
Nz_final = int(round((self.params['Zrange'][1] - self.params['Zrange'][0]) / self.params['dx']))
|
|
537
539
|
# --- 2. Time and space factors ---
|
|
538
540
|
factorT = int(np.ceil(self.params['f_AQ'] / self.params['f_saving']))
|
|
539
|
-
factorX = int(np.ceil(
|
|
540
|
-
factorZ =
|
|
541
|
+
factorX = int(np.ceil(self.params['dx'] / dx))
|
|
542
|
+
factorZ = factorX
|
|
541
543
|
|
|
542
544
|
# --- 3. Grid and source initialization ---
|
|
543
545
|
kgrid = kWaveGrid([Nx, Nz], [dx, dx])
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
546
|
+
|
|
547
|
+
# --- CORRECTIF : Définition du Medium avec hétérogénéité ---
|
|
548
|
+
# Initialisation en float32 (essentiel pour GPU)
|
|
549
|
+
c_map = np.full((Nx, Nz), 343.0, dtype=np.float32) # Air par défaut
|
|
550
|
+
rho_map = np.full((Nx, Nz), 1.2, dtype=np.float32)
|
|
551
|
+
|
|
552
|
+
# Insertion du bloc de PVA
|
|
553
|
+
x_start = air_margin
|
|
554
|
+
x_end = air_margin + pva_nx
|
|
555
|
+
c_map[x_start:x_end, :] = self.params['c0']
|
|
556
|
+
rho_map[x_start:x_end, :] = self.params.get('density', 1000.0)
|
|
557
|
+
|
|
558
|
+
medium = kWaveMedium(sound_speed=c_map, density=rho_map)
|
|
559
|
+
|
|
560
|
+
# --- CORRECTIF : Recalcul du pas de temps (CFL) ---
|
|
561
|
+
# k-Wave a besoin d'un dt basé sur la vitesse MAXIMALE (1540 m/s)
|
|
562
|
+
c_mean = np.mean(c_map[:, 0]) # mean speed at z=0
|
|
563
|
+
c_max = np.max(c_map)
|
|
564
|
+
cfl = 0.3 # Valeur de sécurité
|
|
565
|
+
dt = cfl * dx / c_max
|
|
566
|
+
kgrid.setTime(self.kgrid.Nt, dt)
|
|
552
567
|
|
|
553
568
|
|
|
554
569
|
source = kSource()
|
|
555
570
|
source.p_mask = np.zeros((Nx, Nz))
|
|
571
|
+
# Appel à la méthode spécialisée
|
|
572
|
+
self._SetUpSource(self,source, Nx, dt, dx, c_mean,factorT) # factorT=1 pour simplifier
|
|
556
573
|
|
|
557
574
|
# --- 4. Sensor setup ---
|
|
558
575
|
sensor = kSensor()
|
|
@@ -564,11 +581,14 @@ class AcousticField(ABC):
|
|
|
564
581
|
# --- 7. Simulation options ---
|
|
565
582
|
simulation_options = SimulationOptions(
|
|
566
583
|
pml_inside=False, # PML ajoutée autour de la grille Air+PVA
|
|
567
|
-
pml_size=[
|
|
584
|
+
pml_size=[1, pml_size],
|
|
568
585
|
use_sg=False,
|
|
569
586
|
save_to_disk=True,
|
|
570
587
|
input_filename=os.path.join(gettempdir(), "KwaveIN.h5"),
|
|
571
|
-
output_filename=os.path.join(gettempdir(), "KwaveOUT.h5")
|
|
588
|
+
output_filename=os.path.join(gettempdir(), "KwaveOUT.h5"),
|
|
589
|
+
smooth_c0 = True,
|
|
590
|
+
smooth_rho0 = True,
|
|
591
|
+
smooth_p0 = True
|
|
572
592
|
)
|
|
573
593
|
|
|
574
594
|
execution_options = SimulationExecutionOptions(
|
|
@@ -577,9 +597,6 @@ class AcousticField(ABC):
|
|
|
577
597
|
show_sim_log=show_log
|
|
578
598
|
)
|
|
579
599
|
|
|
580
|
-
# --- 7. Call specialized function to set up source.p_mask and source.p ---
|
|
581
|
-
self._SetUpSource(source, Nx, dx, factorT)
|
|
582
|
-
|
|
583
600
|
# --- 8. Run simulation ---
|
|
584
601
|
sensor_data = kspaceFirstOrder2D(
|
|
585
602
|
kgrid=kgrid,
|
|
@@ -592,16 +609,18 @@ class AcousticField(ABC):
|
|
|
592
609
|
|
|
593
610
|
# --- 9. Post-process results ---
|
|
594
611
|
data = sensor_data['p'].reshape(kgrid.Nt, Nz, Nx)
|
|
595
|
-
|
|
596
612
|
if factorT != 1 or factorX != 1 or factorZ != 1:
|
|
597
|
-
|
|
613
|
+
data = reshape_field(data, [factorT, factorX, factorZ])
|
|
614
|
+
xStart = (Nx//2)//factorX - (Nx_final//2)
|
|
615
|
+
return data[:, :Nz_final, xStart:xStart+Nx_final]
|
|
598
616
|
else:
|
|
599
|
-
return data
|
|
617
|
+
return data[:, :Nz_final, xStart:xStart+Nx_final]
|
|
600
618
|
|
|
601
619
|
except Exception as e:
|
|
602
620
|
print(f"Error generating 2D acoustic field: {e}")
|
|
603
621
|
return None
|
|
604
622
|
|
|
623
|
+
|
|
605
624
|
def _generate_acoustic_field_KWAVE_3D(self, isGPU=True, show_log=True):
|
|
606
625
|
"""
|
|
607
626
|
Generate a 3D acoustic field using k-Wave.
|
AOT_biomaps/__init__.py
CHANGED
|
@@ -85,7 +85,7 @@ from .AOT_Recon.AOT_PotentialFunctions.RelativeDifferences import *
|
|
|
85
85
|
from .Config import config
|
|
86
86
|
from .Settings import *
|
|
87
87
|
|
|
88
|
-
__version__ = '2.9.
|
|
88
|
+
__version__ = '2.9.378'
|
|
89
89
|
__process__ = config.get_process()
|
|
90
90
|
|
|
91
91
|
def initialize(process=None):
|
|
@@ -239,5 +239,6 @@ def initialize(process=None):
|
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
|
|
242
|
+
|
|
242
243
|
|
|
243
244
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
AOT_biomaps/Config.py,sha256=ghEOP1n8aO1pR-su13wMeAZAxZRfry5hH67NbtZ8SqI,3614
|
|
2
2
|
AOT_biomaps/Settings.py,sha256=v8fPhnvvcfBJP29m1RLOTEr3jndGLGwbUiORXmsj2Bo,2853
|
|
3
|
-
AOT_biomaps/__init__.py,sha256=
|
|
3
|
+
AOT_biomaps/__init__.py,sha256=S_KfEFZ_eCoqy0gfMeQgnrb9rnTBdwdU8Q_avyhpNLI,4418
|
|
4
4
|
AOT_biomaps/AOT_Acoustic/AcousticEnums.py,sha256=s5kXa6jKzbS4btwbubrVcynLOr0yg5tth5vL_FGfbMk,1802
|
|
5
5
|
AOT_biomaps/AOT_Acoustic/AcousticTools.py,sha256=7kuWIIGyzZPQrzRI0zVvdwNUp7qKUE67yCYOMzSb0Ug,8283
|
|
6
6
|
AOT_biomaps/AOT_Acoustic/FocusedWave.py,sha256=3kGKKDx_3Msy5COYqIwzROPORGWvNjw8UsDanBfkMXE,11037
|
|
@@ -8,7 +8,7 @@ AOT_biomaps/AOT_Acoustic/IrregularWave.py,sha256=yZhtxkR6zlciRcEpdTR0BAhvgQl40XH
|
|
|
8
8
|
AOT_biomaps/AOT_Acoustic/PlaneWave.py,sha256=xza-rj5AUWDecLkGDxRcULrwZVWeBvGnEP2d51TyR04,1447
|
|
9
9
|
AOT_biomaps/AOT_Acoustic/StructuredWave.py,sha256=CpmvyHmwVvYuGhC1bL6VDQERC70gDQNgIdKNZI22Zpw,18978
|
|
10
10
|
AOT_biomaps/AOT_Acoustic/__init__.py,sha256=t9M2rRqa_L9pk7W2FeELTkHEMuP4DBr4gBRldMqsQbg,491
|
|
11
|
-
AOT_biomaps/AOT_Acoustic/_mainAcoustic.py,sha256=
|
|
11
|
+
AOT_biomaps/AOT_Acoustic/_mainAcoustic.py,sha256=tGsCSJXrGs25M0IWf6qRKniQ1KAgU3fAHi-n48prDFw,47696
|
|
12
12
|
AOT_biomaps/AOT_Experiment/ExperimentTools.py,sha256=aFvJw6J_jfFVTDFnG7J3a61SHEgORdZKZS0UI82VMaY,2637
|
|
13
13
|
AOT_biomaps/AOT_Experiment/Focus.py,sha256=B2nBawmv-NG2AWJx9zgQ8GlN6aFB9FwTSqX-M-phKXg,3193
|
|
14
14
|
AOT_biomaps/AOT_Experiment/Tomography.py,sha256=9mJDwV9WVphoX8drL7MgN3WhS6fjYwS6HWQD3x1CrVs,37625
|
|
@@ -42,7 +42,7 @@ AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/__init__.py,sha256=RwrJdLOFbAFBFnRx
|
|
|
42
42
|
AOT_biomaps/AOT_Recon/AOT_SparseSMatrix/SparseSMatrix_CSR.py,sha256=RACc2P5oxmp0uPLAGnNj9mEtAxa_OlepNgCawKij3jI,12062
|
|
43
43
|
AOT_biomaps/AOT_Recon/AOT_SparseSMatrix/SparseSMatrix_SELL.py,sha256=ti3dZQsb_Uu62C7Bn65Z-yf-R5NKCFsmnBT5GlLd_HY,15138
|
|
44
44
|
AOT_biomaps/AOT_Recon/AOT_SparseSMatrix/__init__.py,sha256=8nou-hqjQjuCTLhoL5qv4EM_lMPFviAZAZKSPhi84jE,67
|
|
45
|
-
aot_biomaps-2.9.
|
|
46
|
-
aot_biomaps-2.9.
|
|
47
|
-
aot_biomaps-2.9.
|
|
48
|
-
aot_biomaps-2.9.
|
|
45
|
+
aot_biomaps-2.9.378.dist-info/METADATA,sha256=y50KhGuRlcPegJxI1-vSusy6byZECPWGUDpsACtCNDI,700
|
|
46
|
+
aot_biomaps-2.9.378.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
aot_biomaps-2.9.378.dist-info/top_level.txt,sha256=6STF-lT4kaAnBHJYCripmN5mZABoHjMuY689JdiDphk,12
|
|
48
|
+
aot_biomaps-2.9.378.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|