Campaign
gravtools.models.campaign
Modelling of relative gravity campaigns.
Copyright (C) 2021 Andreas Hellerschmied andreas.hellerschmied@bev.gv.at
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Campaign
Gravity Campaign dataset.
A gravity campaign datasets consists of:
- Campaign name
- One or more gravity surveys that belong together and
- Each survey was observed with one gravimeter on a single day
- Station data (datum and non-datum stations)
- Reductions and corrections
- All observations (from surveys) are corrected and reduced in the same way
- Time series data for the correction of gravity observations (optional)
- Gravimeter data
Attributes:
| Name | Type | Description |
|---|---|---|
campaign_name |
str
|
Name of the campaign. |
output_directory |
str
|
Path to output directory (all output files are stored there). |
surveys |
dict of :py:obj:`.Survey` objects
|
Arbitrary number of survey objects. |
stations |
:py:obj:`.Station` object
|
Data of known stations (datum- and non-datum-stations). |
lsm_runs |
list of objects inherited from :py:obj:`gravtools.models.lsm.LSM`
|
Each item in the list contains one enclosed LSM object. Each LSM object reflects one dedicated run of a least-squares adjustment in order to estimate target parameters. |
ref_delta_t_dt |
datetime object
|
Reference epoch for relative times within the campaign, e.g. for the determination of the drift polynomials. This reference time is equalt to the first (active) observation in the campaign considering all surveys. |
correction_time_series |
:py:obj:`CorrectionTimeSeries`
|
Contains time series data for correcting gravity observations. |
gravimeters |
:py:obj:`Gravimeters`
|
|
gravtools_version |
str
|
Version of the gravtools software that was used to create the dataset. |
Source code in gravtools/models/campaign.py
41 42 43 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 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 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 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 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 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 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 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 | |
lsm_run_times
property
Returns a list of lsm-run times/dates that can be used to identify individual runs.
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of string stating the epochs of lsm adjustment runs that can be used to identify individual runs.
|
|
number_of_lsm_runs
property
Returns the number of LSM runs in the campaign.
number_of_stations
property
int : Returns the number of stations in this campaign.
number_of_surveys
property
int : Returns the number of surveys in this campaign.
survey_names
property
Returns a list with the names of all surveys in the campaign.
__init__(campaign_name, output_directory, surveys=None, stations=None, gravimeters=None, lsm_runs=None, ref_delta_t_dt=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign_name
|
str
|
Name of the campaign. |
required |
surveys
|
Arbitrary number of survey data objects. Default=None which implies that the campaign will be initialized without surveys. |
None
|
|
stations
|
Station data (datum- and non-datum-stations). Default=None implies that the campaign will be initialized without station data. |
None
|
|
gravimeters
|
Gravimeter data. Default=None implies that the campaign will be initialized without gravimeter data. |
None
|
|
lsm_runs
|
list of objects inherited from :py:obj:`gravtools.models.lsm.LSM`
|
Each item in the list contains one enclosed LSM object. Each LSM object reflects one dedicated run of an least-squares adjustment in order to estimate target parameters. |
None
|
Raises:
| Type | Description |
|---|---|
TypeError
|
Wrong input argument type. |
Source code in gravtools/models/campaign.py
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 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 | |
activate_all_surveys(verbose=False)
Activates all surveys in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
|
False
|
Source code in gravtools/models/campaign.py
339 340 341 342 343 344 345 346 347 348 349 350 351 | |
activate_survey(survey_name, verbose=False)
Set the survey with the specified name active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
survey_name
|
str
|
Name of the survey that will be set active. |
required |
verbose
|
(bool, optional(default=False))
|
If True, status messages are printed to the command line. |
False
|
Returns:
| Type | Description |
|---|---|
bool
|
True, if the survey was successfully activated; False, if not. |
Source code in gravtools/models/campaign.py
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 | |
add_empty_correction_time_series()
Adds an empty CorrectionTimeSeries object to the campaign.
Notes
This is required, e.g. if a campaign object os loaded into GravTools from a previous GRavTools version without support of time series corrections.
Source code in gravtools/models/campaign.py
180 181 182 183 184 185 186 187 188 | |
add_stations_from_csv_file(csv_filename, verbose=False)
Add station from a CSV file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
csv_filename
|
string, specifying the path and filename of the station csv file
|
Stations in this csv file are added to the campaign. |
required |
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
477 478 479 480 481 482 483 484 485 486 487 | |
add_stations_from_oesgn_table_file(oesgn_filename, is_datum=False, verbose=False)
Add station from an OESGN table file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
oesgn_filename
|
string, specifying the path and filename of the OESGN file
|
Stations in the specified OESGN table file are added to the campaign. |
required |
is_datum
|
(bool, optional(default=False))
|
|
False
|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
463 464 465 466 467 468 469 470 471 472 473 474 475 | |
add_survey(survey_add, verbose=False)
Add a survey to campaign and specify whether to use it for ths analysis.
Notes
A survey can only be added, f the survey's name is unique within the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
survey_add
|
:py:obj:`.Survey`
|
Contains all information of s specific survey independent of the data source. |
required |
verbose
|
(bool, optional(default=False))
|
If True, status messages are printed to the command line. |
False
|
Source code in gravtools/models/campaign.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
calculate_setup_data(obs_type='reduced', active_obs_only_for_ref_epoch=True, method='variance_weighted_mean', method_sd='sd_from_obs_file', default_sd_mugal=100.0, verbose=False)
Calculate accumulated pseudo observations for each active setup in all active surveys.
Notes
Two relative reference epochs are calculated for each setup: (a) w.r.t. the first (active) observation in the
whole campaign and (b) w.r.t. the first (active) observation in each survey. Both reference time do not differ
for the first survey on a campaign. Whether active observations only are considered is defined by the input
parameter active_obs_only_for_ref_epoch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs_type
|
(str, observed or reduced(default))
|
Defines whether the observed (as loaded from an observation file) or the reduced observations from
|
'reduced'
|
active_obs_only_for_ref_epoch
|
|
True
|
|
method
|
str, optional (default=`variance_weighted_mean`)
|
Select method for the calculation of setup data. |
'variance_weighted_mean'
|
method_sd
|
(str, optional(default=sd_from_obs_file))
|
Method for the determination of standard deviations (SD) of setup observations. |
'sd_from_obs_file'
|
default_sd_mugal
|
(float, optional(default=100.0))
|
Default standard deviation [µGal] that is used to determine the SD of setup observations when |
100.0
|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | |
change_campaign_name(name)
Change the name of the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
New campaign name. Non-empty string. |
required |
Source code in gravtools/models/campaign.py
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 | |
check_gravimeter_data(verbose=True)
Check gravimeter data in campaign and add missing information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
If |
True
|
Notes
In case the gravimeters object is mission, it as added and initialized with data from the surveys.
Source code in gravtools/models/campaign.py
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | |
check_survey_data(verbose=True)
Check survey data in campaign, correct missing elements or raise an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
If |
True
|
Source code in gravtools/models/campaign.py
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 | |
deactivate_all_surveys(verbose=False)
Deactivates all surveys in the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
|
False
|
Source code in gravtools/models/campaign.py
325 326 327 328 329 330 331 332 333 334 335 336 337 | |
deactivate_survey(survey_name, verbose=False)
Set the survey with the specified name inactive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
survey_name
|
str
|
Name of the survey that will be set inactive. |
required |
verbose
|
(bool, optional(default=False))
|
|
False
|
Returns:
| Type | Description |
|---|---|
bool
|
True, if the survey was successfully deactivated; False, if not. |
Source code in gravtools/models/campaign.py
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 | |
delete_all_lsm_runs()
Delete all LSM runs in the campaign.
Source code in gravtools/models/campaign.py
689 690 691 692 | |
delete_lsm_run(idx)
Delete the LSM run with the specified index in the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
Index of the LSM object in the list. |
required |
Source code in gravtools/models/campaign.py
678 679 680 681 682 683 684 685 686 687 | |
flag_observations_based_on_obs_list_csv_file(obs_list_filename, update_type='all_obs', verbose=False)
Flag observations in campaign based on an observation list file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs_list_filename
|
str
|
Name and path of the input CSV file containing the observation list. |
required |
update_type
|
(str, optional(default=all))
|
Defines which observations in the input list are used to update the |
'all_obs'
|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 | |
from_pkl(filename_pkl, verbose=True)
classmethod
Loads a campaign object from a pickle file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename_pkl
|
str
|
Name and path of the pickle file containing the campaign data. |
required |
verbose
|
(bool, optional(default=False))
|
If |
True
|
Returns:
| Type | Description |
|---|---|
`Campaign` object
|
|
Source code in gravtools/models/campaign.py
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 | |
get_epoch_of_first_observation(active_obs_only_for_ref_epoch=True)
Returns the epoch of the first (active) observation in this campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
active_obs_only_for_ref_epoch
|
|
True
|
Returns:
| Type | Description |
|---|---|
datetime object
|
|
Source code in gravtools/models/campaign.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | |
get_survey_names_and_status(verbose=False)
Return list with all survey names and information whether the survey is set active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
If True, survey names and status are printed to the command line. |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
The keys are the survey names and the values represent the respective status (active=True, inactive=False). |
Source code in gravtools/models/campaign.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | |
init_gravimeters()
Adds an empty Gravimeters object to the campaign.
Notes
This is required, e.g. if a campaign object os loaded into GravTools from a previous GravTools version without support of gravimeter data.
Source code in gravtools/models/campaign.py
190 191 192 193 194 195 196 197 198 | |
initialize_and_add_lsm_run(lsm_method, comment='', write_log=True)
Initialize and add an least-squares adjustment run (object) to the campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lsm_method
|
str
|
Defines the adjustment method. Has to b listed in :py:obj: |
required |
comment
|
(str, optional(default=''))
|
Optional comment on the adjustment run. |
''
|
write_log
|
(bool, optional(default=True))
|
Flag that indicates whether log string should be written or not. |
True
|
Source code in gravtools/models/campaign.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
reduce_observations_in_all_surveys(target_ref_height=None, target_tide_corr=None, target_atm_pres_corr=None, target_scale_corr=None, target_oceanload_corr=None, atm_pres_admittance=None, tide_corr_timeseries_interpol_method='', verbose=False)
Reduce the observed gravity by applying the specified corrections.
Notes
-
For this reduction vertical gravity gradients are required. They are obtained from the
Stationobject. Hence, aStationobject has to be attached to the Campaign object beforehand. -
All corrections are applied on the survey-level. See py:obj:
.Survey.reduce_observationsfor more details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_ref_height
|
string, specifying the target reference height type (default = `None`).
|
The target reference height type has to be listed in :py:obj: |
None
|
target_tide_corr
|
str, specifying the tidal correction type to be applied (default = `None`).
|
The target tidal correction type specifies what kind of tidal correction will be applied. Valid types have
to be listed in :py:obj: |
None
|
target_atm_pres_corr
|
str (default = `None`)
|
Specifying the atmospheric press ure correction type to be applied to all surveys. Valid types to be listed
in :py:obj: |
None
|
target_scale_corr
|
str, optional (default = `None`)
|
Specifies the scale correction type to be applied on all observations of this survey. Vali types are listed
in :py:obj: |
None
|
target_oceanload_corr
|
str, optional (default = `None`)
|
Specifying the ocean-loading correction type to be applied to all surveys (if available). Valid types to be
listed in :py:obj: |
None
|
atm_pres_admittance
|
float, optional (default = `None`)
|
Admittance factor for the determination of pressure corrections based on the difference between measured and
normal air pressure. If |
None
|
tide_corr_timeseries_interpol_method
|
(str, optional(default=''))
|
Interpolation method used to calculate tidal corrections from time series data. If tidal corrections are obtained from other sources or models, this attribute is irrelevant and has to be empty! |
''
|
verbose
|
(bool, optional(default=False))
|
If True, status messages are printed to the command line. |
False
|
Source code in gravtools/models/campaign.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | |
remove_survey(survey_name, verbose=False)
Remove survey with the specified name from the campaign
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
survey_name
|
str
|
Name of the survey that will be removed from the campaign. |
required |
verbose
|
(bool, optional(default=False))
|
If True, status messages are printed to the command line. |
False
|
Returns:
| Type | Description |
|---|---|
bool
|
True, if the survey was successfully removed; False, if not. |
Source code in gravtools/models/campaign.py
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 | |
save_to_pickle(filename_pkl=None, verbose=True)
Save the campaign object to a pickle file at the given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename_pkl
|
str, optional (default=`None`)
|
Path and name of the pickle file, e.g. /home/user1/data/camp1.pkl. |
None
|
verbose
|
(bool, optional(default=False))
|
If |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
Name and path of the saved file.
|
|
Source code in gravtools/models/campaign.py
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 | |
set_output_directory(output_directory)
Change the campaign's output directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_directory
|
str
|
New output directory. The specified directory has to exist on the computer/os! |
required |
Source code in gravtools/models/campaign.py
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 | |
set_reference_time(ref_delta_t_dt)
Set reference time for the determination of relative time spans, e.g. for the drift polynomial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ref_delta_t_dt
|
datetime object
|
Reference time epoch w.r.t. UTC. |
required |
Source code in gravtools/models/campaign.py
694 695 696 697 698 699 700 701 702 703 704 705 | |
sync_observed_stations(verbose=False)
Adds all stations that were observed in at least one survey to this campaign's station dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
524 525 526 527 528 529 530 531 532 533 534 535 536 | |
synchronize_stations_and_surveys(verbose=False)
Synchronize information between station and survey data in the campaign.
The following information is synchronized:
- The
is_observedflags in the :py:obj:.Campaign.stations.stat_dfare set according to the surveys in :py:obj:.Campaign.surveys.Trueindicated that the station as observed at least once. - Populates the vertical gradient columns (
`) of the observation DataFrames (:py:obj:.Campaign.surveys) with values from a Station object (:py:obj:.Campaign.stations`). - Populate longitudes, latitudes and heights in the observation DataFrames (:py:obj:
.Campaign.surveys) with values from a Station object (:py:obj:.Campaign.stations). - Add observed stations
Notes
It is recommended to run this method whenever new stations and/or new surveys are added to the campaign on order to synchronize the data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
write_log_file(filename_log, lsm_run_index, verbose=False)
Write log file of a selected LSM run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename_log
|
str
|
Name and path of the output nsb file (e.g. /home/johnny/example.nsb) |
required |
lsm_run_index
|
int
|
Index of the lsm run in |
required |
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 | |
write_nsb_file(filename_nsb, lsm_run_index, vertical_offset_mode='first', exclude_datum_stations=False, formal_error_type='se', verbose=False)
Write the results of an LSM run to a nsb file (input for NSDB database).
Notes
A nsb file can only be written, if station results are available which is not the case e.g. for the estimation of vertical gravity gradients!
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename_nsb
|
str
|
Name and path of the output nsb file (e.g. /home/johnny/example.nsb) |
required |
lsm_run_index
|
int
|
Index of the lsm run in |
required |
vertical_offset_mode
|
(str, optional(default=first))
|
Defines how the vertical offsets between instrument top and ground (dhb) and reference marker (dhf), respectively, are determined in the case of multiple measurements (setups) on the same point. In the nsb file only one dhf/dhb pair per station is allowed. Two options: (1) 'first' indicates that dhb and dhf are taken from the first setup at a station. (2) 'mean' indicates that mean values over all setups are taken. |
'first'
|
exclude_datum_stations
|
(boolean, optional(default=False))
|
|
False
|
formal_error_type
|
str, optional (default=`se`, alternative: `sd`)
|
Select which formal errors (of station gravities) are exported to the nsd file. The user may choose
between post-fit standard deviations ( |
'se'
|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | |
write_obs_list_csv(filename_csv, export_type='all_obs', verbose=False)
Export a list of all observations in the current campaign.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename_csv
|
str
|
Name and path of the output CSV file. |
required |
export_type
|
(str, optional(default=all_obs))
|
Defines which observations are exported. There are three options: (1) all observations ('all_obs'), (2) only active observations ('active_only') or (3) only inactive observations ('inactive_only'). |
'all_obs'
|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | |
write_obs_list_of_lsm_run_csv(filename_csv, lsm_run_index, export_type='all_obs', verbose=False)
Export a list of all observations that were used for calculating the setup data of a lsm_run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename_csv
|
str
|
Name and path of the output CSV file. |
required |
lsm_run_index
|
int
|
Index of the lsm_run for which the observation list should be exported. If |
required |
export_type
|
(str, optional(default=all_obs))
|
Defines which observations are exported. There are three options: (1) all observations ('all_obs'), (2) only active observations ('active_only') or (3) only inactive observations ('inactive_only'). |
'all_obs'
|
verbose
|
(bool, optional(default=False))
|
If |
False
|
Source code in gravtools/models/campaign.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 | |