|
Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
|
Functions | |
| void | Accumulate (Signal &sgn) |
| Accumulates input signal. More... | |
| Signal | Accumulate (const Signal &sgn) |
| Returns a copy of input signal, accumulated. More... | |
| double | AccumulatedFrequency (const Signal &sgn, size_t min_bin=0) |
| Returns the sum of the frequencies from min_bin to the last bin (including the extremities). More... | |
| double | AccumulatedFrequency (const Signal &sgn, size_t min_bin, size_t max_bin) |
| Returns the sum of the frequencies from min_bin to max_bin (including the extremities). More... | |
| double | AccumulatedWeightedFrequency (const Signal &sgn, size_t min_bin=0) |
| Returns the sum of frequencies weighted by their sampling time from min_bin to the last bin (including the extremities). More... | |
| double | AccumulatedWeightedFrequency (const Signal &sgn, size_t min_bin, size_t max_bin) |
| Returns the sum of frequencies weighted by their sampling time from min_bin to max_bin (including the extremities). More... | |
| Signal | RemoveEmptyBins (const Signal &sgn) |
| Returns a copy of input signal, without the empty bins. More... | |
| Vector< size_t > | MapBins (const Signal &source, const Signal &target) |
| Returns a Vector contaning the indexes of the target bins which corresponds to the bins with the same frequency in source signals. Used to get corresponding bins with a signal which empty bins were removed. More... | |
| void | Equalize (Signal &sgn) |
| Equalizes input signal. More... | |
| Signal | Equalize (const Signal &sgn) |
| Returns a copy of input signal, equalized. More... | |
| void | SegmentEqualize (Signal &sgn) |
| Equalizes input signal by segmented histogram in two parts. More... | |
| Signal | SegmentEqualize (const Signal &sgn) |
| Returns a copy of input signal, equalized. More... | |
| double | LowHysteresis (const Signal &sgn, size_t krl_size, float low_threshold, float hgh_threshold) |
| Returns data value of the hysteresis in the low data value of the histogram. More... | |
| double | HighHysteresis (const Signal &sgn, size_t krl_size, float low_threshold, float hgh_threshold) |
| Returns data value of the hysteresis in the high data value of the histogram. More... | |
| size_t | Peak (const Signal &sgn, size_t min_bin, size_t max_bin) |
| Finds the highest peak from bin min_bin to bin max_bin. More... | |
| Vector< size_t > | Peaks (const Signal &sgn, size_t min_bin, size_t max_bin, size_t kernel_size) |
| Finds the bins representing the local maxima with respect to their adjacents in kernel range. More... | |
| size_t | FirstRightPeak (const Signal &sgn, size_t start_bin, size_t kernel_size) |
| Finds the first peak to the right of start_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored. More... | |
| size_t | FirstRightPeak (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size) |
| Finds the first peak to the right of start_bin up to end_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftPeak (const Signal &sgn, size_t start_bin, size_t kernel_size) |
| Finds the first peak to the left of start_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftPeak (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size) |
| Finds the first peak to the left of start_bin up to end_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored. More... | |
| size_t | Valley (const Signal &sgn, size_t min_bin, size_t max_bin) |
| Finds the lowest valley from bin min_bin to bin max_bin. More... | |
| Vector< size_t > | Valleys (const Signal &sgn, size_t min_bin, size_t max_bin, size_t kernel_size) |
| Finds the bins representing the local minima with respect to their adjacents in kernel range. More... | |
| size_t | FirstRightValley (const Signal &sgn, size_t start_bin, size_t kernel_size) |
| Finds the first valley to the right of start_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored. More... | |
| size_t | FirstRightValley (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size) |
| Finds the first valley to the right of start_bin up to end_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftValley (const Signal &sgn, size_t start_bin, size_t kernel_size) |
| Finds the first valley to the left of start_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftValley (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size) |
| Finds the first valley to the left of start_bin up to end_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored. More... | |
| size_t | FirstRightAcclivity (const Signal &sgn, size_t start_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an acclivity, to the right of start_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstRightAcclivity (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an acclivity, to the right of start_bin and limited to end_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftAcclivity (const Signal &sgn, size_t start_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an acclivity, to the left of start_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftAcclivity (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an acclivity, to the left of start_bin and limited to end_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstRightDeclivity (const Signal &sgn, size_t start_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an declivity, to the right of start_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstRightDeclivity (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an declivity, to the right of start_bin and limited to end_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftDeclivity (const Signal &sgn, size_t start_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an declivity, to the left of start_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | FirstLeftDeclivity (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the first bin that belongs to an declivity, to the left of start_bin and limited to end_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored. More... | |
| size_t | PlateauRightLimit (const Signal &sgn, size_t start_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the last occurrence, to the right of start_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored. More... | |
| size_t | PlateauRightLimit (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the last occurrence, to the right of start_bin up to end_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored. More... | |
| size_t | PlateauLeftLimit (const Signal &sgn, size_t start_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the last occurrence, to the left of start_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored. More... | |
| size_t | PlateauLeftLimit (const Signal &sgn, size_t start_bin, size_t end_bin, size_t kernel_size, float signal_delta_proportion) |
| Detects the last occurrence, to the left of start_bin up to end_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored. More... | |
| void | MedianFilter (Signal &sgn, size_t kernel_size) |
| Filters input signal by a median kernel of size kernel_size. More... | |
| Signal | MedianFilter (const Signal &sgn, size_t kernel_size) |
| Returns a copy of input signal filtered by median kernel of size kernel_size. More... | |
| void | Normalize (Signal &sgn) |
| Normalizes input signal. More... | |
| Signal | Normalize (const Signal &sgn) |
| Returns a copy of input signal, normalized. More... | |
| size_t | OtsuThreshold (const Signal &sgn) |
| Computes otsu threshold of input signal. More... | |
| void Bial::SignalOp::Accumulate | ( | Signal & | sgn | ) |
Accumulates input signal.
| sgn | Input signal. |
Returns a copy of input signal, accumulated.
| sgn | Input signal. |
Returns the sum of the frequencies from min_bin to the last bin (including the extremities).
| sgn | Input signal. |
| min_bin | left most bin. |
Returns the sum of the frequencies from min_bin to max_bin (including the extremities).
| sgn | Input signal. |
| min_bin | left most bin. |
| max_bin | right most bin. |
Returns the sum of frequencies weighted by their sampling time from min_bin to the last bin (including the extremities).
| sgn | Input signal. |
| min_bin | left most bin. |
| double Bial::SignalOp::AccumulatedWeightedFrequency | ( | const Signal & | sgn, |
| size_t | min_bin, | ||
| size_t | max_bin | ||
| ) |
Returns the sum of frequencies weighted by their sampling time from min_bin to max_bin (including the extremities).
| sgn | Input signal. |
| min_bin | left most bin. |
| max_bin | right most bin. |
| void Bial::SignalOp::Equalize | ( | Signal & | sgn | ) |
Equalizes input signal.
| sgn | Input signal. |
Returns a copy of input signal, equalized.
| sgn | Input signal. |
| size_t Bial::SignalOp::FirstLeftAcclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an acclivity, to the left of start_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the acclivity. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
| size_t Bial::SignalOp::FirstLeftAcclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an acclivity, to the left of start_bin and limited to end_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the acclivity. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
| size_t Bial::SignalOp::FirstLeftDeclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an declivity, to the left of start_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the declivity. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
| size_t Bial::SignalOp::FirstLeftDeclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an declivity, to the left of start_bin and limited to end_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the declivity. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
Finds the first peak to the left of start_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::FirstLeftPeak | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the first peak to the left of start_bin up to end_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
Finds the first valley to the left of start_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::FirstLeftValley | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the first valley to the left of start_bin up to end_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::FirstRightAcclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an acclivity, to the right of start_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the acclivity. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
| size_t Bial::SignalOp::FirstRightAcclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an acclivity, to the right of start_bin and limited to end_bin, that is greater than start_bin value * ( 1.0 + signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the acclivity. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
| size_t Bial::SignalOp::FirstRightDeclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an declivity, to the right of start_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the declivity. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
| size_t Bial::SignalOp::FirstRightDeclivity | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the first bin that belongs to an declivity, to the right of start_bin and limited to end_bin, that is lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| start_bin | A bin tha lies before the declivity. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted. |
Finds the first peak to the right of start_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::FirstRightPeak | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the first peak to the right of start_bin up to end_bin using a kernel of size kernel_size to validade the peak. Peaks that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::FirstRightValley | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the first valley to the right of start_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::FirstRightValley | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the first valley to the right of start_bin up to end_bin using a kernel of size kernel_size to validade the valley. Valleys that are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | Bin of reference. |
| end_bin | Limit for the search. |
| kernel_size | Size of used kernel. |
| double Bial::SignalOp::HighHysteresis | ( | const Signal & | sgn, |
| size_t | krl_size, | ||
| float | low_threshold, | ||
| float | hgh_threshold | ||
| ) |
Returns data value of the hysteresis in the high data value of the histogram.
| sgn | Input signal. |
| krl_size | Size of the kernel to locate hysteresis. |
| low_threshold | Low frequency threshold. |
| hgh_threshold | High frequency threshold. |
| double Bial::SignalOp::LowHysteresis | ( | const Signal & | sgn, |
| size_t | krl_size, | ||
| float | low_threshold, | ||
| float | hgh_threshold | ||
| ) |
Returns data value of the hysteresis in the low data value of the histogram.
| sgn | Input signal. |
| krl_size | Size of the kernel to locate hysteresis. |
| low_threshold | Low frequency threshold. |
| hgh_threshold | High frequency threshold. |
Returns a Vector contaning the indexes of the target bins which corresponds to the bins with the same frequency in source signals. Used to get corresponding bins with a signal which empty bins were removed.
| source | The source signal to be mapped. Signal without empty bins. |
| target | The target signal with empty bins. Indexes from source corresponding to target are returned. |
| void Bial::SignalOp::MedianFilter | ( | Signal & | sgn, |
| size_t | kernel_size | ||
| ) |
Filters input signal by a median kernel of size kernel_size.
| sgn | Input signal. |
| kernel_size | Size of the kernel for filtering. |
Returns a copy of input signal filtered by median kernel of size kernel_size.
| sgn | Input signal. |
| kernel_size | Size of the kernel for filtering. |
| void Bial::SignalOp::Normalize | ( | Signal & | sgn | ) |
Normalizes input signal.
| sgn | Input signal. |
Returns a copy of input signal, normalized.
| sgn | Input signal. |
Computes otsu threshold of input signal.
| sgn | Input signal. |
Finds the highest peak from bin min_bin to bin max_bin.
| sgn | Input signal. |
| min_bin | minimum bin range. |
| max_bin | maximum bin range. |
| Vector< size_t > Bial::SignalOp::Peaks | ( | const Signal & | sgn, |
| size_t | min_bin, | ||
| size_t | max_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the bins representing the local maxima with respect to their adjacents in kernel range.
| sgn | Input signal. |
| min_bin | minimum bin range. |
| max_bin | maximum bin range. |
| kernel_size | Size of used kernel. |
| size_t Bial::SignalOp::PlateauLeftLimit | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the last occurrence, to the left of start_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value * ( 1.0 - signal_delta_proportion ).
Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | A bin that belongs to the plateau. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted for a bin to belong to the plateau. |
| size_t Bial::SignalOp::PlateauLeftLimit | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the last occurrence, to the left of start_bin up to end_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value ( 1.0 - signal_delta_proportion ).
Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | A bin that belongs to the plateau. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted for a bin to belong to the plateau. |
| end_bin | Limit for the search. |
| size_t Bial::SignalOp::PlateauRightLimit | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the last occurrence, to the right of start_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value * ( 1.0 - signal_delta_proportion ). Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | A bin that belongs to the plateau. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted for a bin to belong to the plateau. |
| size_t Bial::SignalOp::PlateauRightLimit | ( | const Signal & | sgn, |
| size_t | start_bin, | ||
| size_t | end_bin, | ||
| size_t | kernel_size, | ||
| float | signal_delta_proportion | ||
| ) |
Detects the last occurrence, to the right of start_bin up to end_bin, of a bin that is not greater than start_bin value * ( 1.0 + signal_delta_proportion ) and that is not lower than start_bin value ( 1.0 - signal_delta_proportion ).
Sets of consecutive bins that are out of plateau signal range but are narrower than kernel_size are ignored.
| sgn | Input signal. |
| signal | Input signal. |
| start_bin | A bin that belongs to the plateau. |
| kernel_size | Size of used kernel. |
| signal_delta_proportion | maximum signal proportion difference accepted for a bin to belong to the plateau. |
| end_bin | Limit for the search. |
Returns a copy of input signal, without the empty bins.
| sgn | Input signal. |
| void Bial::SignalOp::SegmentEqualize | ( | Signal & | sgn | ) |
Equalizes input signal by segmented histogram in two parts.
| sgn | Input signal. |
Returns a copy of input signal, equalized.
| sgn | Input signal. |
Finds the lowest valley from bin min_bin to bin max_bin.
| sgn | Input signal. |
| min_bin | minimum bin range. |
| max_bin | maximum bin range. |
| Vector< size_t > Bial::SignalOp::Valleys | ( | const Signal & | sgn, |
| size_t | min_bin, | ||
| size_t | max_bin, | ||
| size_t | kernel_size | ||
| ) |
Finds the bins representing the local minima with respect to their adjacents in kernel range.
| sgn | Input signal. |
| min_bin | minimum bin range. |
| max_bin | maximum bin range. |
| kernel_size | Size of used kernel. |


Next, we’ll build diamondback which adds support for
- User-Defined Functions
In the process of doing so, we will learn abou t
- Static Checking
- Calling Conventions
- Tail Recursion
Plan
- Defining Functions
- Checking Functions
- Compiling Functions
- Compiling Tail Calls
1. Defining Functions
First, lets add functions to our language.
As always, lets look at some examples.
Example: Increment
For example, a function that increments its input:
We have a function definition followed by a single “main” expression, which is evaluated to yield the program’s result, which, in this case, is 11
.
Example: Factorial
Here’s a somewhat more interesting example:
This program should produce the result
5
4
3
2
1
0
120
Suppose we modify the above to produce intermediate results:
we should now get:
5
4
3
2
1
0
1
1
2
6
24
120
120
Example: Mutually Recursive Functions
For this language, the function definitions are global * any function can call any other function.
This lets us write mutually recursive functions like:
def even(n):
if (n == 0):
true
else:
odd(n - 1)
def odd(n):
if (n == 0):
false
else:
even(n - 1)
let t0 = print(even(0)),
t1 = print(even(1)),
t2 = print(even(2)),
t3 = print(even(3))
in
0
QUIZ What should be the result of executing the above?
false true false true 0
true false true false 0
false false false false 0
true true true true 0
Types
Lets add some new types to represent programs.
Bindings
Lets create a special type that represents places where variables are bound,
A Bind
is basically just an Id
decorated with an a
which will let us save extra metadata like tags or source positions
- The metadata will make it easy to report errors.
We will use Bind
at two places:
- Let-bindings,
- Function parameters.
It will be helpful to have a function to extract the Id
corresponding to a Bind
Programs
A program is a list of declarations and main expression.
data Program a = Prog
{ pDecls :: [Decl a] -- ^ function declarations
, pBody :: !(Expr a) -- ^ "main" expression
}
Declarations
Each function lives is its own declaration,
data Decl a = Decl
{ fName :: (Bind a) -- ^ name
, fArgs :: [Bind a] -- ^ parameters
, fBody :: (Expr a) -- ^ body expression
, fLabel :: a -- ^ metadata/tag
}
Expressions
Finally, lets add function application (calls) to the source expressions:
An application or call comprises
- an
Id
, the name of the function being called, - a list of expressions corresponding to the parameters, and
- a metadata/tag value of type
a
.
(Note: that we are now using Bind
instead of plain Id
at a Let
.)
Examples Revisited
Lets see how the examples above are represented:
ghci> parseFile "tests/input/incr.diamond"
Prog {pDecls = [Decl { fName = Bind "incr" ()
, fArgs = [Bind "n" ()]
, fBody = Prim2 Plus (Id "n" ()) (Number 1 ()) ()
, fLabel = ()}
]
, pBody = App "incr" [Number 5 ()] ()
}
ghci> parseFile "tests/input/fac.diamond"
Prog { pDecls = [ Decl {fName = Bind "fac" ()
, fArgs = [Bind "n" ()]
, fBody = Let (Bind "t" ()) (Prim1 Print (Id "n" ()) ())
(If (Prim2 Less (Id "n" ()) (Number 1 ()) ())
(Number 1 ())
(Prim2 Times (Id "n" ())
(App "fac" [Prim2 Minus (Id "n" ()) (Number 1 ()) ()] ())
()) ()) ()
, fLabel = ()}
]
, pBody = App "fac" [Number 5 ()] ()
}
2. Static Checking
Next, we will look at an increasingly important aspect of compilation, pointing out bugs in the code at compile time
Called Static Checking because we do this without (i.e. before) compiling and running (“dynamicking”) the code.
There is a huge spectrum of checks possible:
- Code Linting jslint, hlint
- Static Typing
- Static Analysis
- Contract Checking
- Dependent or Refinement Typing
Increasingly, this is the most important phase of a compiler, and modern compiler engineering is built around making these checks lightning fast. For more, see this interview of Anders Hejlsberg the architect of the C# and TypeScript compilers.
Static Well-formedness Checking
We will look at code linting and, later in the quarter, type systems in 131.
For the former, suppose you tried to compile:
We would like compilation to fail, not silently, but with useful messages:
$ make tests/output/err-fac.result
Errors found!
tests/input/err-fac.diamond:6:13-14: Unbound variable 'm'
6| n * fac(m - 1)
^
tests/input/err-fac.diamond:8:1-9: Function 'fact' is not defined
8| fact(5) + fac(3, 4)
^^^^^^^^
tests/input/err-fac.diamond:(8:11)-(9:1): Wrong arity of arguments at call of fac
8| fact(5) + fac(3, 4)
^^^^^^^^^
We get multiple errors:
- The variable
m
is not defined, - The function
fact
is not defined, - The call
fac
has the wrong number of arguments.
Next, lets see how to update the architecture of our compiler to support these and other kinds of errors.
Types
An error message type:
We make it an exception (that can be thrown):
We can create errors with:
We can throw errors with:
We display errors with:
which takes something like:
Error
"Unbound variable 'm'"
{ file = "tests/input/err-fac"
, startLine = 8
, startCol = 1
, endLine = 8
, endCol = 9
}
and produce a pretty message (that requires reading the source file),
tests/input/err-fac.diamond:6:13-14: Unbound variable 'm'
6| n * fac(m - 1)
^
We can put it all together by
main :: IO ()
main = runCompiler `catch` esHandle
esHandle :: [UserError] -> IO ()
esHandle es = renderErrors es >>= hPutStrLn stderr >> exitFailure
Which runs the compiler and if any UserError
are thrown, catch
-es and renders the result.
Transforms
Next, lets insert a checker
phase into our pipeline:
In the above, we have defined the types:
type BareP = Program SourceSpan -- ^ each sub-expression has source position metadata
type AnfP = Program SourceSpan -- ^ each function body in ANF
type AnfTagP = Program (SourceSpan, Tag) -- ^ each sub-expression has unique tag
Catching Multiple Errors
To make using a language and compiler pleasant, we should return as many errors as possible in each run.
- Its rather irritating to get errors one-by-one.
We will implement this by writing the functions
which will recursively walk over the entire program, declaration and expression and return the list of all errors.
- If this list is empty, we just return the source unchanged,
- Otherwise, we
throw
the list of found errors (and exit.)
Thus, our check
function looks like this:
Well-formed Programs, Declarations and Expressions
The bulk of the work is done by:
wellFormed :: BareProgram -> [UserError]
wellFormed (Prog ds e)
= duplicateFunErrors ds
++ concatMap (wellFormedD fEnv) ds
++ wellFormedE fEnv emptyEnv e
where
fEnv = fromListEnv [(bindId f, length xs)
| Decl f xs _ _ <- ds]
This function,
- creates
fEnv
, a map from function-names to the function-arity (number of params), - computes the errors for each declaration (given functions in
fEnv
), - concatenates the resulting lists of errors.
Traversals
Lets look at how we might find three types of errors:
- “unbound variables”
- “undefined functions”
(In your assignment, you will look for many more.)
The helper function wellFormedD
creates an initial variable environment vEnv
containing the functions parameters, and uses that (and fEnv
) to walk over the body-expressions.
wellFormedD :: FunEnv -> BareDecl -> [UserError]
wellFormedD fEnv (Decl _ xs e _) = wellFormedE fEnv vEnv e
where
vEnv = addsEnv xs emptyEnv
The helper function wellFormedE
starts with the input vEnv0
(which has just) the function parameters, and fEnv
that has the defined functions, and traverses the expression:
- At each definition
Let x e1 e2
, the variablex
is added to the environment used to checke2
, - At each use
Id x
we check ifx
is invEnv
and if not, create a suitableUserError
- At each call
App f es
we check iff
is infEnv
and if not, create a suitableUserError
.
wellFormedE :: FunEnv -> Env -> Bare -> [UserError]
wellFormedE fEnv vEnv0 e = go vEnv0 e
where
gos vEnv es = concatMap (go vEnv) es
go _ (Boolean {}) = []
go _ (Number n l) = []
go vEnv (Id x l) = unboundVarErrors vEnv x l
go vEnv (Prim1 _ e _) = go vEnv e
go vEnv (Prim2 _ e1 e2 _) = gos vEnv [e1, e2]
go vEnv (If e1 e2 e3 _) = gos vEnv [e1, e2, e3]
go vEnv (Let x e1 e2 _) = go vEnv e1
++ go (addEnv x vEnv) e2
go vEnv (App f es l) = unboundFunErrors fEnv f l
++ gos vEnv es
You should understand the above and be able to easily add extra error checks.
QUIZ Which function(s) would we have to modify to add large number errors (i.e. errors for numeric literals that may cause overflow)?
wellFormed :: BareProgram -> [UserError]
wellFormedD :: FunEnv -> BareDecl -> [UserError]
wellFormedE :: FunEnv -> Env -> Bare -> [UserError]
1
and2
2
and3
QUIZ Which function(s) would we have to modify to add variable shadowing errors ?
wellFormed :: BareProgram -> [UserError]
wellFormedD :: FunEnv -> BareDecl -> [UserError]
wellFormedE :: FunEnv -> Env -> Bare -> [UserError]
1
and2
2
and3
QUIZ Which function(s) would we have to modify to add duplicate parameter errors ?
wellFormed :: BareProgram -> [UserError]
wellFormedD :: FunEnv -> BareDecl -> [UserError]
wellFormedE :: FunEnv -> Env -> Bare -> [UserError]
1
and2
2
and3
QUIZ Which function(s) would we have to modify to add duplicate function errors ?
wellFormed :: BareProgram -> [UserError]
wellFormedD :: FunEnv -> BareDecl -> [UserError]
wellFormedE :: FunEnv -> Env -> Bare -> [UserError]
1
and2
2
and3
3. Compiling Functions
In the above, we have defined the types:
type BareP = Program SourceSpan -- ^ each sub-expression has source position metadata
type AnfP = Program SourceSpan -- ^ each function body in ANF
type AnfTagP = Program (SourceSpan, Tag) -- ^ each sub-expression has unique tag
Tagging
The tag
phase simply recursively tags each function body and the main expression
ANF Conversion
The
normalize
phase (i.e.anf
) is recursively applied to each function body.In addition to
Prim2
operands, each call’s arguments should be transformed into an immediate expression
Generalize the strategy for binary operators
- from (
2
arguments) ton
-arguments.
Strategy
Now, lets look at compiling function definitions and calls.
We need a co-ordinated strategy for definitions and calls.
Definitions * Each definition is compiled into a labeled block of Asm
* That implements the body of the definitions. * (But what about the parameters)?
Calls * Each call of f(args)
will execute the block labeled f
* (But what about the parameters)?
Strategy: The Stack
We will use our old friend, the stack to
- pass parameters
- have local variables for called functions.
Calling Convention
Recall that we are using the C
calling convention that ensures the following stack layout:
Strategy: Definitions
When the function body starts executing, the parameters x1
, x2
, … xn
are at [ebp + 4*2]
, [ebp + 4*3]
, … [ebp + 4*(n+1)]
.
Ensure that enough stack space is allocated i.e. that
esp
andebp
are properly managedCompile body with initial
Env
mapping parameters to-2
,-3
,…,-(n+1)
.
Strategy: Calls
As before we must ensure that the parameters actually live at the above address.
- Before the call,
push
the parameter values onto the stack in reverse order, - Call the appropriate function (using its label),
- After the call, clear the stack by incrementing
esp
appropriately.
NOTE:
At both definition and call, if you are compiling on MacOS, you need to also respect the 16-Byte Stack Alignment Invariant
Types
We already have most of the machinery needed to compile calls.
Lets just add a new kind of Label
for each user-defined function:
We will also extend the Arg
type to include information about size directives
We will often need to specify that an Arg
is a double word
(the other possibilities are – single word
and byte
) which we needn’t worry about.
Implementation
Lets can refactor our compile
functions into:
that respectively compile Program
, Decl
and Expr
.
In order to simplify stack managment as in Cobra lets have a helper function that compiles the body of each function:
compileBody env e
will wrap the Asm
generated by compileExpr env e
with the code that manages esp
and ebp
.
Compiling Programs
To compile a Program
we compile each Decl
and the main body expression
QUIZ:
Does it matter whether we put the code for e
before ds
?
- Yes
- No
QUIZ:
Does it matter what order we compile the ds
?
- Yes
- No
Compiling Declarations
compileDecl (Decl fname xs body)
= ILabel (Func fname)
: compileBody env body
where
env = fromListEnv (zip xs [-2,-3..])
To compile a single Decl
we
- Create a block starting with a label for the function’s name (so we know where to
call
), - Invoke
compileBody
to fill in the assembly code for the body, using the initialEnv
obtained from the function’s formal parameters.
compileDecl :: ADcl -> [Instruction]
compileDecl (Decl f xs e _)
= ILabel (DefFun (bindId f))
: compileBody (paramsEnv xs) e
The initial Env
is created by paramsEnv
which returns an Env
mapping each parameter to its stack position
(Recall that bindId
extracts the Id
from each Bind
)
Finally, as in cobra, compileBody env e
wraps the assmbly for e
with the code that manages esp
and ebp
.
compileBody :: Env -> AnfTagE -> Asm
compileBody env e = entryCode e
++ compileExpr env e
++ exitCode e
++ [IRet]
entryCode :: AnfTagE -> Asm
entryCode e = [ IPush (Reg EBP)
, IMov (Reg EBP) (Reg ESP)
, ISub (Reg ESP) (Const 4 * n)
]
where
n = countVars e
exitCode :: AnfTagE -> Asm
exitCode = [ IMov (Reg ESP) (Reg EBP)
, IPop (Reg EBP)
]
Compiling Calls
Finally, lets extend code generation to account for calls:
compileExpr :: Env -> AnfTagE -> [Instruction]
compileExpr env (App f vs _)
= call (DefFun f) [param env v | v <- vs]
The function param
converts an immediate expressions (corresponding to function arguments)
The Sized DWordPtr
specifies that each argument will occupy a double word (i.e. 4 bytes) on the stack.
EXERCISE The hard work in compiling calls is done by:
which implements the strategy for calls. Fill in the implementation of call
yourself. As an example, of its behavior, consider the (source) program:
The call add2(12, 7)
is represented as:
The code for the above call is generated by
where arg
converts source values into assembly Arg
which should generate the equivalent of the assembly:
4. Compiling Tail Calls
Our language doesn’t have loops. While recursion is more general, it is more expensive because it uses up stack space (and requires all the attendant management overhead). For example (the python
program):
- Requires a single stack frame
- Can be implemented with 2 registers
But, the “equivalent” diamond
program
- Requires
10000
stack frames … - One for
fac(10000)
, one forfac(9999)
etc.
Tail Recursion
Fortunately, we can do much better.
A tail recursive function is one where the recursive call is the last operation done by the function, i.e. where the value returned by the function is the same as the value returned by the recursive call.
We can rewrite sumTo
using a tail-recursive loop
function:
def loop(r, i):
if (0 <= i):
let rr = r + i
, ii = i - 1
in
loop(rr, ii) # tail call
else:
r
def sumTo(n):
loop(0, n)
sumTo(10000)
Visualizing Tail Calls
Lets compare the execution of the two versions of sumTo
Plain Recursion
sumTo(5)
==> 5 + sumTo(4)
^^^^^^^^
==> 5 + [4 + sumTo(3)]
^^^^^^^^
==> 5 + [4 + [3 + sumTo(2)]]
^^^^^^^^
==> 5 + [4 + [3 + [2 + sumTo(1)]]]
^^^^^^^^
==> 5 + [4 + [3 + [2 + [1 + sumTo(0)]]]]
^^^^^^^^
==> 5 + [4 + [3 + [2 + [1 + 0]]]]
^^^^^
==> 5 + [4 + [3 + [2 + 1]]]
^^^^^
==> 5 + [4 + [3 + 3]]
^^^^^
==> 5 + [4 + 6]
^^^^^
==> 5 + 10
^^^^^^
==> 15
- Each call pushes a frame onto the call-stack;
- The results are popped off and added to the parameter at that frame.
Tail Recursion
sumTo(5)
==> loop(0, 5)
==> loop(5, 4)
==> loop(9, 3)
==> loop(12, 2)
==> loop(14, 1)
==> loop(15, 0)
==> 15
- Accumulation happens in the parameter (not with the output),
- Each call returns its result without further computation
No need to use call-stack, can make recursive call in place. * Tail recursive calls can be compiled into loops!
Tail Recursion Strategy
Instead of using call
to make the call, simply:
- Move the call’s arguments to the (same) stack position (as current args),
- Free current stack space by resetting
esp
andebp
(as just prior toret
c.f.exitCode
), - Jump to the start of the function.
That is, here’s what a naive implementation would look like:
but a tail-recursive call can instead be compiled as:
mov eax , [ebp - 8] # overwrite i with ii
mov [ebp + 12], eax
mov eax, [ebp - 4] # overwrite r with rr
mov [ebp + 8], eax
mov esp, ebp # "free" stack frame (as before `ret`)
pop ebp
jmp def_loop # jump to function start
which has the effect of executing loop
literally as if it were a while-loop!
Requirements
To implement the above strategy, we need a way to:
- Identify tail calls in the source
Expr
(AST), - Compile the tail calls following the above strategy.
Types
We can do the above in a single step, i.e., we could identify the tail calls during the code generation, but its cleaner to separate the steps into:
In the above, we have defined the types:
type BareP = Program SourceSpan -- ^ each sub-expression has source position metadata
type AnfP = Program SourceSpan -- ^ each function body in ANF
type AnfTagP = Program (SourceSpan, Tag) -- ^ each sub-expression has unique tag
type AnfTagTlP = Program ((SourceSpan, Tag), Bool) -- ^ each call is marked as "tail" or not
Transforms
Thus, to implement tail-call optimization, we need to write two transforms:
1. To Label each call with True
(if it is a tail call) or False
otherwise:
2. To Compile tail calls, by extending compileExpr
Labeling Tail Calls
The Expr
in non tail positions
Prim1
Prim2
Let
(“bound expression”)If
(“condition”)
cannot contain tail calls; all those values have some further computation performed on them.
However, the Expr
in tail positions
If
(“then” and “else” branch)Let
(“body”)
can contain tail calls (unless they appear under the first case)
Algorithm: Traverse Expr
using a Bool
- Initially
True
but - Toggled to
False
under non-tail positions, - Used as “tail-label” at each call.

Compiling Tail Calls
Finally, to generate code, we need only add a special case to compileExpr
compileExpr :: Env -> AnfTagTlE -> [Instruction]
compileExpr env (App f vs l)
| isTail l = tailcall (DefFun f) [param env v | v <- vs]
| otherwise = call (DefFun f) [param env v | v <- vs]
That is, if the call is not labeled as a tail call, generate code as before. Otherwise, use tailcall
which implements our tail recursion strategy
tailcall :: Label -> [Arg] -> [Instruction]
tailcall f args
= moveArgs args -- overwrite current param stack-slots with call args
++ exitCode -- restore ebp and esp
++ [IJmp f] -- jump to start
EXERCISE
Does the above strategy work always? Can you think of situations where it may go horribly wrong?
Recap
We just saw how to add support for first-class function
- Definitions, and
- Calls
and a way in which an important class of
- Tail Recursive functions can be compiled as loops.
Later, we’ll see how to represent functions as values using closures.
let x = 10
, y = 20
in
x + y
def foo(x, y):
x + y
tail :: Expr a -> Expr (a, Bool)
tail e = visit True e
where
visit b (Number n l)
visit b (Boolean n l)
visit b (Prim1 n l)
.


Forward Motion Compensation
GEOG*2420
The Earth From Space
Airborne and Spaceborne
Imaging Systems Part 2
John Lindsay
Fall 2015
Multiband Cameras
Airborne Digital Cameras
- Analog (film) versus digital cameras
- Film camera uses film for image capture, display and storage
- Digital systems may use film as a display and storage medium, but
likely stored in digital form
- Film is often transferred to digital format these days by
scanning...why do you think?
The Digital Advantage
- Environmental effects are lessened
- Easily stored, reproduced, and transferred (over the Internet)
- Pixels are uniform in size and shape, unlike silver halide crystals
- Can be transmitted from satellites without need for physical collection
The Digital Advantage
- Amenable to use with computers
- Potential for advanced digital image enhancement and analysis using
'soft-copy' photogrammetry/RS software
- Digital cameras can be made to have sensitivity to a broader portion of
the spectrum than film
Disadvantages of Digital Imaging
- Long-term storage in digital format
- Very large file sizes...can be a challenge for storage and processing
- Most available digital cameras still have significantly poorer resolutions compared to film
- A large format (9 x 9 in.) digital camera would require 80-400MP! And what about colour?
- This is changing rapidly with the use of imaging systems based on linear arrays
and newer digital large format cameras
Airborne Digital Cameras
- Small format: typically < 15 MP
- Medium format: usually 4000 x 4000 pixels or about 16 MP
- Large format: usually based on a linear array of 12,000 detector elements
- Can surpass the resolution of analog (film) cameras)
- But they are very expensive!
- That's equivalent to 144 MP and creates a 4.4GB image!
Digital Image Detectors
- Charge-coupled devices (CCDs)
- Light sensitive material embedded in silicon
- Each ‘potential well’ is ~1 μm and many are connected to form an array
- Respond to brightness more linearly than film
- Complementary metal-oxide semiconductors (CMOS)
- Cheaper but more noisy than CCDs
- Faster and require less power
Digital Image Detectors
Readings
Jensen Chapter 7
How remotely sensed data are transformed into useful information
Orbital altitude and period are related
Altitude vs. Period vs. Speed
Orbital Characteristics
- Orbit Type:
- Equatorial
- Polar
- Near-polar
- Prograde (<90°) or retrograde (>90 °)
Orbital Characteristics
- Geosynchronous
- Satellite in the same position in the sky at the same time daily
- Geostationary (special case of geosynchronous)
- Circular equatorial orbit with 35,786 km orbital altitude
- 23 hr 56 min 5 s orbital period
- Appears to stay in the same location in the sky
- Sun-synchronous
- Crosses latitudes at the same time of day
- 600–800 km altitude; periods 96–100 min; inclinations ~98° (i.e. retrograde)
- Useful for Earth imaging applications
Typical sun-synchronous orbit
Low-Earth, Medium-Earth, & High-Earth Orbits
Types of Satellite Imaging Systems
- Thermal Scanners
- Multi-spectral (MS) Scanners
- Imaging Spectrometers (Hyperspectral)
- Radar (SLAR) & laser altimeters (LiDAR)
- Note: A single satellite platform may have more than one imaging system
The Landsat Program Timeline
The SPOT Satellite Program
- Data sold commercially by SPOT Image Inc.
- A commercially oriented program intended to be operational rather than experimental
- 832 km altitude, inclination of 98.7, crosses equator at 10:30AM
- SPOT 6 launched Sept. 2012 and SPOT 7 launched on June 2014 and subsequently sold to Azerbaijan
SPOT satellite components
Fine-resolution Commercial Satellites
- Starting with SPOT-5 we have entered into a new era of fine-resolution
commercial satellite imagery.
GeoEye-1 provides 0.41 m pan and 1.65 m multi-spec imagery
Commercial satellite image providers
- SPOT Image
- DigitalGlobe
- EarlyBird-1
- IKONOS
- QuickBird
- GeoEye-1, (GeoEye-2 in 2016)
- WorldView-1, WorldView-2, WorldView-3
- Planet Labs (Blackbridge Ltd.; formerly RapidEye): 5 RapidEye sats
WorldView-3
Is there need for aerial photos anymore?
Advantages of fine-res sat data
(compared to airborne imaging)
- Wide swaths compared to aerial photos mean less need to mosaic images
- Satellite is a much more stable platform
- Potential for short-term repeat surveys, i.e. within days
- Wider window for acquisition
- Far cheaper ($2-$12 / km2)
Disvantages of fine-res sat data
(compared to airborne imaging)
- Issues with atmospheric/weather conditions
- Resolution is still not quite as good and may be degraded
outside the US (20 in. or 50.8 cm; this has been relaxed as of 2014)
- Tasking issues (can get bumped by priority)
- Restrictive licences


{% markdown trusted %}
Django Girls Foundation is a Charitable Incorporated Organisation (“the CIO”). The goal of the foundation is to advance the education of the public in particular but not exclusively women in the subject of computer science by providing or assisting in the provision of programming workshops and educational material.
The foundation achieves that by:
- providing opportunities, such as free, accessible programming workshops for women and creating educational materials available online;
- promoting the image of female software engineer by driving advertising campaigns to encourage women to join the IT field and highlighting existing role models.
The Django Girls Foundation is a legal entity protecting Django Girls, but **it is not Django Girls initiative itself**. Django Girls term could be used by anyone involved with Django Girls community and being a trustee is not required.
## Foundation details
**Official name:** Django Girls Foundation
**Other names:** Django Girls Foundation of Awesome, Cupcake and Emoji, DGF, DGFACE, 🐶
**Registered Charity Number:** [1163260](http://apps.charitycommission.gov.uk/Showcharity/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=1163260&SubsidiaryNumber=0)
[Charity Certificate of Registration is available here](https://drive.google.com/file/d/0B-eUYObdf2QbUTVtb2cwU2M1M00/view?usp=sharing)
[Governing document is available here]({% url 'core:foundation-governing-document' %}).
**Address:**
11 Florin Lane
Salford
M6 5TF
### Trustees
- Aisha Bello
- Rachell Calhoun
- Anna Makarudze
- Leona So
- Claire Wicher
## Who owns Django Girls?
The Django Girls Foundation and **the community**.
## How can I financially support Django Girls Foundation?
There are several ways to financially support Django Girls Foundation:
- you could support us on [Patreon](https://www.patreon.com/djangogirls) by monthly donations.
- sponsoring one of [Django Girls events]({% url 'core:events' %}), by contacting local organizers.
## More information
If you want to learn more about Django Girls Foundation or have a question about the foundation, you can contact us by writing an e-mail to [foundation@djangogirls.org](mailto:foundation@djangogirls.org).
{% endmarkdown %}


 If you don’t fancy rice you could serve the curry with wholemeal flatbread, roti or salad. Leftovers will keep in the fridge for a day or can be frozen.
With a GI of 50, this meal is
high protein, low GI
and provides 457 kcal per portion.
Spray a wide-based saucepan or sauté pan with oil and place over a medium heat. Cook the onions for five minutes, stirring regularly, until softened and very lightly browned.
Cut the chicken thighs in half and add to the pan. Cook for two minutes, turning occasionally. Stir in the garlic, ginger, garam masala and chilli powder and cook for a few seconds, stirring constantly.
Tip the tomatoes into the pan and add the chicken stock, lentils and bay leaves. Bring to the boil, then cover loosely with a lid and simmer gently for 35 minutes, or until the chicken is tender and the lentils have completely broken down, stirring occasionally. Remove the lid for the last 10 minutes of cooking time, stirring regularly so the lentils don’t stick.
About 25 minutes before the curry is ready, cook the rice in plenty of boiling water until tender, then drain well.
Season the curry to taste. Serve with the rice, topped with yoghurt and sprinkled with coriander.


{% extends "base.html" %} {% block content %}
If you have a BrowserID, you're already covered. If not, it only takes a minute. We don't even ask for your name.


|
ExcelProject
|
#include <CellFormula.h>
Public Member Functions | |
| CellFormula (const Table *tableRef) | |
| CellFormula (const Table *tableRef, const std::string &value) | |
| CellFormula (const CellFormula ©) | |
| void | setValue (const std::string &value) |
| double | getValue () |
| void | recalculate () |
| CellFormula * | getPointer () |
| std::string | getDisplayableString () |
| std::string | getConstructString () |
| bool | error () |
| bool | isValid (const std::string &value) |
| CellFormula * | clone () const |
| Public Member Functions inherited from Cell | |
| virtual | ~Cell () |
Private Member Functions | |
| void | trimEntirely (std::string &str) |
| int | seekFirstOperation (const std::string &str, char ch[], size_t charCount) |
| int | seekLastOperation (const std::string &str, char ch[], size_t charCount) |
| double | extractCellValue (size_t row, size_t column) |
| double | calculateFormulaRecursively (const std::string &value) |
| double | calculateFormula (const std::string &value) |
| void | trimZeroes (std::string &str) |
Private Attributes | |
| const Table * | tableRef_ |
| std::string | formula_ |
| double | result_ |
| bool | error_ = false |
Static Private Attributes | |
| static constexpr double | zero_ = 0.0000001 |
CellFormula is a class which extends the abstract class Cell Every instance of this class takes care of one formula. A formula represents an algebraic expressing, whole return value is a floating number.
A formula consists of operands (real numbers), unary operators (+,-) and binary ones (+,-,*,/,^)
This class allows:
| CellFormula::CellFormula | ( | const Table * | tableRef | ) |
Constructor which takes pointer to the table this formula is supposed to take all the required information if a reference to a cell is given. Automatically sets the error flag to true and sets default value to the result (0)
| invalid_argument | - if the Table pointer is null. |
| pointer | to the Table class |
| CellFormula::CellFormula | ( | const Table * | tableRef, |
| const std::string & | value | ||
| ) |
Constructor which takes pointer to the table this formula is supposed to take all the required information if a reference to a cell is given. Additionally, takes an initial string and tries to calculate it. If fails, sets the error flag to true and sets default value to the result (0) - setValue
| invalid_argument | - if the Table pointer is null. |
| pointer | to the Table class |
| initial | value |
| CellFormula::CellFormula | ( | const CellFormula & | copy | ) |
Copy constructor
| object | of type CellFormula to copy from |
|
private |
Given a string with an algebraic expression, this function makes sure the expression is correct and properly formatted, so that it can call the following recursive function calculateFormulaRecursively can use its result as an wanted result.
| invalid_argument | - thrown if the expression is invalid. This includes: wrong use of brackets (unequal count of opening and closing ones as well as having more closing than opening brackets at some time |
| expression | to calculate |
|
private |
Given a string with an algebraic expression, this function analyzes it, determines operation priorities and smartly divide the problem into 2 smaller problems which are again sent to this function to calculate them until an operand is reached. The following algorithm is applied
| invalid_argument | - thrown if the expression is invalid. Can be thrown if:
|
| expression | to calculate |
|
virtual |
Clones (creates an exact copy) of the current instance of this class (CellFormula).
Implements Cell.
| bool CellFormula::error | ( | ) |
Returns whether the entered formula was successfully calculated.
|
private |
Given a position in 2D coordinates (row and column), returns the value on that position according to the provided table. The following calculate dependencies apply:
| Wanted | row to get value from |
| Wanted | column to get value from |
|
virtual |
Implements Cell.
|
virtual |
Implements Cell.
|
virtual |
| double CellFormula::getValue | ( | ) |
|
virtual |
Checks whether a string represents a correct formula format. It still can have error, though.
Implements Cell.
| void CellFormula::recalculate | ( | ) |
|
private |
Finds the first occurrence of a wanted char.
Used by calculateFormulaRecursively
| String | to search the wanted char. |
| A | char array of wanted strings (will return the first time it finds at least one match) (follows array's priority) |
| Count | of elements in the char array |
|
private |
Finds the first occurrence of a wanted char.
Used by calculateFormulaRecursively
| String | to search the wanted char. |
| A | char array of wanted strings (will return the first time it finds at least one match) (follows array's priority) |
| Count | of elements in the char array |
|
virtual |
Every instance of this class holds a value of type double. This method returns it.
Implements Cell.
|
private |
Removes every whitespace inside the string. Used to provide the function which calculates the formula a valid string
Used by calculateFormula
| String | to be trimmed. |
|
private |
Given a string which is supposed to represent a floating number, this function changes it, so that it does not have and exceed zeroes at the end of the floating part. Does not check whether the string is actually a floating number.
|
private |
If the last calculated result was unsuccessful, this flag should be set to true.
|
private |
Holds an unchanged copy of the last entered formula.
|
private |
Holds the last calculated result in a formula, so that it does not need to calculate it again
|
private |
A formula might have a reference to another cell in the current or another table. In order to find the information this class needs of, a reference to the table should be provided.
|
staticconstexprprivate |
private constant representing an extremely low positive floating number. Used to indicate whether a floating number is so close to zero, that it can be freely considered as a zero


Give Today , Make Tommorow Better !
We all have that inner voice inside our head that makes us terrible each time we abandon something that we don't use anymore but that can be used to someone in need. Don't we all have a lot of clothes,books and other household goods just lying at some corner and getting dusted.It's time to give them a new life by donating them to those who in need and bring smiles on their faces.Humene provides you the most convenient and easy way to donate those items and spread happiness.
To fill the gap between NGO and Donors Humane come up with a solution.We help to reach the donations to the beneficiaries.Users need to register to make donation.After user has logged in the user has to give his donation and personal details.He/She needs to set up pickup schedule.After we have picked up the donation user can also track us.


Hi,
I'm a little confused how to setup EmonLib for Arduino using a SCT-013-030. According to http://openenergymonitor.org/emon/node/2447 it's calibration value must be 30 and it already has a internal burden resistor, so I'm using the following code:
#include <EmonLib.h> EnergyMonitor emon1; // Create an instance void setup() { Serial.begin(9600); emon1.current(1, 30); // Current: input pin, calibration. } void loop() { double Irms = emon1.calcIrms(1480); // Calculate Irms only Serial.println(Irms); // Irms }
with this schema :
I'm reading between 0.04 and 0.06 constantly without any load. It's just noise / not or it's just not accurate enough to read that there's no load? Maybe I'm missing something else...
Anyone can give me some insight?
thanks,
Re: arduino SCT-013-030
It is just noise.
If you use an Arduino variant that has good filtering between the analogue and digital sides, and has good noiseless power supplies, and you pay very careful attention to grounding, screening and filtering, you will hopefully see an improvement. But you will probably never read a true zero current.
This is because the rms calculation in emonLib rectifies the wave, so the slightest amount of noise is added to the wanted signal. If you add a voltage input and measure real power, there is no rectification, and you will see an improvement because the negative noise spikes and the positive noise spikes will tend to balance each other out.
Don't ask me which particular Arduino is best, I don't know. But I'm told that some makes/builds/clones are better than others.
Re: arduino SCT-013-030
my application is to measure the blower of my oil burner and also the oil burner and of course when both are on, blower and burrner.
in a past life, working with many industrial sensors, we incorporated a 'zero-drop-out circuit.
we typically used % of full span accuracy., often 1/4 of a percent.
below that point, the ZDO circuit would just bring the reading to 0.00. this was more for the on-looker to feel good as most did not understand the concept of tolerance and accuracy.
in my sketch, I added
if(Irms <= 0.25){ // added for zero dropout
IrmsDisplay=0;
and then
Serial.println(IrmsDisplay);
this way, the actual match was never effected, only the reading on the display.
Re: arduino SCT-013-030
HI guys,
I have implemented the same circuit, the same program in my arduino mega 2560 and I used the SCT-013 30A with output 0-1Volt.
I try with calibration value=30 but I'm reading between 0.29and 0.31 constantly without any load.
I connected a soldering of 30 Watts and I get reads 0.34-036 amperes, this reads sre fake because 0.35*220v=77Wats
How I can calibrate this program?
Re: arduino SCT-013-030
Hi Rody, calibrating with such a small load is difficult. If you haven't looked at the calibration resource here yet, you should do so - it's really helpful. Try a space heater, toaster, or some other resistive (not a motor) load above 1kW rather than a lamp or soldering iron.
Re: arduino SCT-013-030
Hi, I will attach here as I am having problems with this sensor and emon lib on arduino duemilanove. I read ~70A without any load attached (sensor brings that 2.5V basically down to zero). Setup is usual (two R10k for diving 5V into two + 10uF pull down). When I disconnect the sensor and short circuit its pins inside the socket I see just a noise (>0.1A) so it looks ok. I am also using SD shield + one wire temp sensor (at the end I am trying to debug a fridge). Any idea what am I doing wrong?
* I measure 38.5R on sensor's output
Re: arduino SCT-013-030
Have you told emonLib that your ADC has a 12-bit resolution? I can't see that in your code. Look at emonLib.h to see what to do.
Re: arduino SCT-013-030
I have taken unconnected pin from 3.5mm jack... So embarrassing :)
It is not Due but Duemilanove so 10b ADC resolution only
Funny thing - I got two sensors (5A/1V and 30A/1V, first due to supplier mistake):
when connecting ~1A load (it is a dryer so a motor + heater) 5A sensor gives me 0.5A while only 30A sensor providing expected load. Calibrating 5A sensor as 10A gives proper result - maybe this time it is manufacturer's mistake with marking 10A/1V as 5A/1V or picking wrong burden resistor? Anyone having any similar story?
BTW Have anyone experienced those sensors working with currents higher then nominal? I guess linearity can be problematic?
Re: arduino SCT-013-030
"maybe this time it is manufacturer's mistake"
That sounds likely, but without actually measuring the CT directly, it's hard to tell. You could open it up (it's quite easy and non-destructive) to read the burden value, then calculate what it should be - or measure the resistance you see, bearing in mind the secondary winding resistance is in the order of 100 Ω and in parallel with the burden. We think all versions use the same winding 100 A : 50 mA. I can't remember anyone reporting a similar problem.
"Have anyone experienced those sensors working with currents higher then nominal? I guess linearity can be problematic?"
You can see the answer to that in the test report in Resources.
Re: arduino SCT-013-030
Yes, I have already disassembled 5A/1V version.
You are probably referring to saturation graph? That would answer my doubts only if all versions use the same winding and just differ with a burden resistor. Thanks.
Re: arduino SCT-013-030
@kodak,
Don't you have this already? If the core cross-section is the same, the driving flux is from the single turn primary, hence saturation is independent of how many turns in the secondary.
Re: arduino SCT-013-030
"Yes, I have already disassembled 5A/1V version."
But you're not telling us what value the burden resistor was, so I can't help you.
emjay:
Only partly true - remember the secondary current actually reduces the core flux, so in a lightly loaded/unloaded CT all the primary flux is magnetising flux and the core saturates a lot earlier than a short-circuited one. (Hence the danger from having no burden: the rate of change of flux, hence voltage, is very large as the core switches from saturation one way to saturation the other. You can see the unburdened CT saturating, in the report.)
Re: arduino SCT-013-030
5A/1V: resistor's code is 3900
30A/1V: 62R0
Re: arduino SCT-013-030
Those do appear to be the correct burden resistor values for the stated rating, so unless the resistor in the 5 A one is wrongly marked, or just plain wrong (which is unlikely), the only possible explanation seems to be a parallel burden resistor, of 390 Ω. You don't have a second burden? - that too seems improbable if the other CT was correct.
So it looks as if that will have to remain a mystery.


Move your mouse to play.
Click to shoot.
Press space or esc to Pause.
Make sure to kill all the enemies before the time runs out.
Best played in
Google Chrome
or
Safari


COVID-19 tracker
World counter
{{totalAffected}}
Affected
{{totalDeceased}}
Deceased
{{totalCritical}}
Serious
{{totalRecovered}}
Recovered


Welcome to the /usr/sbin/ece-install Guide
Table of Contents
- 1 Supported Operating Systems
- 2 A Note on Running ece-install On Non-GNU/Linux Systems
- 3 Downloading the ece-install Script
- 4 Running the ece-install Script
- 5 Available Server Profiles
- 5.1 Common for All Server Profiles
- 5.2 Common for Editorial, Presentation and Search Instances
- 5.3 Profile - Full Stack on One Host
- 5.4 Profile - Editorial Server (Publication Server)
- 5.5 Profile - Presentation Server
- 5.6 Profile - Database Server
- 5.7 Profile - Cache Server
- 5.8 Profile - Install Widget Framework
- 5.9 Profile - Create Publication
- 5.10 Profile - Monitoring Server
- 5.11 Profile - Restoring from backup
- 5.12 Running interactively
- 5.13 Running in FAI mode
- 5.14 Data security
- 6 Full Automatic Install (FAI)
- 7 Running More Than One Installation Process
- 8 Re-running ece-install (and How To Speed It Up)
- 9 Using a Custom Configuration File for ece-install
- 10 Overview of File Paths Used by the ece-install script
- 11 Overriding the Escenic directories
- 12 Extending ece-install by Writing Hooks
- 13 Assumptions
- 14 Uninstalling Everything That the ece-install Set Up
- 15 Example Output FAI
1 Supported Operating Systems
For the best experience, run this script on Debian Squeeze (or newer), the latest Ubuntu LTS or most other Debian based operating systems, but it should work without any problems on any Unix like system that has a recent version of BASH.
1.1 Debian based operating systems
If running on a Debian based operating system, ece-install will take care of installing all required third party software, such as database & caching server.
1.2 Other GNU/Linux and Unix systems
If you're installing on another Linux or Unix system, you must first make sure that these 3rd party components are installed. ece-install will tell you which ones it cannot find and tell you to install these, so you can simply run it to find out which ones you need.
You may also look inside the ece-install script for all calls to the 'assert_pre_prequesite' method and you'll get a list of the binaries ece-install assumes are present.
2 A Note on Running ece-install On Non-GNU/Linux Systems
Please note, it's assumed that the OS uses GNU's tools, i.e. find, cp & tar. If you're running a system which has a different set of core tools, such as any of the BSDs (including Mac OS X) or Solaris, make sure that GNU's tools take precedence in the command PATH offered to ece-install.
3 Downloading the ece-install Script
The ece-install script can be downloaded from: https://raw.github.com/skybert/ece-scripts/master/usr/sbin/ece-install or be downloaded together with the other ece-scripts using git:
$ git clone git@github.com:skybert/ece-scripts.git
4 Running the ece-install Script
You must run the script as the root user. If you start the script as a regular user, it will complain:
[ece-install] You must be root when running ece-install
To become root on Ubuntu based systems and Mac OS X, do:
$ sudo su
Please note that just doing "sudo ece-install" may not work.
On all other Unix like system, do:
$ su -
You will need access to http://technet.escenic.com and put these credentials in the root user's $HOME/ece-install.conf, normally this means /root/ece-install.conf, the script will also tell you this if you forget to provide such a configuration file:
[ece-install] /root/ece-install.conf doesn't exist, I cannot live without it :-(
As for the technet credentials, the script will also tell you if it cannot find what it's looking for:
[ece-install] Be sure to set technet_user and technet_password [ece-install] in /root/ece-install.conf
The minimum ece-install.conf file is thus:
technet_user=<user> technet_password=<password>
If you're installing WF as well, you'll need additional credentials for this, see the Widget Framwork section below, and if you want to runn a fully automatic install without any user interaction, you'll need to specify some FAI specific parameters, see the FAI section below.
With the configuration file in place, you're now ready to run it:
# bash ece-install [-v|--verbose]
ece-install will try to "fail fast", exiting as soon as it detects an error during its execution:
[ece-install-1] The command [cd /does/not/exist] FAILED, exiting :-( [ece-install-1] See /var/log/ece-install.log for further details.
As a last resort, if something goes astray with the script, and the log file cannot give you enough clues, the ultimate way of debugging this is to run the BASH interpreter with the -x flag:
# bash -x ece-install
Here you can see everything that BASH does when running the script, how the wildcard variables expand and so on. Normally, having a tail on /var/log/ece-install.log should be sufficient, though.
5 Available Server Profiles
When starting the script, it will ask you which server profile you want to install:
Hi, which server profile do you wish to install? 1 - All in one, full stack on one host, suitable for dev & test environments 2 - Editorial (publication) server 3 - Presentation server (ECE + memcached). 4 - Database server 5 - Cache server (cache and web server) 6 - RMI hub 7 - Search server (Solr + indexer-webapp) 8 - Install Widget Framework. 9 - Create a new publication based on WF if available, ECE/clean-demo if not 10 - A monitoring server (web server + Munin gatherer) 11 - Restore from backup (DB, data files, binaries, conf & publications) Select 1-11 and press ENTER Your choice [1]>
5.1 Common for All Server Profiles
The script will install a Munin node on the host. It will also install the Escenic specific Munin plugins on hosts where there are any Escenic server components.
5.2 Common for Editorial, Presentation and Search Instances
5.2.1 Sun Java 6
5.2.2 Apache Tomcat application server
- Compression of textual content (previously, this was typically set up with Apache and its mod_deflate module).
- pooling set up tweaked for high read/write performance.
- proper logging configuration directing solr messages to its own log.
- routing information in the cookies
- application server access log
5.2.3 Basic Escenic Nursery configuration
The basic Nursery configuration is taken care of for you, including RMI, database, search and application server/URIs.
5.2.4 APR, native library for optimal Tomcat I/O performance
5.2.5 Escenic Assembly environment
The reason why ece-install sets this up on each host, is to make the installation process as smooth as possible. The assembly environment may be removed after the installation if you want to.
5.2.6 Database driver
5.2.7 Compression of content
This was was previously accomplished by having a web server in fron t of the application server (or cache server if you used ESI). A typical system architecture would contain Apache with mod_deflate. However, this is no longer necessary as Varnish can handles ESI parsing of compressed content (and many other things that we before needed Apache for). Thus, we'll let the application server do the compression for us now.
5.3 Profile - Full Stack on One Host
This profile is suitable for developers and admins wanting to set up a test environment. It will install the full stack including caching server, application server, ECE, assembly host, database, Widget Framework, as well as creating a publication for you.
For further details on each of the different server components, see the different profile descriptions bellow.
5.4 Profile - Editorial Server (Publication Server)
Will set up a typical editorial server (often referred to as the publication server in Escenic literature).
5.5 Profile - Presentation Server
This will set up a typical presentation server:
- Memcached, distributed memory cache
- Deployment setup to only deploy escenic-admin and the publication(s).
5.6 Profile - Database Server
If ece-install is run on a support version of Debian or Ubuntu, this will install the excellent Percona distribution of MySQL with their set of high performance patches.
If not, MySQL or Percona must be installed in advance.
Given that the mysqld is install, this profile will download all the Escenic components and install the ECE database schema based from the SQL files contained inside the distribution bundles. To accomplish this, the script will make a call to drop-and-create-ecedb in the same directory as the ece-intall script itself.
The script will fail by itself if the DB already exists:
[ece-install] Setting up the ECE database schema ... ERROR 1007 (HY000) at line 1: Can't create database 'ece5db'; database exists ERROR 1050 (42S01) at line 2: Table 'DBChangeLog' already exists [ece-install] running tables FAILED, exiting :-(
5.7 Profile - Cache Server
If ece-install is run on a support version of Debian or Ubuntu, it will install the latest Varnish 3.0 caching server from the Varnish APT repository.
If ece-install is run on a different platform, the admin must install Varnish 3.x prior to running ece-install.
The script will configure Varnish for a typical Escenic site:
- it will set up the cache server on port 80
- will set up an access control lists of IPs which may access the
privileged web applications such as /escenic-admin, /escenic and
/webservice.
ece-install will also add the host from which you connect, making sure that if you've SSH-ed into the server to conduct the install, you'll automatically be included in the "staff" ACL and can access all the web applications without editing these ACLs (or disabling security as many does).
- will set up sticky sessions/session binding
- will set up a backend cluster and allow the user to enter the different backend servers that will serve the web site.
- will set up configuration to strip away cookies from static resources, such as CSS, JS and pictures.
- will install the nginx web server for serving static content and will configure Varnish accordingly. This will be very useful for Adactus servers wanting to pull content from your ECEs.
TBD:
- If run on a Linux platform, the script will tweak the kernel parameters for optimal TCP handling for a web facing server.
- let the /munin run through on port 80, requiring the connecting IPs to be in the staff network ACL, defined in the Varnish configuration.
5.8 Profile - Install Widget Framework
You'll need a user name and password for accessing the repo.escenic.com Maven repository. You should get these credentials when you bought Widget Framework. If you for some reason do not have these, please contact<EMAIL_ADDRESS>If you don't have these ready in your ece-install.conf, ece-install will complain:
[ece-install] Be sure to set wf_user and wf_password in /root/ece-install.conf [ece-install] If you don't have these, please contact<EMAIL_ADDRESS>5.9 Profile - Create Publication
This profile will create a publication for you, only asking you the name of the publication and which ECE instance to use for its creation.
This installation profile will base the publication on the Widget Framework if its present on the system, if not, ECE's clean demo WAR is used as a basis.
5.10 Profile - Monitoring Server
This will install a Munin gatherer and web server. The latter for accessing the reports generated by the former.
TBD: This profile will also install the Nagios interface for monitoring the different nodes.
5.11 Profile - Restoring from backup
ece-install can restore from a backup made by the ece script:
$ ece -i <instance> backup
As stated in the ece guide, this backup may contain (depending on what's available on the host where it's run):
- database dump of the instance
- data files (pictures, video files and so on). This is often referred to as the "multimedia archive" in Escenic literature.
- ECE, cache and web server configuration
- Escenic software
5.12 Running interactively
5.12.1 Start ece-install and choose the Option, "Restore from backup"
# ece-install
5.12.2 Select Which Backup to Restore
[ece-install-5] From which dataset do you wish to backup? 1 - engine-dev1-backup-2011-10-10.tar.gz 2 - engine-dev1-backup-2011-10-11.tar.gz [ece-install-5] Enter the number next to the tarball, from 1 to 2 Your choice [1]>
The ece script mentioned above will create backups in
/var/backups/escenic
and the ece-install script will hence expect to find them here.
5.12.3 Choose What to Restore
[ece-install-12] Which part of the system do you wish to restore? 1 - The database 2 - The Solr and ECE data files (multimedia archive) 3 - The ECE configuration files 4 - The Escenic and Tomcat software binaries + publication templates Your choice [1]> 2
5.12.4 Sit Back and Watch ece-install Restore the Data for You
[ece-install-13] Restoring the Solr & ECE data files on ubiquitous ... [ece-install-21] - The installation is now complete! It took 0d 0h 0m 20s [ece-install] Successfully restored Solr & ECE data files [ece-install] from backup: engine-dev1-backup-2011-10-12.tar.gz [ece-install] Check /var/lib/escenic to verify they're all there
5.13 Running in FAI mode
If you're running in FAI mode, you can choose between these settings to decide what to restore and where to find the backup file to restore from:
| Parameter | Default | Description |
|---|---|---|
| fai_restore_all | 0 | Restore everything found in the backup file |
| fai_restore_db | 0 | Install the DB server & restore its contents |
| fai_restore_data_files | 0 | Restore the Solr & ECE data files |
| fai_restore_configuration | 0 | Restore the Solr & ECE configuration files |
| fai_restore_software_binaries | 0 | Restore the Escenic and Apache Tomcat software |
| fai_restore_from_file | "" | The .tar.gz produced by "ece -i <instance> backup" |
For example, to restore everything possible from a given tarball, you need this in your ece-install.conf:
fai_enabled=1 fai_restore_from_backup=1 fai_restore_all=1 fai_restore_from_file=/var/backups/escenic/engine-dev1-backup-2011-10-10.tar.gz
5.14 Data security
You should take heed when running restore, so that you're not restoring a system which you didn't want to change (yes, this mishap does happen).
The ece-install script will help you a bit on the way, but the final responsibility always lies with you as the user.
If you're trying to restore the DB and the ECE schema already exists, the restore will fail:
[ece-install-8] Restoring the database contents on ubiquitous ... [ece-install-24] Selecting the most recent database dump ece5db-2011-10-10.sql.gz ERROR 1007 (HY000) at line 1: Can't create database 'ece5db'; database exists ERROR 1050 (42S01) at line 25: Table '`ece5db`.`AccessControlList`' already exists [ece-install-24] The command [restoring from var/backups/escenic/ece5db-2011-10-10.sql.gz] FAILED, exiting :-( [ece-install-24] See /var/log/ece-install.log for further details.
6 Full Automatic Install (FAI)
The ece-install script has support for doing a full automatic install (FAI). You can only install one profile at a time. The profiles are the parameters with "install" in their name, such as:
fai_editor_install
When running in FAI mode, you probably want to redirect standard output to a log file for easy reading later on:
# bash ece-install > ece-install.out &
Alternatively, you may do:
# nohup bash ece-install > ece-install.out &
The "nohup" at the beginning and the ampersand at the end lets you log out of the SSH/X session to your Linux/Unix box while the script keeps running in the background.
6.1 Installing from EARs instead of Binaries
It is possible to get ece-install to use a supplied EAR and configuration archive instead of using the files provided with the Escenic Content Engine & plugins.
The EAR to provide is the one you generate with:
$ ece -i <instance> assemble
Normally, the EAR will then be available in:
/var/cache/escenic/engine.ear
The configuration bundle must contain:
engine/security engine/siteconfig/bootstrap-skeleton engine/siteconfig/config-skeleton assemblytool/plugins/<plugin>/siteconfig
and optionally also:
engine/solr/conf
A simple way to create this bundle, is to use a server which has the assembly environment set up and then do:
$ cd /opt/escenic $ tar czf /tmp/nursery-skeleton-solr-and-security.tar.gz \ engine/security \ engine/siteconfig/config-skeleton/ \ engine/solr/conf \ engine/siteconfig/bootstrap-skeleton/ \ `find -L assemblytool/plugins/ -name siteconfig`
/tmp/nursery-skeleton-solr-and-security.tar.gz should now have everything you need. You can now configure your FAI installation to use these by, e.g.:
fai_presentation_ear=/tmp/engine.ear fai_presentation_conf_archive=/tmp/nursery-skeleton-solr-and-security.tar.gz
Corresponding configuration options are available for the other server profiles, see the table below.
The inclusion of the engine/solr directory makes it easy for users to provide their own, optimised Solr configuration. In this context, also note that a post install hook, setupsolr.postinst, is available.
6.2 Setting up virtual hosts
Setting up virtual host definitions in the application server makes a some things easier, such as ECE plugins which set cookies based on information they get from the app server.
ece-install can set up the virtual hosts configuration for Tomcat application servers if the profile is editorial, all presentation.
To use this feature, you must define one domain for each publication in the following FAI parameter:
fai_publication_domain_mapping_list=" firepub#fire.escenic.com ildpub#ild.escenic.com "
This will produce the following stanzas in server.xml:
<Host name="fire.escenic.com" appBase="webapps" autoDeploy="false"> <Context displayName="fire.escenic.com" docBase="firepub" path="/" /> </Host> <Host name="ild.escenic.com" appBase="webapps" autoDeploy="false"> <Context displayName="ild.escenic.com" docBase="ildpub" path="/" /> </Host>
You must of course make sure that these host names are resolvable to the intended IPs on your system using /etc/hosts or a local DNS.
6.3 Overview of All FAI Parameters
The ece-install script understands for the following settings in the $HOME/ece-install.conf file of the root user:
| Parameter | Default | Description |
|---|---|---|
| fai_all_install | 0 | Install all components on your server. |
| fai_cache_backends | ${HOSTNAME}:8080 | Space separated, e.g. "app1:8080 app2:8080" |
| fai_cache_install | 0 | Install cache server profile |
| fai_db_host | $HOSTNAME | Useful for editor & presentation profiles |
| fai_db_drop_old_db_first | 0 | Warning: this will drop the old database before installing a new one |
| fai_db_install | 0 | Install db profile |
| fai_db_password | read-the-source-luke | Useful for DB installation profile |
| fai_db_port | 3306 | Useful for editor & presentation profiles |
| fai_db_schema | ece5db | Useful for DB installation profile |
| fai_db_user | ece5user | Useful for DB installation profile |
| fai_editor_conf_archive | "" | conf.tar.gz to use for Nursery & JAAS configuration |
| fai_editor_ear | "" | EAR to use instead of the Escenic binaries |
| fai_editor_install | 0 | Install the editorial profile |
| fai_editor_name | editor1 | Name of the editor instance |
| fai_editor_port | 8080 | HTTP port of the editor instance |
| fai_editor_shutdown | 8005 | Shutdown port of the editor instance |
| fai_enabled | 0 | Whether or not to run ece-install in FAI mode |
| fai_monitoring_server_install | 0 | Install the monitoring server profile. |
| fai_monitoring_server_ip | <IP_ADDRESS> | The IP of the monitoring server. |
| fai_presentation_conf_archive | "" | conf.tar.gz to use for Nursery & JAAS configuration |
| fai_presentation_ear | "" | EAR to use instead of the Escenic binaries |
| fai_presentation_install | 0 | Install the presentation server profile |
| fai_presentation_name | web1 | Name of the presentation server instance |
| fai_presentation_port | 8080 | HTTP port of the presentation server instance |
| fai_presentation_shutdown | 8005 | Shutdown port of the presentation instance |
| fai_public_host_name | ${HOSTNAME}:8080 | The public address for your website |
| fai_publication_create | 0 | Create a new publication |
| fai_publication_name | mypub | Name of the publication |
| fai_publication_use_instance | dev1 | Name of local instance to use for creation |
| fai_publication_war | "WF or ECE demo WAR" | WAR to base the new publication on |
| fai_publication_war_uri_list | "" | Publication WARs used for setting up Assembly tool. Supported: http[s]://tmp.com/mypub.war, ///tmp/mypub.war and /tmp/mypub.war. |
| fai_publication_domain_mapping_list | "" | Mapping between publication names and their corresponding domains on the form: one#one.com other#other.com |
| fai_rmi_install | 0 | Install RMI hub profile |
| fai_search_conf_archive | "" | conf.tar.gz to use for Nursery & JAAS configuration |
| fai_search_ear | "" | EAR to use instead of the Escenic binaries |
| fai_search_for_editor | 0 | If 1 (true), will configure Solr for use with an editorial server, if not conf for presentation servers will be chosen. |
| fai_search_indexer_ws_uri | http://${HOSTNAME}:8080/indexer-webservice/index/ | URI of the indexer-webservice that the search instance shall use for knowing what to index. |
| fai_search_install | 0 | Install the search server profile (Solr + indexer) |
| fai_search_name | search1 | Name of the search instance |
| fai_search_port | 8080 | HTTP port of the search instance |
| fai_search_shutdown | 8005 | Shutdown port of the search instance |
| fai_wf_install | 0 | Install Widget Framework profile |
As you've probably have guessed, 0 means "false" and 1 means "true" :-)
6.4 Examples
6.4.1 Installing an Editorial Server & Create a Publication
To automatically install an editorial server and create a publication called "jollygood", the minimal configuration in ece-install.conf would be:
fai_enabled=1 fai_editor_install=1 fai_publication_create=1 fai_publication_name=jollygood
6.4.2 Installing Two Presentation Servers On a Single Host
If you wish to only install two presentation servers called "web1" and "web2" on your host, you will first run ece-install with:
fai_enabled=1 fai_presentation_install=1 fai_presentation_name=web1
And then re-issue ece-install with the following configuration:
fai_enabled=1 fai_presentation_install=1 fai_presentation_name=web2 fai_presentation_port=8081 fai_presentation_shutdown=8105
Notice that this configuration has some extra options since the previous run of ece-install could run with the default settings, whereas the second one needs to override these.
6.5 Verifying That the Script Is Running In FAI Mode
When FAI is enabled, ece-install will report:
[ece-install] Full Automatic Install (FAI) enabled. [ece-install] All user input will be read from /root/ece-install.conf
7 Running More Than One Installation Process
If the script believes there's already an ece-intall process running, it will abort:
[ece-install] There's already one ece-install process running. If you believe [ece-install] this is wrong, e.g. if a previous run of ece-install was aborted [ece-install] before it completed, you may delete /var/run/ece-install.pid and [ece-install] run ece-install again.
8 Re-running ece-install (and How To Speed It Up)
Although the initial thought behind ece-install, is to run it on a clean system to get up and running as soon as possible. However, you may want to re-run ece-install on the same host, for instance to add another instance of ECE, set up Widget Framework or create another publication.
ece-install has a number of features which will try to minimise the time it takes to run it on consecutive runs. If running on Debian based systems, it will check if you already have installed pre-requisite 3rd party libraries and only if any are missing will it ask the package manager to fetch it.
Likewise, ece-install will see if the Escenic artifacts or application server that you need are already present in the /tmp/ece-downloads folder, and only download the missing ones (if any).
To get a list of the artifacts it'll pull from http://technet.escenic.com and http://tomcat.apache.org search for the following variables:
- technet_download_list
- wf_download_list
- tomcat_download
Two other ways of speeding up the installation is (of course) to use the backup/restore feature or install from a EAR and configuration bundle, see the FAI section.
9 Using a Custom Configuration File for ece-install
You can specify a different configuration by using the -f parameter:
$ ece-install -f ece-install-presentation-server.conf
10 Overview of File Paths Used by the ece-install script
There are of course other paths involved when setting up your system, but these should be the most interesting ones.
| Path | Explanation |
|---|---|
| /etc/apt/sources.list.d/escenic.list | 3rd party APT repositories added by ece-install *) |
| /etc/default/ece | The configuration file for the ece init.d script |
| /etc/escenic/ece-<instance>.conf | Instance specific settings for /usr/bin/ece |
| /etc/escenic/ece.conf | Common ece.conf file for /usr/bin/ece |
| /etc/escenic/engine/common | Common Nursery configuration layer |
| /etc/escenic/engine/common/security | Common security configuration for all ECE instances. |
| /etc/escenic/engine/common/trace.properties | Log4j configuration, produces instance specific log files. |
| /etc/escenic/engine/instance/<instance> | Instance specific Nursery configuration |
| /etc/escenic/solr | ECE specific Solr configuration |
| /etc/init.d/mysql[d] | For starting and stopping MySQL/Percona |
| /etc/init.d/varnish | For starting and stopping Varnish |
| /etc/intit.d/ece | The init.d script managing all the ECE instances on your host. |
| /etc/varnish/default.vcl | The Varnish configuration |
| /opt/escenic | All ECE components can be found here |
| /opt/escenic/assemblytool | The assembly tool |
| /opt/escenic/assemblytool/plugins | Contains symlinks to all plugins in /opt/escenic |
| /opt/escenic/engine | Symlink pointing to the current ECE |
| /opt/tomcat | Symlink pointing to the install Apache Tomcat (catalina_home) |
| /opt/tomcat-<instance> | Instance specific Tomcat files (catalina_base) |
| /usr/bin/ece | Script for operating all ECE instances + RMI hub and EAE |
| /usr/sbin/drop-and-create-ecedb | DB script used by the ece-install script |
| /usr/sbin/ece-install | The installation script described in this guide |
| /var/log/escenic/<type>-<instance>.log | The instance's log4j log |
| /var/log/escenic/<type>-<instance>.out | The instance system out log |
| /var/log/escenic/solr.<date>.log | The Solr log (not in standard out!) |
| /var/run/escenic/<type>-<instance>.pid | The instance's PID file |
*) Applies only to Debian based systems.
11 Overriding the Escenic directories
All of the Escenic specific directories may be overwritten in ece-install.conf. Here's an example of changing all the paths possible with the same suffix.
suffix=escenic-parallel escenic_root_dir=/opt/$suffix escenic_conf_dir=/etc/$suffix escenic_log_dir=/var/log/$suffix escenic_data_dir=/var/lib/$suffix escenic_run_dir=/var/run/$suffix escenic_backups_dir=/var/backups/$suffix escenic_spool_dir=/var/spool/$suffix escenic_cache_dir=/var/cache/$suffix escenic_crash_dir=/var/crash/$suffix
Note, this is only needed if you are running two completely separate environments on the same host. A use case is if you're setting up a test environment and want to separate stacks of Escenic Content Engine and plugins.
12 Extending ece-install by Writing Hooks
ece-install has a number of hooks on which you can hook on your own scripts. The scripts are to reside in $HOME/ece-conf.d/ and have names inspired by Debian's package scripts:
<hook name>.<phase>
e.g.:
install_analysis_server.preinst
Will be run before the body of the hook, just the corresponding .postinst hook will be run after.
12.1 Accessing ece-install variables
Before running the hook, ece-install will make all its local variables available in /var/run/escenic/ece-install.env, which can then be used by the hook scripts.
12.2 Example hook
Here is an example hook which will be run after the EAE is installed.
# Put this in is $HOME/ece-install.d/install_analysis_server.postinst # read ece-install's current variables source /var/run/escenic/ece-install.env # do something useful echo "Hello from $0, EAE is installed in ${tomcat_base}" > /tmp/hello.txt
12.3 Available hooks
Currently, the following hooks are available:
install_analysis_server.preinst install_analysis_server.postinst set_up_solr.preinst set_up_solr.postinst
13 Assumptions
13.1 /etc/esecenic is shared
It's assumed that the /etc/escenic directory is either on a shared file system or rsync-ed among the hosts that are running the ECE instances (the exception being database and cache servers).
14 Uninstalling Everything That the ece-install Set Up
WARNING: this is potentially dangerous as some of these components may be used by other pieces of software you have running on your host. However, this may be useful if you're installing a clean environment and want to e.g. undo your previous install to install a different profile.
Open the ece-install script and look for the "un_install_ece" function, it has copy and pastable commands for undoing most/all things set up by the script.
15 Example Output FAI
The ece-install will often be run in FAI mode where all the settings are read from ~/ece-install.conf. Given the following entries in this file:
technet_user=apples technet_password=andoranges wf_user=foo wf_password=bar fai_enabled=1 fai_all_install=1
All the different components described in this guide are installed on the host that runs the install script.
The following output is produced from ece-install:
[ece-install-0] Full Automatic Install (FAI) enabled. [ece-install-0] All user input will be read from /root/ece-install.conf [ece-install-0] I'm logging to /var/log/ece-install.log [ece-install-1] Stopping conflicting processes ... [ece-install-1] Installing 3rd party packages needed by ece-install ... [ece-install-1] Setting up the ece UNIX scripts ... [ece-install-2] Setting up the torstein user's UNIX environment ... [ece-install-2] Installing a presentation server on quanah ... [ece-install-2] Installing 3rd party packages needed by ECE ... [ece-install-4] Setting up the basic Nursery configuration ... [ece-install-4] Using the supplied Nursery & JAAS configuration [ece-install-4] from the bundle: /tmp/nursery-skeleton-and-security.tar.gz [ece-install-4] Setting up the application server ... [ece-install-5] Setting up proper log4j & Java logging configuration ... [ece-install-5] Setting correct permissions on ECE related directories ... [ece-install-6] Assembling, deploying & starting pres1 ... [ece-install-7] I'm using the supplied EAR instead of running an assembly. [ece-install-24] Adding the ece init.d script to the default run levels ... [ece-install-24] Installing a Munin node on quanah ... [ece-install-30] The installation is now complete! It took 0d 0h 0m 30s [ece-install-30] - New ECE instance pres1 installed. [ece-install-30] - Admin interface: http://quanah:9980/escenic-admin/ [ece-install-30] - View installed versions with: ece -i pres1 versions [ece-install-30] - Type 'ece help' to see all the options of this script [ece-install-30] - Read its guide: /usr/share/doc/escenic/ece-guide.txt [ece-install-30] - /etc/default/ece lists all instances started at boot time [ece-install-30] - A Munin node has been installed on quanah [ece-install-30] - Install info: /usr/share/doc/escenic/ece-install-guide.txt [ece-install-30] - Guide books: http://documentation.vizrt.com/ece-5.3.html [ece-install-30] Enjoy your time with Escenic Content Engine! [ece-install-30] -Vizrt Online


Apply a discount coupon in your shop's products
Playstation 5
$100.000
If you have a coupon add it here
Done