correctNan.php
780 Bytes
<?php
define("AMDA_INTERNAL_METADATA",getenv("AMDAINTERNALDIR"));
$info = new DomDocument("1.0");
// $infoName = $argv[1];
$pattern = "info_psp_om*.xml";
foreach (glob(AMDA_INTERNAL_METADATA."/PARAM_INFO_PREDEFINED/".$pattern) as $infoName) {
$info->load($infoName);
$dimensions = $info->getElementsByTagName("dimensions")->item(0);
$dim_1 = $dimensions->getAttribute("dim_1");
$channels = $info->getElementsByTagName("channel");
if ($dim_1 != $channels->length) {
$dimensions->setAttribute("dim_1", $channels->length);
echo $infoName.PHP_EOL;
echo $dim_1." ".$channels->length.PHP_EOL;
}
$info->save($infoName);
}
?>