API reference
earthcarekit.plot
Plotting utilities.
Notes
This module depends on other internal modules:
- earthcarekit.color
- earthcarekit.colormap
- earthcarekit.constants
- earthcarekit.data
- earthcarekit.filter
- earthcarekit.geo
- earthcarekit.overpass
- earthcarekit.read
- earthcarekit.site
- earthcarekit.typing
- earthcarekit.utils
-
API reference
API reference
calval Notes
Cmap
Bases: ListedColormap
Colormap with categorical, gradient, and circular support.
This subclass of matplotlib.colors.ListedColormap adds utilities for
continuous and categorical color mappings. Supports labels, ticks,
normalization, blending, and transparency adjustments.
Attributes:
| Name | Type | Description |
|---|---|---|
categorical |
bool
|
Whether the colormap is discrete/categorical. |
gradient |
bool
|
Whether the colormap was generated from a gradient. |
circular |
bool
|
Whether the colormap wraps around cyclically. |
ticks |
list[float]
|
Optional tick positions for categorical plots. |
labels |
list[str]
|
Optional labels corresponding to ticks. |
norm |
Normalize | None
|
Normalization strategy for value mapping. |
values |
list
|
Associated values for categorical mapping. |
- API reference
- API reference
Source code in earthcarekit/colormap/_cmap.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 | |
__init__
__init__(
colors: Sequence,
name: str = "colormap",
N: int | None = None,
categorical: bool = False,
ticks: List[float] | None = None,
labels: List[str] | None = None,
norm: Normalize | None = None,
values: List | None = None,
gradient: bool = False,
circular: bool = False,
)
Initialize a Cmap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
colors
|
Sequence
|
Sequence of colors (strings or ColorLike objects). |
required |
name
|
str
|
Name of the colormap. Defaults to "colormap". |
'colormap'
|
N
|
int | None
|
Number of discrete colors. Defaults to None. |
None
|
categorical
|
bool
|
Whether the colormap is discrete/categorical. Defaults to False. |
False
|
ticks
|
list[float] | None
|
Optional tick positions for categorical plots. Defaults to None. |
None
|
labels
|
list[str] | None
|
Optional labels corresponding to ticks. Defaults to None. |
None
|
norm
|
Normalize | None
|
Normalization strategy for value mapping. Defaults to None. |
None
|
gradient
|
bool
|
If True, generate intermediate gradient colors. Defaults to False. |
False
|
circular
|
bool
|
If True, colormap wraps around cyclically. Defaults to False. |
False
|
Source code in earthcarekit/colormap/_cmap.py
__new__
Allow instantiation from an existing Colormap or standard arguments.
blend
Return a copy of the colormap blended with a second color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Blend factor in the range [0, 1]. |
required |
blend_color
|
Color | str
|
Color to blend with. |
'white'
|
Returns:
| Name | Type | Description |
|---|---|---|
Cmap |
Cmap
|
Blended colormap. |
Source code in earthcarekit/colormap/_cmap.py
from_colormap
classmethod
from_colormap(cmap: Colormap, N: int = 256, name: str | None = None) -> Cmap
Create a Cmap instance from an existing Matplotlib colormap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmap
|
Colormap
|
Source colormap to convert. |
required |
N
|
int
|
Number of discrete colors (if needed, e.g, for categorical colormaps with limited number of colors). Defaults to 256. |
256
|
Returns:
| Name | Type | Description |
|---|---|---|
Cmap |
Cmap
|
New colormap. |
Source code in earthcarekit/colormap/_cmap.py
rgba_list
property
List of RGBA tuples representing all colors in the colormap.
set_alpha
set_alpha(value: float) -> Cmap
Return a copy of the colormap with modified alpha transparency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
Alpha value in the range [0, 1]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Cmap |
Cmap
|
Colormap with updated transparency. |
Source code in earthcarekit/colormap/_cmap.py
to_categorical
to_categorical(
values_to_labels: Dict[Any, str] | int,
endpoint: bool | None = None,
use_discrete: bool | None = None,
) -> Cmap
Convert a colormap to categorical.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values_to_labels
|
dict | int
|
Mapping from values to labels, or number of categories if int. |
required |
endpoint
|
bool | None
|
Whether the last color is included at 1.0. |
None
|
use_discrete
|
bool | None
|
If True, use the colormap's defined colors directly rather than sampling across its range. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Cmap |
Cmap
|
Categorical version of the colormap. |
- Tutorials Colormaps Categorical colormaps
Source code in earthcarekit/colormap/_cmap.py
to_discrete
to_discrete(n: int) -> Cmap
Convert a colormap to a discretized version of itself.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
Number of steps (i.e., discrete colors). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Cmap |
Cmap
|
Discretized version of the colormap. |
Source code in earthcarekit/colormap/_cmap.py
Color
dataclass
Bases: str
Represents a color with convenient conversion, blending, and alpha support.
Extends str to store a color as a hex string while providing methods
to access RGB/RGBA, set transparency, blend with other colors, and
normalize input from various formats.
Attributes:
| Name | Type | Description |
|---|---|---|
input |
ColorLike
|
Original input used to create the color. |
name |
str | None
|
Optional name of the color. |
is_normalized |
bool
|
Whether the color values are normalized (0-1). |
- API reference
- API reference
Source code in earthcarekit/color/_color.py
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 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 | |
__hash__
__init__
__init__(color_input: Color | ColorLike, name: str | None = None, is_normalized: bool = False)
Initialize Color attributes.
Source code in earthcarekit/color/_color.py
__new__
__new__(color_input: Color | ColorLike, name: str | None = None, is_normalized: bool = False)
Create a Color instance from a color-like input.
Source code in earthcarekit/color/_color.py
blend
Returns the same color blended with a second color.
Source code in earthcarekit/color/_color.py
from_optional
classmethod
from_optional(
color_input: Color | ColorLike | None, alpha: float | None = None
) -> Union[Color, None]
Parses optional color input and returns a Color instance or None.
Source code in earthcarekit/color/_color.py
get_best_bw_contrast_color
get_best_bw_contrast_color() -> Color
Return black or white color depending on best contrast according to WCAG 2.0.
See https://www.w3.org/TR/WCAG20/
is_close_to_white
rgba
property
Returns the RGBA tuple with values in the 0-1 range.
set_alpha
set_alpha(value: float) -> Color
Returns the same color with the given transparency alpha value applied.
Source code in earthcarekit/color/_color.py
CurtainFigure
Bases: TimeseriesFigure
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.
Attributes:
| Name | Type | Description |
|---|---|---|
ax |
Axes | None
|
Existing matplotlib axes to plot on; if not provided, a new figure and axes will be created. Defaults to None. |
figsize |
tuple[float, float]
|
Size of the figure in inches. Defaults to (FIGURE_WIDTH_CURTAIN, FIGURE_HEIGHT_CURTAIN). |
dpi |
int | None
|
Resolution of the figure in dots per inch. Defaults to None. |
title |
str | None
|
Title to display above the curtain plot. Defaults to None. |
ax_style_top |
AlongTrackAxisStyle | str
|
Style of the top x-axis, e.g., "geo", "time", or "frame". Defaults to "geo". |
ax_style_bottom |
AlongTrackAxisStyle | str
|
Style of the bottom x-axis, e.g., "geo", "time", or "frame". Defaults to "time". |
num_ticks |
int
|
Maximum number of tick marks to be place along the x-axis. Defaults to 10. |
show_height_left |
bool
|
Whether to show height labels on the left y-axis. Defaults to True. |
show_height_right |
bool
|
Whether to show height labels on the right y-axis. Defaults to False. |
mode |
Literal['exact', 'fast']
|
Curtain plotting mode. Use "fast" to speed up plotting by coarsening data to at least |
min_num_profiles |
int
|
Minimum number of profiles to keep when using "fast" mode. Defaults to 5000. |
Source code in earthcarekit/plot/figure/curtain.py
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 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 | |
ax
property
The main matplotlib axis of the figure.
ecplot
ecplot(
ds: Dataset,
var: str,
*,
time_var: str = TIME_VAR,
height_var: str = HEIGHT_VAR,
lat_var: str = TRACK_LAT_VAR,
lon_var: str = TRACK_LON_VAR,
temperature_var: str = TEMP_CELSIUS_VAR,
along_track_dim: str = ALONG_TRACK_DIM,
site: SiteLike | None = None,
radius_km: float = 100.0,
mark_closest: bool = False,
show_radius: bool = True,
show_info: bool = True,
show_info_orbit_and_frame: bool = True,
show_info_file_type: bool = True,
show_info_baseline: bool = True,
info_text_orbit_and_frame: str | None = None,
info_text_file_type: str | None = None,
info_text_baseline: str | None = None,
info_text_loc: str | None = None,
values: NDArray | None = None,
time: NDArray | None = None,
height: NDArray | None = None,
latitude: NDArray | None = None,
longitude: NDArray | None = None,
values_temperature: NDArray | None = None,
value_range: ValueRangeLike | Literal["default"] | None = "default",
log_scale: bool | None = None,
norm: Normalize | None = None,
time_range: TimeRangeLike | None = None,
height_range: DistanceRangeLike | None = (0, 40000.0),
label: str | None = None,
units: str | None = None,
cmap: str | Colormap | None = None,
colorbar: bool = True,
colorbar_ticks: ArrayLike | None = None,
colorbar_tick_labels: ArrayLike | None = None,
colorbar_position: str | Literal["left", "right", "top", "bottom"] = "right",
colorbar_alignment: str | Literal["left", "center", "right"] = "center",
colorbar_width: float = DEFAULT_COLORBAR_WIDTH,
colorbar_spacing: float = 0.2,
colorbar_length_ratio: float | str = "100%",
colorbar_label_outside: bool = True,
colorbar_ticks_outside: bool = True,
colorbar_ticks_both: bool = False,
rolling_mean: int | None = None,
selection_time_range: TimeRangeLike | None = None,
selection_color: str | None = Color("ec:earthcare"),
selection_linestyle: str | None = "dashed",
selection_linewidth: float | int | None = 2.5,
selection_highlight: bool = False,
selection_highlight_inverted: bool = True,
selection_highlight_color: str | None = Color("white"),
selection_highlight_alpha: float = 0.5,
selection_max_time_margin: TimedeltaLike | Sequence[TimedeltaLike] | None = None,
ax_style_top: AlongTrackAxisStyle | str | None = None,
ax_style_bottom: AlongTrackAxisStyle | str | None = None,
show_temperature: bool = False,
mode: Literal["exact", "fast"] | None = None,
min_num_profiles: int = _MIN_NUM_PROFILES,
mark_time: TimestampLike | Sequence[TimestampLike] | None = None,
mark_time_color: str | Color | Sequence[str | Color | None] | None = None,
mark_time_linestyle: str | Sequence[str] = "solid",
mark_time_linewidth: float | Sequence[float] = 2.5,
label_length: int = 40,
**kwargs: Any
) -> Self
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
|
SiteLike | None
|
Highlights data within |
None
|
radius_km
|
float
|
Radius around the ground site to highlight data from; ignored if |
100.0
|
mark_closest
|
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. |
'default'
|
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 5000. |
_MIN_NUM_PROFILES
|
mark_time
|
Sequence[TimestampLike] | None
|
Timestamps at which to mark vertical profiles. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
CurtainFigure |
Self
|
The figure object containing the curtain plot. |
Example
Source code in earthcarekit/plot/figure/curtain.py
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 | |
ecplot_contour
ecplot_contour(
ds: Dataset,
var: str,
time_var: str = TIME_VAR,
height_var: str = HEIGHT_VAR,
levels: Sequence | NDArray | None = None,
label_format: str | None = None,
label_levels: Sequence | NDArray | None = None,
linewidths: int | float | Sequence | NDArray | None = 1.5,
linestyles: str | Sequence | NDArray | None = "solid",
colors: Color | str | Sequence | NDArray | None = "black",
zorder: float | int = _ZORDER_CONTOUR,
) -> Self
Adds contour lines to the plot.
Source code in earthcarekit/plot/figure/curtain.py
ecplot_elevation
ecplot_elevation(
ds: Dataset,
var: str = ELEVATION_VAR,
time_var: str = TIME_VAR,
land_flag_var: str = LAND_FLAG_VAR,
color: Color | str | None = "ec:land",
color_water: Color | str | None = "ec:water",
legend_label: str | None = None,
legend_label_water: str | None = None,
**kwargs: Any
) -> Self
Adds filled elevation/surface area to the plot.
Source code in earthcarekit/plot/figure/curtain.py
ecplot_hatch
ecplot_hatch(
ds: Dataset,
var: str,
value_range: tuple[float, float],
time_var: str = TIME_VAR,
height_var: str = HEIGHT_VAR,
hatch: str = "/////",
linewidth: float = 1,
linewidth_border: float = 0,
color: ColorLike | None = "black",
color_border: ColorLike | None = None,
zorder: int | float | None = _ZORDER,
legend_label: str | None = None,
) -> Self
Adds hatched/filled areas to the plot.
Source code in earthcarekit/plot/figure/curtain.py
ecplot_hatch_attenuated
ecplot_hatch_attenuated(
ds: Dataset,
var: str = "simple_classification",
value_range: tuple[float, float] = (-1.5, -0.5),
**kwargs: Any
) -> Self
Adds hatched area where ATLID "simple_classification" shows "attenuated" (-1).
Source code in earthcarekit/plot/figure/curtain.py
ecplot_height
ecplot_height(
ds: Dataset,
var: str,
time_var: str = TIME_VAR,
linewidth: int | float | None = 1.5,
linestyle: str | None = "none",
color: Color | str | None = "black",
zorder: int | float | None = _ZORDER,
marker: str | None = "s",
markersize: int | float | None = 1,
show_info: bool = True,
info_text_loc: str | None = None,
legend_label: str | None = None,
) -> Self
Adds height line to the plot.
Source code in earthcarekit/plot/figure/curtain.py
ecplot_pressure
ecplot_pressure(
ds: Dataset,
var: str = PRESSURE_VAR,
time_var: str = TIME_VAR,
height_var: str = HEIGHT_VAR,
label_format: str | None = "%d hPa",
scale: float = 0.01,
**kwargs: Any
) -> Self
Adds pressure contour lines to the plot.
Source code in earthcarekit/plot/figure/curtain.py
ecplot_temperature
ecplot_temperature(
ds: Dataset,
var: str = TEMP_CELSIUS_VAR,
label_format: str | None = "$%.0f^{\\circ}$C",
label_levels: Sequence | NDArray | None = [-80, -40, 0],
levels: Sequence | NDArray | None = None,
linewidths: int | float | Sequence | NDArray | None = None,
linestyles: str | Sequence | NDArray | None = None,
colors="black",
**kwargs: Any
) -> Self
Adds temperature contour lines to the plot.
Source code in earthcarekit/plot/figure/curtain.py
ecplot_tropopause
ecplot_tropopause(
ds: Dataset,
var: str = TROPOPAUSE_VAR,
time_var: str = TIME_VAR,
color: Color | str | None = "ec:tropopause",
linewidth: float = 2,
linestyle: str = "solid",
legend_label: str | None = None,
**kwargs: Any
) -> Self
Adds tropopause line to the plot.
Source code in earthcarekit/plot/figure/curtain.py
invert_xaxis
invert_yaxis
plot_contour
plot_contour(
values: NDArray,
time: NDArray,
height: NDArray,
label_levels: Sequence | NDArray | None = None,
label_format: str | None = None,
levels: Sequence | NDArray | None = None,
linewidths: int | float | Sequence | NDArray | None = 1.5,
linestyles: str | Sequence | NDArray | None = "solid",
colors: Color | str | Sequence | NDArray | None = "black",
zorder: int | float | None = _ZORDER_CONTOUR,
) -> Self
Adds contour lines to the plot.
Source code in earthcarekit/plot/figure/curtain.py
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 | |
plot_hatch
plot_hatch(
values: NDArray,
time: NDArray,
height: NDArray,
value_range: tuple[float, float],
hatch: str = "/////",
linewidth: float = 1,
linewidth_border: float = 0,
color: ColorLike | None = "black",
color_border: ColorLike | None = None,
zorder: int | float | None = _ZORDER,
legend_label: str | None = None,
) -> Self
Adds hatched/filled areas to the plot.
Source code in earthcarekit/plot/figure/curtain.py
plot_height
plot_height(
height: NDArray,
time: NDArray,
linewidth: int | float | None = 1.5,
linestyle: str | None = "solid",
color: Color | str | None = None,
alpha: float | None = 1.0,
zorder: int | float | None = _ZORDER,
marker: str | None = None,
markersize: int | float | None = None,
fill: bool = False,
legend_label: str | None = None,
**kwargs: Any
) -> Self
Adds height line to the plot.
Source code in earthcarekit/plot/figure/curtain.py
remove_colorbar
remove_legend
save
save(
filename: str = "",
filepath: str | None = None,
ds: Dataset | None = None,
ds_filepath: str | None = None,
dpi: float | Literal["figure"] = "figure",
orbit_and_frame: str | None = None,
utc_timestamp: TimestampLike | None = None,
use_utc_creation_timestamp: bool = False,
site_name: str | None = None,
hmax: int | float | None = None,
radius: int | float | None = None,
extra: str | None = None,
transparent_outside: bool = False,
verbose: bool = True,
print_prefix: str = "",
create_dirs: bool = False,
transparent_background: bool = False,
resolution: str | None = None,
**kwargs
) -> None
Save a figure as an image or vector graphic to a file and optionally format the file name in a structured way using EarthCARE metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The base name of the file. Can be extended based on other metadata provided. Defaults to empty string. |
''
|
filepath
|
str | None
|
The path where the image is saved. Can be extended based on other metadata provided. Defaults to None. |
None
|
ds
|
Dataset | None
|
A EarthCARE dataset from which metadata will be taken. Defaults to None. |
None
|
ds_filepath
|
str | None
|
A path to a EarthCARE product from which metadata will be taken. Defaults to None. |
None
|
dpi
|
float | figure
|
The resolution in dots per inch. If 'figure', use the figure's dpi value. Defaults to None. |
'figure'
|
orbit_and_frame
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
utc_timestamp
|
TimestampLike | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
use_utc_creation_timestamp
|
bool
|
Whether the time of image creation should be included in the file name. Defaults to False. |
False
|
site_name
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
hmax
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
radius
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
resolution
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
extra
|
str | None
|
A custom string to be included in the file name. Defaults to None. |
None
|
transparent_outside
|
bool
|
Whether the area outside figures should be transparent. Defaults to False. |
False
|
verbose
|
bool
|
Whether the progress of image creation should be printed to the console. Defaults to True. |
True
|
print_prefix
|
str
|
A prefix string to all console messages. Defaults to "". |
''
|
create_dirs
|
bool
|
Whether images should be saved in a folder structure based on provided metadata. Defaults to False. |
False
|
transparent_background
|
bool
|
Whether the background inside and outside of figures should be transparent. Defaults to False. |
False
|
**kwargs
|
dict[str, Any]
|
Keyword arguments passed to wrapped function call of |
{}
|
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
set_colorbar_tick_scale
set_colorbar_tick_scale(
multiplier: float | None = None, fontsize: float | str | None = None
) -> Self
Configure the scale of the colorbar tick lables, if present.
Source code in earthcarekit/plot/figure/_figure/base.py
set_grid
set_grid(
visible: bool | None = None,
which: Literal["major", "minor", "both"] | None = None,
axis: Literal["both", "x", "y"] | None = None,
color: ColorLike | None = None,
alpha: float = 1.0,
linestyle: LineStyleType | None = None,
linewidth: float | None = None,
**kwargs
) -> Self
Configure the grid lines of the main matplotlib axis.
Source code in earthcarekit/plot/figure/_figure/base.py
set_legend
set_legend(
ax: Axes | None = None,
loc: str | None = None,
markerscale: float | None = None,
frameon: bool | None = None,
facecolor: ColorLike | None = None,
edgecolor: ColorLike | None = None,
framealpha: float | None = None,
fancybox: bool | None = None,
handlelength: float | None = None,
handletextpad: float | None = None,
borderaxespad: float | None = None,
ncols: int | None = None,
edgewidth: float | None = None,
textcolor: ColorLike | None = None,
textweight: int | str | None = None,
textshadealpha: float | None = None,
textshadewidth: float | None = None,
textshadecolor: ColorLike | None = None,
**kwargs
) -> Self
Configure the legend.
If no axis is given and a right-side axis is present (ax_right), the legend is attached
to it so that it renders above all plot elements; otherwise, the main axis is used (ax).
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
show
Display figure in interactive frontends (e.g., IPython/jupyter notebooks).
Source code in earthcarekit/plot/figure/_figure/base.py
show_legend
Configure the legend.
Deprecated
Use set_legend() instead.
Source code in earthcarekit/plot/figure/_figure/base.py
to_texture
Convert the figure to a texture (i.e., remove all axis ticks, labels, annotations, and text).
Source code in earthcarekit/plot/figure/_figure/base.py
LineFigure
Bases: TimeseriesFigure
TODO: documentation
- Tutorials Quickstart Create your first plots
Source code in earthcarekit/plot/figure/line.py
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 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 | |
ax
property
The main matplotlib axis of the figure.
invert_xaxis
invert_yaxis
remove_colorbar
remove_legend
save
save(
filename: str = "",
filepath: str | None = None,
ds: Dataset | None = None,
ds_filepath: str | None = None,
dpi: float | Literal["figure"] = "figure",
orbit_and_frame: str | None = None,
utc_timestamp: TimestampLike | None = None,
use_utc_creation_timestamp: bool = False,
site_name: str | None = None,
hmax: int | float | None = None,
radius: int | float | None = None,
extra: str | None = None,
transparent_outside: bool = False,
verbose: bool = True,
print_prefix: str = "",
create_dirs: bool = False,
transparent_background: bool = False,
resolution: str | None = None,
**kwargs
) -> None
Save a figure as an image or vector graphic to a file and optionally format the file name in a structured way using EarthCARE metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The base name of the file. Can be extended based on other metadata provided. Defaults to empty string. |
''
|
filepath
|
str | None
|
The path where the image is saved. Can be extended based on other metadata provided. Defaults to None. |
None
|
ds
|
Dataset | None
|
A EarthCARE dataset from which metadata will be taken. Defaults to None. |
None
|
ds_filepath
|
str | None
|
A path to a EarthCARE product from which metadata will be taken. Defaults to None. |
None
|
dpi
|
float | figure
|
The resolution in dots per inch. If 'figure', use the figure's dpi value. Defaults to None. |
'figure'
|
orbit_and_frame
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
utc_timestamp
|
TimestampLike | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
use_utc_creation_timestamp
|
bool
|
Whether the time of image creation should be included in the file name. Defaults to False. |
False
|
site_name
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
hmax
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
radius
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
resolution
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
extra
|
str | None
|
A custom string to be included in the file name. Defaults to None. |
None
|
transparent_outside
|
bool
|
Whether the area outside figures should be transparent. Defaults to False. |
False
|
verbose
|
bool
|
Whether the progress of image creation should be printed to the console. Defaults to True. |
True
|
print_prefix
|
str
|
A prefix string to all console messages. Defaults to "". |
''
|
create_dirs
|
bool
|
Whether images should be saved in a folder structure based on provided metadata. Defaults to False. |
False
|
transparent_background
|
bool
|
Whether the background inside and outside of figures should be transparent. Defaults to False. |
False
|
**kwargs
|
dict[str, Any]
|
Keyword arguments passed to wrapped function call of |
{}
|
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
set_colorbar_tick_scale
set_colorbar_tick_scale(
multiplier: float | None = None, fontsize: float | str | None = None
) -> Self
Configure the scale of the colorbar tick lables, if present.
Source code in earthcarekit/plot/figure/_figure/base.py
set_grid
set_grid(
visible: bool | None = None,
which: Literal["major", "minor", "both"] | None = None,
axis: Literal["both", "x", "y"] | None = None,
color: ColorLike | None = None,
alpha: float = 1.0,
linestyle: LineStyleType | None = None,
linewidth: float | None = None,
**kwargs
) -> Self
Configure the grid lines of the main matplotlib axis.
Source code in earthcarekit/plot/figure/_figure/base.py
set_legend
set_legend(
ax: Axes | None = None,
loc: str | None = None,
markerscale: float | None = None,
frameon: bool | None = None,
facecolor: ColorLike | None = None,
edgecolor: ColorLike | None = None,
framealpha: float | None = None,
fancybox: bool | None = None,
handlelength: float | None = None,
handletextpad: float | None = None,
borderaxespad: float | None = None,
ncols: int | None = None,
edgewidth: float | None = None,
textcolor: ColorLike | None = None,
textweight: int | str | None = None,
textshadealpha: float | None = None,
textshadewidth: float | None = None,
textshadecolor: ColorLike | None = None,
**kwargs
) -> Self
Configure the legend.
If no axis is given and a right-side axis is present (ax_right), the legend is attached
to it so that it renders above all plot elements; otherwise, the main axis is used (ax).
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
show
Display figure in interactive frontends (e.g., IPython/jupyter notebooks).
Source code in earthcarekit/plot/figure/_figure/base.py
show_legend
Configure the legend.
Deprecated
Use set_legend() instead.
Source code in earthcarekit/plot/figure/_figure/base.py
to_texture
Convert the figure to a texture (i.e., remove all axis ticks, labels, annotations, and text).
Source code in earthcarekit/plot/figure/_figure/base.py
MapFigure
Bases: BaseFigure
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 | Literal['none', 'stock_img', 'gray', 'osm', 'satellite', 'mtg', 'msg', 'blue_marble', 'land_ocean', 'land_ocean_lakes_rivers']
|
Style of the map's background image. 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. |
0.0
|
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 | None
|
Level of detail for choosen background map style image; higher values increase complexity. Defaults to None (meaning automatic selection). |
None
|
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
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 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 | |
ax
property
The main matplotlib axis of the figure.
ecplot
ecplot(
ds: Dataset,
var: str | None = None,
*,
lat_var: str = TRACK_LAT_VAR,
lon_var: str = TRACK_LON_VAR,
swath_lat_var: str = SWATH_LAT_VAR,
swath_lon_var: str = SWATH_LON_VAR,
time_var: str = TIME_VAR,
along_track_dim: str = ALONG_TRACK_DIM,
across_track_dim: str = ACROSS_TRACK_DIM,
site: SiteLike | None = None,
radius_km: float = 100.0,
time_range: TimeRangeLike | None = None,
view: Literal["global", "data", "overpass"] = "global",
zoom_tmin: TimestampLike | None = None,
zoom_tmax: TimestampLike | None = None,
color: ColorLike | None = "ec:earthcare",
linewidth: float = 3,
linestyle: str | None = "solid",
color2: ColorLike | None = "ec:blue",
linewidth2: float | None = None,
linestyle2: str | None = None,
cmap: CmapLike | None = None,
zoom_radius_km: float | None = None,
extent: list[float] | None = None,
central_latitude: float | None = None,
central_longitude: float | None = None,
value_range: ValueRangeLike | Literal["default"] | None = "default",
log_scale: bool | None = None,
norm: Normalize | None = None,
colorbar: bool = True,
pad: float | list[float] | None = None,
show_text_time: bool | None = None,
show_text_frame: bool | None = None,
show_text_overpass: bool | None = None,
colorbar_position: str | Literal["left", "right", "top", "bottom"] = "bottom",
colorbar_alignment: str | Literal["left", "center", "right"] = "center",
colorbar_width: float = DEFAULT_COLORBAR_WIDTH,
colorbar_spacing: float = 0.3,
colorbar_length_ratio: float | str = "100%",
colorbar_label_outside: bool = True,
colorbar_ticks_outside: bool = True,
colorbar_ticks_both: bool = False,
selection_max_time_margin: TimedeltaLike | Sequence[TimedeltaLike] | None = None,
show_nadir: bool = True,
show_swath_border: bool = True,
highlight_first: bool = False,
highlight_last: bool = True
) -> Self
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
|
SiteLike | 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 |
'default'
|
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
|
Returns:
| Name | Type | Description |
|---|---|---|
MapFigure |
Self
|
The figure object containing the map with track or swath. |
Example
Source code in earthcarekit/plot/figure/map.py
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 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 | |
invert_xaxis
invert_yaxis
remove_colorbar
remove_legend
save
save(
filename: str = "",
filepath: str | None = None,
ds: Dataset | None = None,
ds_filepath: str | None = None,
dpi: float | Literal["figure"] = "figure",
orbit_and_frame: str | None = None,
utc_timestamp: TimestampLike | None = None,
use_utc_creation_timestamp: bool = False,
site_name: str | None = None,
hmax: int | float | None = None,
radius: int | float | None = None,
extra: str | None = None,
transparent_outside: bool = False,
verbose: bool = True,
print_prefix: str = "",
create_dirs: bool = False,
transparent_background: bool = False,
resolution: str | None = None,
**kwargs
) -> None
Save a figure as an image or vector graphic to a file and optionally format the file name in a structured way using EarthCARE metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The base name of the file. Can be extended based on other metadata provided. Defaults to empty string. |
''
|
filepath
|
str | None
|
The path where the image is saved. Can be extended based on other metadata provided. Defaults to None. |
None
|
ds
|
Dataset | None
|
A EarthCARE dataset from which metadata will be taken. Defaults to None. |
None
|
ds_filepath
|
str | None
|
A path to a EarthCARE product from which metadata will be taken. Defaults to None. |
None
|
dpi
|
float | figure
|
The resolution in dots per inch. If 'figure', use the figure's dpi value. Defaults to None. |
'figure'
|
orbit_and_frame
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
utc_timestamp
|
TimestampLike | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
use_utc_creation_timestamp
|
bool
|
Whether the time of image creation should be included in the file name. Defaults to False. |
False
|
site_name
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
hmax
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
radius
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
resolution
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
extra
|
str | None
|
A custom string to be included in the file name. Defaults to None. |
None
|
transparent_outside
|
bool
|
Whether the area outside figures should be transparent. Defaults to False. |
False
|
verbose
|
bool
|
Whether the progress of image creation should be printed to the console. Defaults to True. |
True
|
print_prefix
|
str
|
A prefix string to all console messages. Defaults to "". |
''
|
create_dirs
|
bool
|
Whether images should be saved in a folder structure based on provided metadata. Defaults to False. |
False
|
transparent_background
|
bool
|
Whether the background inside and outside of figures should be transparent. Defaults to False. |
False
|
**kwargs
|
dict[str, Any]
|
Keyword arguments passed to wrapped function call of |
{}
|
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
set_colorbar_tick_scale
set_colorbar_tick_scale(
multiplier: float | None = None, fontsize: float | str | None = None
) -> Self
Configure the scale of the colorbar tick lables, if present.
Source code in earthcarekit/plot/figure/_figure/base.py
set_grid
set_grid(
visible: bool | None = None,
which: Literal["major", "minor", "both"] | None = None,
axis: Literal["both", "x", "y"] | None = None,
color: ColorLike | None = None,
alpha: float = 1.0,
linestyle: LineStyleType | None = None,
linewidth: float | None = None,
**kwargs
) -> Self
Configure the grid lines of the main matplotlib axis.
Source code in earthcarekit/plot/figure/_figure/base.py
set_legend
set_legend(
ax: Axes | None = None,
loc: str | None = None,
markerscale: float | None = None,
frameon: bool | None = None,
facecolor: ColorLike | None = None,
edgecolor: ColorLike | None = None,
framealpha: float | None = None,
fancybox: bool | None = None,
handlelength: float | None = None,
handletextpad: float | None = None,
borderaxespad: float | None = None,
ncols: int | None = None,
edgewidth: float | None = None,
textcolor: ColorLike | None = None,
textweight: int | str | None = None,
textshadealpha: float | None = None,
textshadewidth: float | None = None,
textshadecolor: ColorLike | None = None,
**kwargs
) -> Self
Configure the legend.
If no axis is given and a right-side axis is present (ax_right), the legend is attached
to it so that it renders above all plot elements; otherwise, the main axis is used (ax).
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
set_view
Fits the plot extent to the given latitude and longitude values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
latitude
|
ArrayLike
|
Latitude values. |
required |
longitude
|
ArrayLike
|
Longitude values. |
required |
pad
|
float | Iterable | None
|
Padding or margins around the given lat/lon values.
The padding is applied relative to the min/max difference along the respective lat/lon extent,
e.g., |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Axes |
Self
|
description |
Source code in earthcarekit/plot/figure/map.py
show
Display figure in interactive frontends (e.g., IPython/jupyter notebooks).
Source code in earthcarekit/plot/figure/_figure/base.py
show_legend
Configure the legend.
Deprecated
Use set_legend() instead.
Source code in earthcarekit/plot/figure/_figure/base.py
ProfileFigure
Bases: BaseFigure
Source code in earthcarekit/plot/figure/profile.py
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 | |
ax
property
The main matplotlib axis of the figure.
invert_xaxis
invert_yaxis
plot
plot(
profiles: Profile | None = None,
*,
values: NDArray | None = None,
time: NDArray | None = None,
height: NDArray | None = None,
latitude: NDArray | None = None,
longitude: NDArray | None = None,
error: NDArray | None = None,
label: str | None = None,
units: str | None = None,
value_range: ValueRangeLike | None = (0, None),
height_range: DistanceRangeLike | None = None,
time_range: TimeRangeLike | None = None,
selection_height_range: DistanceRangeLike | None = None,
show_mean: bool = True,
show_std: bool = True,
show_min: bool = False,
show_max: bool = False,
show_sem: bool = False,
show_error: bool = False,
color: str | ColorLike | None = None,
alpha: float = 1.0,
linestyle: str = "solid",
linewidth: Number = 1.5,
ribbon_alpha: float = 0.2,
show_grid: bool | None = None,
zorder: Number | None = 1,
legend_label: str | None = None,
show_legend: bool | None = None,
show_steps: bool = DEFAULT_PROFILE_SHOW_STEPS
) -> Self
TODO: documentation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profiles
|
Profile | 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
|
Number
|
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
|
Number | 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 |
Self
|
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 560 561 562 563 | |
remove_colorbar
remove_legend
save
save(
filename: str = "",
filepath: str | None = None,
ds: Dataset | None = None,
ds_filepath: str | None = None,
dpi: float | Literal["figure"] = "figure",
orbit_and_frame: str | None = None,
utc_timestamp: TimestampLike | None = None,
use_utc_creation_timestamp: bool = False,
site_name: str | None = None,
hmax: int | float | None = None,
radius: int | float | None = None,
extra: str | None = None,
transparent_outside: bool = False,
verbose: bool = True,
print_prefix: str = "",
create_dirs: bool = False,
transparent_background: bool = False,
resolution: str | None = None,
**kwargs
) -> None
Save a figure as an image or vector graphic to a file and optionally format the file name in a structured way using EarthCARE metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The base name of the file. Can be extended based on other metadata provided. Defaults to empty string. |
''
|
filepath
|
str | None
|
The path where the image is saved. Can be extended based on other metadata provided. Defaults to None. |
None
|
ds
|
Dataset | None
|
A EarthCARE dataset from which metadata will be taken. Defaults to None. |
None
|
ds_filepath
|
str | None
|
A path to a EarthCARE product from which metadata will be taken. Defaults to None. |
None
|
dpi
|
float | figure
|
The resolution in dots per inch. If 'figure', use the figure's dpi value. Defaults to None. |
'figure'
|
orbit_and_frame
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
utc_timestamp
|
TimestampLike | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
use_utc_creation_timestamp
|
bool
|
Whether the time of image creation should be included in the file name. Defaults to False. |
False
|
site_name
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
hmax
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
radius
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
resolution
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
extra
|
str | None
|
A custom string to be included in the file name. Defaults to None. |
None
|
transparent_outside
|
bool
|
Whether the area outside figures should be transparent. Defaults to False. |
False
|
verbose
|
bool
|
Whether the progress of image creation should be printed to the console. Defaults to True. |
True
|
print_prefix
|
str
|
A prefix string to all console messages. Defaults to "". |
''
|
create_dirs
|
bool
|
Whether images should be saved in a folder structure based on provided metadata. Defaults to False. |
False
|
transparent_background
|
bool
|
Whether the background inside and outside of figures should be transparent. Defaults to False. |
False
|
**kwargs
|
dict[str, Any]
|
Keyword arguments passed to wrapped function call of |
{}
|
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
set_colorbar_tick_scale
set_colorbar_tick_scale(
multiplier: float | None = None, fontsize: float | str | None = None
) -> Self
Configure the scale of the colorbar tick lables, if present.
Source code in earthcarekit/plot/figure/_figure/base.py
set_grid
set_grid(
visible: bool | None = None,
which: Literal["major", "minor", "both"] | None = None,
axis: Literal["both", "x", "y"] | None = None,
color: ColorLike | None = None,
alpha: float = 1.0,
linestyle: LineStyleType | None = None,
linewidth: float | None = None,
**kwargs
) -> Self
Configure the grid lines of the main matplotlib axis.
Source code in earthcarekit/plot/figure/_figure/base.py
set_legend
set_legend(
ax: Axes | None = None,
loc: str | None = None,
markerscale: float | None = None,
frameon: bool | None = None,
facecolor: ColorLike | None = None,
edgecolor: ColorLike | None = None,
framealpha: float | None = None,
fancybox: bool | None = None,
handlelength: float | None = None,
handletextpad: float | None = None,
borderaxespad: float | None = None,
ncols: int | None = None,
edgewidth: float | None = None,
textcolor: ColorLike | None = None,
textweight: int | str | None = None,
textshadealpha: float | None = None,
textshadewidth: float | None = None,
textshadecolor: ColorLike | None = None,
**kwargs
) -> Self
Configure the legend.
If no axis is given and a right-side axis is present (ax_right), the legend is attached
to it so that it renders above all plot elements; otherwise, the main axis is used (ax).
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
show
Display figure in interactive frontends (e.g., IPython/jupyter notebooks).
Source code in earthcarekit/plot/figure/_figure/base.py
show_legend
Configure the legend.
Deprecated
Use set_legend() instead.
Source code in earthcarekit/plot/figure/_figure/base.py
to_texture
Convert the figure to a texture (i.e., remove all axis ticks, labels, annotations, and text).
Source code in earthcarekit/plot/figure/_figure/base.py
SwathFigure
Bases: TimeseriesFigure
TODO: documentation
- Tutorials Quickstart Create your first plots
Source code in earthcarekit/plot/figure/swath.py
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 | |
ax
property
The main matplotlib axis of the figure.
invert_xaxis
invert_yaxis
plot_contour
plot_contour(
values: NDArray,
time: NDArray,
latitude: NDArray,
longitude: NDArray,
nadir_index: int,
label_levels: list | NDArray | None = None,
label_format: str | None = None,
levels: list | NDArray | None = None,
linewidths: int | float | list | NDArray | None = 1.5,
linestyles: str | list | NDArray | None = "solid",
colors: Color | str | list | NDArray | None = "black",
zorder: int | float | None = 2,
show_labels: bool = True,
) -> Self
Adds contour lines to the plot.
Source code in earthcarekit/plot/figure/swath.py
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 | |
remove_colorbar
remove_legend
save
save(
filename: str = "",
filepath: str | None = None,
ds: Dataset | None = None,
ds_filepath: str | None = None,
dpi: float | Literal["figure"] = "figure",
orbit_and_frame: str | None = None,
utc_timestamp: TimestampLike | None = None,
use_utc_creation_timestamp: bool = False,
site_name: str | None = None,
hmax: int | float | None = None,
radius: int | float | None = None,
extra: str | None = None,
transparent_outside: bool = False,
verbose: bool = True,
print_prefix: str = "",
create_dirs: bool = False,
transparent_background: bool = False,
resolution: str | None = None,
**kwargs
) -> None
Save a figure as an image or vector graphic to a file and optionally format the file name in a structured way using EarthCARE metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The base name of the file. Can be extended based on other metadata provided. Defaults to empty string. |
''
|
filepath
|
str | None
|
The path where the image is saved. Can be extended based on other metadata provided. Defaults to None. |
None
|
ds
|
Dataset | None
|
A EarthCARE dataset from which metadata will be taken. Defaults to None. |
None
|
ds_filepath
|
str | None
|
A path to a EarthCARE product from which metadata will be taken. Defaults to None. |
None
|
dpi
|
float | figure
|
The resolution in dots per inch. If 'figure', use the figure's dpi value. Defaults to None. |
'figure'
|
orbit_and_frame
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
utc_timestamp
|
TimestampLike | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
use_utc_creation_timestamp
|
bool
|
Whether the time of image creation should be included in the file name. Defaults to False. |
False
|
site_name
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
hmax
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
radius
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
resolution
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
extra
|
str | None
|
A custom string to be included in the file name. Defaults to None. |
None
|
transparent_outside
|
bool
|
Whether the area outside figures should be transparent. Defaults to False. |
False
|
verbose
|
bool
|
Whether the progress of image creation should be printed to the console. Defaults to True. |
True
|
print_prefix
|
str
|
A prefix string to all console messages. Defaults to "". |
''
|
create_dirs
|
bool
|
Whether images should be saved in a folder structure based on provided metadata. Defaults to False. |
False
|
transparent_background
|
bool
|
Whether the background inside and outside of figures should be transparent. Defaults to False. |
False
|
**kwargs
|
dict[str, Any]
|
Keyword arguments passed to wrapped function call of |
{}
|
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
set_colorbar_tick_scale
set_colorbar_tick_scale(
multiplier: float | None = None, fontsize: float | str | None = None
) -> Self
Configure the scale of the colorbar tick lables, if present.
Source code in earthcarekit/plot/figure/_figure/base.py
set_grid
set_grid(
visible: bool | None = None,
which: Literal["major", "minor", "both"] | None = None,
axis: Literal["both", "x", "y"] | None = None,
color: ColorLike | None = None,
alpha: float = 1.0,
linestyle: LineStyleType | None = None,
linewidth: float | None = None,
**kwargs
) -> Self
Configure the grid lines of the main matplotlib axis.
Source code in earthcarekit/plot/figure/_figure/base.py
set_legend
set_legend(
ax: Axes | None = None,
loc: str | None = None,
markerscale: float | None = None,
frameon: bool | None = None,
facecolor: ColorLike | None = None,
edgecolor: ColorLike | None = None,
framealpha: float | None = None,
fancybox: bool | None = None,
handlelength: float | None = None,
handletextpad: float | None = None,
borderaxespad: float | None = None,
ncols: int | None = None,
edgewidth: float | None = None,
textcolor: ColorLike | None = None,
textweight: int | str | None = None,
textshadealpha: float | None = None,
textshadewidth: float | None = None,
textshadecolor: ColorLike | None = None,
**kwargs
) -> Self
Configure the legend.
If no axis is given and a right-side axis is present (ax_right), the legend is attached
to it so that it renders above all plot elements; otherwise, the main axis is used (ax).
Source code in earthcarekit/plot/figure/_figure/base.py
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 | |
show
Display figure in interactive frontends (e.g., IPython/jupyter notebooks).
Source code in earthcarekit/plot/figure/_figure/base.py
show_legend
Configure the legend.
Deprecated
Use set_legend() instead.
Source code in earthcarekit/plot/figure/_figure/base.py
to_texture
Convert the figure to a texture (i.e., remove all axis ticks, labels, annotations, and text).
Source code in earthcarekit/plot/figure/_figure/base.py
cmaps
module-attribute
Dictionary of custom colormaps for earthcarekit.
create_column_figure_layout
create_column_figure_layout(
ncols: int,
single_figsize: tuple[float, float] = (3, 8),
margin: float = 0.0,
height_scale: float = 1.0,
width_scale: float | list[float] = 1.0,
) -> FigureLayoutColumns
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 |
|---|---|
FigureLayoutColumns
|
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_multi_figure_layout
create_multi_figure_layout(
rows: Sequence[FigureType | int],
zoom_rows: Sequence[FigureType | int] | None = None,
profile_rows: Sequence[FigureType | int] | None = None,
map_rows: Sequence[FigureType | int] | None = None,
wspace: float | Sequence[float] = 1.2,
hspace: float | Sequence[float] = 1.2,
wmain: float = FIGURE_WIDTH_CURTAIN,
hrow: float = FIGURE_HEIGHT_CURTAIN,
hswath: float = FIGURE_HEIGHT_SWATH,
hline: float = FIGURE_HEIGHT_LINE,
wprofile: float = FIGURE_WIDTH_PROFILE,
wmap: float = FIGURE_MAP_WIDTH,
wzoom: float = FIGURE_WIDTH_CURTAIN / 3.0,
) -> FigureLayoutMapMainZoomProfile
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. |
1.2
|
hspace
|
float | Sequence[float]
|
Vertical spacing between rows. Similar behavior as |
1.2
|
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 |
FigureLayoutMapMainZoomProfile
|
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
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 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 | |
ecquicklook
ecquicklook(
ds: Dataset | str,
vars: str | list[str] | None = None,
show_maps: bool = True,
show_zoom: bool = False,
show_profile: bool = True,
site: SiteLike | None = None,
radius_km: float = 100.0,
time_range: TimeRangeLike | None = None,
height_range: DistanceRangeNoneLike | None = None,
ds_tropopause: Dataset | str | None = None,
ds_elevation: Dataset | str | None = None,
ds_temperature: Dataset | str | None = None,
resolution: Literal["low", "medium", "high", "l", "m", "h"] = "medium",
ds2: Dataset | str | None = None,
ds_xmet: Dataset | str | None = None,
logger: Logger | None = None,
log_msg_prefix: str = "",
selection_max_time_margin: TimedeltaLike | Sequence[TimedeltaLike] | None = None,
show_steps: bool = DEFAULT_PROFILE_SHOW_STEPS,
mode: Literal["fast", "exact"] = "fast",
map_style: (
str
| Literal[
"none",
"stock_img",
"gray",
"osm",
"satellite",
"mtg",
"msg",
"blue_marble",
"land_ocean",
"land_ocean_lakes_rivers",
]
| None
) = "blue_marble",
curtain_kwargs: dict[str, Any] = {},
map_kwargs: dict[str, Any] = {},
profile_kwargs: dict[str, Any] = {},
) -> QuicklookFigure
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
|
SiteLike | 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
|
DistanceRangeNoneLike | None
|
Height range in meters. Defaults to None. |
None
|
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". |
'medium'
|
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'
|
map_style
|
str | Literal['none', 'stock_img', 'gray', 'osm', 'satellite', 'mtg', 'msg', 'blue_marble', 'land_ocean', 'land_ocean_lakes_rivers'] | None
|
Style of the background in the secondary/zoomed map. Defaults to "blue_marble". |
'blue_marble'
|
Returns:
| Name | Type | Description |
|---|---|---|
_QuicklookResults |
QuicklookFigure
|
Object containing figures and metadata. |
Source code in earthcarekit/plot/quicklook/_quicklook.py
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 | |
ecquicklook_deep_convection
ecquicklook_deep_convection(
mrgr: Dataset | str,
cfmr: Dataset | str,
ccd: Dataset | str,
aebd: Dataset | str,
xmet: Dataset | str | None = None,
height_range: DistanceRangeLike | None = (-250, 20000.0),
time_range: TimeRangeLike | None = None,
info_text_loc: str | None = None,
trim_to_frame: bool = False,
mrgr_kwargs: dict[str, Any] | None = None,
cfmr_kwargs: dict[str, Any] | None = None,
ccd_kwargs: dict[str, Any] | None = None,
aebd_kwargs: dict[str, Any] | None = None,
map_kwargs: dict[str, Any] | None = None,
marble_kwargs: dict[str, Any] | None = None,
map_style: MapStyleLike = "gray",
map_timestamp: TimestampLike | None = None,
marble_style: MapStyleLike = "gray",
marble_timestamp: TimestampLike | None = None,
show_mrgr: bool = True,
show_cfmr: bool = True,
show_ccd: bool = True,
show_aebd: bool = True,
show_marble: bool | None = None,
show_map: bool | None = None,
show_maps: bool | None = None,
small_marble: bool = False,
) -> QuicklookFigure
Creates a 4 panel quicklook of a storm or deep convective event, displaying:
- 1st row: RGB image from MSI_RGR_1C
- 2nd row: Radar reflectivity from CPR_FMR_2A
- 3rd row: Doppler velocity from CPR_CD__2A
- 4th row: Total attenuated backscatter from ATL_EBD_2A
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds_mrgr
|
Dataset
|
The MSI_RGR_1C product filepath or dataset. |
required |
ds_cfmr
|
Dataset
|
The CPR_FMR_2A product filepath or dataset. |
required |
ds_ccd
|
Dataset
|
The CPR_CD__2A product filepath or dataset. |
required |
ds_aebd
|
Dataset
|
The ATL_EBD_2A product filepath or dataset. |
required |
ds_xmet
|
Dataset | None
|
The AUX_MET_1D product filepath or dataset. If given, temperature contour lines will be added to the plots. Defaults to None. |
required |
height_range
|
DistanceRangeLike | None
|
A height range (i.e., min, max) in meters. Defaults to (-250, 20e3). |
(-250, 20000.0)
|
time_range
|
TimeRangeLike | None
|
A time range to filter the displayed data. Defaults to None. |
None
|
info_text_loc
|
str | None
|
The positioning of the orbt, frame and product info text (e.g., "upper right"). Defaults to None. |
None
|
trim_to_frame
|
bool
|
Wether the read products should be trimmed to the EarthCARE frame bounds. |
False
|
mrgr_kwargs
|
dict[str, Any] | None
|
Additional keyword arguemnts passed to the |
None
|
cfmr_kwargs
|
dict[str, Any] | None
|
Additional keyword arguemnts passed to the |
None
|
ccd_kwargs
|
dict[str, Any] | None
|
Additional keyword arguemnts passed to the |
None
|
aebd_kwargs
|
dict[str, Any] | None
|
Additional keyword arguemnts passed to the |
None
|
map_kwargs
|
dict[str, Any] | None
|
Additional keyword arguemnts passed to the |
None
|
map_style
|
MapStyleLike
|
Style of the map's background image. Defaults to "gray". |
'gray'
|
map_timestamp
|
TimeRangeLike | None
|
Time reference used for nightshade overlay. Defaults to None. |
None
|
marble_style
|
MapStyleLike
|
Style of the "marble" map's background image. Defaults to "gray". |
'gray'
|
marble_timestamp
|
TimeRangeLike | None
|
Time reference used for nightshade overlay for the "marble" map. Defaults to None. |
None
|
show_mrgr
|
bool
|
If True, displays the MSI_RGR_1C sub-figure. Defaults to True. |
True
|
show_cfmr
|
bool
|
If True, displays the CPR_FMR_2A sub-figure. Defaults to True. |
True
|
show_ccd
|
bool
|
If True, displays the CPR_CD__2A sub-figure. Defaults to True. |
True
|
show_aebd
|
bool
|
If True, displays the ATL_EBD_2A sub-figure. Defaults to True. |
True
|
show_marble
|
bool | None
|
If True, displays the "marble" sub-figure (MSI_RGR_1C-based). Defaults to None. |
None
|
show_map
|
bool | None
|
If True, displays the map sub-figure (MSI_RGR_1C-based). Defaults to None. |
None
|
show_maps
|
bool | None
|
If True, two maps will be plotted in column before the along-track plots.
The first map shows the EC track on a global earth map (i.e., "marble").
The second map shows swath data from MSI_RGR_1C zoomed to the selected |
None
|
small_marble
|
bool
|
If True, the size of the "marble" map will be reduced to the first figure row; otherwise it will take the space of the first two rows. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
QuicklookFigure |
QuicklookFigure
|
The quicklook object. |
Examples:
import earthcarekit as eck
df = eck.search_product(
file_type=["mrgr", "cfmr", "ccd", "aebd", "xmet"],
orbit_and_frame="07590D",
).filter_latest()
fp_mrgr = df.filter_file_type("mrgr").filepath[-1]
fp_cfmr = df.filter_file_type("cfmr").filepath[-1]
fp_ccd = df.filter_file_type("ccd").filepath[-1]
fp_aebd = df.filter_file_type("aebd").filepath[-1]
fp_xmet = df.filter_file_type("xmet").filepath[-1]
ql = eck.ecquicklook_deep_convection(
mrgr=fp_mrgr,
cfmr=fp_cfmr,
ccd=fp_ccd,
aebd=fp_aebd,
xmet=fp_xmet,
time_range=("2025-09-28T18:27:10", None),
info_text_loc="upper left",
)
Source code in earthcarekit/plot/quicklook/_quicklook_deep_convection.py
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 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 | |
ecquicklook_psc
ecquicklook_psc(
anom: str | Sequence[str] | NDArray[str_] | Dataset,
xmet: str | Sequence[str] | NDArray[str_] | Dataset | None = None,
zoom_at: float | None = 0.5,
height_range: DistanceRangeLike | None = (0, 40000.0),
time_range: TimeRangeLike | None = None,
info_text_loc: str | None = None,
) -> QuicklookFigure
Creates a two-column multi-panel quicklook of a PSC event, displaying:
- 1st column: Two maps showing the EarthCARE track.
- 2nd column: Three rows showing co- and cross-polar attenuated backscatter and the calculated depolarization ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anom
|
str | Sequence[str] | Dataset
|
The ATL_NOM_1B product filepath(s) or dataset(s). |
required |
xmet
|
str | Sequence[str] | Dataset | None
|
The AUX_MET_1D product filepath(s) or dataset(s). If given, temperature contour lines will be added to the plots. Defaults to None. |
None
|
zoom_at
|
float | None
|
In case two frames are given, selects only a zoomed-in portion of the frames around this fractional index (0 -> only 1st frame, 0.5 -> half of end of 1st and half of beginning of 2nd frame, 1 -> only 2nd frame). Defaults to 0.5. |
0.5
|
height_range
|
DistanceRangeLike | None
|
description. Defaults to (0, 40e3). |
(0, 40000.0)
|
time_range
|
TimeRangeLike | None
|
A time range to filter the displayed data. Defaults to None. |
None
|
info_text_loc
|
str | None
|
The positioning of the orbt, frame and product info text (e.g., "upper right"). Defaults to None. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If none or more than 2 frames are given. |
ValueError
|
If given number X-MET files does not match number of A-NOM files. |
Returns:
| Name | Type | Description |
|---|---|---|
QuicklookFigure |
QuicklookFigure
|
The quicklook object. |
Examples:
import earthcarekit as eck
df = eck.search_product(
file_type=["anom", "xmet"],
orbit_and_frame=["3579B", "3579C"],
).filter_latest()
fps_anom = df.filter_file_type("anom").filepath
fps_xmet = df.filter_file_type("xmet").filepath
ql = eck.ecquicklook_psc(
anom=fps_anom,
xmet=fps_xmet,
)
Source code in earthcarekit/plot/quicklook/_quicklook_psc.py
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 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
get_cmap
get_cmap(cmap: CmapLike | None, **kwargs) -> Cmap
Return a colormap given by cmap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmap
|
CmapLike | None
|
|
required |
Returns: Cmap: The resolved colormap.
Source code in earthcarekit/colormap/_get_cmap.py
plot_line_between_figures
plot_line_between_figures(
ax1: Axes,
ax2: Axes,
point1: _NumberTimeOrTuple,
point2: _NumberTimeOrTuple | None = None,
color: ColorLike | None = "ec:red",
linestyle: str = "dashed",
linewidth: int | float = 2,
alpha: int | float = 0.3,
capstyle: str = "butt",
zorder: int | float = -20,
**kwargs
) -> None
Draws a line connecting a point in one subfigure (ax1) to a point in another (ax2).
Source code in earthcarekit/plot/figure/_plot_line_between_figures.py
save_plot
save_plot(
fig: Figure | HasFigure,
filename: str = "",
filepath: str | None = None,
ds: Dataset | None = None,
ds_filepath: str | None = None,
pad: float = 0.1,
dpi: float | Literal["figure"] = "figure",
orbit_and_frame: str | None = None,
utc_timestamp: TimestampLike | None = None,
use_utc_creation_timestamp: bool = False,
site_name: str | None = None,
hmax: int | float | None = None,
radius: int | float | None = None,
resolution: str | None = None,
extra: str | None = None,
transparent_outside: bool = False,
verbose: bool = True,
print_prefix: str = "",
create_dirs: bool = False,
transparent_background: bool = False,
**kwargs
) -> None
Save a figure as an image or vector graphic to a file and optionally format the file name in a structured way using EarthCARE metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Figure | HasFigure
|
A figure object ( |
required |
filename
|
str
|
The base name of the file. Can be extended based on other metadata provided. Defaults to empty string. |
''
|
filepath
|
str | None
|
The path where the image is saved. Can be extended based on other metadata provided. Defaults to None. |
None
|
ds
|
Dataset | None
|
A EarthCARE dataset from which metadata will be taken. Defaults to None. |
None
|
ds_filepath
|
str | None
|
A path to a EarthCARE product from which metadata will be taken. Defaults to None. |
None
|
pad
|
float
|
Extra padding (i.e., empty space) around the image in inches. Defaults to 0.1. |
0.1
|
dpi
|
float | figure
|
The resolution in dots per inch. If 'figure', use the figure's dpi value. Defaults to None. |
'figure'
|
orbit_and_frame
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
utc_timestamp
|
TimestampLike | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
use_utc_creation_timestamp
|
bool
|
Whether the time of image creation should be included in the file name. Defaults to False. |
False
|
site_name
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
hmax
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
radius
|
int | float | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
resolution
|
str | None
|
Metadata used in the formatting of the file name. Defaults to None. |
None
|
extra
|
str | None
|
A custom string to be included in the file name. Defaults to None. |
None
|
transparent_outside
|
bool
|
Whether the area outside figures should be transparent. Defaults to False. |
False
|
verbose
|
bool
|
Whether the progress of image creation should be printed to the console. Defaults to True. |
True
|
print_prefix
|
str
|
A prefix string to all console messages. Defaults to "". |
''
|
create_dirs
|
bool
|
Whether images should be saved in a folder structure based on provided metadata. Defaults to False. |
False
|
transparent_background
|
bool
|
Whether the background inside and outside of figures should be transparent. Defaults to False. |
False
|
**kwargs
|
dict[str, Any]
|
Keyword arguments passed to wrapped function call of |
{}
|
Source code in earthcarekit/plot/save/simple_save.py
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 | |
shift_cmap
shift_cmap(
cmap: str | Colormap | None,
start: float = 0.0,
midpoint: float = 0.5,
stop: float = 1.0,
name: str = "shifted_cmap",
) -> 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 |
- Tutorials Colormaps Shift the midpoint of a colormap

