Plotting¶
Image¶
This module is used to plot an image (time, altitude) for a given variable of an instance of the ProfilesData
class.
plot(da, var='attenuated_backscatter_0', zref='agl', zmin=None, zmax=None, vmin=None, vmax=None, log=False, show_foc=False, show_pbl=False, show_clouds=False, cmap='coolwarm', show_fig=True, save_fig=None)
¶
Plot image of selected variable from :class:aprofiles.profiles.ProfilesData
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
da
|
DataArray
|
DataArray. |
required |
var
|
str
|
Variable of the DataArray to be plotted. |
'attenuated_backscatter_0'
|
zref
|
{agl, asl}
|
Base reference for altitude axis. |
'agl'
|
zmin
|
float
|
Minimum altitude AGL (m). |
None
|
zmax
|
float
|
Maximum altitude AGL (m). |
None
|
vmin
|
float
|
Minimum value. |
None
|
vmax
|
float
|
Maximum value. If |
None
|
log
|
bool
|
Use logarithmic scale. |
False
|
show_foc
|
bool
|
Add foc detection. |
False
|
show_pbl
|
bool
|
Add PBL height. |
False
|
show_clouds
|
bool
|
Add clouds detection. |
False
|
cmap
|
str
|
Matplotlib colormap. |
'coolwarm'
|
show_fig
|
bool
|
Show figure. |
True
|
save_fig
|
str
|
Path of the saved figure. |
None
|
Example
import aprofiles as apro
# read example file
path = "examples/data/L2_0-20000-001492_A20210909.nc"
reader = apro.reader.ReadProfiles(path)
profiles = reader.read()
# attenuated backscatter image
profiles.plot(vmin=1e-2, vmax=1e1, log=True)
Source code in aprofiles/plot/image.py
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 |
|
Profile¶
This module is used to plot a single profile for a given numpy.datetime64
, of a given variable of an instance of the ProfilesData
class.
plot(da, datetime, var='attenuated_backscatter_0', zref='agl', zmin=None, zmax=None, vmin=None, vmax=None, log=False, show_foc=False, show_pbl=False, show_clouds=False, show_fig=True, save_fig=None)
¶
Plot single profile of selected variable from (aprofiles.profiles.ProfilesData): object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
da
|
DataArray
|
DataArray. |
required |
datetime
|
datetime64
|
Time for which the profile is plotted. |
required |
var
|
str
|
Variable of the DataArray to be plotted. |
'attenuated_backscatter_0'
|
zref
|
{agl, asl}
|
Base reference for the altitude axis. Defaults to 'agl'. |
'agl'
|
zmin
|
float
|
Minimum altitude AGL (m). Defaults to minimum available altitude. |
None
|
zmax
|
float
|
Maximum altitude AGL (m). Defaults to maximum available altitude. |
None
|
vmin
|
float
|
Minimum value. |
None
|
vmax
|
float
|
Maximum value. If None, calculates max from data. |
None
|
log
|
bool
|
Use logarithmic scale. |
False
|
show_foc
|
bool
|
Add foc detection. |
False
|
show_pbl
|
bool
|
Add PBL height. |
False
|
show_clouds
|
bool
|
Add clouds detection. |
False
|
show_fig
|
bool
|
Show figure. |
True
|
save_fig
|
str
|
Path of the saved figure. |
None
|
Example
import aprofiles as apro
# read example file
path = "examples/data/L2_0-20000-001492_A20210909.nc"
reader = apro.reader.ReadProfiles(path)
profiles = reader.read()
# some detection
profiles.clouds(inplace=True).pbl(inplace=True)
# attenuated backscatter single profile
datetime = np.datetime64('2021-09-09T10:25:00')
profiles.plot(datetime=datetime, vmin=-1, vmax=10, zmax=12000, show_clouds=True, show_pbl=True)
Source code in aprofiles/plot/profile.py
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 |
|
Time Series¶
This module is used to plot a time series of a given variable of an instance of the ProfilesData
class.
plot(da, var='aod', show_fig=True, save_fig=None, **kwargs)
¶
Plot time series of selected variable from (aprofiles.profiles.ProfilesData): object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
da
|
DataArray
|
DataArray |
required |
var
|
str
|
Variable of the DataArray to be plotted. |
'aod'
|
show_fig
|
bool
|
Show Figure. |
True
|
save_fig
|
str
|
Path of the saved figure. |
None
|
Example
import aprofiles as apro
# read example file
path = "examples/data/L2_0-20000-001492_A20210909.nc"
reader = apro.reader.ReadProfiles(path)
profiles = reader.read()
# retrieve pbl height
profiles.pbl(zmin=200, zmax=3000)
# attenuated backscatter image
profiles.plot(var="pbl" ymin=0., ymax=3000., min_snr=2.)
Source code in aprofiles/plot/timeseries.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|