|
72 | 72 |
|
73 | 73 | ################################## Earth tides - point mode ################################## |
74 | 74 | def calc_solid_earth_tides_point(lat, lon, dt0, dt1, step_sec=60, display=False, verbose=True): |
75 | | - """Calculate SET in east/north/up direction for the given time period at the given point (lat/lon). |
76 | | -
|
77 | | - Parameters: lat/lon - float32, latitude/longitude of the point of interest |
78 | | - dt0/1 - datetime.datetime object, start/end date and time |
79 | | - step_sec - int16, time step in seconds |
80 | | - display - bool, plot the calculated SET |
81 | | - verbose - bool, print verbose message |
82 | | - Returns: dt_out - 1D np.ndarray in dt.datetime objects |
83 | | - tide_e - 1D np.ndarray in float32, SET in east direction in meters |
84 | | - tide_n - 1D np.ndarray in float32, SET in north direction in meters |
85 | | - tide_u - 1D np.ndarray in float32, SET in up direction in meters |
86 | | - Examples: dt0 = dt.datetime(2020,11,1,4,0,0) |
87 | | - dt1 = dt.datetime(2020,12,31,2,0,0) |
88 | | - (dt_out, |
89 | | - tide_e, |
90 | | - tide_n, |
91 | | - tide_u) = calc_solid_earth_tides_point(34.0, -118.0, dt0, dt1) |
| 75 | + """ |
| 76 | + Calculate solid earth tides (SET) in east/north/up direction for the given time |
| 77 | + period at the given point. |
| 78 | +
|
| 79 | + Parameters: |
| 80 | + lat : float |
| 81 | + Latitude of the point of interest, in degrees. |
| 82 | + lon : float |
| 83 | + Longitude of the point of interest, in degrees. |
| 84 | + dt0 : datetime.datetime |
| 85 | + The datetime of the beginning of the SET calculation. |
| 86 | + dt1 : datetime.datetime |
| 87 | + The datetime of the end of the SET calculation. |
| 88 | + step_sec : int, optional |
| 89 | + Time step, in seconds, of the output. Defaults to 60. |
| 90 | + display : bool, optional |
| 91 | + If True, plot the calculated SET. Defaults to False. |
| 92 | + verbose : bool, optional |
| 93 | + If True, print verbose messages. Defaults to True. |
| 94 | +
|
| 95 | + Returns: |
| 96 | + dt_out : 1D np.ndarray of datetime.datetime |
| 97 | + The datetimes associated with each index of the following three arrays. |
| 98 | + The span of this array will be at least the period between dt0 and dt1. |
| 99 | + Note that dt_out is clamped to step_sec, so the start and end times may |
| 100 | + be slightly different than dt0 and dt1. |
| 101 | + tide_e : 1D np.ndarray of float32 |
| 102 | + SET in east direction, in meters. |
| 103 | + tide_n : 1D np.ndarray of float32 |
| 104 | + SET in north direction, in meters. |
| 105 | + tide_u : 1D np.ndarray of float32 |
| 106 | + SET in up direction, in meters. |
| 107 | +
|
| 108 | + Example: |
| 109 | + dt0 = dt.datetime(2020,11,1,4,0,0) |
| 110 | +
|
| 111 | + dt1 = dt.datetime(2020,12,31,2,0,0) |
| 112 | +
|
| 113 | + ( |
| 114 | + dt_out, tide_e, tide_n, tide_u |
| 115 | + ) = calc_solid_earth_tides_point(34.0, -118.0, dt0, dt1) |
92 | 116 | """ |
93 | 117 |
|
94 | 118 | print('PYSOLID: calculate solid Earth tides in east/north/up direction') |
@@ -144,20 +168,34 @@ def calc_solid_earth_tides_point(lat, lon, dt0, dt1, step_sec=60, display=False, |
144 | 168 |
|
145 | 169 |
|
146 | 170 | def calc_solid_earth_tides_point_per_day(lat, lon, date_str, step_sec=60): |
147 | | - """Calculate solid Earth tides (SET) in east/north/up direction |
148 | | - for one day at the given point (lat/lon). |
149 | | -
|
150 | | - Parameters: lat/lon - float32, latitude/longitude of the point of interest |
151 | | - date_str - str, date in YYYYMMDD |
152 | | - step_sec - int16, time step in seconds |
153 | | - Returns: dt_out - 1D np.ndarray in dt.datetime objects |
154 | | - tide_e - 1D np.ndarray in float32, SET in east direction in meters |
155 | | - tide_n - 1D np.ndarray in float32, SET in north direction in meters |
156 | | - tide_u - 1D np.ndarray in float32, SET in up direction in meters |
157 | | - Examples: (dt_out, |
158 | | - tide_e, |
159 | | - tide_n, |
160 | | - tide_u) = calc_solid_earth_tides_point_per_day(34.0, -118.0, '20180219') |
| 171 | + """ |
| 172 | + Calculate solid Earth tides (SET) in east/north/up direction for one day at the |
| 173 | + given point (lat/lon). |
| 174 | +
|
| 175 | + Parameters: |
| 176 | + lat : float |
| 177 | + Latitude of the point of interest, in degrees. |
| 178 | + lon : float |
| 179 | + Longitude of the point of interest, in degrees. |
| 180 | + date_str : str |
| 181 | + The date to generate solid earth tides for, in YYYYMMDD format. |
| 182 | + step_sec : int, optional |
| 183 | + Time step, in seconds, of the output. Defaults to 60. |
| 184 | +
|
| 185 | + Returns: |
| 186 | + dt_out : 1D np.ndarray of datetime.datetime |
| 187 | + The datetimes associated with each index of the following three arrays. |
| 188 | + tide_e : 1D np.ndarray of float32 |
| 189 | + SET in east direction, in meters. |
| 190 | + tide_n : 1D np.ndarray of float32 |
| 191 | + SET in north direction, in meters. |
| 192 | + tide_u : 1D np.ndarray of float32 |
| 193 | + SET in up direction, in meters. |
| 194 | +
|
| 195 | + Example: |
| 196 | + ( |
| 197 | + dt_out, tide_e, tide_n, tide_u |
| 198 | + ) = calc_solid_earth_tides_point_per_day(34.0, -118.0, '20180219') |
161 | 199 | """ |
162 | 200 | try: |
163 | 201 | from pysolid.solid import solid_point |
|
0 commit comments