Satellite-based drought monitoring and warning system in Viet_Nam


$d_arr[$j]\n"; } closedir($handle); } } else if ( !$dd && !$mmm && $yyyy ) { $i = 0; $dir = $dir."/".$yyyy; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if (ereg("^[A-Z,a-z]{3}$", $file)) { $d_arr[$i] = $file; $i++; } } sort ($d_arr); reset ($d_arr); for ( $j = 0; $j < $i; $j++ ) { echo "
  • $d_arr[$j] $yyyy\n"; } closedir($handle); } } else if ( !$dd && $mmm && $yyyy ) { $i = 0; $dir = $dir."/".$yyyy."/".$mmm."/map"; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if (ereg("ANM([0-9]{4})([0-9]{2})([0-9]{2})_Viet_Nam\.jpg", $file)) { $d_arr[$i] = $file; $i++; } } sort ($d_arr); reset ($d_arr); for ( $j = 0; $j < $i; $j++ ) { if (ereg("ANM([0-9]{4})([0-9]{2})([0-9]{2})_Viet_Nam\.jpg", $d_arr[$j], $regs)) { //$area = exec("/bin/cat $yyyy/$mmm/met/ANM${yyyy}${mm}${dd}_Viet_Nam.txt | /bin/awk 'BEGIN{n=0}{n += $2}END{print n}'"); echo "
  • $mmm $regs[3], $regs[1]\n"; } } closedir($handle); } } else if ( $dd && $mmm && $yyyy ) { ereg("ANM([0-9]{4})([0-9]{2})([0-9]{2})_Viet_Nam\.jpg", $jpg, $regs); //$area = exec("/bin/echo $yyyy/$mmm/met/ANM${yyyy}$regs[2]${dd}_Viet_Nam.txt | /bin/awk 'BEGIN{n=0}{n += $2}END{print n}'"); echo "
    "; echo "
    Date"; echo "
    $mmm $dd, $yyyy"; echo "
    Drought warning statistics"; echo "
      "; $filename = "$yyyy/$mmm/met/EWNG$regs[1]$regs[2]$regs[3]_Viet_Nam.txt"; if ( filesize($filename) == 0 ) { echo "
    • No drought is found."; } else { $fpi = fopen($filename, "r"); while (!feof ($fpi)){ $contents[] = fgets($fpi, filesize($filename)); } fclose($fpi); for($i = 0; $i < count($contents)-1; $i++){ list ($location[$i], $area[$i]) = split(" ", $contents[$i]); echo "
    • $location[$i], $area[$i] (km2)"; } } echo "
    "; echo "
    Geotiff file"; echo "
    ANM$regs[1]$regs[2]$regs[3]_Viet_Nam.geotiff\n"; echo "
    GSMaP$regs[1]$regs[2]$regs[3]_Viet_Nam.geotiff\n"; echo "
    KBDI$regs[1]$regs[2]$regs[3]_Viet_Nam.geotiff\n"; echo "
    Quicklook image"; echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; closedir($handle); echo "
    "; } ?>
    Satellite-based drought monitoring and warning system in Viet Nam Developer: Dr. Wataru Takeuchi
    E-mail: wataru@iis.u-tokyo.ac.jp