ispyb / ispyb-database-modeling

4 stars 3 forks source link

Tables for storing fluorescence maps #9

Closed KarlLevik closed 6 years ago

KarlLevik commented 7 years ago

One of the Diamond beamlines is using Xspress3 to collect MCAs at all points in a grid scan. They want to be able to show the results from this in the web application. Below are the tables we think should be able to hold the information needed.

CREATE TABLE XRFFluorescenceMappingROI (
    xrfFluorescenceMappingROIId int(11) unsigned auto_increment PRIMARY KEY,
    startEnergy float NOT NULL,
    endEnergy float NOT NULL,
    element varchar(2),
    edge varchar(2) COMMENT 'In future may be changed to enum(K, L)',
    ADD r tinyint unsigned COMMENT 'R colour component', 
    ADD g tinyint unsigned COMMENT 'G colour component', 
    ADD b tinyint unsigned COMMENT 'B colour component'
);

CREATE TABLE XRFFluorescenceMapping (
    xrfFluorescenceMappingId int(11) unsigned auto_increment PRIMARY KEY,
    xrfFluorescenceMappingROIId int(11) unsigned NOT NULL,
    dataCollectionId int(11) unsigned NOT NULL,
    imageNumber int(10) unsigned NOT NULL,
    counts int(10) unsigned NOT NULL,
    CONSTRAINT XRFFluorescenceMapping_ibfk1 
        FOREIGN KEY (xrfFluorescenceMappingROIId) REFERENCES XRFFluorescenceMappingROI(xrfFluorescenceMappingROIId) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT XRFFluorescenceMapping_ibfk2
        FOREIGN KEY (dataCollectionId) REFERENCES DataCollection(dataCollectionId) ON DELETE CASCADE ON UPDATE CASCADE
);

Does this look reasonable? Can this be merged into the official database schema?

StephMonaco commented 7 years ago

Sounds ok to us!