API Documentation
earthcarekit
A Python package to simplify working with EarthCARE satellite data
Copyright (c) 2025 Leonard König
Licensed under the MIT License (see LICENSE file or https://opensource.org/license/mit).
Cmap
Bases: ListedColormap
Source code in earthcarekit/plot/color/colormap/cmap.py
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 |
|
blend
Returns the same colormap beldned with a second color.
Source code in earthcarekit/plot/color/colormap/cmap.py
set_alpha
Returns the same colormap with the given transparency alpha value applied.
Source code in earthcarekit/plot/color/colormap/cmap.py
Color
dataclass
Bases: str
Source code in earthcarekit/plot/color/color.py
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 |
|
blend
Returns the same color blended with a second color.
Source code in earthcarekit/plot/color/color.py
from_optional
classmethod
Parses optional color input and returns a Color
instance or None
.
Source code in earthcarekit/plot/color/color.py
set_alpha
Returns the same color with the given transparency alpha value applied.
Source code in earthcarekit/plot/color/color.py
CurtainFigure
Figure object for displaying EarthCARE curtain data (e.g., ATLID and CPR L1/L2 profiles) along the satellite track.
This class sets up a horizontal-along-track or time vs. vertical-height plot (a "curtain" view), for profiling atmospheric quantities retrieved from ground-based or nadir-viewing air/space-bourne instruments (like EarthCARE). It displays dual top/bottom x-axes (e.g., geolocation and time), and left/right y-axes for height labels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ax
|
Axes | None
|
Existing matplotlib axes to plot on; if not provided, a new figure and axes will be created. Defaults to None. |
None
|
figsize
|
tuple[float, float]
|
Size of the figure in inches. Defaults to (FIGURE_WIDTH_CURTAIN, FIGURE_HEIGHT_CURTAIN). |
(FIGURE_WIDTH_CURTAIN, FIGURE_HEIGHT_CURTAIN)
|
dpi
|
int | None
|
Resolution of the figure in dots per inch. Defaults to None. |
None
|
title
|
str | None
|
Title to display above the curtain plot. Defaults to None. |
None
|
ax_style_top
|
AlongTrackAxisStyle | str
|
Style of the top x-axis, e.g., "geo", "time", or "frame". Defaults to "geo". |
'geo'
|
ax_style_bottom
|
AlongTrackAxisStyle | str
|
Style of the bottom x-axis, e.g., "geo", "time", or "frame". Defaults to "time". |
'time'
|
num_ticks
|
int
|
Number of tick marks to place along the x-axis. Defaults to 10. |
10
|
show_height_left
|
bool
|
Whether to show height labels on the left y-axis. Defaults to True. |
True
|
show_height_right
|
bool
|
Whether to show height labels on the right y-axis. Defaults to False. |
False
|
mode
|
Literal['exact', 'fast']
|
Curtain plotting mode. Use "fast" to speed up plotting by coarsening data to at least |
'fast'
|
min_num_profiles
|
int
|
Minimum number of profiles to keep when using "fast" mode. Defaults to 1000. |
1000
|
Example
Source code in earthcarekit/plot/figure/curtain.py
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 |
|
ecplot
ecplot(
ds,
var,
*,
time_var=TIME_VAR,
height_var=HEIGHT_VAR,
lat_var=TRACK_LAT_VAR,
lon_var=TRACK_LON_VAR,
temperature_var=TEMP_CELSIUS_VAR,
along_track_dim=ALONG_TRACK_DIM,
values=None,
time=None,
height=None,
latitude=None,
longitude=None,
values_temperature=None,
site=None,
radius_km=100.0,
mark_closest_profile=False,
show_info=True,
show_radius=True,
info_text_loc=None,
value_range=None,
log_scale=None,
norm=None,
time_range=None,
height_range=(0, 40000.0),
label=None,
units=None,
cmap=None,
colorbar=True,
colorbar_ticks=None,
colorbar_tick_labels=None,
rolling_mean=None,
selection_time_range=None,
selection_color=Color("ec:earthcare"),
selection_linestyle="dashed",
selection_linewidth=2.5,
selection_highlight=False,
selection_highlight_inverted=True,
selection_highlight_color=Color("white"),
selection_highlight_alpha=0.5,
selection_max_time_margin=None,
ax_style_top=None,
ax_style_bottom=None,
show_temperature=False,
mode=None,
min_num_profiles=5000,
mark_profiles_at=None,
mark_profiles_at_color=None,
mark_profiles_at_linestyle="solid",
mark_profiles_at_linewidth=2.5,
**kwargs
)
Plot a vertical curtain (i.e. cross-section) of a variable along the satellite track a EarthCARE dataset.
This method collections all required data from a EarthCARE xarray.dataset
, such as time, height, latitude and longitude.
It supports various forms of customization through the use of arguments listed below.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds
|
Dataset
|
The EarthCARE dataset from with data will be plotted. |
required |
var
|
str
|
Name of the variable to plot. |
required |
time_var
|
str
|
Name of the time variable. Defaults to TIME_VAR. |
TIME_VAR
|
height_var
|
str
|
Name of the height variable. Defaults to HEIGHT_VAR. |
HEIGHT_VAR
|
lat_var
|
str
|
Name of the latitude variable. Defaults to TRACK_LAT_VAR. |
TRACK_LAT_VAR
|
lon_var
|
str
|
Name of the longitude variable. Defaults to TRACK_LON_VAR. |
TRACK_LON_VAR
|
temperature_var
|
str
|
Name of the temperature variable; ignored if |
TEMP_CELSIUS_VAR
|
along_track_dim
|
str
|
Dimension name representing the along-track direction. Defaults to ALONG_TRACK_DIM. |
ALONG_TRACK_DIM
|
values
|
NDArray | None
|
Data values to be used instead of values found in the |
None
|
time
|
NDArray | None
|
Time values to be used instead of values found in the |
None
|
height
|
NDArray | None
|
Height values to be used instead of values found in the |
None
|
latitude
|
NDArray | None
|
Latitude values to be used instead of values found in the |
None
|
longitude
|
NDArray | None
|
Longitude values to be used instead of values found in the |
None
|
values_temperature
|
NDArray | None
|
Temperature values to be used instead of values found in the |
None
|
site
|
str | GroundSite | None
|
Highlights data within |
None
|
radius_km
|
float
|
Radius around the ground site to highlight data from; ignored if |
100.0
|
mark_closest_profile
|
bool
|
Mark the closest profile to the ground site in the plot; ignored if |
False
|
show_info
|
bool
|
If True, show text on the plot containing EarthCARE frame and baseline info. Defaults to True. |
True
|
info_text_loc
|
str | None
|
Place info text at a specific location of the plot, e.g. "upper right" or "lower left". Defaults to None. |
None
|
value_range
|
ValueRangeLike | None
|
Min and max range for the variable values. Defaults to None. |
None
|
log_scale
|
bool | None
|
Whether to apply a logarithmic color scale. Defaults to None. |
None
|
norm
|
Normalize | None
|
Matplotlib norm to use for color scaling. Defaults to None. |
None
|
time_range
|
TimeRangeLike | None
|
Time range to restrict the data for plotting. Defaults to None. |
None
|
height_range
|
DistanceRangeLike | None
|
Height range to restrict the data for plotting. Defaults to (0, 40e3). |
(0, 40000.0)
|
label
|
str | None
|
Label to use for colorbar. Defaults to None. |
None
|
units
|
str | None
|
Units of the variable to show in the colorbar label. Defaults to None. |
None
|
cmap
|
str | Colormap | None
|
Colormap to use for plotting. Defaults to None. |
None
|
colorbar
|
bool
|
Whether to display a colorbar. Defaults to True. |
True
|
colorbar_ticks
|
ArrayLike | None
|
Custom tick values for the colorbar. Defaults to None. |
None
|
colorbar_tick_labels
|
ArrayLike | None
|
Custom labels for the colorbar ticks. Defaults to None. |
None
|
rolling_mean
|
int | None
|
Apply rolling mean along time axis with this window size. Defaults to None. |
None
|
selection_time_range
|
TimeRangeLike | None
|
Time range to highlight as a selection; ignored if |
None
|
selection_color
|
_type_
|
Color for the selection range marker lines. Defaults to Color("ec:earthcare"). |
Color('ec:earthcare')
|
selection_linestyle
|
str | None
|
Line style for selection range markers. Defaults to "dashed". |
'dashed'
|
selection_linewidth
|
float | int | None
|
Line width for selection range markers. Defaults to 2.5. |
2.5
|
selection_highlight
|
bool
|
Whether to highlight the selection region by shading outside or inside areas. Defaults to False. |
False
|
selection_highlight_inverted
|
bool
|
If True and |
True
|
selection_highlight_color
|
str | None
|
If True and |
Color('white')
|
selection_highlight_alpha
|
float
|
If True and |
0.5
|
selection_max_time_margin
|
TimedeltaLike | Sequence[TimedeltaLike]
|
Zooms the time axis to a given maximum time from a selected time area. Defaults to None. |
None
|
ax_style_top
|
AlongTrackAxisStyle | str | None
|
Style for the top axis (e.g., geo, lat, lon, distance, time, utc, lst, none). Defaults to None. |
None
|
ax_style_bottom
|
AlongTrackAxisStyle | str | None
|
Style for the bottom axis (e.g., geo, lat, lon, distance, time, utc, lst, none). Defaults to None. |
None
|
show_temperature
|
bool
|
Whether to overlay temperature as contours; requires either |
False
|
mode
|
Literal['exact', 'fast'] | None
|
Overwrites the curtain plotting mode. Use "fast" to speed up plotting by coarsening data to at least |
None
|
min_num_profiles
|
int
|
Overwrites the minimum number of profiles to keep when using "fast" mode. Defaults to 1000. |
5000
|
mark_profiles_at
|
Sequence[TimestampLike] | None
|
Timestamps at which to mark vertical profiles. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
CurtainFigure |
CurtainFigure
|
The figure object containing the curtain plot. |
Example
Source code in earthcarekit/plot/figure/curtain.py
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 |
|
FileAgency
Bases: FileInfoEnum
Source code in earthcarekit/utils/read/product/file_info/agency.py
from_input
classmethod
Infers the EarthCARE product agency (i.e. ESA or JAXA) from a given file or dataset.
Source code in earthcarekit/utils/read/product/file_info/agency.py
FileLatency
Bases: FileInfoEnum
Source code in earthcarekit/utils/read/product/file_info/latency.py
from_input
classmethod
Infers the EarthCARE product latency indicator (i.e. N for Near-real time, O for Offline, X for not applicable) from a given name, file or dataset.
Source code in earthcarekit/utils/read/product/file_info/latency.py
FileType
Bases: FileInfoEnum
Source code in earthcarekit/utils/read/product/file_info/type.py
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 |
|
from_input
classmethod
Infers the EarthCARE product type from a given file or dataset.
Source code in earthcarekit/utils/read/product/file_info/type.py
GroundSite
dataclass
Class representing a geographic site (or ground station) with associated metadata.
Attributes:
Name | Type | Description |
---|---|---|
latitude |
float
|
Latitude of the site in decimal degrees. |
longitude |
float
|
Longitude of the site in decimal degrees. |
name |
str
|
Short name or identifier of the site. |
long_name |
str
|
Full descriptive name of the site. |
aliases |
list[str]
|
Alternative names or identifiers for the site. |
altitude |
float
|
Altitude of the site in meters above sea level. |
cloudnet_name |
str | None
|
Identifier string used in CloudNet file names, or None if not applicable. |
Source code in earthcarekit/utils/ground_sites.py
aliases
class-attribute
instance-attribute
Alternative names or identifiers for the site.
altitude
class-attribute
instance-attribute
Altitude of the site in meters above sea level.
cloudnet_name
class-attribute
instance-attribute
Identifier string used in CloudNet file names, or None if not applicable.
LineFigure
TODO: documentation
Source code in earthcarekit/plot/figure/line.py
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 |
|
MapFigure
Figure object for displaying EarthCARE satellite track and/or imager swaths on a global map.
This class sets up a georeferenced map canvas using a range of cartographic projections and visual styles. It serves as the basis for plotting 2D swath data (e.g., from MSI) or simple satellite tracks, optionally with info labels, backgrounds, and other styling options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ax
|
Axes | None
|
Existing matplotlib axes to plot on; if not provided, new axes will be created. Defaults to None. |
None
|
figsize
|
tuple[float, float]
|
Figure size in inches. Defaults to (FIGURE_MAP_WIDTH, FIGURE_MAP_HEIGHT). |
(FIGURE_MAP_WIDTH, FIGURE_MAP_HEIGHT)
|
dpi
|
int | None
|
Resolution of the figure in dots per inch. Defaults to None. |
None
|
title
|
str | None
|
Title to display on the map. Defaults to None. |
None
|
style
|
str
|
Base map style to use; options include "none", "stock_img", "gray", "osm", "satellite", "mtg", "msg". Defaults to "gray". |
'gray'
|
projection
|
str | Projection
|
Map projection to use; options include "platecarree", "perspective", "orthographic", or a custom |
Orthographic()
|
central_latitude
|
float | None
|
Latitude at the center of the projection. Defaults to None. |
None
|
central_longitude
|
float | None
|
Longitude at the center of the projection. Defaults to None. |
None
|
grid_color
|
ColorLike | None
|
Color of grid lines. Defaults to None. |
None
|
border_color
|
ColorLike | None
|
Color of border box around the map. Defaults to None. |
None
|
coastline_color
|
ColorLike | None
|
Color of coastlines. Defaults to None. |
None
|
show_grid
|
bool
|
Whether to show latitude/longitude grid lines. Defaults to True. |
True
|
show_top_labels
|
bool
|
Whether to show tick labels on the top axis. Defaults to True. |
True
|
show_bottom_labels
|
bool
|
Whether to show tick labels on the bottom axis. Defaults to True. |
True
|
show_right_labels
|
bool
|
Whether to show tick labels on the right axis. Defaults to True. |
True
|
show_left_labels
|
bool
|
Whether to show tick labels on the left axis. Defaults to True. |
True
|
show_text_time
|
bool
|
Whether to display a datetime info text above the plot. Defaults to True. |
True
|
show_text_frame
|
bool
|
Whether to display a EarthCARE frame info text above the plot. Defaults to True. |
True
|
show_text_overpass
|
bool
|
Whether to display ground site overpass info in the plot. Defaults to True. |
True
|
show_night_shade
|
bool
|
Whether to overlay the nighttime shading based on |
True
|
timestamp
|
TimestampLike | None
|
Time reference used for nightshade overlay. Defaults to None. |
None
|
extent
|
Iterable | None
|
Map extent given as [lon_min, lon_max, lat_min, lat_max]; overrides auto zoom. Defaults to None. |
None
|
lod
|
int
|
Level of detail for coastlines and grid elements; higher values reduce complexity. Defaults to 2. |
2
|
coastlines_resolution
|
str
|
Resolution of coastlines to display; options are "10m", "50m", or "110m". Defaults to "110m". |
'110m'
|
azimuth
|
float
|
Rotation of the |
0
|
pad
|
float | list[float]
|
Padding applied when selecting a map extent. Defaults to 0.05. |
0.05
|
background_alpha
|
float
|
Transparency level of the background map style. Defaults to 1.0. |
1.0
|
Source code in earthcarekit/plot/figure/map.py
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 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 |
|
ecplot
ecplot(
ds,
var=None,
*,
lat_var=TRACK_LAT_VAR,
lon_var=TRACK_LON_VAR,
swath_lat_var=SWATH_LAT_VAR,
swath_lon_var=SWATH_LON_VAR,
time_var=TIME_VAR,
along_track_dim=ALONG_TRACK_DIM,
across_track_dim=ACROSS_TRACK_DIM,
site=None,
radius_km=100.0,
time_range=None,
view="global",
zoom_tmin=None,
zoom_tmax=None,
color="ec:earthcare",
linewidth=3,
linestyle="solid",
color2="ec:blue",
linewidth2=None,
linestyle2=None,
cmap=None,
zoom_radius_km=None,
extent=None,
central_latitude=None,
central_longitude=None,
value_range=None,
log_scale=None,
norm=None,
colorbar=True,
pad=None,
show_text_time=None,
show_text_frame=None,
show_text_overpass=None,
cb_orientation="horizontal",
cb_position="bottom",
cb_alignment="center",
cb_buffer=1.02,
cb_width_ratio="2%",
cb_height_ratio="100%",
selection_max_time_margin=None
)
Plot the EarthCARE satellite track on a map, optionally showing a 2D swath variable if var
is provided.
This method collects all required data from an EarthCARE xarray.Dataset
.
If var
is given, the corresponding swath variable is plotted on the map using a
color scale. Otherwise, the satellite ground track is plotted as a colored line.
If time_range
or site
is given, the selected track section within the selected time range or in proximity to ground sites are highlighted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds
|
Dataset
|
The EarthCARE dataset from which data will be plotted. |
required |
var
|
str | None
|
Name of a 2D swath variable to plot. If None, only the satellite ground track is shown. Defaults to None. |
None
|
lat_var
|
str
|
Name of the latitude variable for the along-track data. Defaults to TRACK_LAT_VAR. |
TRACK_LAT_VAR
|
lon_var
|
str
|
Name of the longitude variable for the along-track data. Defaults to TRACK_LON_VAR. |
TRACK_LON_VAR
|
swath_lat_var
|
str
|
Name of the latitude variable for the swath. Defaults to SWATH_LAT_VAR. |
SWATH_LAT_VAR
|
swath_lon_var
|
str
|
Name of the longitude variable for the swath. Defaults to SWATH_LON_VAR. |
SWATH_LON_VAR
|
time_var
|
str
|
Name of the time variable. Defaults to TIME_VAR. |
TIME_VAR
|
along_track_dim
|
str
|
Dimension name representing the along-track direction. Defaults to ALONG_TRACK_DIM. |
ALONG_TRACK_DIM
|
across_track_dim
|
str
|
Dimension name representing the across-track direction. Defaults to ACROSS_TRACK_DIM. |
ACROSS_TRACK_DIM
|
site
|
str | GroundSite | None
|
Highlights data within |
None
|
radius_km
|
float
|
Radius around the ground site to highlight data from; ignored if |
100.0
|
time_range
|
TimeRangeLike | None
|
Time range to highlight as selection area; ignored if |
None
|
view
|
Literal['global', 'data', 'overpass']
|
Map extent mode: "global" for full world, "data" for tight bounds, or "overpass" to zoom around |
'global'
|
zoom_tmin
|
TimestampLike | None
|
Optional lower time bound used for zooming map around track. Defaults to None. |
None
|
zoom_tmax
|
TimestampLike | None
|
Optional upper time bound used for zooming map around track. Defaults to None. |
None
|
color
|
ColorLike | None
|
Color used for selected section of the track or entire track if no selection. Defaults to "ec:earthcare". |
'ec:earthcare'
|
linewidth
|
float
|
Line width for selected track section. Defaults to 3. |
3
|
linestyle
|
str | None
|
Line style for selected track section. Defaults to "solid". |
'solid'
|
color2
|
ColorLike | None
|
Color used for unselected sections of the track. Defaults to "ec:blue". |
'ec:blue'
|
linewidth2
|
float
|
Line width for unselected sections. Defaults to None. |
None
|
linestyle2
|
str | None
|
Line style for unselected sections. Defaults to None. |
None
|
cmap
|
str | Cmap | None
|
Colormap to use when plotting a swath variable. Defaults to None. |
None
|
zoom_radius_km
|
float | None
|
If set, overrides map extent derived from |
None
|
extent
|
list[float] | None
|
Map extent in the form [lon_min, lon_max, lat_min, lat_max]. If given, overrides map extent derived from |
None
|
central_latitude
|
float | None
|
Central latitude used for the map projection. Defaults to None. |
None
|
central_longitude
|
float | None
|
Central longitude used for the map projection. Defaults to None. |
None
|
value_range
|
ValueRangeLike | None
|
Min and max range for the variable values; ignored if |
None
|
log_scale
|
bool | None
|
Whether to apply a logarithmic color scale to the variable. Defaults to None. |
None
|
norm
|
Normalize | None
|
Matplotlib norm to use for color scaling. Defaults to None. |
None
|
colorbar
|
bool
|
Whether to display a colorbar for the variable. Defaults to True. |
True
|
pad
|
float | list[float] | None
|
Padding around the map extent; ignored if |
None
|
show_text_time
|
bool | None
|
Whether to display the UTC time start and end of the selected track. Defaults to None. |
None
|
show_text_frame
|
bool | None
|
Whether to display EarthCARE frame information. Defaults to None. |
None
|
show_text_overpass
|
bool | None
|
Whether to display overpass site name and related info. Defaults to None. |
None
|
cb_orientation
|
Literal['vertical', 'horizontal']
|
Orientation of the colorbar. Defaults to "horizontal". |
'horizontal'
|
cb_position
|
Literal['left', 'right', 'top', 'bottom']
|
Position of the colorbar in the plot. Defaults to "bottom". |
'bottom'
|
cb_alignment
|
Literal['left', 'center', 'right']
|
Horizontal alignment of the colorbar relative to the plot. Defaults to "center". |
'center'
|
cb_buffer
|
float
|
Distance between plot and colorbar in axes units. Defaults to 1.02. |
1.02
|
cb_width_ratio
|
float | str
|
Width of the colorbar relative to the plot area. Defaults to "2.5%". |
'2%'
|
cb_height_ratio
|
float | str
|
Height of the colorbar relative to the plot area. Defaults to "100%". |
'100%'
|
Returns:
Name | Type | Description |
---|---|---|
MapFigure |
MapFigure
|
The figure object containing the map with track or swath. |
Example
Source code in earthcarekit/plot/figure/map.py
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 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 |
|
ProductInfo
dataclass
Class storing all info gathered from a EarthCARE product's file path.
Source code in earthcarekit/utils/read/product/file_info/product_info.py
ProfileData
dataclass
Container for atmospheric profile data.
Stores profile values together with their time/height bins and, optionally, their coordinates and metadata in a consistent structure, making profiles easier to handle, compare and visualise.
Attributes:
Name | Type | Description |
---|---|---|
values |
NDArray
|
Profile data, either a single vertical profile or a time series of profiles (time x height). |
height |
NDArray
|
Height bin centers, ascending. Can be fixed or vary with time. |
time |
NDArray
|
Timestamps corresponding to each profile. |
latitude |
NDArray | None
|
Ground latitudes for the profiles, optional. |
longitude |
NDArray | None
|
Ground longitudes for the profiles, optional. |
color |
str | None
|
Color for plotting, optional. |
label |
str | None
|
Variable label for plot annotations, optional. |
units |
str | None
|
Units for plot annotations, optional. |
platform |
str | None
|
Name or type of measurement platform/instrument, optional. |
error |
NDArray | None
|
Associated uncertainties for the profile values, optional. |
Source code in earthcarekit/utils/profile_data/profile_data.py
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 |
|
coarsen_mean
Returns downsampled profile data.
Source code in earthcarekit/utils/profile_data/profile_data.py
layer_mean
Returns layer mean values.
Source code in earthcarekit/utils/profile_data/profile_data.py
mean
Returns mean profile.
Source code in earthcarekit/utils/profile_data/profile_data.py
rebin_along_track
Rebins profiles to new time bins.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
latitude_bin_centers
|
ArrayLike
|
Target time bin centers as a 1D array (shape represents temporal dimension) |
required |
Returns:
Name | Type | Description |
---|---|---|
rebinned_profiles |
VerticalProfiles
|
Profiles rebinned along the temporal dimension according to |
Source code in earthcarekit/utils/profile_data/profile_data.py
rebin_height
Rebins profiles to new height bins.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_height
|
ndarray
|
Target height bin centers as a 1D array (shape represents vertical dimension) |
required |
Returns:
Name | Type | Description |
---|---|---|
rebinned_profiles |
VerticalProfiles
|
Profiles rebinned along the vertical dimension according to |
Source code in earthcarekit/utils/profile_data/profile_data.py
rebin_time
Rebins profiles to new time bins.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_bin_centers
|
Iterable[TimestampLike] | ArrayLike
|
Target time bin centers as a 1D array (shape represents temporal dimension) |
required |
Returns:
Name | Type | Description |
---|---|---|
rebinned_profiles |
VerticalProfiles
|
Profiles rebinned along the temporal dimension according to |
Source code in earthcarekit/utils/profile_data/profile_data.py
rolling_mean
Returns mean profile.
Source code in earthcarekit/utils/profile_data/profile_data.py
select_height_range
Retruns only data within the specified height_range
.
Source code in earthcarekit/utils/profile_data/profile_data.py
select_time_range
Retruns only data within the specified time_range
.
Source code in earthcarekit/utils/profile_data/profile_data.py
ProfileFigure
Source code in earthcarekit/plot/figure/profile.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 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 |
|
plot
plot(
profiles=None,
*,
values=None,
time=None,
height=None,
latitude=None,
longitude=None,
error=None,
label=None,
units=None,
value_range=(0, None),
height_range=None,
time_range=None,
selection_height_range=None,
show_mean=True,
show_std=True,
show_min=False,
show_max=False,
show_sem=False,
show_error=False,
color=None,
alpha=1.0,
linestyle="solid",
linewidth=1.5,
ribbon_alpha=0.2,
show_grid=None,
zorder=1,
legend_label=None,
show_legend=None,
show_steps=DEFAULT_PROFILE_SHOW_STEPS
)
TODO: documentation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profiles
|
ProfileData | None
|
description. Defaults to None. |
None
|
values
|
NDArray | None
|
description. Defaults to None. |
None
|
time
|
NDArray | None
|
description. Defaults to None. |
None
|
height
|
NDArray | None
|
description. Defaults to None. |
None
|
latitude
|
NDArray | None
|
description. Defaults to None. |
None
|
longitude
|
NDArray | None
|
description. Defaults to None. |
None
|
error
|
NDArray | None
|
description. Defaults to None. |
None
|
label
|
str | None
|
description. Defaults to None. |
None
|
units
|
str | None
|
description. Defaults to None. |
None
|
value_range
|
ValueRangeLike | None
|
description. Defaults to (0, None). |
(0, None)
|
height_range
|
DistanceRangeLike | None
|
description. Defaults to None. |
None
|
time_range
|
TimeRangeLike | None
|
description. Defaults to None. |
None
|
selection_height_range
|
DistanceRangeLike | None
|
description. Defaults to None. |
None
|
show_mean
|
bool
|
description. Defaults to True. |
True
|
show_std
|
bool
|
description. Defaults to True. |
True
|
show_min
|
bool
|
description. Defaults to False. |
False
|
show_max
|
bool
|
description. Defaults to False. |
False
|
show_sem
|
bool
|
description. Defaults to False. |
False
|
show_error
|
bool
|
description. Defaults to False. |
False
|
color
|
str | ColorLike | None
|
description. Defaults to None. |
None
|
alpha
|
float
|
description. Defaults to 1.0. |
1.0
|
linestyle
|
str
|
description. Defaults to "solid". |
'solid'
|
linewidth
|
int | float
|
description. Defaults to 1.5. |
1.5
|
ribbon_alpha
|
float
|
description. Defaults to 0.2. |
0.2
|
show_grid
|
bool | None
|
description. Defaults to None. |
None
|
zorder
|
int | float | None
|
description. Defaults to 1. |
1
|
legend_label
|
str | None
|
description. Defaults to None. |
None
|
show_legend
|
bool | None
|
description. Defaults to None. |
None
|
show_steps
|
bool
|
description. Defaults to DEFAULT_PROFILE_SHOW_STEPS. |
DEFAULT_PROFILE_SHOW_STEPS
|
Raises:
Type | Description |
---|---|
ValueError
|
description |
ValueError
|
description |
Returns:
Name | Type | Description |
---|---|---|
ProfileFigure |
ProfileFigure
|
description |
Source code in earthcarekit/plot/figure/profile.py
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 |
|
SwathFigure
TODO: documentation
Source code in earthcarekit/plot/figure/swath.py
35 36 37 38 39 40 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 |
|
compare_bsc_ext_lr_depol
compare_bsc_ext_lr_depol(
input_ec,
input_ground=None,
time_var_ground="time",
height_var_ground="height",
bsc_var_ground=[],
ext_var_ground=[],
lr_var_ground=[],
depol_var_ground=[],
input_ec2=None,
input_ec3=None,
input_ec4=None,
site=None,
radius_km=100.0,
resolution="_low_resolution",
resolution2=None,
resolution3=None,
resolution4=None,
height_range=(0, 30000.0),
selection_height_range=None,
selection_height_range_bsc=None,
selection_height_range_ext=None,
selection_height_range_lr=None,
selection_height_range_depol=None,
value_range_bsc=(0, 8e-06),
value_range_ext=(0, 0.0003),
value_range_lr=(0, 100),
value_range_depol=(0, 0.6),
colors_ec=["ec:red", "ec:orange", "ec:yellow", "ec:purple"],
colors_ground=[
"ec:blue",
"ec:darkblue",
"ec:lightgreen",
"ec:darkgreen",
"ec:purple",
],
alpha=1.0,
show_steps=DEFAULT_PROFILE_SHOW_STEPS,
show_error_ec=False,
to_mega=False,
single_figsize=(5 * CM_AS_INCH, 12 * CM_AS_INCH),
)
Compares Lidar profiles from up to 3 EarthCARE source dataset an one ground-based dataset by creating plots and statistics dataframe.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_ec
|
str | Dataset
|
A opened EarthCARE or file path. |
required |
input_ground
|
str | Dataset
|
A opened ground-based NetCDF dataset or file path (e.g., PollyNET data). |
None
|
time_var_ground
|
str
|
The name of the time variable in the ground-based dataset (e.g., for single profile PollyNET data use |
'time'
|
height_var_ground
|
str
|
The name of the height variable in the ground-based dataset. Defaults to |
'height'
|
bsc_var_ground
|
str | tuple | list[str | tuple]
|
Backscatter variable name in the ground-based dataset.
Multiple variables can be provided as list. Variable errors can be provided as tuples (e.g., |
[]
|
ext_var_ground
|
str | tuple | list[str | tuple]
|
Extinction variable name in the ground-based dataset.
Multiple variables can be provided as list. Variable errors can be provided as tuples (e.g., |
[]
|
lr_var_ground
|
str | tuple | list[str | tuple]
|
Lidar ratio variable name in the ground-based dataset.
Multiple variables can be provided as list. Variable errors can be provided as tuples (e.g., |
[]
|
depol_var_ground
|
str | tuple | list[str | tuple]
|
Depol. ratio variable name in the ground-based dataset.
Multiple variables can be provided as list. Variable errors can be provided as tuples (e.g., |
[]
|
input_ec2
|
str | Dataset
|
An optional seconds EarthCARE dataset to compare. Defaults to None. |
None
|
input_ec3
|
str | Dataset
|
An optional third EarthCARE dataset to compare. Defaults to None. |
None
|
site
|
GroundSite | str | None
|
Ground site or location of the ground-based data as a |
None
|
radius_km
|
float
|
Radius around the ground site. Defaults to 100.0. |
100.0
|
resolution
|
str
|
Sets the used resolution of the EarthCARE data if applicable (e.g., for A-EBD). Defaults to "_low_resolution". |
'_low_resolution'
|
height_range
|
tuple[float, float] | None
|
Height range in meters to restrict the data for plotting. Defaults to (0, 30e3). |
(0, 30000.0)
|
selection_height_range
|
tuple[float, float] | None
|
Height range in meters to select data for statistsics. Defaults to None. |
None
|
selection_height_range_bsc
|
tuple[float, float] | None
|
Height range in meters to select bsc. data for statistsics. Defaults to None (i.e., |
None
|
selection_height_range_ext
|
tuple[float, float] | None
|
Height range in meters to select ext. data for statistsics. Defaults to None (i.e., |
None
|
selection_height_range_lr
|
tuple[float, float] | None
|
Height range in meters to select LR data for statistsics. Defaults to None (i.e., |
None
|
selection_height_range_depol
|
tuple[float, float] | None
|
Height range in meters to select depol. data for statistsics. Defaults to None (i.e., |
None
|
value_range_bsc
|
ValueRangeLike | None
|
Tuple setting minimum and maximum value on x-axis. Defaults to (0, 8e-6). |
(0, 8e-06)
|
value_range_ext
|
ValueRangeLike | None
|
Tuple setting minimum and maximum value on x-axis. Defaults to (0, 3e-4). |
(0, 0.0003)
|
value_range_lr
|
ValueRangeLike | None
|
Tuple setting minimum and maximum value on x-axis. Defaults to (0, 100). |
(0, 100)
|
value_range_depol
|
ValueRangeLike | None
|
Tuple setting minimum and maximum value on x-axis. Defaults to (0, 0.6). |
(0, 0.6)
|
colors_ec
|
list[str]
|
List of colors for the EarthCARE profiles. |
['ec:red', 'ec:orange', 'ec:yellow', 'ec:purple']
|
colors_ground
|
list[str]
|
List of colors for the ground-based profiles. |
['ec:blue', 'ec:darkblue', 'ec:lightgreen', 'ec:darkgreen', 'ec:purple']
|
alpha
|
float
|
Transparency value for the profile lines (value between 0 and 1). Defaults to 1.0. |
1.0
|
show_steps
|
bool
|
If True, profiles will be plotted as step functions instead of bin centers. |
DEFAULT_PROFILE_SHOW_STEPS
|
show_error_ec
|
bool
|
If True, plot error ribbons for EarthCARE profiles. |
False
|
to_mega
|
bool
|
If Ture, converts bsc. and ext. data results (i.e., plot and statistics) to [Mm-1 sr-1] and [Mm-1]. Defaults to False. |
False
|
single_figsize
|
tuple[float, float]
|
2-element tuple setting width and height of the subfigures (i.e., for each profile plot). |
(5 * CM_AS_INCH, 12 * CM_AS_INCH)
|
Returns:
results (_CompareBscExtLRDepolResults): An object containing the plot and statistical results.
- results.fig
: The matplotlib
figure
- results.fig_bsc
: Backscatter subfigure as ProfileFigure
- results.fig_ext
: Extinction subfigure as ProfileFigure
- results.fig_lr
: Lidar ratio subfigure as ProfileFigure
- results.fig_depol
: Depol. ratio subfigure as ProfileFigure
- results.stats
: Statistical results as a pandas.DataFrame
Source code in earthcarekit/calval/_compare_bsc_ext_lr_depol.py
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 |
|
create_column_subfigures
Creates a figure with multiple subfigures arranged as columns in a single row, each containing one Axes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncols
|
int
|
Number of subfigures (columns) to create. |
required |
single_figsize
|
tuple[float, float]
|
Size (width, height) of each individual subfigure. Defaults to (3, 8). |
(3, 8)
|
Returns:
Type | Description |
---|---|
tuple[Figure, list[Axes]]
|
tuple[Figure, list[Axes]]: The parent figure and a list of Axes objects, one for each subfigure. |
Source code in earthcarekit/plot/figure/multi_panel/simple_columns.py
create_fig_layout_map_main_zoom_profile
create_fig_layout_map_main_zoom_profile(
main_rows,
zoom_rows=None,
profile_rows=None,
map_rows=None,
wspace=3.0 * CM_AS_INCH,
hspace=3.0 * CM_AS_INCH,
wmain=FIGURE_WIDTH_CURTAIN,
hrow=FIGURE_HEIGHT_CURTAIN,
hswath=FIGURE_HEIGHT_SWATH,
hline=FIGURE_HEIGHT_LINE,
wprofile=FIGURE_WIDTH_PROFILE,
wmap=FIGURE_MAP_WIDTH,
wzoom=FIGURE_WIDTH_CURTAIN / 3.0,
)
Creates a complex figure layout with columns for map, main, zoom, and profile panels (in that order from left to right).
Each panel column can have a custom sequence of figure types (e.g., row heights), and the layout supports both uniform and per-gap horizontal/vertical spacing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
main_rows
|
Sequence[FigureType | int]
|
List of figure types for the rows of the main column. |
required |
zoom_rows
|
Sequence[FigureType | int]
|
List of figure types for the rows in the optional zoom column. |
None
|
profile_rows
|
Sequence[FigureType | int]
|
List of figure types for the rows in the optional profile column. |
None
|
map_rows
|
Sequence[FigureType | int]
|
List of figure types for the rows in the optional map column. |
None
|
wspace
|
float | Sequence[float]
|
Horizontal spacing between columns. Can be a single value or list defining spacing before, between, and after columns. |
3.0 * CM_AS_INCH
|
hspace
|
float | Sequence[float]
|
Vertical spacing between rows. Similar behavior as |
3.0 * CM_AS_INCH
|
wmain
|
float
|
Width of the main column. Default is |
FIGURE_WIDTH_CURTAIN
|
hrow
|
float
|
Height of a standard row. Default is |
FIGURE_HEIGHT_CURTAIN
|
hswath
|
float
|
Height of a |
FIGURE_HEIGHT_SWATH
|
wprofile
|
float
|
Width of the profile column. |
FIGURE_WIDTH_PROFILE
|
wmap
|
float
|
Width of the map column. |
FIGURE_MAP_WIDTH
|
wzoom
|
float
|
Width of the zoom column. |
FIGURE_WIDTH_CURTAIN / 3.0
|
Returns:
Name | Type | Description |
---|---|---|
tuple |
tuple[Figure, Sequence[Axes], Sequence[Axes], Sequence[Axes], Sequence[Axes]]
|
A tuple containing: - Figure: The matplotlib figure object. - Sequence[Axes]: Axes for map panels (may be empty). - Sequence[Axes]: Axes for main panels. - Sequence[Axes]: Axes for zoom panels (may be empty). - Sequence[Axes]: Axes for profile panels (may be empty). |
Raises:
Type | Description |
---|---|
ValueError
|
If the provided spacing sequences are of invalid length. |
TypeError
|
If spacing arguments are of unsupported types. |
Source code in earthcarekit/plot/figure/multi_panel/map_main_zoom_profile_figure.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 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 |
|
ecquicklook
ecquicklook(
ds,
vars=None,
show_maps=True,
show_zoom=False,
show_profile=True,
site=None,
radius_km=100.0,
time_range=None,
height_range=(0, 30000.0),
ds_tropopause=None,
ds_elevation=None,
ds_temperature=None,
resolution="low",
ds2=None,
ds_xmet=None,
logger=None,
log_msg_prefix="",
selection_max_time_margin=None,
show_steps=DEFAULT_PROFILE_SHOW_STEPS,
mode="fast",
)
Generate a preview visualization of an EarthCARE dataset with optional maps, zoomed views, and profiles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds
|
Dataset | str
|
EarthCARE dataset or path. |
required |
vars
|
(str | list[str] | None, otional)
|
List of variable to plot. Automatically sets product-specific default list of variables if None. |
None
|
show_maps
|
bool
|
Whether to include map view. Dafaults to True. |
True
|
show_zoom
|
bool
|
Whether to show an additional column of zoomed plots. Defaults to False. |
False
|
show_profile
|
bool
|
Whether to include vertical profile plots. Dfaults to True. |
True
|
site
|
GroundSite | str | None
|
Ground site object or name identifier. |
None
|
radius_km
|
float
|
Search radius around site in kilometers. Defaults to 100. |
100.0
|
time_range
|
TimeRangeLike | None
|
Time range filter. |
None
|
height_range
|
DistanceRangeLike | None
|
Height range in meters. Defaults to (0, 30_000). |
(0, 30000.0)
|
ds_tropopause
|
Dataset | str | None
|
Optional dataset or path containing tropopause data to add it to the plot. |
None
|
ds_elevation
|
Dataset | str | None
|
Optional dataset or path containing elevation data to add it to the plot. |
None
|
ds_temperature
|
Dataset | str | None
|
Optional dataset or path containing temperature data to add it to the plot. |
None
|
resolution
|
Literal['low', 'medium', 'high', 'l', 'm', 'h']
|
Resolution of A-PRO data. Defaults to "low". |
'low'
|
ds2
|
Dataset | str | None
|
Secondary dataset required for certain product quicklook (e.g., A-LAY products need A-NOM or A-EBD to serve as background curtain plots). |
None
|
ds_xmet
|
Dataset | str | None
|
Optional auxiliary meteorological dataset used to plot tropopause, elevation and temperature from. |
None
|
logger
|
Logger
|
Logger instance for output messages. |
None
|
log_msg_prefix
|
str
|
Prefix for log messages. |
''
|
selection_max_time_margin
|
TimedeltaLike | Sequence[TimedeltaLike] | None
|
Allowed time difference for selection. |
None
|
show_steps
|
bool
|
Whether to plot profiles as height bin step functions or instead plot only the line through bin centers. Defaults to True. |
DEFAULT_PROFILE_SHOW_STEPS
|
mode
|
Literal['fast', 'exact']
|
Processing mode. |
'fast'
|
Returns:
Name | Type | Description |
---|---|---|
_QuicklookResults |
_QuicklookResults
|
Object containing figures and metadata. |
Source code in earthcarekit/plot/quicklook/_quicklook.py
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 |
|
geodesic
Calculates the geodesic distances between points on Earth (i.e. WSG 84 ellipsoid) using Vincenty's inverse method.
Supports single or sequences of coordiates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
ArrayLike
|
Coordinates [lat, lon] or array of shape (N, 2), in decimal degrees. |
required |
b
|
ArrayLike
|
Second coordinates, same format/shape as |
required |
units
|
str
|
Output units, "km" (default) or "m". |
'km'
|
tolerance
|
float
|
Convergence threshold in radians. Default is 1e-12. |
1e-12
|
max_iterations
|
int
|
Maximum iterations before failure. Default is 10. |
10
|
Returns:
Type | Description |
---|---|
float64 | NDArray[float64]
|
float or np.ndarray: The geodesic distance or distances between the point in |
Raises:
Type | Description |
---|---|
ValueError
|
If input shapes are incompatible or units are invalid. |
Note
Uses WGS84 (a=6378137.0 m, f=1/298.257223563). May fail for nearly antipodal points.
Examples:
>>> geodesic([51.352757, 12.43392], [38.559, 68.856])
4548.675334434374
>>> geodesic([0,0], [[0,0], [10,0], [20,0]])
array([ 0. , 1105.85483324, 2212.36625417])
>>> geodesic([[0,0], [10,0], [20,0]], [[0,0], [10,0], [20,0]])
array([0., 0., 0.])
References
Vincenty, T. (1975). "Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations." Survey Review, 23(176), 88-93. https://doi.org/10.1179/sre.1975.23.176.88
Source code in earthcarekit/utils/geo/distance/_vincenty.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 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 |
|
get_cmap
Return a color map given by cmap
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cmap
|
str | Colormap | list | None
|
|
required |
Returns:
cmap (Cmap):
A color map matching the given cmap
.
Source code in earthcarekit/plot/color/colormap/colormap.py
get_ground_site
Retruns ground site data based on name and raises ValueError
if no matching ground site is found and TypeError
.
Source code in earthcarekit/utils/ground_sites.py
get_product_info
Gather all info contained in the EarthCARE product's file path.
Source code in earthcarekit/utils/read/product/file_info/product_info.py
get_product_infos
Extracts product metadata from EarthCARE product file paths (e.g. file_type, orbit_number, frame_id, baseline, ...).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepaths
|
str | list[str] | NDArray | DataFrame | Dataset
|
Input sources for EarthCARE product files. Can be one of
- |
required |
**kwargs
|
Additional arguments passed to |
{}
|
Returns:
Name | Type | Description |
---|---|---|
ProductDataFrame |
ProductDataFrame
|
A dataframe containing extracted product information. |
Source code in earthcarekit/utils/read/product/file_info/product_info.py
haversine
Calculates the great-circle (spherical) distance between pairs of latitude/longitude coordinates using the haversine formula.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
ArrayLike
|
An array-like object of shape (..., 2) containing latitude and longitude coordinates in degrees. The last dimension must be 2: (lat, lon). |
required |
b
|
ArrayLike
|
An array-like object of the same shape as |
required |
units
|
Literal['m', 'km']
|
Unit of the output distance. Must be either "km" for kilometers or "m" for meters. Defaults to "km". |
'km'
|
radius
|
float
|
Radius of the sphere to use for distance calculation.
Defaults to MEAN_EARTH_RADIUS_METERS (based on WSG 84 ellipsoid: ~6371008.77 meters).
Note: If |
required |
Returns:
Type | Description |
---|---|
np.ndarray: Array of great-circle distances between |
Raises:
Type | Description |
---|---|
ValueError
|
If the shapes of |
Examples:
>>> haversine([51.352757, 12.43392], [38.559, 68.856])
4537.564747442274
>>> haversine([0,0], [[0,0], [10,0], [20,0]])
array([ 0. , 1111.95079735, 2223.90159469])
>>> haversine([[0,0], [10,0], [20,0]], [[0,0], [10,0], [20,0]])
array([0., 0., 0.])
Source code in earthcarekit/utils/geo/distance/_haversine.py
read_any
Reads various input types and returns an xarray.Dataset
.
This function can read
- EarthCARE product files (
.h5
) - NetCDF files (
.nc
) - Manually processed PollyXT output files (
.txt
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
str | Dataset
|
File path or existing Dataset. |
required |
**kwargs
|
Additional keyword arguments for specific readers. |
{}
|
Returns:
Type | Description |
---|---|
Dataset
|
xr.Dataset: Opened dataset. |
Raises:
Type | Description |
---|---|
ValueError
|
If the file type is not supported. |
TypeError
|
If the input type is invalid. |
Source code in earthcarekit/utils/read/_read_any.py
read_header_data
Opens the product header groups of a EarthCARE file as a xarray.Dataset
.
Source code in earthcarekit/utils/read/product/header_group.py
read_nc
Returns an xarray.Dataset
from a Dataset or NetCDF file path, optionally loaded into memory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
Dataset or str
|
Path to a NetCDF file. If a already opened |
required |
modify
|
bool
|
If True, default modifications to the opened dataset will be applied (e.g., converting heights in Polly data from height a.g.l. to height above mean sea level). |
True
|
in_memory
|
bool
|
If True, ensures the dataset is fully loaded into memory. Defaults to False. |
False
|
**kwargs
|
Key-word arguments passed to |
{}
|
Returns:
Type | Description |
---|---|
Dataset
|
xarray.Dataset: The resulting dataset. |
Raises:
Type | Description |
---|---|
TypeError
|
If input is not a Dataset or string. |
Source code in earthcarekit/utils/read/_read_nc.py
read_polly
Reads manually processed PollyXT output text files as xarray.Dataset
or returns an already open one.
Source code in earthcarekit/utils/read/_read_polly.py
read_product
read_product(
input,
trim_to_frame=True,
modify=DEFAULT_READ_EC_PRODUCT_MODIFY,
header=DEFAULT_READ_EC_PRODUCT_HEADER,
meta=DEFAULT_READ_EC_PRODUCT_META,
in_memory=False,
)
Returns an xarray.Dataset
from a Dataset or EarthCARE file path, optionally loaded into memory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
str or Dataset
|
Path to a EarthCARE file. If a |
required |
trim_to_frame
|
bool
|
Whether to trim the dataset to latitude frame bounds. Defaults to True. |
True
|
modify
|
bool
|
If True, default modifications to the opened dataset will be applied (e.g., renaming dimension corresponding to height to "vertical"). Defaults to True. |
DEFAULT_READ_EC_PRODUCT_MODIFY
|
header
|
bool
|
If True, all header data will be included in the dataframe. Defaults to False. |
DEFAULT_READ_EC_PRODUCT_HEADER
|
meta
|
bool
|
If True, select meta data from header (like orbit number and frame ID) will be included in the dataframe. Defaults to True. |
DEFAULT_READ_EC_PRODUCT_META
|
in_memory
|
bool
|
If True, ensures the dataset is fully loaded into memory. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Dataset
|
xarray.Dataset: The resulting dataset. |
Raises:
Type | Description |
---|---|
TypeError
|
If input is not a Dataset or string. |
Source code in earthcarekit/utils/read/product/_generic.py
read_products
read_products(
filepaths,
zoom_at=None,
along_track_dim=ALONG_TRACK_DIM,
func=None,
func_inputs=None,
max_num_files=8,
coarsen=True,
)
Read and concatenate a sequence of EarthCARE frames into a single xarray Dataset.
Optionally applies a processing function to each frame and zooms in on a specific region
(defined by zoom_at
). Handles coarse averaging when not zooming.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepaths
|
Sequence[str] or DataFrame
|
EarthCARE product file paths as a list or a DataFrame
with metadata including |
required |
zoom_at
|
float
|
If set, selects only a zoomed-in portion of the frames around this fractional index. Defaults to None. |
None
|
along_track_dim
|
str
|
Name of the dimension to concatenate along. Defaults to ALONG_TRACK_DIM. |
ALONG_TRACK_DIM
|
func
|
Callable
|
Function to apply to each frame after loading. Defaults to None. |
None
|
func_inputs
|
Sequence[dict]
|
Optional per-frame arguments to pass to |
None
|
max_num_files
|
int
|
Max. number of files that are allowed to be loaded at once. A |
8
|
coarsen
|
bool
|
If Ture, read data sets are coarened depending on the number given of files. Only aplicable when not zooming. Defaults to Ture. |
True
|
Returns:
Name | Type | Description |
---|---|---|
Dataset |
Dataset
|
Concatenated dataset with all frames along |
Source code in earthcarekit/utils/read/product/_concat.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 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 |
|
read_science_data
Opens the science data of a EarthCARE file as a xarray.Dataset
.
Source code in earthcarekit/utils/read/product/science_group.py
rebin_xmet_to_vertical_track
rebin_xmet_to_vertical_track(
ds_xmet,
ds_vert,
vars=None,
k=4,
eps=1e-12,
lat_var=TRACK_LAT_VAR,
lon_var=TRACK_LON_VAR,
time_var=TIME_VAR,
height_var=HEIGHT_VAR,
along_track_dim=ALONG_TRACK_DIM,
height_dim=VERTICAL_DIM,
xmet_lat_var="latitude",
xmet_lon_var="longitude",
xmet_height_var="geometrical_height",
xmet_height_dim="height",
xmet_horizontal_grid_dim="horizontal_grid",
)
Rebins variables from an AUX_MET_1D (XMET) dataset onto the vertical curtain track of given by another dataset (e.g. ATL_EBD_2A).
This function interpolates selected variables from ds_xmet
onto a EarthCARE
vertical track given in ds_vert
, using quick horizontal kd-tree nearest-neighbor search with scipy.spatial.cKDTree
followed
by averaging the k
-nearest vertical XMET profiles using inverse distance weighting. The resulting
profiles are then interpolated in the vertical to match the height resolution of ds_vert
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds_xmet
|
Dataset
|
The source XMET dataset from which vertical curtain along track will be interpolated. |
required |
ds_vert
|
Dataset
|
The target dataset containing the vertical curtain track. |
required |
vars
|
list[str] | None
|
List of variable names from |
None
|
k
|
int
|
Number of nearest horizontal neighbors to include in the kd-tree search. Defaults to 4. |
4
|
eps
|
float
|
Numerical threshold to avoid division by zero in distance calculations during the kd-tree search. Defaults to 1e-12. |
1e-12
|
lat_var
|
str
|
Name of the latitude variable in |
TRACK_LAT_VAR
|
lon_var
|
str
|
Name of the longitude variable in |
TRACK_LON_VAR
|
time_var
|
str
|
Name of the time variable in |
TIME_VAR
|
height_var
|
str
|
Name of the height variable in |
HEIGHT_VAR
|
along_track_dim
|
str
|
Name of the along-track dimension in |
ALONG_TRACK_DIM
|
height_dim
|
str
|
Name of the vertical or height dimension in |
VERTICAL_DIM
|
xmet_lat_var
|
str
|
Name of the latitude variable in |
'latitude'
|
xmet_lon_var
|
str
|
Name of the longitude variable in |
'longitude'
|
xmet_height_var
|
str
|
Name of the height variable in |
'geometrical_height'
|
xmet_height_dim
|
str
|
Name of the vertical dimension in |
'height'
|
xmet_horizontal_grid_dim
|
str
|
Name of the horizontal grid dimension in |
'horizontal_grid'
|
Returns:
Type | Description |
---|---|
Dataset
|
xr.Dataset: A new dataset containing the selected XMET variables interpolated to the grid of the
vertical curtain given in |
Raises:
Type | Description |
---|---|
KeyError
|
If any specified variable or coordinate name is not found in |
Source code in earthcarekit/utils/read/product/auxiliary/aux_met_1d.py
30 31 32 33 34 35 36 37 38 39 40 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 |
|
search_files_by_regex
Recursively searches for files in a directory that match a given regex pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root_dirpath
|
str
|
The root directory to start the search from. |
required |
regex_pattern
|
str
|
A regular expression pattern to match file names against. |
required |
Return
list[str]: A list of absolute file paths that point to files with matching names.
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If the root directory does not exist. |
error
|
If the given pattern is not a valid regular expression. |
Source code in earthcarekit/utils/read/search.py
search_product
search_product(
root_dirpath=None,
config=None,
file_type=None,
agency=None,
latency=None,
timestamp=None,
baseline=None,
orbit_and_frame=None,
orbit_number=None,
frame_id=None,
filename=None,
start_time=None,
end_time=None,
)
Searches for EarthCARE product files matching given metadata filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root_dirpath
|
str
|
Root directory to search. Defaults to directory given in a configuration file. |
None
|
config
|
str | ECKConfig | None
|
Path to a |
None
|
file_type
|
str | Iterable[str]
|
Product file type(s) to match. |
None
|
agency
|
str | Iterable[str]
|
Producing agency or agencies (e.g. "ESA" or "JAXA"). |
None
|
latency
|
str | Iterable[str]
|
Data latency level(s). |
None
|
timestamp
|
TimestampLike | Iterable
|
Timestamp(s) included in the product's time coverage. |
None
|
baseline
|
str | Iterable[str]
|
Baseline version(s). |
None
|
orbit_and_frame
|
str | Iterable[str]
|
Orbit and frame identifiers. |
None
|
orbit_number
|
int, str, | Iterable
|
Orbit number(s). |
None
|
frame_id
|
str | Iterable[str]
|
Frame identifier(s). |
None
|
filename
|
str | Iterable[str]
|
Specific filename(s) or regular expression patterns to match. |
None
|
start_time
|
TimestampLike
|
First timestamp included in the product's time coverage. |
None
|
end_time
|
TimestampLike
|
Last timestamp included in the product's time coverage. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ProductDataFrame |
ProductDataFrame
|
Filtered list of matching product files as a |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If root directory does not exist. |
Source code in earthcarekit/utils/read/product/_search.py
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 |
|
shift_cmap
Create a colormap with its center point shifted to a specified value.
This function is useful for data with asymmetric ranges (e.g., negative min and positive max) where you want the center of the colormap to align with a specific value like zero.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cmap
|
str | Colormap | None
|
Colormap to be modified |
required |
start
|
float
|
Lower bound of the colormap range (value between 0 and |
0.0
|
midpoint
|
float
|
New center point of the colormap (value between 0 and 1). Defaults to 0.5. For data ranging from vmin to vmax where you want the center at value v, set midpoint = 1 - vmax/(vmax + abs(vmin)) |
0.5
|
stop
|
float
|
Upper bound of the colormap range (value between |
1.0
|
name
|
str
|
Name of the new colormap. Defaults to "shifted_cmap". |
'shifted_cmap'
|
Returns:
Name | Type | Description |
---|---|---|
Cmap |
Cmap
|
New colormap with shifted center |