title: Index out of bounds error for raster data extraction code
body: <p>I am using a code written by Victor Velasquez to extract data from raster files which contain dayly precipitation data since 1981.
  When I run the code, I get this error that some index is out of bounds. I did a little research and found that this is common and there are a lot of similar questions here, but I haven´t been able to find the specific solution for this case.</p>
  <p>The error:</p>
  <pre><code>IndexError                                Traceback (most recent call last)
  &lt;ipython-input-8-eff66ef74d73&gt; in &lt;module&gt;
        1 Pisco = Extract_Pisco()
  ----&gt; 2 Pisco.DataPre()
        3 Pisco.ExportExcel()
  
  &lt;ipython-input-7-6cf99336b9e1&gt; in DataPre(self)
       23                 Band = Data.read(1)
       24                 X,Y  = Data.index(self.x,self.y) #extraigo
  ---&gt; 25                 Pre  = Band[X,Y]
       26                 self.ListPre.append(Pre) #agrego a lista
       27 
  
  IndexError: index 158116290 is out of bounds for axis 0 with size 198
  </code></pre>
  <p>The part of the code pointed by the traceback is:</p>
  <pre><code>    def DataPre(self):
              os.chdir(path) 
              fileDir= path
              fileExt = r&quot;.tif&quot; 
              Lis = [_ for _ in os.listdir(fileDir) if _.endswith(fileExt)]
              Lis.sort() #ordeno archivos .tif
              Inicio = '1981-01-01.tif' 
              Fin    = '2018-07-31.tif'  
              Rini = Lis.index(Inicio)
              Rend = Lis.index(Fin)
              self.Lis = Lis[Rini:Rend+1]
              self.ListPre = [] 
              for i in tnrange (0,len(self.Lis),desc = &quot;!! Extrayendo Datos !!&quot;):
                  with rasterio.open(self.Lis[i]) as Data:
                      Band = Data.read(1)
                      X,Y  = Data.index(self.x,self.y)
                      Pre  = Band[X,Y] 
                      self.ListPre.append(Pre)
  </code></pre>
  <p>Thank you very much!</p>