#!/usr/bin/env bash 

###################################################################
#Author         : Joaquín M.C. Belart
#Email          : joaquin@lmi.is
###################################################################

source ~/shgen/lasfunciones.sh
do_stuff="y"

main()
{
	if [ "$do_stuff" == "y" ] ; then
        echo "..."
        base=faf_oct23_5x5m_isn93_zmasl_water-100.tif
        dem1=/u01/jmcb/0ap/phaseone/20240930/20240930_Reykjanes_DEM_2m_ISN93_zmasl.tif
        #dem_align.py -res max -tiltcor -polyorder 5 $base $dem1 -outdir dem1_align
        #dem_mosaic --tr 5 --t_srs "${isn93}" --priority-blending-length 30 -o rkns_oct2024_5m_isn93_dem *tiltcorr/*align_clp.tif $base
        
        gdalparam='-overwrite -r cubic -tr 5 5 -dstnodata 0 -t_srs EPSG:3057 -te 313995 367995 357005 404005 -co compress=lzw -co predictor=2'
        #gdalwarp $gdalparam rkns_oct2024_5m_isn93_dem-tile-0.tif rkns_oct2024_5m_isn93_dem.tif
        gdal_translate -of AAIGrid rkns_oct2024_5m_isn93_dem.tif rkns_oct2024_5m_isn93_dem.asc
    fi
}

main
