Commit f2301557751af2fb67c3148f7a917df992330080
1 parent
1bdf58eb
Exists in
master
Use kilometers.
Showing
1 changed file
with
13 additions
and
4 deletions
Show diff stats
flaskr/laws/travel_emission_linear_fit.py
... | ... | @@ -90,6 +90,11 @@ class EmissionModel(BaseEmissionModel): |
90 | 90 | return footprint |
91 | 91 | |
92 | 92 | def compute_airplane_distance_footprint(self, distance, config=None): |
93 | + """ | |
94 | + :param distance: in km | |
95 | + :param config: | |
96 | + :return: | |
97 | + """ | |
93 | 98 | if config is None: |
94 | 99 | config = self.config.plane_emission_linear_fit |
95 | 100 | distance = distance * config.scale_before + config.offset_before |
... | ... | @@ -103,6 +108,11 @@ class EmissionModel(BaseEmissionModel): |
103 | 108 | return config.rfi * footprint |
104 | 109 | |
105 | 110 | def apply_scaling_law(self, distance, config): |
111 | + """ | |
112 | + :param distance: in km | |
113 | + :param config: | |
114 | + :return: | |
115 | + """ | |
106 | 116 | footprint = distance |
107 | 117 | for interval in config.intervals: |
108 | 118 | if interval.dmin <= distance < interval.dmax: |
... | ... | @@ -125,11 +135,10 @@ class EmissionModel(BaseEmissionModel): |
125 | 135 | :param origin_longitude: |
126 | 136 | :param destination_latitude: |
127 | 137 | :param destination_longitude: |
128 | - :return: Distance in meters between the two locations, | |
138 | + :return: Distance in kilometers between the two locations, | |
129 | 139 | along Earth's great circles. |
130 | 140 | """ |
131 | - gcd = great_circle( | |
141 | + return great_circle( | |
132 | 142 | (np.float(origin_latitude), np.float(origin_longitude)), |
133 | 143 | (np.float(destination_latitude), np.float(destination_longitude)) |
134 | - ).m | |
135 | - return gcd | |
144 | + ).kilometers | ... | ... |