Load Data¶
Older Approach¶
The purpose of this script is to, firstly read what the data source is (JPL, CSR or ITSG) read file path for GRACE L2 spherical harmonics inputs, read replacement files for tn13 and tn14 source of the SH files (JPL, ITSG or CSR)
read_GRACE_SH_paths(use_sample_files=0)
¶
Returns path of data files, path of tn13 and path of tn14 replacement files
Parameters:
Name | Type | Description | Default |
---|---|---|---|
use_sample_files |
int
|
description. Defaults to 0. |
0
|
Raises:
Type | Description |
---|---|
Exception
|
description |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
Source code in pyshbundle/read_GRACE_SH_paths.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
Replaces the certain coefficients with other given coeff.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
description |
required |
path_tn14 |
str
|
description |
required |
path_tn13 |
str
|
description |
required |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
Source code in pyshbundle/reader_replacer_jpl.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
|
Source code in pyshbundle/reader_replacer_csr.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
|
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
_type_
|
description |
required |
path_tn14 |
_type_
|
description |
required |
path_tn13 |
_type_
|
description |
required |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
Source code in pyshbundle/reader_replacer_itsg.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
|
Function to read files & extract data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_name |
_type_
|
description |
required |
line_num |
_type_
|
description |
required |
degree |
_type_
|
description |
required |
order |
_type_
|
description |
required |
clm |
_type_
|
description |
required |
slm |
_type_
|
description |
required |
delta_clm |
_type_
|
description |
required |
delta_slm |
_type_
|
description |
required |
start_date |
_type_
|
description |
required |
end_date |
_type_
|
description |
required |
year_start |
_type_
|
description |
required |
time_axes |
_type_
|
description |
required |
Source code in pyshbundle/reader_replacer.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
Newer Approach¶
Reads the spherical harmonic data provided by JPL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
Absolute path to the file |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Header info in a structured dictionary |
|
np.ndarray: SH coefficient data in form of a numpy n-dim array. Format is CLM. |
||
set |
Epoch start and end times as per the GRACE datafile. (eg. 20020519.0) |
Source code in pyshbundle/io.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
Reads the spherical harmonic data provided by CSR
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
Absolute path to the GRACE data file from CSR |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Header info in a structured dictionary |
|
np.ndarray: SH coefficient data in form of a numpy n-dim array. Format is KLM |
||
set |
Epoch begin and stop dates stored as float (eg. 20020519.0) |
Source code in pyshbundle/io.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
Reads the spherical harmonic data provided by CSR
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
Absolute path to the GRACE data file from CSR |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Header info in a structured dictionary |
|
np.ndarray: SH coefficient data in form of a numpy n-dim array. Format is KLM |
||
set |
Epoch begin and stop dates stored as float (eg. 20020519.0) |
Source code in pyshbundle/io.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
_type_
|
description |
required |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
Source code in pyshbundle/io.py
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
|
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
_type_
|
description |
required |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
Source code in pyshbundle/io.py
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 |
|
Computing Ling Term Mean¶
The purpose of this script is to, load longterm mean for our GRACE SH data
For this, we need to input the GRACE data source as well as the path to the longterm mean values Data source may be CSR, JPL or ITSG.
For RL06, example data have been provided within the package. In case this option is chosen, the program directly returns the longterm mean values.
Returns the long_mean path
load_longterm_mean(source='', use_sample_mean=0)
¶
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source |
str
|
description. Defaults to "". |
''
|
use_sample_mean |
int
|
description. Defaults to 0. |
0
|
Raises:
Type | Description |
---|---|
Exception
|
description |
Returns:
Name | Type | Description |
---|---|---|
_type_ |
description |
Todo
- Not sure if using "source = ''" is all right
- instead of base eception is can be ValueError
Source code in pyshbundle/load_longterm_mean.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
Physical and Geodetic Constants¶
This script contains some of the major relavant Physical and Geodetic(GRS80) constants:
clight
speed of light - \(2.99792458e+8\) \(m/s\)G
Gravitational constant- \(6.67259e-11\) $rac{m^3} {kg \cdot s^2}$-
au
astronomical unit - \(149.597870691e+9\) \(m\) -
ae
semi-major axis of ellipsoidGRS 80
- \(6378137\) m GM
geocentric grav. constantGRS 80
- \(3.986005e+14\) $rac{m^3}{s^2}$J2
earth's dynamic form factorGRS 80
- \(1.08263e-3\) [unitless C20 unnormalized coefficient]-
Omega
mean ang. velocityGRS 80
- $7.292115e-5 $rac{rad}{s}$ -
flat
flattening - $rac{1}{298.257222101}$