code: def generate_short_inj_from_inj(self, inj_waveform, simulation_id):
          
          if not self.enabled:
              # Do nothing!
              return
          if simulation_id in self.short_injections:
              err_msg = "An injection with simulation id "
              err_msg += str(simulation_id)
              err_msg += " has already been added. This suggests "
              err_msg += "that your injection file contains injections with "
              err_msg += "duplicate simulation_ids. This is not allowed."
              raise ValueError(err_msg)
          curr_length = len(inj_waveform)
          new_length = int(nearest_larger_binary_number(curr_length))
          # Don't want length less than 1/delta_f
          while new_length * inj_waveform.delta_t < 1./self.coarsematch_deltaf:
              new_length = new_length * 2
          inj_waveform.resize(new_length)
          inj_tilde = inj_waveform.to_frequencyseries()
          # Dynamic range is important here!
          inj_tilde_np = inj_tilde.numpy() * DYN_RANGE_FAC
          delta_f = inj_tilde.get_delta_f()
          new_freq_len = int(self.coarsematch_fmax / delta_f + 1)
          # This shouldn't be a problem if injections are generated at
          # 16384 Hz ... It is only a problem of injection sample rate
          # gives a lower Nyquist than the trunc_f_max. If this error is
          # ever raised one could consider zero-padding the injection.
          assert(new_freq_len <= len(inj_tilde))
          df_ratio = int(self.coarsematch_deltaf/delta_f)
          inj_tilde_np = inj_tilde_np[:new_freq_len:df_ratio]
          new_inj = FrequencySeries(inj_tilde_np, dtype=np.complex64,
                                    delta_f=self.coarsematch_deltaf)
          self.short_injections[simulation_id] = new_inj
docs: Generate and a store a truncated representation of inj_waveform.