Description of the GILDA API

The GILDA API provides to developers the utilities of the GILDA beamline . A list of the available methods is given here:

The use of each method is now explained in detail. Parameters are passed in REST form and the response is formatted in the JSON form.

Sample codes
Examples in html/javascript and python to use the GILDA API.

Absorber

Absorber is used to calculate, at a given energy, the absorption of an ion chamber of given length, gas pressure and gas type. At this purpose the parameters from the McMaster tables are used. In the following example we will calculate the absorption of an ion chamber 15 cm long and filled with 500m Bar of Nitrogen gas for X-rays of 10 KeV of energy.

Example of request

http://gilda.iom.cnr.it/ABSORBER/absorber_api_02.php?energy=10&leng=15&press=500&gas=n2&callback=myParser

Description

Method: absorber_api_02.php

Parameters:

?energy=xx xx=energy of the X-ray beam in KeV

&leng=yy, yy is the length of the chamber in cm.

&press=xx, zz is the pressure of the gas in mbars

&gas=jj, jj is the gas and can EXCLUSIVELY take the values N2, Ar or Kr.

&callback=hh hh is the name of the callback function that will be used to extract the data.

Response

myParser({"energy":10,"leng":15,"press":500,"gas":"n2","abs":0.031})

Some parameters of the calculation and the value of the absorption are collected in the response object. Remark: if the gas is not one of those expected absorber returns 0.
back to the methods list

BVM

BVM stands for Bond Valence Method. It is a phenomenological theory to foresee bond length values in polyhedra formed by a cation and several anions. Details on this method can be found here and in the original publication ALTERMATT, D. & BROWN, I. D. (1985). Acta Cryst. (1985). B41, 244-247. The valence states of the cation and the anions must be given and the parameters for the calculation are taken from the BVM parameter provided by the International Union of Crystallography available here . In the following example we will consider a Fe3+ cation surrounded by 6 (i.e. octahedral coordination) O2- anions and we wish to know RFe-O the expected bond length between Fe and O.

Description

Method: bvm_api_05.php

Parameters:

Example of request:

http://gilda.iom.cnr.it/BVM/bvm_api_05.php?ani=O-2&ele=Fe&val=3&coo=6&callback=myParser

?ani=X-Y, X=atomic symbol of a typical anion O, S, Se..., Y is its valence state

&ele=XX, XX=atomic symbol of the anion

&val=X, X=valence of the anion

&coo=X, number of coordination (i.e. number of cations around the anion).

&callback=hh hh is the name of the callback function that will be used to extract the data.

Response

myParser({"bondlen":2.015,"message":"OK"})

The first value is the anion-cation bond length (in Å ) and the message is used for check purposes. In case the requested ions are not tabled (either for atomic species or related valence state) the message becomes Not Found!
back to the methods list

Chamabs

Chamabs is used to calculate the pressure of a given gas in an ion chamber needed to obtain a certain absorption. The energy of the X-ray beam (in KeV) as well as the chamber length (in cm) should be provided.

Example of request

http://gilda.iom.cnr.it/ABSORBER/chamabs_api_02.php?desabs=0.1&eng=10&leng=15&gas=n2&callback=myParser

Description

Method: chamabs_api_02.php

Parameters:

?desabs=zz zz=desired absorption (0-1)

&eng=xx xx=energy of the X-ray beam in KeV

&leng=yy, yy is the length of the chamber in cm.

&gas=jj, jj is the gas and can EXCLUSIVELY take the values n2, ar or kr.

&callback=hh hh is the name of the callback function that will be used to extract the data.

Response

myParser({"energy":10,"leng":15,"abs":0.1,"gas":"n2","pressure":1691})

The value of the gas pressure in mbar.

back to the methods list

Flux

FLUX is a method that permits to calculate the X-ray flux (in photons/s) read by a detector (ion chamber of photodiode). As input parameters it needs the current (taken from the amplifier readout voltage + amplification scale), the energy of the incoming x-ray beam, the efficiency of the detector at that energy and the energy needed to create an electron-hole pair in the detector.
The method returns the flux in ph/s.

Example of request

http://gilda.iom.cnr.it/ABSORBER/flux_api_02.php?rvol=1&Ampl=7&eng=10&eta=0.1&eeh=23&callback=myParser

Description

Method: flux_api_02.php

Parameters:

?rvol=zz zz=readout voltage from the amplifier

&Ampl=xx xx=Amplification value in A/V

&eng=yy, yy=energy of the beam in keV

&eta=jj, jj=efficiency of the detector (0-1).

&eeh=jj, jj=enrgy to create a e-h pair in the detector in eV. eeh is 23 for ion chambers and 3.6 for Si PIN diodes.

&callback=hh hh is the name of the callback function that will be used to extract the data.

Response

myParser({"energy":10,"effic":0.1,"flux":1.437500e+10})

The photon flux in ph/s.
back to the methods list

Sample codes

We provide here two examples, one in html/javascript and one in python to describe how to use the GILDA API. In these examples the absorber api is used to calculate the absorption of an ion chamber of 40cm in length filled with N2 at a pressure of 1000 mbar.

Example using html/javascript


Example in python:

back to the methods list
Back to Index

F. d'Acapito 2014, dacapito AT gmail.com