a, Schematic of behavior (left), and measurement of threat onset/offset kinetics using a thermocouple (heat) or two-photon imaging of fluorescence in flow solution (flow - salinity, acidity) (right). b, Threat onset does not influence forward swimming (mean ± s.e.m., 1 s bins, N = 57 fish (5 trials each), same fish as shown in Fig. 1c). c, Fraction of trials with turning movements during threat presentation, across all 5 trials (mean ± s.e.m., N = 57 fish). Comparison of first two trials vs last two trials. All p > 0.1, Two-sided Wilcoxon signed-rank test. d, Ventral sections of Tg(pomc:Gal4;UAS:NTR-mCherry) fish, showing ablation of pomc+ cells in the pituitary (red) upon treatment with metronidazole (MTZ; right). Similar ablation observed in N = 3 fish examined. e, Summary data from control and ablated fish. N = 9 fish per group, mean ± s.e.m., individual fish are points. One-tailed Mann-Whitney U tests, Benjamini-Hochberg false discovery rate correction for multiple comparisons. NS = ‘not significant’, all p > 0.4. f, Maximum tail angle of responsive movements - summary data from control and ablated fish. Note that control fish have lower response magnitude on salinity trials. N = 9 fish per group, mean ± s.e.m., individual fish are points. One-tailed Mann-Whitney U tests, Benjamini-Hochberg false discovery rate correction for multiple comparisons. *p < 0.05. NS = ‘not significant’, all p > 0.4. See Supplementary Table 2 for test statistics.