Commits

Darrell Schiebel authored 718cc8dab56
setup measures data + resolve numeric problems

src/guitools/apps/casafeather/casafeather.cc

Modified
28 28 #include <iostream>
29 29 #include <casa/aips.h>
30 30 #include <casa/Inputs/Input.h>
31 31 #include <casa/BasicSL/String.h>
32 32 #include <casa/Exceptions/Error.h>
33 33 #include <signal.h>
34 34 #include <sys/types.h>
35 35 #include <sys/wait.h>
36 36
37 37 #include <unistd.h>
38 +#include <stdlib.h>
38 39 #include <sys/stat.h>
40 +#include <sys/types.h>
41 +#include <pwd.h>
39 42
43 +#include <casatools/Config/State.h>
40 44 #include <guitools/Feather/FeatherMain.qo.h>
41 45 #include <QApplication>
42 46 #include <QDebug>
43 47 #include <casa/namespace.h>
48 +#include <casacore/scimath/Mathematics/FFTW.h>
49 +
44 50
45 51 using namespace casa;
46 52
47 53 int main( int argc, char *argv[] ) {
54 +
55 + casacore::FFTW init_casacore_fftw;
56 + std::string casadata;
57 +
58 + char *ctmp;
59 + std::string tmp;
60 + struct stat statbuf;
61 + if ( (ctmp=getenv("CASADATA")) && stat(ctmp,&statbuf) == 0 && S_ISDIR(statbuf.st_mode) ) {
62 + casadata = ctmp;
63 + } else if ( (ctmp=getenv("CASAPATH")) && stat((tmp=std::string(ctmp)+"/data").c_str( ),&statbuf) && S_ISDIR(statbuf.st_mode) ) {
64 + casadata = tmp;
65 + } else {
66 + struct passwd *pw = getpwuid(getuid());
67 + casadata = std::string(pw->pw_dir) + "/.casa/data";
68 + }
69 + //fprintf(stderr, "measures data: %s\n", casadata.c_str( ));
70 + //fflush(stderr);
71 + casatools::get_state( ).setDistroDataPath(casadata);
72 +
48 73 int stat = 0;
49 74 QApplication app(argc, argv );
50 75 app.setOrganizationName( "CASA");
51 76 app.setApplicationName( "Feather");
52 77 try {
53 78 FeatherMain featherApplication;
54 79 featherApplication.show();
55 80 /*featherApplication.ensurePolished();
56 81 QSize rect = featherApplication.size();
57 82 qDebug() << "Size of rectangle is "<<rect.width()<<" height="<<rect.height();
62 87 return stat;
63 88 }
64 89 catch (const casacore::AipsError& err) {
65 90 cerr<<"**"<<err.getMesg()<<endl;
66 91 }
67 92 catch (...) {
68 93 cerr<<"**non-AipsError exception**"<<endl;
69 94 }
70 95 return stat;
71 96 }
72 -
73 -
74 -
75 -
76 -
77 -
78 -

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut