Commits
Takahiro Tsutsumi authored f37715e605f Merge
175 175 | vector<char> logIndent; |
176 176 | // #define LOGENTER(name) if (debug) {for_each(logIndent.begin(), logIndent.end(), cout << _1); logIndent.push_back('\t'); cout << #name ": entering" << endl;} |
177 177 | // #define LOGEXIT(name) if (debug) {logIndent.pop_back(); for_each(logIndent.begin(), logIndent.end(), cout << _1); cout << #name ": exiting" << endl;} |
178 178 | // #define LOG(msg) if (debug) {for_each(logIndent.begin(), logIndent.end(), cout << _1); cout << msg << endl;} |
179 179 | |
180 180 | |
181 181 | ostringstream errstream; |
182 182 | ostringstream infostream; |
183 183 | |
184 184 | template<typename T> string TO_STRING(const T &v) { |
185 - | const T shift = 100000000; |
186 - | const T rnd = .000000005; |
187 185 | char buffer[128]; |
188 - | int whole = int(v); |
189 - | int fraction = int((v-whole+rnd)*shift); |
190 - | sprintf(buffer,"%d.%08d",whole,fraction); |
186 + | sprintf(buffer,"%d",v); |
191 187 | return string(buffer); |
192 188 | } |
193 189 | |
194 - | string TO_STRING(const int &v) { |
190 + | string TO_STRING(const long unsigned int &v) { |
191 + | char buffer[128]; |
192 + | sprintf(buffer,"%ld", v); |
193 + | return string(buffer); |
194 + | } |
195 + | |
196 + | string TO_STRING(const long int &v) { |
197 + | char buffer[128]; |
198 + | sprintf(buffer,"%ld", v); |
199 + | return string(buffer); |
200 + | } |
201 + | |
202 + | string TO_STRING(const long long &v) { |
203 + | char buffer[128]; |
204 + | sprintf(buffer,"%lld", v); |
205 + | return string(buffer); |
206 + | } |
207 + | |
208 + | string TO_STRING(const float &v) { |
209 + | const float shift = 100000000; |
210 + | const float rnd = .000000005; |
195 211 | char buffer[128]; |
196 - | sprintf(buffer,"%d",v); |
212 + | int whole = int(v); |
213 + | int fraction = int((v-whole+rnd)*shift); |
214 + | sprintf(buffer,"%d.%08d",whole,fraction); |
197 215 | return string(buffer); |
198 216 | } |
199 217 | |
200 218 | string TO_STRING(const double &d) { |
201 219 | char buffer[128]; |
202 220 | sprintf(buffer,"%g",d); |
203 221 | return string(buffer); |
204 222 | } |
205 223 | |
206 224 | // A facility to get rid of blanks at start and end of a string. |
4924 4942 | errstream << e.getMessage(); |
4925 4943 | error(errstream.str()); |
4926 4944 | } |
4927 4945 | |
4928 4946 | // Create the measurement set(s). |
4929 4947 | if (!false) { |
4930 4948 | try { |
4931 4949 | if (lazy) casa::AsdmStMan::registerClass(); |
4932 4950 | for (map<AtmPhaseCorrectionMod::AtmPhaseCorrection, string>::iterator iter = msNames.begin(); iter != msNames.end(); ++iter) { |
4933 4951 | info("About to create a filler for the measurement set '" + msNames[iter->first] + "'"); |
4934 - | msFillers[iter->first] = new ASDM2MSFiller(msNames[iter->first], 0.0, false, complexData, |
4952 + | msFillers[iter->first] = new ASDM2MSFiller(msNames[iter->first], 0.0, complexData, |
4935 4953 | withCompression, telName, maxNumCorr, maxNumChan, |
4936 4954 | false, lazy); |
4937 4955 | } |
4938 4956 | } catch(AipsError & e) { |
4939 4957 | errstream.str(""); |
4940 4958 | errstream << e.getMesg(); |
4941 4959 | error(errstream.str()); |
4942 4960 | } catch (std::exception & e) { |
4943 4961 | errstream.str(""); |
4944 4962 | errstream << e.what(); |