Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions apps/src/Hummbee/hummbee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ float Hummbee(
string& imageName, string& modelImageName,
string& deconvolver,
vector<float>& scales,
float& largestscale, float& fusedthreshold,
float& largestscale, float& fusedthreshold,vector<float>& waveletscales,vector<float>& waveletamps,float& autothreshold,int& automaxiter,float& autogain,float& hogbomgain,bool& autohogbom, float& autotrigger,float& autopower, int& autoxmask, int& autoymask,float& lbfgsepsf, float& lbfgsepsx, float& lbfgsepsg, int& lbfgsmaxit,
int& nterms,
float& gain, float& threshold,
float& nsigma,
Expand Down Expand Up @@ -286,6 +286,21 @@ float Hummbee(
decPars_p.interactive=false;
decPars_p.autoAdjust=False; //genie
decPars_p.fusedThreshold = fusedthreshold;
decPars_p.waveletScales = Vector<Float>(waveletscales);
decPars_p.waveletAmps = Vector<Float>(waveletamps);
decPars_p.autoThreshold = autothreshold;
decPars_p.autoMaxiter = automaxiter;
decPars_p.autoGain = autogain;
decPars_p.hogbomGain = hogbomgain;
decPars_p.autoHogbom = autohogbom;
decPars_p.autoTrigger = autotrigger;
decPars_p.autoPower = autopower;
decPars_p.autoXMask = autoxmask;
decPars_p.autoYMask = autoymask;
decPars_p.lbfgsEpsF = lbfgsepsf;
decPars_p.lbfgsEpsX = lbfgsepsx;
decPars_p.lbfgsEpsG = lbfgsepsg;
decPars_p.lbfgsMaxit = lbfgsmaxit;
decPars_p.specmode=specmode; //deconvolve task does not have this
decPars_p.largestscale = largestscale;
decPars_p.scalebias = 0.0;
Expand Down Expand Up @@ -320,9 +335,9 @@ float Hummbee(

float minpsffraction = 0.05;
float maxpsffraction = 0.8;
float CycleFactor = 1.0;
//float CycleFactor = 1.0;

Float psffraction = MaxPsfSidelobe * CycleFactor;
Float psffraction = MaxPsfSidelobe * cyclefactor;//CycleFactor;
psffraction = casacore::max(psffraction, minpsffraction);
psffraction = casacore::min(psffraction, maxpsffraction);
Float cyclethreshold = PeakResidual * psffraction;
Expand Down
6 changes: 4 additions & 2 deletions apps/src/Hummbee/hummbee.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#include <synthesis/ImagerObjects/SDAlgorithmMSClean.h>
#include <synthesis/ImagerObjects/SDAlgorithmMEM.h>
#include <synthesis/ImagerObjects/SDAlgorithmAAspClean.h>
#include <synthesis/ImagerObjects/SDAlgorithmWaveletAspClean.h>
#include <synthesis/ImagerObjects/SDAlgorithmSpectralAspClean.h>

#include <synthesis/ImagerObjects/SDMaskHandler.h>
#include <synthesis/ImagerObjects/SIMinorCycleController.h>
Expand Down Expand Up @@ -81,7 +83,7 @@ using namespace casacore;
float Hummbee(std::string& imageName, std::string& modelImageName,
std::string& deconvolver,
std::vector<float>& scales,
float& largestscale, float& fusedthreshold,
float& largestscale, float& fusedthreshold,vector<float>& waveletscales,vector<float>& waveletamps,float& autothreshold,int& automaxiter,float& autogain, float& hogbomgain,bool& autohogbom,float& autotrigger,float& autopower,int& autoxmask,int& autoymask,float& lbfgsepsf, float& lbfgsepsx, float& lbfgsepsg, int& lbfgsmaxit,
int& nterms,
float& gain, float& threshold,
float& nsigma,
Expand All @@ -95,7 +97,7 @@ void UI(bool restart, int argc, char **argv, bool interactive,
string& imageName, string& modelImageName,
string& deconvolver,
vector<float>& scales,
float& largestscale, float& fusedthreshold,
float& largestscale, float& fusedthreshold,vector<float>& waveletscales,vector<float>& waveletamps,float& autothreshold,int& automaxiter,float& autogain, float& hogbomgain,bool& autohogbom, float& autotrigger,float& autopower,int& autoxmask,int& autoymask,float& lbfgsepsf, float& lbfgsepsx, float& lbfgsepsg, int& lbfgsmaxit,
int& nterms,
float& gain, float& threshold,
float& nsigma,
Expand Down
51 changes: 48 additions & 3 deletions apps/src/Hummbee/hummbee_cl_interface.cc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmuellergoe These added parameters seem fine but why do we need to expose lbfgsbepsf/lbfgsbepsx/lbfgsbepsg/lbfgsmaxit (LBFGSB optimization parameters of Asp-CLEAN)? Is it for the purpose of CG-Clean or autocorrelation, or just for better Asp-Clean performance if users know how to fine tune them?

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void UI(bool restart, int argc, char **argv, bool interactive,
Float& pbLimit,*/
string& deconvolver,
vector<float>& scales,
float& largestscale, float& fusedthreshold,
float& largestscale, float& fusedthreshold,vector<float>& waveletscales,vector<float>& waveletamps,float& autothreshold,int& automaxiter,float& autogain,float& hogbomgain, bool& autohogbom, float& autotrigger,float& autopower, int& autoxmask, int& autoymask, float& lbfgsepsf, float& lbfgsepsx, float& lbfgsepsg, int& lbfgsmaxit,
int& nterms,
float& gain, float& threshold,
float& nsigma,
Expand Down Expand Up @@ -129,6 +129,21 @@ void UI(bool restart, int argc, char **argv, bool interactive,
//InitMap(watchPoints,exposedKeys);
exposedKeys.push_back("largestscale");
exposedKeys.push_back("fusedthreshold");
exposedKeys.push_back("waveletscales");
exposedKeys.push_back("waveletamps");
exposedKeys.push_back("autothreshold");
exposedKeys.push_back("automaxiter");
exposedKeys.push_back("autogain");
exposedKeys.push_back("hogbomgain");
exposedKeys.push_back("autohogbom");
exposedKeys.push_back("autotrigger");
exposedKeys.push_back("autopower");
exposedKeys.push_back("autoxmask");
exposedKeys.push_back("autoymask");
exposedKeys.push_back("lbfgsepsf");
exposedKeys.push_back("lbfgsepsx");
exposedKeys.push_back("lbfgsepsg");
exposedKeys.push_back("lbfgsmaxit");
watchPoints["asp"]=exposedKeys;

i=1;clgetSValp("deconvolver", deconvolver, i ,watchPoints);
Expand All @@ -139,6 +154,21 @@ void UI(bool restart, int argc, char **argv, bool interactive,

i=1;clgetFValp("largestscale", largestscale,i);
i=1;clgetFValp("fusedthreshold", fusedthreshold,i);
N=0; N=clgetNFValp("waveletscales", waveletscales, N);
N=0; N=clgetNFValp("waveletamps", waveletamps, N);
i=1;clgetFValp("autothreshold", autothreshold,i);
i=1;clgetIValp("automaxiter", automaxiter,i);
i=1;clgetFValp("autogain", autogain,i);
i=1;clgetFValp("hogbomgain", hogbomgain,i);
i=1;clgetBValp("autohogbom", autohogbom,i);
i=1;clgetFValp("autotrigger", autotrigger, i);
i=1;clgetFValp("autopower", autopower, i);
i=1;clgetIValp("autoxmask", autoxmask,i);
i=1;clgetIValp("autoymask", autoymask,i);
i=1;clgetFValp("lbfgsepsf", lbfgsepsf,i);
i=1;clgetFValp("lbfgsepsx", lbfgsepsx,i);
i=1;clgetFValp("lbfgsepsg", lbfgsepsg,i);
i=1;clgetIValp("lbfgsmaxit", lbfgsmaxit,i);

i=1;clgetIValp("nterms", nterms,i);
i=1;clgetFValp("gain", gain,i);
Expand Down Expand Up @@ -203,6 +233,21 @@ int main(int argc, char **argv)
vector<float> scales;
float largestscale = -1;
float fusedthreshold = 0;
vector<float> waveletscales;
vector<float> waveletamps;
float autothreshold = 0;
int automaxiter = 0;
float autogain = 0;
float hogbomgain = 0;
bool autohogbom = false;
float autotrigger = 0;
float autopower = 1;
int autoxmask = 0;
int autoymask = 0;
float lbfgsepsf = 0.001;
float lbfgsepsx = 0.001;
float lbfgsepsg = 0.001;
int lbfgsmaxit = 5;
int nterms=1;
float gain=0.1;
float threshold=0.0;
Expand All @@ -225,7 +270,7 @@ int main(int argc, char **argv)
,doPBCorr, conjBeams, pbLimit,*/
deconvolver,
scales,
largestscale, fusedthreshold,
largestscale, fusedthreshold,waveletscales, waveletamps, autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower,autoxmask,autoymask,lbfgsepsf,lbfgsepsx,lbfgsepsg,lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand All @@ -241,7 +286,7 @@ int main(int argc, char **argv)
doPBCorr, conjBeams, pbLimit,*/
deconvolver,
scales,
largestscale, fusedthreshold,
largestscale, fusedthreshold,waveletscales, waveletamps, autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower,autoxmask,autoymask,lbfgsepsf,lbfgsepsx,lbfgsepsg,lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down
15 changes: 15 additions & 0 deletions apps/src/Hummbee/hummbee_py_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ PYBIND11_MODULE(hummbee2py, m)
"scales"_a,
"largestscale"_a=-1,
"fusedthreshold"_a=0,
"waveletscales"_a,
"waveletamps"_a,
"autothreshold"_a=0,
"automaxiter"_a=0,
"autogain"_a=0,
"hogbomgain"_a=0,
"autohogbom"_a=false,
"autotrigger"_a=0,
"autopower"_a=1,
"autoxmask"_a=0,
"autoymask"_a=0,
"lbfgsepsf"_a=0.001,
"lbfgsepsx"_a=0.001,
"lbfgsepsg"_a=0.001,
"lbfgsmaxit"_a=5,
"nterms"_a=1,
"gain"_a=0.1,
"threshold"_a=0.0,
Expand Down
93 changes: 93 additions & 0 deletions apps/src/tests/test_hummbee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ TEST(HummbeeTest, AppLevelCubeAsp) {
vector<float> scales;
float largestscale = -1;
float fusedthreshold = 0;
vector<float> waveletscales;
vector<float> waveletamps;
float autothreshold;
int automaxiter;
float autogain;
float hogbomgain;
bool autohogbom;
float autotrigger;
float autopower;
int autoxmask;
int autoymask;
float lbfgsepsf=0.001;
float lbfgsepsx=0.001;
float lbfgsepsg=0.001;
int lbfgsmaxit=5;
int nterms=1;
float gain=0.1;
float threshold=1e-4;
Expand All @@ -68,6 +83,9 @@ TEST(HummbeeTest, AppLevelCubeAsp) {
deconvolver,
scales,
largestscale, fusedthreshold,
waveletscales, waveletamps,
autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower, autoxmask, autoymask,
lbfgsepsf, lbfgsepsx, lbfgsepsg, lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down Expand Up @@ -134,6 +152,21 @@ TEST(HummbeeTest, AppLevelMfsAsp) {
vector<float> scales;
float largestscale = -1;
float fusedthreshold = 0.007;
vector<float> waveletscales;
vector<float> waveletamps;
float autothreshold;
int automaxiter;
float autogain;
float hogbomgain;
bool autohogbom;
float autotrigger;
float autopower;
int autoxmask;
int autoymask;
float lbfgsepsf=0.001;
float lbfgsepsx=0.001;
float lbfgsepsg=0.001;
int lbfgsmaxit=5;
int nterms=1;
float gain=0.2;
float threshold=2.6e-07;
Expand All @@ -152,6 +185,9 @@ TEST(HummbeeTest, AppLevelMfsAsp) {
deconvolver,
scales,
largestscale, fusedthreshold,
waveletscales, waveletamps,
autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower, autoxmask, autoymask,
lbfgsepsf, lbfgsepsx, lbfgsepsg, lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down Expand Up @@ -222,6 +258,21 @@ TEST(HummbeeTest, AppLevelWAsp) {
vector<float> scales;
float largestscale = 5;
float fusedthreshold = 0.05;
vector<float> waveletscales;
vector<float> waveletamps;
float autothreshold;
int automaxiter;
float autogain;
float hogbomgain;
bool autohogbom;
float autotrigger;
float autopower;
int autoxmask;
int autoymask;
float lbfgsepsf=0.001;
float lbfgsepsx=0.001;
float lbfgsepsg=0.001;
int lbfgsmaxit=5;
int nterms=3;
float gain=0.6;
float threshold=0.2;
Expand All @@ -236,6 +287,9 @@ TEST(HummbeeTest, AppLevelWAsp) {
deconvolver,
scales,
largestscale, fusedthreshold,
waveletscales, waveletamps,
autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower, autoxmask, autoymask,
lbfgsepsf, lbfgsepsx, lbfgsepsg, lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down Expand Up @@ -292,6 +346,21 @@ TEST(HummbeeTest, AppLevelMfsRestore) {
vector<float> scales;
float largestscale = -1;
float fusedthreshold = 0.007;
vector<float> waveletscales;
vector<float> waveletamps;
float autothreshold;
int automaxiter;
float autogain;
float hogbomgain;
bool autohogbom;
float autotrigger;
float autopower;
int autoxmask;
int autoymask;
float lbfgsepsf=0.001;
float lbfgsepsx=0.001;
float lbfgsepsg=0.001;
int lbfgsmaxit=5;
int nterms=1;
float gain=0.2;
float threshold=2.6e-07;
Expand All @@ -311,6 +380,9 @@ TEST(HummbeeTest, AppLevelMfsRestore) {
deconvolver,
scales,
largestscale, fusedthreshold,
waveletscales, waveletamps,
autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower, autoxmask, autoymask,
lbfgsepsf, lbfgsepsx, lbfgsepsg, lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down Expand Up @@ -339,6 +411,9 @@ TEST(HummbeeTest, AppLevelMfsRestore) {
deconvolver,
scales,
largestscale, fusedthreshold,
waveletscales, waveletamps,
autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower, autoxmask, autoymask,
lbfgsepsf, lbfgsepsx, lbfgsepsg, lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down Expand Up @@ -380,6 +455,21 @@ TEST(HummbeeTest, UIFactory) {
vector<float> scales;
float largestscale = -1;
float fusedthreshold = 0;
vector<float> waveletscales;
vector<float> waveletamps;
float autothreshold;
int automaxiter;
float autogain;
float hogbomgain;
bool autohogbom;
float autotrigger;
float autopower;
int autoxmask;
int autoymask;
float lbfgsepsf=0.001;
float lbfgsepsx=0.001;
float lbfgsepsg=0.001;
int lbfgsmaxit=5;
int nterms=1;
float gain=0.1;
float threshold=0.0;
Expand All @@ -396,6 +486,9 @@ TEST(HummbeeTest, UIFactory) {
deconvolver,
scales,
largestscale, fusedthreshold,
waveletscales, waveletamps,
autothreshold, automaxiter, autogain, hogbomgain, autohogbom, autotrigger, autopower, autoxmask, autoymask,
lbfgsepsf, lbfgsepsx, lbfgsepsg, lbfgsmaxit,
nterms,
gain, threshold,
nsigma,
Expand Down
Loading