LIB: Difference between revisions

Jump to navigation Jump to search
350 bytes added ,  20 September 2019
(→‎Problems: Implementations)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
The possibility of using external libraries (that are loaded at runtime) has been available in C/C++ for a long time, but in Fortran became only available as of Fortran2003.  
The possibility of using external libraries (that are loaded at runtime) has been available in C/C++ for a long time, but in Fortran became only available as of Fortran2003.  


In the case of XDS, frame-reading and computation can be separated starting with version November-2016. This allows users/companies to develop their own specialized frame-reading libraries, and relieves the XDS maintainers from implementing even more file formats.
In the case of XDS, frame-reading and computation can be separated starting with version November-2016. This allows users/companies to develop their own specialized frame-reading libraries, and relieves the XDS maintainers from implementing even more file formats. The feature was developed in order to be able to natively (i.e. without temporary intermediates) read the HDF5 files written for data from the [[Eiger]] detector.


In the following, small examples are given for
In the following, small examples are given for
Line 11: Line 11:
The interface was designed by Markus Mathes (Dectris), Vittorio Boccone (Dectris) and Kay Diederichs. It is supposed to be generic, i.e. useful beyond XDS. In particular, the 4096 bytes of the info_array can be utilized to obtain and use header information (e.g. wavelength, distance, axes specifications and other metadata).   
The interface was designed by Markus Mathes (Dectris), Vittorio Boccone (Dectris) and Kay Diederichs. It is supposed to be generic, i.e. useful beyond XDS. In particular, the 4096 bytes of the info_array can be utilized to obtain and use header information (e.g. wavelength, distance, axes specifications and other metadata).   


The interface is currently used by the [https://github.com/dectris/neggia Neggia] and  [https://github.com/DiamondLightSource/durin Durin] libraries, both for reading HDF5 files.
The interface has several [[LIB#Existing_implementations|implementations]].


== Host code example ==
== Host code example ==
Line 131: Line 131:


MODULE plugin_test_mod
MODULE plugin_test_mod
       CHARACTER :: fn_template*132=''
       CHARACTER :: fn_template*132='',cformat*6='(i4.4)'
       INTEGER  :: lenfn,firstqm,lastqm
       INTEGER  :: lenfn,firstqm,lastqm
END MODULE
END MODULE
Line 154: Line 154:
       firstqm=INDEX(fn_template,'?')
       firstqm=INDEX(fn_template,'?')
       lastqm =INDEX(fn_template,'?',BACK=.TRUE.)
       lastqm =INDEX(fn_template,'?',BACK=.TRUE.)
      WRITE(cformat(3:5),'(i1,a1,i1)')lastqm-firstqm+1,'.',lastqm-firstqm+1
END SUBROUTINE plugin_open
END SUBROUTINE plugin_open
!
!
Line 184: Line 185:
! local variables
! local variables
     INTEGER k,i,dummy
     INTEGER k,i,dummy
     CHARACTER :: fn*132,cformat*6='(i4.4)'
     CHARACTER :: fn*132
     fn=fn_template
     fn=fn_template
    WRITE(cformat(3:5),'(i1,a1,i1)')lastqm-firstqm+1,'.',lastqm-firstqm+1
     IF (frame_number>0) WRITE(fn(firstqm:lastqm),cformat) frame_number
     IF (frame_number>0) WRITE(fn(firstqm:lastqm),cformat) frame_number
! -qopenmp compile option needs to be used otherwise race in writing fn
! -qopenmp compile option needs to be used otherwise race in writing fn
Line 676: Line 676:


# [https://github.com/dectris/neggia Dectris Neggia-plugin] to read HDF5 written by Dectris-supplied software of Eiger detectors
# [https://github.com/dectris/neggia Dectris Neggia-plugin] to read HDF5 written by Dectris-supplied software of Eiger detectors
# [https://github.com/DiamondLightSource/durin Diamond's Durin-plugin] to read HDF5 written by Eiger detectors
# [https://github.com/DiamondLightSource/durin Diamond's Durin-plugin] to read HDF5 written by Eiger detectors at Diamond (and presumably elsewhere); latest binaries for MacOS and Linux (RHEL6) as well as example XDS.INP and source at https://github.com/DiamondLightSource/durin/releases/latest
# [https://git.embl.de/nikolova/xds-zcbf/ EMBL-Hamburg's zcbf-plugin] to read gzip-compressed CBF files without intermediate file
# [https://git.embl.de/nikolova/xds-zcbf/ EMBL-Hamburg's zcbf-plugin] to read gzip-compressed CBF files without intermediate file
== See also ==
# https://rosettacode.org/wiki/Call_a_function_in_a_shared_library#GNU_Fortran_on_Linux
2,652

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu