I processed MODIS MOD13Q1 NDVI times series (from 2000 to 2015) in Timesat. I specifically extracted start of season data and for each year (growth season) I was able to produce an image showing the SOS across my study area using the seas2img function. I was able to save these images as pictures but fail to understand how these images can be exported in a format that I will be able to use in ArcMAP in order to do further analyses. Please advise if this is at all possible and what process I need to follow to get it done.
1 Answer
You need to create the header file (*.hdr) for each TIMESAT binary output. You can follow my hdr file below.
ENVI
description = {C:\timesat32\compiled\Win64\indonesia_all_rice_2000_2001_eos_s1}
samples = 21863
lines = 7910
bands = 1
header offset = 0
file type = ENVI Standard
data type = 2
interleave = bsq
byte order = 0
map info = {Geographic Lat/Lon, 1, 1, 95.1525139304, 5.63277950899, 0.00209129, 0.00209129, WGS-84}
coordinate system string = {GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137, 298.257223563]],PRIMEM["Greenwich",0],UNIT["DEGREE",0.017453292519943295]]}
band names = {
Band 1}
And please make sure you are modified some information:
- Adjust the description name
- You need to replace the image dimension (samples and lines) with yours. To get it you can use
gdalinfo yourfile.bil
- You must know the top-left coordinate and the pixel size of your image, and replace "95.1525139304, 5.63277950899, 0.00209129, 0.00209129" with your data.
- If necessary you could also change the coordinate system.
After you got your hdr file, you can convert to GeoTIF using gdal
gdal_translate -of GTiff startofseason startofseason.tif
or if you want to convert all the data in the directory
for i in
find . -type f ! -name "*.hdr"
; do gdal_translate -of GTiff $i $i.tif; done
-
This was asked above, but what software is this script run in?– BeckCommented Jul 5, 2021 at 20:26
-
@Beck you need to install GDAL to run above script. I am using Mac, if you are using Windows then you need to adjust few syntax in last script. But if you use Windows Subsystem for Linux, you are good. Commented Jul 7, 2021 at 0:03
-
Which library do you load for it? (I'm quite new to coding, and a first timer for GDAL.) As well, by last script, do you mean
find . -type f ! -name "*.hdr"
?– BeckCommented Jul 7, 2021 at 13:23 -
1@Beck are you referring to GDAL? If yes, I install gdal on my Mac via Homebrew
brew install gdal
. In my windows machine, I prefer install gdal using Anacondaconda install -c conda-forge gdal
Commented Jul 8, 2021 at 16:30 -
1I just recheck again, seems your .hdr filename is different, then I renamed into 1315sos_season1.hdr and do
gdal_translate -of GTiff 1315sos_season1 1315sos_season1.tif
its worked and I assume your header file content is correct. Commented Jul 23, 2021 at 9:29