ColwynGulliford / lume-gpt

Apache License 2.0
3 stars 4 forks source link

gpt_from_tao fieldmap conversion #9

Closed ndwang closed 1 year ago

ndwang commented 1 year ago

When I use gpt_from_tao to translate a Bmad injector lattice to GPT, GPT complains about missing grid points. However, if I convert the fieldmaps separately, it seems fine. Perhaps there's something wrong with the fieldmap conversion in gpt_from_tao.

I've included an example and a notebook to reproduce this. in0.zip

ColwynGulliford commented 1 year ago

Generally speaking, the convert has two steps - first one to write the field map to an ascii file, and then calling ASIC2GDF (the gpt binary) to convert to GDF.

Just FYI, you example notebook runs fun no problem on my M2 laptop, so the problem is likely something subtle about your version of GPT. Now, I do recall once having an issue where np.savetxt (which is used to write the ascii file) adds a newline on the end and that used to mess up the old GPT converter. I can add some code to fix that. But you will have to check it on your end, as your example always runs for me.

Screenshot 2023-10-13 at 7 30 51 PM
ndwang commented 1 year ago

Ok interesting. If it works fine on your machine then the issue must be specific to my version of GPT. Thanks for looking into this.

ColwynGulliford commented 1 year ago

That's true, but I may have fixed it. The latest release v0.7.2 has my attempt update. If you're installing via conda, might take a day to to be released there.