def divide_list(list_file):
   """Checks if every element in provided list is a HRS image and divides the original list into red and blue frames lists

   Parameters
   ----------

   list_file: list of str
       List containing names of HRS files   

   Returns
   -------
   blue_files: list of str
       List of HRS blue frames in the running directory
   red_files: list of str
       List of HRS red frames in the running directory
   """

   blue_files=[]
   red_files=[]

   f=open(list_file,"r")
   for line in f.readlines():
      line_s=line.replace("\n", "")
      if (line_s[-5:]==".fits") and ("H201" in line_s) and not("pH201" in line_s):
         blue_files.append(line_s)
      elif (line_s[-5:]==".fits") and ("R201" in line_s) and not("pR201" in line_s):
         red_files.append(line_s)
      else:
         print("This does not look like a name of a raw HRS file: %s"%line_s)
   f.close()

   return blue_files,red_files