Commit a58039b8 authored by Christopher Wipf's avatar Christopher Wipf

Improve backward compatibility with ancient matplotlib/numpy versions

matplotlib: use hex color names instead of the cool xkcd ones
When matplotlib >= 2.0 is ubiquitous, we can revert this.
numpy: use np.flipud in place of np.flip
np.flip only exists in numpy >= 1.12, and flipud is clearer anyway.
parent 95bfb2a8
Pipeline #27983 passed with stages
in 51 seconds
......@@ -19,42 +19,53 @@ PRIORITY_MAP = {
STYLE_MAP = {
'Quantum Vacuum': dict(
color = 'xkcd:vibrant purple',
# color = 'xkcd:vibrant purple',
color = '#ad03de',
),
'Seismic': dict(
color = 'xkcd:brown',
# color = 'xkcd:brown',
color = '#653700',
),
'Newtonian Gravity': dict(
color = 'xkcd:green',
# color = 'xkcd:green',
color = '#15b01a',
),
'Suspension Thermal': dict(
color = 'xkcd:deep sky blue',
# color = 'xkcd:deep sky blue',
color = '#0d75f8',
),
'Coating Brownian': dict(
color = 'xkcd:fire engine red',
# color = 'xkcd:fire engine red',
color = '#fe0002',
),
'Coating Thermo-Optic': dict(
color = 'xkcd:bright sky blue',
# color = 'xkcd:bright sky blue',
color = '#02ccfe',
ls = '--',
),
'ITM Thermo-Refractive': dict(
color = 'xkcd:dark sky blue',
# color = 'xkcd:dark sky blue',
color = '#448ee4',
ls = '--',
),
'ITM Carrier Density': dict(
color = 'xkcd:grey',
# color = 'xkcd:grey',
color = '#929591',
ls = '--',
),
'Substrate Brownian': dict(
color = 'xkcd:pumpkin orange',
# color = 'xkcd:pumpkin orange',
color = '#fb7d07',
ls = '--',
),
'Substrate Thermo-Elastic': dict(
color = 'xkcd:golden',
# color = 'xkcd:golden',
color = '#f5bf03',
ls = '--',
),
'Excess Gas': dict(
color = 'xkcd:baby shit brown',
# color = 'xkcd:baby shit brown',
color = '#ad900d',
ls = '--',
),
}
......@@ -111,7 +122,7 @@ def plot_noise(
ax.loglog(f, sqrt(noise), **stylekw)
plot_dict(noises)
ax.loglog(f, sqrt(noises['Total']), color='xkcd:black', alpha=0.6, label='Total', lw=4)
ax.loglog(f, sqrt(noises['Total']), color='#000000', alpha=0.6, label='Total', lw=4)
ax.grid(
True,
......
......@@ -206,7 +206,7 @@ def suspQuad(f, ifo, material='Silica'):
phi_b[n] = bladeMat.Phi # loss angle
# weight support by lower stages
Mg = g * np.flip(np.cumsum(np.flip(mass, 0)), 0)
Mg = g * np.flipud(np.cumsum(np.flipud(mass)))
# Correction for the pendulum restoring force
kh0 = Mg / length # N/m, horiz. spring constant, stage n
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment