2

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.

2
  • In what environment/software do run the script you provided here? Commented Apr 29, 2018 at 14:05
  • Please post it this type of questions in comment section of the original question.
    – neogeomat
    Commented Apr 29, 2018 at 14:08

1 Answer 1

5

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:

  1. Adjust the description name
  2. You need to replace the image dimension (samples and lines) with yours. To get it you can use

gdalinfo yourfile.bil

  1. 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.
  2. 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

18
  • This was asked above, but what software is this script run in?
    – Beck
    Commented 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.
    – user97103
    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"?
    – Beck
    Commented 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 Anaconda conda install -c conda-forge gdal
    – user97103
    Commented Jul 8, 2021 at 16:30
  • 1
    I 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.
    – user97103
    Commented Jul 23, 2021 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.