alan-turing-institute / DetectorChecker

Project to develop software to assess developing detector screen damage (Web App based on the original DetectorChecker package)
https://detectorchecker.azurewebsites.net
MIT License
0 stars 1 forks source link

Objects containing the term "layout" #42

Closed ejulia17 closed 5 years ago

ejulia17 commented 5 years ago

Dear Oscar,

I briefly brought this up at the last meeting last Wednesday, but am now explaining this in detail. It's a bit lengthy, but the good news is that I am also including a way forward to solve the issue.

In the orginal code there was an object to store the parameters describing the layout of the X-ray detector, that is, the dimensions of the grid defining the detector and the module it is made from. These parameters are the same for all detectors of that model by manufacturing specifications.

In the R package this object now has also slots for data that changes of the life course of a detector: pix_matrix = NA, pix_dead = NA, dead_stats = NA, pix_dead_modules = NA, clumps = NA)

Putting all in one object is probably convenient from a software engineering perspective.

Unfortunately, it is potentially utterly confusing for a user of this package with domain knowledge, such as engineers and statisticians:

The dead pixel data is not part of the layout. The layout is manufactured by design, the dead pixel data is accumulated over the life span of the detector due to usage causing pixels to die.

In the original code I kept those separate, which has also the advantage that one object containing the layout can be used for a number of objects containing different detector data sets (e.g. the same detector at different time points or several detectors with the same layout but naturally different dead pixel sets).

I'm not suggesting to reverse this all to the previous state of having two different objects, because:

However, we need to do something to avoid the confusion for users of the package. An easy fix for this issue is to systematically rename all the objects that not only contain layout information but also dead pixel information into something more general than "layout", such as "detector".

For example, you could change Default_Layout to Default_Detector

This will concern most of all the file layout.R, but also all files that used those objects later.

Some object have initially no slots with dead pixel data, but they get filled in later, so the renaming will also apply to them.

Change also any of the following lines

' A S3 class to represent a detector layout.

to

' A S3 class to represent detector data.

Thank you, Julia