Figure: src: beacon field sizing

This commit is contained in:
Eric Teunis de Boone 2023-08-15 16:28:27 +02:00
parent 5e9f5d5621
commit 47016f867e
2 changed files with 37 additions and 8 deletions

View file

@ -47,20 +47,31 @@ field_single_center_time_nomax.%: src/beacon_field.py
$< --time $@ single-center --max-rms 0
field_three: \
field_three_left \
field_three_center \
#
field_three_left: \
field_three_left_time.pdf field_three_left_time.png \
field_three_left_phase.pdf field_three_left_phase.png \
field_three_left_time_nomax.pdf field_three_left_time_nomax.png \
field_three_left_phase_nomax.pdf field_three_left_phase_nomax.png \
#
field_three_center: \
field_three_center_time.pdf field_three_center_time.png \
field_three_center_phase.pdf field_three_center_phase.png \
field_three_left_time_nomax.pdf field_three_left_time_nomax.png \
field_three_center_time_nomax.pdf field_three_center_time_nomax.png \
field_three_center_phase_nomax.pdf field_three_center_phase_nomax.png \
#
field_three_left_time.%: src/beacon_field.py
$< --time $@ three-left
field_three_left_phase.%: src/beacon_field.py
$< --phase $@ three-left
field_three_left_time_nomax.%: src/beacon_field.py
$< --time $@ three-left --max-rms 0
field_three_left_phase.%: src/beacon_field.py
$< --phase $@ three-left
field_three_left_phase_nomax.%: src/beacon_field.py
$< --phase $@ three-left --max-rms 0
field_three_center_time.%: src/beacon_field.py
$< --time $@ three-center
@ -68,8 +79,8 @@ field_three_center_time_nomax.%: src/beacon_field.py
$< --time $@ three-center --max-rms 0
field_three_center_phase.%: src/beacon_field.py
$< --phase $@ three-center
field_three_center_time_nomax.%: src/beacon_field.py
$< --time $@ three-center --max-rms 0
field_three_center_phase_nomax.%: src/beacon_field.py
$< --phase $@ three-center --max-rms 0
field_square: \

View file

@ -255,6 +255,20 @@ if __name__ == "__main__":
args = parser.parse_args()
if False: #specific formatting
from matplotlib import rcParams
#rcParams["text.usetex"] = True
rcParams["font.family"] = "serif"
rcParams["font.size"] = "12"
if True:# small
figsize = (6, 4)
rcParams["font.size"] = "14" # 15 at 6,4 looks fine
elif True: # large
figsize = (9, 6)
rcParams["grid.linestyle"] = 'dotted'
rcParams["figure.figsize"] = figsize
if args.fname == 'none':
args.fname = None
@ -347,8 +361,9 @@ if __name__ == "__main__":
kwargs = {}
mask = None
if plot_phase:
color_label='$\\sqrt{ \\sum_{(i,j)} \\left(\\Delta\\varphi_{ij}(x) - \\Delta \\varphi_{ij}\\right)^2}$'
min_val = min(val)
color_label='$\\sqrt{ \\sum_{(i,j)} \\left(\\Delta\\varphi_{ij}(x) - \\Delta \\varphi_{ij}\\right)^2}$ [rad]'
if args.max_rms:
min_val = abs(min(min(val), args.max_rms))
mask = abs(val) > np.pi + min_val
else:
color_label='$\\sqrt{ \\sum_{(i,j)} \\left(\Delta t_{ij}(x) - \\Delta t_{ij}\\right)^2}$ [ns]'
@ -377,6 +392,9 @@ if __name__ == "__main__":
if isinstance(args.fname, str):
args.fname = [args.fname]
fig = plt.gcf()
fig.tight_layout()
for fname in args.fname:
plt.savefig(fname)
else: