Comments (2)
The general architecture of Keck-DR is based on the idea of splitting the code into discreet units with well specified interfaces.
The processing steps that are required for each image type are listed in a "recipe". Each step in a recipe is a call to a "primitive", a relatively small piece of code that performs a single operation on the input data.
Recipes don't contain logic, and are built as functions. Recipes contain the algorithms and are built as classes.
The framework provides a way to associate recipes with specific image types, and an execution engine that runs that recipe.
A key element of this design is that it enables code sharing and reuse.
In this design, recipes are, in general, specific to an instrument. Primitives, instead, can be either specific to an instrument or more general. For example, a primitive that subtract the overscan is generic and can be used on any instrument where an overscan region is present, but the need to subtract an overscan or not is specific to an instrument, so that the recipe for that instrument will or will not include this primitive as needed.
Because of this design, primitives must be arrange in a hierarchy that defines the generalization and inheritance. Python (and other Object Oriented languages) provide a natural way of doing this by means of subclassing.
We envision the creation of a base primitive class, and then the creation of additional primitive classes that are increasingly specific in terms of area of operation or instrument, each of which would subclass the higher level, more generic classes as needed.
An an example:
BasePrimitiveClass
The base CCD methods such as read, write, subtract a bias are implemented as a CCDPrimitives class which subclasses the BasePrimitive Class. Other generic classes might have to do with logging, or display.
The specific instrument primitive class, such as KCWIPrimitives, will subclass all the classes it needs, plus provide the additional methods that are specific to the instrument.
At the end, only one instrument-specific class will be instantiated and passed as an argument to the primitive, which calls a sequence of methods to perform a complex set of operations.
This is an example of this implementation for a primitive.
class KCWIPrimitives(CCDPrimitives, IOPrimitives):
def __init__(self):
super(KCWIPrimitives).__init__()
def my_method_1(self):
do_something()
def my_method_2(self):
do_something_else()
And for a recipe:
from KCWIPrimitives import KCWIPrimitives
def process_this_frame(p, frame):
p.my_method_1()
p.my_method_2()
The engine would first instantiate the class, then trigger the recipe:
p = KCWIPrimitives()
process_this_frame(p, frame)
from framework.
If recipes are classes as well, they are easier to customize. For consideration.
from framework.
Related Issues (16)
- Operation model/workflow HOT 2
- Reproducibility summary
- Record of processing history
- Describe stakeholders HOT 3
- Data Model HOT 1
- Persistent storage of intermediate steps HOT 2
- Server/client architecture HOT 7
- Recipes association system HOT 2
- -Subclassing- Composition as a way to implement code sharing/inheritance HOT 3
- Pre-condition/Post-condition handling. This is where quality assessment can fit. HOT 2
- Standard facilities provided by the framework (logging, display, fits IO ...)
- Execution modes HOT 6
- Neill / Server mode
- Neill / Object oriented model
- Create simulated data sets, FITS file following the header ICD
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.