<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_ln_a_n_max(self, C, n_sites, idx, rup):
 """ Defines the rock site amplification defined in equations 10a and 10b """

        ln_a_n_max = C["lnSC1AM"] * np.ones(n_sites)
        for i in [2, 3, 4]:
            if np.any(idx[i]):
                ln_a_n_max[idx[i]] += C["S{:g}".format(i)]
        return ln_a_n_max