Gamma spectroscopy file types

PRA, BeqMoni, Theremino, Fitzpeaks and beyond!
User avatar
NuclearPhoenix
Posts: 72
Joined: 15 Aug 2022, 19:24
Location: Austria
Contact:

Gamma spectroscopy file types

Post by NuclearPhoenix » 08 Jan 2023, 10:28

Hi all,

I've been wondering if there was a somewhat universal file format for gamma spectroscopy that also allows saving meta data. I'm thinking of stuff like device, calibration, time, and so on.
Most of the time what you're using is a plain old CSV with the spectrum histogram. Then with theremino you get a simple file header too, I think, but the rest is just the histogram too.

One thing I can think of are the XML files that are used with BecqMoni 2011. That's a great format, but can it be read by other applications? I'm not sure. In addition to that, the file size can get big really quick as the XML formatting is just so bulky that most of the size is just XML tags.

Is there anything else I forgot?

- Matthias

User avatar
Sesselmann
Posts: 1160
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: Gamma spectroscopy file types

Post by Sesselmann » 09 Jan 2023, 20:02

Matthias,

You are right, it appears everyone has their own format. I have just started working on a python program, not sure how it will turn out, I am only a few days into the project and still struggling with the pulse height functions.
My first goal is to save three numbers, time, pulse_height, distortion. from this I should be able to build histograms.

Once I have the basic pulse height working I am happy to get everyones input.

Steven

User avatar
NuclearPhoenix
Posts: 72
Joined: 15 Aug 2022, 19:24
Location: Austria
Contact:

Re: Gamma spectroscopy file types

Post by NuclearPhoenix » 10 Jan 2023, 00:21

Steven,

I'd love to see some sort of standardized format like the BecqMoni XML files that includes all of the measurement info. These, for example, also somewhat work with the RadiaCode-101 apps and store all the meta data and even the calibration with the energy and background spectra in the same file.
But I really dislike that there is no documentation on this format and also, like I said, the XML is extremely bulky. Had to reverse-engineer the files using a couple examples for work on my spectrum analyzer app...

I'm even beginning to think of a file format of my own, which does exactly what I talked about, but is also a lot smaller than the XMLs and -- most importantly -- has everything documented so that devs and hobbyists can look it up. But realistically that would probably end up as yet another format in the void.

Matthias

User avatar
Sesselmann
Posts: 1160
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: Gamma spectroscopy file types

Post by Sesselmann » 10 Jan 2023, 07:43

Matthias,

I often have clients who want to output data from PRA to Labview or some other software, but as you know there is no standard.
It would be pretty cool to have something like a software version of a USB port, something which just talked to other programs regardless of what kind of program it was.
Theremino have done something similar, I recall testing Theremino MCA with with Theremino Synthesizer, but I have not looked into the code.

I suppose connecting two different programs would require the software equivalent of a cable, a GUI where incoming connections can be wired up to the outgoing connections.

Maybe something like this already exists, don't know?

Steven

User avatar
NuclearPhoenix
Posts: 72
Joined: 15 Aug 2022, 19:24
Location: Austria
Contact:

Re: Gamma spectroscopy file types

Post by NuclearPhoenix » 10 Jan 2023, 08:22

Steven,

yes that sounds like a great idea, albeit a little nightmare as a dev to maintain such a database of file formats for all kinds of programs.
Definitely possible, though, as you could just build some sort of file converter and that doesn't really need to do "live" conversion with both programs connected at the same time. Just a plain simple "Select Input Program" and "Select Output Program", load the file and save the output.
But that, again, wouldn't really save us the hassle of reverse-engineering some more complicated file formats in the first place and god forbid software X gets an update that changes the output syntax.

I just wish the world could agree on some kind of universal file format for this kind of data. It's really not that hard at all, it mostly worked with CSV histograms too. But maybe I'm being way too naive with this, who knows.

User avatar
NuclearPhoenix
Posts: 72
Joined: 15 Aug 2022, 19:24
Location: Austria
Contact:

Re: Gamma spectroscopy file types

Post by NuclearPhoenix » 21 Jan 2023, 06:52

Lately, I had some experiments with different file formats and came up with my own attempt at a somewhat universal file. It's standard JSON, but with a twist. There is a JSON Schema for it, which provides all the data structure and generates the complete documentation. You can also validate this format (i.e. the files) either manually (online) or in your program using an additional libraries.

If some fellow developers come along and want to use the file format for compatability, feel free! If you're using Python or doing web development, it's very easy to validate the data. You are also, obviously, not required to do that, so you will need a standard JSON serializers/deserializers at least. Nevertheless, you should still make sure to adhere to the format, otherwise all of that serves no purpose whatsoever ;)

There is documentation on the file structure and also some example files for gamma spectroscopy:

https://github.com/OpenGammaProject/NPES-JSON

User avatar
Sesselmann
Posts: 1160
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: Gamma spectroscopy file types

Post by Sesselmann » 21 Jan 2023, 08:35

Matthias,

I think a standard JSON file format would be great for quick exchange of spectrum data, it also looks easy to implement.

The discussion that needs to be had is what keyWords to include in the dictionary.

Your example is a good start, but there should be an absolute minimum schema for opening a file and a selection of optional keyWords to enrich the data.

Just to add a few suggestions, how about, "operator, institution, date, project.

Steven

Schema copied from Mattias example.

Code: Select all

{"schemaVersion":"NPESv1","deviceData":{"softwareName":"Gamma MCA, 2023-01-14","deviceName":"Open Gamma Detector"},"sampleInfo":{"name":"LYSO Scintillator","location":"","note":"","weight":4,"volume":0.3,"time":"2022-12-14T17:37:00+01:00"},"resultData":{"energySpectrum":{"numberOfChannels":4096,"validPulseCount":154633,"measurementTime":1,"energyCalibration":{"polynomialOrder":2,"coefficients":[-125.81976744186045,0.6104651162790697,0]},"spectrum":[2845,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,21,113,202,118,32,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,97,140,155,127,126,66,117,137,160,138,138,163,156,100,167,186,196,184,182,201,191,96,164,199,228,213,204,199,217,223,211,214,222,216,224,197,185,125,184,223,213,211,210,209,219,134,213,237,272,258,280,232,215,104,218,262,329,268,293,319,332,184,319,351,370,382,394,419,373,238,370,452,486,435,451,480,439,290,475,501,516,507,486,489,452,249,405,476,540,446,481,446,416,215,402,448,498,457,456,444,391,254,342,425,462,442,451,397,407,238,383,401,455,440,399,401,360,208,354,392,428,416,429,400,398,238,366,381,408,437,401,407,375,228,308,381,433,396,439,397,381,201,386,410,408,359,414,407,342,221,309,415,367,376,356,366,248,187,295,370,382,348,347,359,285,195,319,362,369,367,352,368,353,191,334,349,360,363,362,358,317,186,270,362,353,337,356,367,313,195,327,338,383,351,383,360,296,185,309,336,315,324,336,326,284,201,304,304,332,340,351,324,283,189,280,334,333,346,322,340,312,166,275,300,337,303,318,289,271,181,251,319,337,303,294,288,268,173,299,292,280,321,310,293,231,161,269,298,265,275,282,285,277,161,229,272,295,272,281,242,247,153,234,267,261,282,259,280,239,146,253,318,301,274,295,279,231,153,247,303,316,343,288,318,551,0,643,382,356,370,386,376,320,189,362,400,445,399,392,393,410,250,425,432,426,398,435,420,379,235,339,426,448,461,451,407,377,230,426,388,445,423,415,391,347,236,325,397,369,429,325,369,336,181,327,351,353,320,299,308,255,155,233,284,272,252,249,216,215,145,206,234,245,242,229,222,197,114,183,196,209,181,173,170,156,95,148,161,160,157,147,142,134,82,109,160,133,156,124,121,144,68,127,109,135,102,128,113,77,66,102,114,102,99,111,114,96,66,107,118,124,97,117,118,98,48,91,117,129,107,98,100,64,52,77,104,134,100,96,120,88,59,91,132,106,134,107,117,117,84,117,125,157,130,133,136,130,70,126,154,148,159,152,155,157,90,147,150,182,172,159,205,135,100,151,176,192,175,194,187,164,115,185,184,226,203,234,205,181,112,200,220,229,264,198,222,213,127,197,218,267,226,242,261,197,131,206,268,261,230,232,207,218,129,224,238,212,238,210,187,179,104,180,217,224,234,188,204,189,128,207,186,179,211,163,219,154,80,146,159,170,173,170,169,173,95,158,155,141,141,137,126,108,64,120,146,117,111,117,118,111,109,103,102,101,86,89,102,69,56,77,79,76,79,70,66,81,35,69,70,66,66,58,54,39,29,39,53,46,44,45,59,36,25,43,46,54,37,41,35,31,29,38,37,46,37,39,35,29,20,33,38,27,28,37,38,29,14,19,26,24,22,21,14,31,11,17,24,32,30,23,26,19,13,22,22,21,17,26,27,20,13,22,26,29,28,21,26,17,20,25,24,29,29,20,22,14,18,14,22,16,20,18,25,22,7,18,19,17,15,24,17,17,20,10,18,20,22,11,17,18,13,18,17,16,19,18,15,10,11,15,18,16,18,19,22,14,10,18,9,14,13,16,15,17,11,12,19,14,18,19,15,17,8,14,13,24,17,15,14,18,13,12,13,11,17,16,10,16,13,13,14,13,10,19,10,12,5,10,14,11,17,10,14,13,14,13,10,22,20,10,9,10,6,14,16,16,8,14,15,9,10,11,18,13,18,12,14,15,8,15,12,14,21,14,17,13,6,6,20,8,22,16,22,21,11,15,18,12,8,12,13,10,9,10,13,17,16,11,18,13,9,12,14,20,16,12,20,10,13,14,15,19,18,16,20,18,9,13,18,19,16,14,16,12,6,12,17,20,17,13,13,18,9,13,24,18,16,19,15,17,6,10,19,15,16,12,18,14,9,11,14,23,23,22,19,18,8,17,15,16,16,19,15,7,13,16,14,16,16,16,9,17,9,12,19,23,8,21,23,14,8,15,12,14,15,7,14,13,7,11,10,8,16,15,10,15,6,5,9,12,8,9,7,11,6,9,16,13,14,15,16,9,8,10,15,12,18,8,11,6,8,5,14,13,6,9,6,3,4,11,9,15,11,11,12,6,7,5,16,9,13,9,3,6,1,10,6,13,7,16,10,7,5,8,7,10,5,6,11,12,2,3,5,10,10,6,7,7,2,12,14,4,7,11,16,7,6,10,6,8,9,10,6,9,4,4,7,4,16,6,8,8,7,6,6,14,9,2,5,9,2,10,9,5,12,3,8,2,4,5,8,3,8,3,8,3,2,7,11,7,6,9,9,3,7,6,6,6,4,8,3,6,3,7,9,8,5,5,8,4,5,8,7,10,6,8,3,4,5,5,6,4,8,7,10,5,3,8,7,11,2,3,4,5,4,3,9,5,6,4,7,5,5,6,1,8,3,6,4,7,2,6,5,5,3,6,11,3,2,4,6,3,5,4,2,8,2,1,8,5,6,4,6,2,2,5,7,6,3,5,5,4,2,2,4,4,8,3,10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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"backgroundEnergySpectrum":{"numberOfChannels":4096,"validPulseCount":88237,"measurementTime":1,"energyCalibration":{"polynomialOrder":2,"coefficients":[-125.81976744186045,0.6104651162790697,0]},"spectrum":[1324,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,52,90,97,34,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,13,76,75,92,81,62,52,69,59,54,76,79,72,87,51,83,88,65,98,99,85,70,44,81,100,111,96,100,90,99,129,133,106,108,97,119,110,104,54,93,136,110,124,136,120,137,73,125,115,142,156,133,151,134,66,124,148,166,140,176,178,174,104,165,183,189,190,188,213,181,114,190,216,241,216,242,223,251,155,206,261,269,264,301,294,218,152,229,288,283,274,284,283,260,144,272,302,379,281,340,322,295,190,288,315,359,322,351,327,315,190,310,329,352,352,328,351,305,205,299,364,374,355,321,347,342,190,301,338,378,367,327,338,288,200,267,331,373,366,345,371,327,201,327,331,357,387,337,324,295,184,303,364,340,351,352,341,237,134,252,330,360,310,339,342,300,161,283,332,372,325,306,357,290,191,284,321,307,295,312,319,270,132,262,305,323,289,307,297,262,168,268,275,296,308,268,265,252,142,230,276,309,252,260,272,269,168,238,265,294,244,253,264,229,162,193,238,239,251,271,250,203,138,189,243,230,229,250,227,187,116,190,232,216,216,234,173,202,130,204,212,209,235,227,205,174,106,171,200,222,227,192,181,168,95,144,204,183,199,176,194,173,112,149,185,182,186,165,179,166,106,136,142,166,173,179,189,141,80,134,177,153,162,157,174,249,0,254,137,140,127,141,137,97,66,117,111,140,119,123,138,121,71,115,112,135,107,104,104,104,64,107,100,112,110,101,120,97,58,102,95,110,115,106,94,93,43,98,94,111,95,84,108,99,70,87,92,104,94,102,101,76,43,80,85,99,86,82,97,66,53,71,79,73,78,90,94,71,41,73,73,90,77,92,80,81,37,64,85,73,75,73,86,57,35,64,79,69,72,66,72,70,33,60,78,78,76,75,65,47,29,59,77,75,63,72,66,69,36,56,63,73,61,56,64,64,25,41,52,69,59,56,64,43,20,48,58,64,54,56,41,61,36,54,52,51,46,60,50,45,23,47,41,44,50,46,57,37,20,30,65,43,49,48,41,39,28,45,45,46,50,40,40,36,26,37,34,53,41,40,36,42,23,35,36,41,32,37,35,25,14,31,34,35,29,53,35,44,20,41,31,40,46,37,37,38,27,39,43,31,57,30,45,32,21,38,24,39,35,23,28,37,14,26,35,38,34,35,33,27,29,21,32,26,35,36,27,33,15,21,26,24,34,28,35,21,13,26,25,25,28,27,26,24,16,26,30,23,27,24,18,27,29,32,29,33,28,24,26,20,14,24,20,26,29,13,27,26,18,20,29,31,26,18,30,29,19,15,23,25,21,19,32,22,19,24,23,28,32,31,20,15,11,22,23,21,21,22,20,26,11,25,19,19,25,24,19,13,10,14,22,23,18,23,19,11,11,20,14,27,15,18,22,11,8,12,23,19,14,18,19,22,20,23,16,13,20,15,17,16,17,11,14,15,21,28,20,16,6,16,20,13,18,19,14,13,4,14,13,14,17,17,8,10,10,16,11,24,12,13,14,11,7,7,17,15,15,18,14,9,7,10,12,13,16,13,16,8,11,13,15,13,9,16,10,8,11,21,16,21,14,6,23,10,11,10,15,14,15,11,11,10,6,5,13,11,15,17,10,15,5,10,9,11,7,7,12,11,10,8,9,8,16,10,11,14,8,6,13,5,11,10,10,15,5,9,8,12,13,5,9,12,2,5,14,10,12,7,5,6,9,10,6,3,16,7,9,11,6,9,11,7,12,6,11,7,5,8,6,14,5,9,13,8,1,4,13,7,9,12,10,7,10,7,10,13,10,9,15,7,2,2,12,8,7,13,11,11,8,11,8,6,10,7,7,14,7,14,9,13,8,9,6,8,4,8,10,9,13,7,8,8,5,6,7,11,5,7,7,4,4,6,8,8,10,9,9,9,4,9,8,7,6,5,10,7,6,9,10,11,8,10,6,2,3,4,11,11,8,5,5,3,2,7,11,15,9,7,9,10,7,6,6,14,10,12,15,9,7,10,16,7,9,9,11,4,6,3,7,10,8,7,9,13,11,5,3,6,5,10,11,6,5,9,10,6,7,11,9,7,4,8,11,10,10,6,10,8,5,8,6,7,8,6,11,5,6,6,7,6,9,10,3,5,7,4,6,3,13,4,8,7,5,4,7,7,7,5,3,9,2,8,5,8,11,8,8,7,5,6,5,3,9,15,8,5,0,7,9,7,10,10,10,6,4,7,14,5,10,1,9,2,3,5,8,7,5,6,5,8,2,1,3,8,13,6,9,7,2,5,5,3,11,3,10,11,1,10,6,6,9,8,4,3,3,5,5,6,7,8,8,5,4,5,4,4,8,3,6,4,4,3,9,11,6,2,5,7,2,12,3,3,4,6,3,4,1,8,6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,9,6,6,6,4,5,9,4,3,4,5,3,5,3,4,6,5,2,6,4,0,0,1,1,5,1,3,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}}

User avatar
NuclearPhoenix
Posts: 72
Joined: 15 Aug 2022, 19:24
Location: Austria
Contact:

Re: Gamma spectroscopy file types

Post by NuclearPhoenix » 21 Jan 2023, 08:51

Steven,

you can find all the keywords, their description, optional parameters and so on in the JSON Schema:

https://github.com/OpenGammaProject/NPE ... chema.json

or a more "fancy" (easier to read) HTML documentation can be found here:

https://opengammaproject.github.io/NPES-JSON/

An absolute minimum version of the file would only need to contain the schema version code, one histogram array either for the energy or background energy spectrum and the respective channel/bin count, so it's already as slim as it gets I think.

I'm happy to discuss improvements and suggestions!

User avatar
Sesselmann
Posts: 1160
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Re: Gamma spectroscopy file types

Post by Sesselmann » 21 Jan 2023, 10:25

Matthias,

Thanks, I get it now, what you have there is a good starting point.

I see your histogram data is a list not a dictionary, makes sense..

Steven

User avatar
NuclearPhoenix
Posts: 72
Joined: 15 Aug 2022, 19:24
Location: Austria
Contact:

Re: Gamma spectroscopy file types

Post by NuclearPhoenix » 06 Feb 2023, 01:34

What I forgot to mention is that due to this new data format being JSON, it can also be used to transfer data in APIs or stuff like that. That's what JSON Schema are originally for -- you can validate API requests and responses.

You could connect to a server that is providing some kind of spectrum data and periodically query it for new data. The responses would then be formatted in the NPES format and you would instantly know if the server responses are good to use. That's what came to mind with Steven's new impulse program. Like you already have a local web server through the Python code, so you could also provide a read-only API with the spectrum data formatted in NPES JSON and connect to the server with some other software.

That's just one of the possible applications and obviously only limited to your local machine in this case, but I think this has more potential. Once you got the data you can do anything with it.

I updated the GitHub repo to reflect some of the thoughts on APIs.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest