docs: def write_flows_to_gssha_time_series_ihg(self,
                                               path_to_output_file,
                                               connection_list_file,
                                               date_search_start=None,
                                               date_search_end=None,
                                               daily=False,
                                               filter_mode="mean"):
          # pylint: disable=line-too-long
          """
          Write out RAPID output to GSSHA time series ihg file
  
          .. note:: See: http://www.gsshawiki.com/Surface_Water_Routing:Introducing_Dischage/Constituent_Hydrographs
  
          .. note:: GSSHA project card is CHAN_POINT_INPUT
  
          Parameters
          ----------
          path_to_output_file: str
              Path to the output xys file.
          connection_list_file: str
              CSV file with link_id, node_id, baseflow, and rapid_rivid header
              and rows with data.
          date_search_start: :obj:`datetime.datetime`, optional
              This is a datetime object with the date of the minimum date
              for starting.
          date_search_end: :obj:`datetime.datetime`, optional
              This is a datetime object with the date of the maximum date
              for ending.
          daily: bool, optional
              If True and the file is CF-Compliant, write out daily flows.
          filter_mode: str, optional
              You can get the daily average "mean" or the maximum "max".
              Defauls is "mean".
  
  
          Example connection list file::
  
              link_id, node_id, baseflow, rapid_rivid
              599, 1, 0.0, 80968
              603, 1, 0.0, 80967
  
  
          Example writing entire time series to file:
  
          .. code:: python
  
              from RAPIDpy import RAPIDDataset
  
              path_to_rapid_qout = '/path/to/Qout.nc'
              connection_list_file = '/path/to/connection_list_file.csv'
  
              with RAPIDDataset(path_to_rapid_qout) as qout_nc:
                  #for writing entire time series to file
                  qout_nc.write_flows_to_gssha_time_series_ihg(
                      '/timeseries/Qout_3624735.ihg',
                      connection_list_file)
  
  
          Example writing entire time series as daily average to file:
  
          .. code:: python
  
              from RAPIDpy import RAPIDDataset
  
              path_to_rapid_qout = '/path/to/Qout.nc'
              connection_list_file = '/path/to/connection_list_file.csv'
  
              with RAPIDDataset(path_to_rapid_qout) as qout_nc:
                  # if file is CF compliant, you can write out daily average
                  qout_nc.write_flows_to_gssha_time_series_ihg(
                      '/timeseries/Qout_3624735.ihg',
                      connection_list_file,
                      daily=True)
  
  
          Example writing subset of time series as daily maximum to file:
  
          .. code:: python
  
              from datetime import datetime
              from RAPIDpy import RAPIDDataset
  
              path_to_rapid_qout = '/path/to/Qout.nc'
              connection_list_file = '/path/to/connection_list_file.csv'
  
              with RAPIDDataset(path_to_rapid_qout) as qout_nc:
                  # if file is CF compliant, you can filter by
                  # date and get daily values
                  qout_nc.write_flows_to_gssha_time_series_ihg(
                      '/timeseries/Qout_daily_date_filter.ihg',
                      connection_list_file,
                      date_search_start=datetime(2002, 8, 31),
                      date_search_end=datetime(2002, 9, 15),
                      daily=True,
                      filter_mode="max")
          """  # noqa
          self.raise_time_valid()
  
          # analyze and write
          with open_csv(path_to_output_file, 'w') as out_ts:
              # HEADER SECTION EXAMPLE:
              # NUMPT 3
              # POINT 1 599 0.0
              # POINT 1 603 0.0
              # POINT 1 605 0.0
  
              connection_list = np.loadtxt(connection_list_file,
                                           skiprows=1, ndmin=1,
                                           delimiter=',',
                                           usecols=(0, 1, 2, 3),
                                           dtype={'names': ('link_id',
                                                            'node_id',
                                                            'baseflow',
                                                            'rapid_rivid'),
                                                  'formats': ('i8', 'i8',
                                                              'f4', 'i8')
                                                  },
                                           )
  
              out_ts.write("NUMPT {0}\n".format(connection_list.size))
  
              river_idx_list = []
              for connection in connection_list:
                  out_ts.write("POINT {0} {1} {2}\n"
                               "".format(connection['node_id'],
                                         connection['link_id'],
                                         connection['baseflow'],
                                         ),
                               )
                  river_idx_list.append(
                      self.get_river_index(connection['rapid_rivid'])
                      )
  
              # INFLOW SECTION EXAMPLE:
              # NRPDS 54
              # INPUT 2002 01 01 00 00 15.551210 12.765090 0.000000
              # INPUT 2002 01 02 00 00 15.480830 12.765090 0.000000
              # INPUT 2002 01 03 00 00 16.078910 12.765090 0.000000
              # ...
              qout_df = self.get_qout_index(
                  river_idx_list,
                  date_search_start=date_search_start,
                  date_search_end=date_search_end,
                  daily=daily,
                  filter_mode=filter_mode,
                  as_dataframe=True)
  
              out_ts.write("NRPDS {0}\n".format(len(qout_df.index)))
  
              for index, pd_row in qout_df.iterrows():
                  date_str = index.strftime("%Y %m %d %H %M")
                  qout_str = " ".join(["{0:.5f}".format(pd_row[column])
                                       for column in qout_df])
                  out_ts.write("INPUT {0} {1}\n".format(date_str, qout_str))