<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def proportional_weights(self, fraction_stdev=1.0, wmax=100.0, leave_zero=True):
 """setup weights inversely proportional to the observation value Parameters fraction_stdev : float the fraction portion of the observation val to treat as the standard deviation. set to 1.0 for inversely proportional wmax : float maximum weight to allow leave_zero : bool flag to leave existing zero weights """

        new_weights = []
        for oval, ow in zip(self.observation_data.obsval,
                            self.observation_data.weight):
            if leave_zero and ow == 0.0:
                ow = 0.0
            elif oval == 0.0:
                ow = wmax
            else:
                nw = 1.0 / (np.abs(oval) * fraction_stdev)
                ow = min(wmax, nw)
            new_weights.append(ow)
        self.observation_data.weight = new_weights