Calculations/Dipolar-Gas-Simulator/Results/Data_3D/GradientDescent/IdentifyMissingFiles.ps1

41 lines
1.5 KiB
PowerShell

$root = "C:\Users\Karthik\Documents\GitRepositories\Calculations\Dipolar-Gas-Simulator\Results\Data_3D\GradientDescent\Phi030"
# Define parameter ranges
$SCATTERING_LENGTH_RANGE = @(79.0..90.0)
$POLAR_ANGLE_RANGE = @(30.0)
$AZIMUTHAL_ANGLE_RANGE = @(0.0)
$NUM_ATOMS_LIST = @(50000, 55000, 60000, 65000, 70000, 75000, 80000, 85000, 90000, 95000, 100000, 105000)
# Utility function to format floating point values as zero-padded 3-digit integers
function Format-Value($value) {
return "{0:D3}" -f [int]($value * 1)
}
# Generate all valid folder names
$expectedFolders = @()
foreach ($aS in $SCATTERING_LENGTH_RANGE) {
$aS_str = Format-Value $aS
foreach ($theta in $POLAR_ANGLE_RANGE) {
$theta_str = Format-Value $theta
foreach ($phi in $AZIMUTHAL_ANGLE_RANGE) {
$phi_str = Format-Value $phi
foreach ($N in $NUM_ATOMS_LIST) {
$folderName = "aS_${aS_str}_theta_${theta_str}_phi_${phi_str}_N_${N}"
$expectedFolders += $folderName
}
}
}
}
# Get actual folders in the root directory
$actualFolders = Get-ChildItem -Path $root -Directory -Force | Select-Object -ExpandProperty Name
# Compare and find missing folders
$missingFolders = $expectedFolders | Where-Object { $_ -notin $actualFolders }
# Output missing folders
Write-Host "Missing folders:"
$missingFolders | ForEach-Object { Write-Host $_ }
# Optional: Save to a file
$missingFolders | Out-File -FilePath "$root\missing_folders.txt" -Encoding UTF8