code: def coadd_maps(geom, maps, preserve_counts=True):
      
  
      # FIXME: This functionality should be built into the Map.coadd method
      map_out = gammapy.maps.Map.from_geom(geom)
      for m in maps:
          m_tmp = m
          if isinstance(m, gammapy.maps.HpxNDMap):
              if m.geom.order < map_out.geom.order:
                  factor = map_out.geom.nside // m.geom.nside
                  m_tmp = m.upsample(factor, preserve_counts=preserve_counts)
          map_out.coadd(m_tmp)
  
      return map_out
docs: Coadd a sequence of `~gammapy.maps.Map` objects.