plotting
Plot helpers used in notebooks and examples.
Full API
Plotting helpers used by notebooks and examples.
This module provides small convenience functions for common plotting tasks used across the dorito examples, such as plotting the diffraction-limit scale bar, computing axis extents in arcseconds and a standard image plotting function that handles normalization, rotation and optional scale bars.
plot_diffraction_limit(model, ax=None, OOP=False)
¤
Plot a scale bar showing the diffraction limit (lambda / D).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Object exposing |
required | |
ax
|
Axes
|
Axis to draw onto. If not provided, the function draws to the current pyplot axes. |
None
|
OOP
|
bool
|
If True and |
False
|
Source code in src/dorito/plotting.py
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 | |
get_arcsec_extents(pixel_scale, shape)
¤
Return axis extents in arcseconds for use with imshow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pixel_scale
|
float
|
Pixel scale in arcseconds per pixel. |
required |
shape
|
tuple
|
Shape of the image (ny, nx) or (n, n). The function uses the first axis length to compute the extent. |
required |
Source code in src/dorito/plotting.py
83 84 85 86 87 88 89 90 91 92 93 94 | |
plot_result(ax, array, pixel_scale, roll_angle_degrees=None, cmap='afmhot_10u', bg_color='k', axis_labels={'xlabel': '$\\Delta$RA [arcsec]', 'ylabel': '$\\Delta$DEC [arcsec]'}, norm=mpl.colors.PowerNorm(1, vmin=0, vmax=None), diff_lim=None, scale=1.0, translate=(0.0, 0.0), ticks=[0.5, 0, -0.5])
¤
Convenience wrapper to display an image with sensible defaults.
This helper sets axis labels, background colour, computes an extent in
arcseconds from the provided pixel_scale and applies optional rotation
and scaling to the resulting image artist.
Source code in src/dorito/plotting.py
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 | |