The comment in measurements.py before the definition of the zp property:
# So many other calculated properties need the zeropoint that we
# have to be able to find it. Users would be adivsed to set the
# zeropoint manually if they are able... otherwise, we're gonna
# have six table joins to make sure we get the right zeropoint of
# the upstream new image! (Note that before the database refactor,
# underneath many of these table joins were happening, but also it
# dependend on an image object it was linked to having the manual
# "zp" field loaded with the right thing. So, we haven't reduced
# the need for manual setting in the refactor.)
Go through places in the pipeline where we create Measurements objects and, if we have the zp available, set it. Generally, we'll be creating a lot of Measurements objects at once, so it's way more efficient to load the zp once and then just assign it to all those objects than to let each Measurements object load it redundantly when this property is accessed.
The comment in
measurements.py
before the definition of thezp
property:Go through places in the pipeline where we create Measurements objects and, if we have the zp available, set it. Generally, we'll be creating a lot of Measurements objects at once, so it's way more efficient to load the zp once and then just assign it to all those objects than to let each Measurements object load it redundantly when this property is accessed.