11import type { Config } from "@classmodel/class/config" ;
2- import { type Parcel , calculatePlume } from "@classmodel/class/fire" ;
2+ import { calculatePlume , transposePlumeData } from "@classmodel/class/fire" ;
33import {
44 type ClassOutput ,
55 type OutputVariableKey ,
@@ -45,7 +45,7 @@ import { MdiCamera, MdiDelete, MdiImageFilterCenterFocus } from "./icons";
4545import { AxisBottom , AxisLeft , getNiceAxisLimits } from "./plots/Axes" ;
4646import { Chart , ChartContainer , type ChartData } from "./plots/ChartContainer" ;
4747import { Legend } from "./plots/Legend" ;
48- import { Line , Plume , type Point } from "./plots/Line" ;
48+ import { Line , type Point } from "./plots/Line" ;
4949import { SkewTPlot , type SoundingRecord } from "./plots/skewTlogP" ;
5050import { Button } from "./ui/button" ;
5151import { Card , CardContent , CardHeader , CardTitle } from "./ui/card" ;
@@ -239,16 +239,25 @@ export function VerticalProfilePlot({
239239 "Specific humidity [kg/kg]" : "qt" ,
240240 "u-wind component [m/s]" : "u" ,
241241 "v-wind component [m/s]" : "v" ,
242+ "vertical velocity [m/s]" : "w" ,
242243 "Pressure [Pa]" : "p" ,
243244 "Exner function [-]" : "exner" ,
244245 "Temperature [K]" : "T" ,
245246 "Dew point temperature [K]" : "Td" ,
246247 "Density [kg/m³]" : "rho" ,
248+ "Relative humidity [%]" : "rh" ,
247249 } as const satisfies Record < string , keyof ClassProfile > ;
248250
249251 const classVariable = ( ) =>
250252 variableOptions [ analysis . variable as keyof typeof variableOptions ] ;
251253
254+ type PlumeVariable = "theta" | "qt" | "thetav" | "T" | "Td" | "rh" | "w" ;
255+ function isPlumeVariable ( v : string ) : v is PlumeVariable {
256+ return [ "theta" , "qt" , "thetav" , "T" , "Td" , "rh" , "w" ] . includes ( v ) ;
257+ }
258+
259+ const showPlume = createMemo ( ( ) => isPlumeVariable ( classVariable ( ) ) ) ;
260+
252261 const observations = ( ) =>
253262 flatObservations ( ) . map ( ( o ) => observationsForProfile ( o , classVariable ( ) ) ) ;
254263
@@ -266,10 +275,17 @@ export function VerticalProfilePlot({
266275 const firePlumes = ( ) =>
267276 flatExperiments ( ) . map ( ( e , i ) => {
268277 const { config, output, ...formatting } = e ;
269- if ( config . sw_fire ) {
278+ if ( config . sw_fire && isPlumeVariable ( classVariable ( ) ) ) {
279+ const plume = transposePlumeData (
280+ calculatePlume ( config , profileData ( ) [ i ] . data ) ,
281+ ) ;
270282 return {
271283 ...formatting ,
272- data : calculatePlume ( config , profileData ( ) [ i ] . data ) ,
284+ linestyle : "4" ,
285+ data : plume . z . map ( ( z , i ) => ( {
286+ x : plume [ classVariable ( ) as PlumeVariable ] [ i ] ,
287+ y : z ,
288+ } ) ) ,
273289 } ;
274290 }
275291 return { ...formatting , data : [ ] } ;
@@ -288,10 +304,12 @@ export function VerticalProfilePlot({
288304 } ) ) as ChartData < Point > [ ] ;
289305
290306 const allX = ( ) => [
307+ ...firePlumes ( ) . flatMap ( ( p ) => p . data . map ( ( d ) => d . x ) ) ,
291308 ...profileDataForPlot ( ) . flatMap ( ( p ) => p . data . map ( ( d ) => d . x ) ) ,
292309 ...observations ( ) . flatMap ( ( obs ) => obs . data . map ( ( d ) => d . x ) ) ,
293310 ] ;
294311 const allY = ( ) => [
312+ ...firePlumes ( ) . flatMap ( ( p ) => p . data . map ( ( d ) => d . y ) ) ,
295313 ...profileDataForPlot ( ) . flatMap ( ( p ) => p . data . map ( ( d ) => d . y ) ) ,
296314 ...observations ( ) . flatMap ( ( obs ) => obs . data . map ( ( d ) => d . y ) ) ,
297315 ] ;
@@ -322,10 +340,6 @@ export function VerticalProfilePlot({
322340 setResetPlot ( analysis . id ) ;
323341 }
324342
325- const showPlume = createMemo ( ( ) => {
326- return [ "theta" , "qt" , "thetav" , "T" , "Td" ] . includes ( classVariable ( ) ) ;
327- } ) ;
328-
329343 return (
330344 < >
331345 < div class = "flex flex-col gap-2" >
@@ -356,10 +370,7 @@ export function VerticalProfilePlot({
356370 { ( d ) => (
357371 < Show when = { toggles [ d . label ] } >
358372 < Show when = { showPlume ( ) } >
359- < Plume
360- d = { d }
361- variable = { classVariable as ( ) => keyof Parcel }
362- />
373+ < Line { ...d } />
363374 </ Show >
364375 </ Show >
365376 ) }
0 commit comments