Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/unified/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const BEAMLINE_TECHNIQUES_SUBSET = {
Technique.Mib,
],
[Beamline.E01]: [Technique.Dpc, Technique.Nbed, Technique.Ptyrex],
[Beamline.P99]: [Technique.Ptypy],
};

const BEAMLINES_DEFAULT_TECHNIQUE = {
Expand All @@ -69,6 +70,7 @@ const BEAMLINES_DEFAULT_TECHNIQUE = {
[Beamline["I13-1"]]: Technique.Ptycho,
[Beamline["I13-2"]]: Technique.Ptycho,
[Beamline.I14]: Technique.Dpc,
[Beamline.P99]: Technique.Ptypy,
};

const filterTemplates = (technique: Technique) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Visit, visitToText } from "@diamondlightsource/sci-react-ui";
import { InstrumentSession } from "../SessionSelector";
import { Fbp180ParameterConfiguration } from "./Fbp180ParameterConfiguration";
import PtypyI08ParameterConfiguration from "./PtypyI08ParameterConfiguration";
import PtypyP99ParameterConfiguration from "./PtypyP99ParameterConfiguration";

type ParameterConfigurationProps = {
technique: Technique;
Expand Down Expand Up @@ -147,7 +148,16 @@ export const ParameterConfiguration: React.FC<ParameterConfigurationProps> = ({
[Technique.Ptycho]: {},
[Technique.Ptypy]: {
"ptypy-i08-1-from-config": (
<PtypyI08ParameterConfiguration setParameters={setTemplateParameters} />
<PtypyI08ParameterConfiguration
setParameters={setTemplateParameters}
setResourceParameters={setResourceParameters}
/>
),
"ptypy-p99-from-config": (
<PtypyP99ParameterConfiguration
setParameters={setTemplateParameters}
setResourceParameters={setResourceParameters}
/>
),
},
[Technique.Ptyrex]: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import {
Card,
Checkbox,
FormControlLabel,
Stack,
TextField,
} from "@mui/material";
import { useEffect, useState } from "react";

const PtypyP99ParameterConfiguration = ({
setParameters,
setResourceParameters,
}: {
setParameters: (_: object) => void;
setResourceParameters: (_: object) => void;
}) => {
const [id, setId] = useState<string>("");
const [inPath, setInPath] = useState<string>(
"processing/writenData/reconstruction_test_data"
);
const [outPath, setOutPath] = useState<string>("processing/workflows/ptypy");
const [nprocs, setNprocs] = useState<string>("1");
const [memory, setMemory] = useState<string>("20Gi");
const [useGpu, setUseGpu] = useState<boolean>(false);

useEffect(() => {
setParameters({
id: id,
inpath: inPath,
outpath: outPath,
usegpu: useGpu,
});
setResourceParameters({
memory: memory,
nprocs: nprocs,
});
}, [
setParameters,
setResourceParameters,
id,
inPath,
outPath,
useGpu,
memory,
nprocs,
]);

return (
<Card
variant="outlined"
sx={{
mb: 2,
p: 2,
border: "1px solid #89987880",
borderRadius: "4px",
}}
>
<Stack direction="column" spacing={2}>
<TextField
error={id.length === 0}
label="Scan Number"
value={id}
onChange={(e) => setId(e.target.value)}
size="small"
/>
<TextField
label="Path to raw data folder"
value={inPath}
onChange={(e) => setInPath(e.target.value)}
size="small"
/>
<TextField
label="Path to output folder"
value={outPath}
onChange={(e) => setOutPath(e.target.value)}
size="small"
/>
<TextField
label="Requested CPU memory"
value={memory}
onChange={(e) => setMemory(e.target.value)}
size="small"
/>
<TextField
label="Nr. of processes"
value={nprocs}
onChange={(e) => setNprocs(e.target.value)}
size="small"
/>
<FormControlLabel
control={
<Checkbox
checked={useGpu}
onChange={(e) => setUseGpu(e.target.checked)}
/>
}
label="Use GPU"
/>
</Stack>
</Card>
);
};

export default PtypyP99ParameterConfiguration;
5 changes: 5 additions & 0 deletions frontend/unified/src/data/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export const templateOptions: Option[] = [
value: "ptypy-i08-1-from-config",
desc: "Runs a PtyPy reconstruction job inside a container based on data collected at I08-1.",
},
{
label: "Ptypy Reconstruction for P99",
value: "ptypy-p99-from-config",
desc: "Runs a PtyPy reconstruction job inside a container based on data collected at P99.",
},
{
label: "ptycho",
value: "ptycho-recon",
Expand Down
1 change: 1 addition & 0 deletions frontend/unified/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum Beamline {
Epsic = "e01",
E01 = "e01",
E02 = "e02",
P99 = "p99",
}

export type Option = { label: string; value: string; desc?: string };
Expand Down
Loading