code: def _compute_soil_linear_factor(cls, pga_rock, imt):
          
          if imt.period >= 1:
              return np.ones_like(pga_rock)
          else:
              sl = np.zeros_like(pga_rock)
  
              pga_between_100_500 = (pga_rock > 100) & (pga_rock < 500)
              pga_greater_equal_500 = pga_rock >= 500
  
              is_SA_between_05_1 = 0.5 < imt.period < 1
  
              is_SA_less_equal_05 = imt.period <= 0.5
  
              if is_SA_between_05_1:
                  sl[pga_between_100_500] = (1 - (1. / imt.period - 1) *
                                             (pga_rock[pga_between_100_500] -
                                             100) / 400)
                  sl[pga_greater_equal_500] = 1 - (1. / imt.period - 1)
  
              if is_SA_less_equal_05 or imt.period == 0:
                  sl[pga_between_100_500] = (1 - (pga_rock[pga_between_100_500] -
                                             100) / 400)
  
              sl[pga_rock <= 100] = 1
  
              return sl
docs: Compute soil linear factor as explained in paragraph 'Functional
          Form', page 1706.