<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#ffffff">
<font face="Courier New, Courier, monospace">Dear gdal-gurus,<br>
<br>
Trying to use<b> gdal_calc</b> to do the same calculation for tow
366 band (daily data) files and store it in a *.nc file with the
same dimensions as the input files. <br>
<br>
This works OK (output to 366 tiff files):<br>
<font color="#0000ff">for i in {1..366} # One band per day output
to tif<br>
do<br>
gdal_calc.py --calc="exp( (17.625*D) /(243.04+D) ) / exp(
(17.625*T)/(243.04+T) ) * 100" --outfile=Rh_2020_day$i.tif -D
DPTa_dayavg_C_2020.nc -T Ta_dayavg_C_2020.nc --D_band=$i
--T_band=$i<br>
done</font><br>
<br>
<br>
This do not work (output to one netcdf file):<br>
<font color="#0000ff">for i in {1..366} # One band per day output
to tif<br>
do<br>
gdal_calc.py --calc="exp( (17.625*D) /(243.04+D) ) / exp(
(17.625*T)/(243.04+T) ) * 100" --outfile=Rh_2020.nc -D
DPTa_dayavg_C_2020.nc -T Ta_dayavg_C_2020.nc --D_band=$i
--T_band=$i<br>
done<br>
<br>
<font color="#000000">yields:<br>
Error! Output exists, but is the wrong geotransform. Use the
--overwrite option to automatically overwrite the existing
file<br>
Error! Output exists, but is the wrong geotransform. Use the
--overwrite option to automatically overwrite the existing
file<br>
</font><br>
<font color="#000000">Any suggestions how to make the output
into a 366-band netcdf file?</font><br>
</font></font>
<pre class="moz-signature" cols="72"><font face="Courier New, Courier, monospace">using on Cygwin:
gdalinfo.exe --version
GDAL 3.5.1, released 2022/06/30
Regards
/Jonas, Lund University, Sweden
</font></pre>
</body>
</html>