0

This question already has an answer here:

i work with EVI MODIS and i need to stack all raster i had using python but i don't know how

i'm using this backag and script to read my rasters

    import os
    import glob
    from osgeo import gdal
    import numpy as np
    import matplotlib.pyplot as plt
    import scipy.ndimage
    import pandas as pd
    import datetime as dt
    import rasterio as rio


    #repertoire de travail 

    inDir = r'D:\MODIS\Doy2000/'
    os.chdir(inDir)  
    #repertoir sorti 

    outDir = os.path.normpath(os.path.split(inDir)[0] + os.sep + 'output') + '\\' 
    if not os.path.exists(outDir): os.makedirs(outDir)

    # Create list of MODIS rasters for surface reflectance
    modis_EVI = glob.glob('MOD13Q1.006__250m_16_days_EVI_**.tif')

modis_EVI
Out[32]: 
['MOD13Q1.006__250m_16_days_EVI_doy2000209_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000225_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000241_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000257_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000273_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000289_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000305_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000321_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000337_aid0001.tif',
 'MOD13Q1.006__250m_16_days_EVI_doy2000353_aid0001.tif']

but idon't know how stack all my raster in python need help i'm very new in python

marked as duplicate by Aaron Dec 31 '18 at 20:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.