Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zocalo callback to trigger zocalo fluorescence #233

Open
DominicOram opened this issue Jun 19, 2024 · 7 comments
Open

Zocalo callback to trigger zocalo fluorescence #233

DominicOram opened this issue Jun 19, 2024 · 7 comments
Labels

Comments

@DominicOram
Copy link
Contributor

After capturing fluorescence data we should trigger zocalo to analyse it. To do this zocalo needs a blank recipe and the following parameters:

params = {
    "inputFile": "/dls/i24/data/2024/cm37275-3/20240617_16_03_53.dat",
    "omega": "10.1",
    "transmission": "9.879",
    "samplexyz": "(0,-1,0)",
    "acqTime": "1.0",
    "energy": "12399.7",
    "spectrumID": "15408",
    "custom_recipe": {
        "start": [[1, []]],
        "1": {
            "service": "DLS PyMca Fitter",
            "queue": "pymca.fitter",
            "parameters": {
                "inputFile": "{inputFile}",
                "omega": "{omega}",
                "transmission": "{transmission}",
                "samplexyz": "{samplexyz}",
                "acqTime": "{acqTime}",
                "energy": "{energy}",
                "xfeFluorescenceSpectrumID": "{spectrumID}",
            },
        },
    },
}

Where inputFile is the file written by the detector (Note that we will be using the HDF writer on the detector so we can read the location from that). Currently, it is not obvious what spectrumID corresponds to @pblowey is looking into it

Acceptance Criteria

  • There is a read_hardware plan stub that will read the required hardware
  • There is a callback that will take this data and pass it to zocalo as expected
@pblowey
Copy link

pblowey commented Jun 20, 2024

An update on this. I think I have found the file that GDA calls to trigger PyMCA and it is /dls_sw/apps/mx-scripts/bin/RunPyMcaZocaloAtEndOfCollect.sh. This file actually does call a recipe file that is contained within the live zocalo-configuration called pymca-fitter except for some reason, this script calls it using the file path with the -f flag, meaning that zocalo treats it as a custom-recipe (in terms of logging), which is why I thought it was running a custom-recipe. If you got hyperion to run a similar command to the one in the file with zocalo.go (except you can replace the -f <file_path>.json with -r pymca-fitter, it should activate the PyMCA fitter in zocalo.

@pblowey
Copy link

pblowey commented Jun 21, 2024

spectrumID or "xfeFluorescenceSpectrumID" is not actually used by the pymca-zocalo code in any way, though, in its current state, I think it will throw an error if it is not present as it is given as a required argument to a function that doesn't use it.

@DominicOram
Copy link
Contributor Author

Are you able to make it optional your end so that it won't give an error if we don't provide it?

@pblowey
Copy link

pblowey commented Jun 21, 2024

Ultimately, yes, I will do this. The pymca_fitter service code has not been maintained for a while and is currently running from some old zocalo environment, so it will need a bit of work before I can deploy it with this change. I'll let you know when it's done.

@DominicOram
Copy link
Contributor Author

This recipe does not need the ispyb deposition to be made before triggering

@DominicOram
Copy link
Contributor Author

As per #236 we can send the h5 file in as h5path

@pblowey
Copy link

pblowey commented Aug 9, 2024

As per #1433 (comment) we can send the h5 file in as h5path

Slight correction on this, h5path is a variable I created that would let you specify the path to the data within the h5 file. When you've got the nexus file sorted, you'll have standardised this, and I'll set that as the default value.

The file path should be sent in as inputFile

@DominicOram DominicOram transferred this issue from DiamondLightSource/hyperion Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants