Changeset 1441 in Sophya for trunk/SophyaProg/PrgUtil
- Timestamp:
- Mar 14, 2001, 5:25:02 PM (25 years ago)
- Location:
- trunk/SophyaProg/PrgUtil
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaProg/PrgUtil/runcxx.cc
r1341 r1441 18 18 #include "pdlmgr.h" 19 19 #include "timing.h" 20 21 /*! 22 \ingroup PrgUtil 23 \file runcxx.cc 24 \brief \b runcxx: Compile and run simple C++ code using SOPHYA 25 26 \verbatim 27 csh> runcxx -h 28 SOPHYA Version 1.1 Revision 0 (V_Fev2001) -- Mar 9 2001 15:45:31 cxx 29 runcxx : compiling and running of a piece of C++ code 30 Usage: runcxx [-compopt CompileOptions] [-linkopt LinkOptions] 31 [-tmpdir TmpDirectory] [-f C++CodeFileName] 32 [-inc includefile] [-inc includefile ...] 33 [-import modulename] [-import modulename ...] 34 [-uarg UserArg1 UserArg2 ...] 35 if no file name is specified, read from standard input 36 modulenames: SkyMap, Samba, SkyT, FitsIOServer, LinAlg, IFFTW 37 \endverbatim 38 */ 20 39 21 40 typedef void (* DlFunctionOfVecStr) (vector<string> & args, int & rc); -
trunk/SophyaProg/PrgUtil/scanfits.cc
r1306 r1441 11 11 #include "fitsntuple.h" 12 12 13 /*! 14 \ingroup PrgUtil 15 \file scanfits.cc 16 \brief \b scanfits: Check and scan FITS files 17 18 Scan FITS files and prints information on each FITS bloc in file. 19 Uses the FitsIOServer module. 20 21 \verbatim 22 Usage: scanfits FITSFilename 23 \endverbatim 24 */ 25 26 string FITSExtType2String(FitsFile::FitsExtensionType exttype) 27 { 28 if (exttype == FitsFile::FitsExtensionType_IMAGE) return("IMAGE"); 29 else if (exttype == FitsFile::FitsExtensionType_ASCII_TBL) return("ASCII_TBL"); 30 else if (exttype == FitsFile::FitsExtensionType_BINARY_TBL) return("BINARY_TBL"); 31 else if (exttype == FitsFile::FitsExtensionType_EOF) return("EOF"); 32 else if (exttype == FitsFile::FitsExtensionType_ERROR) return("ERROR"); 33 else return("Unknown?"); 34 } 35 36 string FITSDataType2String(FitsFile::FitsDataType datatype) 37 { 38 if (datatype == FitsFile::FitsDataType_double) return("double"); 39 else if (datatype == FitsFile::FitsDataType_float) return("float"); 40 else if (datatype == FitsFile::FitsDataType_int) return("int"); 41 else if (datatype == FitsFile::FitsDataType_long) return("long"); 42 else if (datatype == FitsFile::FitsDataType_byte) return("byte"); 43 else if (datatype == FitsFile::FitsDataType_char) return("char"); 44 else if (datatype == FitsFile::FitsDataType_ASCII) return("ASCII"); 45 else if (datatype == FitsFile::FitsDataType_NULL) return("NULL"); 46 else return("Unknown?"); 47 } 48 13 49 int main(int narg, char *arg[]) 14 50 { … … 21 57 string flnm = arg[1]; 22 58 int nbblk = FitsInFile::NbBlocks(arg[1]); 23 cout << " :::: File " << flnm << " has " << nbblk << " blocks " << endl; 24 DVList header; 25 FitsFile::FitsExtensionType exttype; 26 FitsFile::FitsDataType datatype; 59 cout << " :::::::: File " << flnm << " has " << nbblk << " blocks " 60 << " :::::::: " << endl; 27 61 28 cout << " FitsFile::FitsExtensionType : FitsExtensionType_IMAGE= " <<29 (int)FitsFile::FitsExtensionType_IMAGE <<30 " FitsExtensionType_ASCII_TBL= " << (int)FitsFile::FitsExtensionType_ASCII_TBL <<31 " FitsExtensionType_BINARY_TBL= " << (int)FitsFile::FitsExtensionType_BINARY_TBL << endl;32 cout << " FitsFile::FitsDataType: FitsDataType_double= " <<33 (int)FitsFile::FitsDataType_double <<34 " FitsDataType_float= " << (int)FitsFile::FitsDataType_float <<35 " FitsDataType_int= " << (int)FitsFile::FitsDataType_int <<36 " FitsDataType_char= " << (int)FitsFile::FitsDataType_char <<37 " FitsDataType_ASCII= " << (int)FitsFile::FitsDataType_ASCII << endl << endl;62 // cout << " FitsFile::FitsExtensionType : FitsExtensionType_IMAGE= " << 63 // (int)FitsFile::FitsExtensionType_IMAGE << 64 // " FitsExtensionType_ASCII_TBL= " << (int)FitsFile::FitsExtensionType_ASCII_TBL << 65 // " FitsExtensionType_BINARY_TBL= " << (int)FitsFile::FitsExtensionType_BINARY_TBL << endl; 66 // cout << " FitsFile::FitsDataType: FitsDataType_double= " << 67 // (int)FitsFile::FitsDataType_double << 68 // " FitsDataType_float= " << (int)FitsFile::FitsDataType_float << 69 // " FitsDataType_int= " << (int)FitsFile::FitsDataType_int << 70 // " FitsDataType_char= " << (int)FitsFile::FitsDataType_char << 71 // " FitsDataType_ASCII= " << (int)FitsFile::FitsDataType_ASCII << endl << endl; 38 72 39 int naxis;40 vector<int> axis;41 73 for(int i=1; i<=nbblk; i++) { 74 int naxis; 75 vector<int> axis; 76 DVList header; 77 FitsFile::FitsExtensionType exttype; 78 FitsFile::FitsDataType datatype; 79 42 80 FitsInFile::GetBlockType(arg[1], i, exttype, naxis, axis, datatype, header); 43 cout << " --------- Header Num " << i << " Type " << (int)exttype 44 << " NAxis= " << naxis << " (" << axis.size() << " )" 45 << " DataType= " << (int)datatype << endl; 46 for(int j=0; j<axis.size(); j++) cout << axis[j] << " x " ; 47 cout << endl; 81 cout << "\n--------- Header Num " << i << " Type " << FITSExtType2String(exttype) 82 << " --- NAxis= " << naxis 83 << " DataType= " << FITSDataType2String(datatype) << endl; 84 if (axis.size() > 0) { 85 cout << " >> Axis Sizes: " ; 86 for(int j=0; j<axis.size(); j++) { 87 if (j > 0) cout << " x " ; 88 cout << axis[j] ; 89 } 90 cout << endl; 91 } 92 cout << " >>> Header info : " ; 48 93 cout << header << endl; 49 cout << "----------------------------------------------------" << endl; 94 cout << "----------------------------------------------------------------------" 95 << endl; 50 96 } 51 97 52 98 } 53 99 catch (PThrowable & exc) { 54 cerr << " Catched Exception " << (string)typeid(exc).name()55 << " -Msg= " << exc.Msg() << endl;100 cerr << "sanfits: Catched Exception " << (string)typeid(exc).name() 101 << "\n .... Msg= " << exc.Msg() << endl; 56 102 } 57 103 catch (...) { -
trunk/SophyaProg/PrgUtil/scanppf.cc
r1373 r1441 12 12 #include <console.h> 13 13 #endif 14 15 16 /*! 17 \defgroup PrgUtil PrgUtil module 18 This module contains simple programs to perform various utility tasks: 19 <UL> 20 <LI> scanppf : Check and scan PPF files (scanppf.cc) 21 <LI> scanfits : Check and scan FITS files (scanfits.cc) 22 <LI> runcxx : Compile and run simple C++ code using SOPHYA (runcxx.cc) 23 <LI> prjsmap : Molleweide and sinus projection of sky maps (prjsmap.cc) 24 <LI> map2cl : Computes power spectra (C(l)) on spherical maps (map2cl.cc) 25 <LI> cl2map : generates spherical maps from power spectra (C(l)) (cl2map.cc) 26 </UL> 27 */ 28 29 /*! 30 \ingroup PrgUtil 31 \file scanppf.cc 32 \brief \b scanppf: Check and scan PPF files 33 34 \verbatim 35 36 csh> scanppf -h 37 SOPHYA Version 1.1 Revision 0 (V_Fev2001) -- Mar 9 2001 15:45:31 cxx 38 Usage: scanppf filename [s/n/a0/a1/a2/a3] 39 s[=default} : Sequential reading of objects 40 n : Object reading at NameTags 41 a0...a3 : Tag List with PInPersist.AnalyseTags(0...3) 42 43 \endverbatim 44 */ 14 45 15 46 int main(int narg, char* arg[])
Note:
See TracChangeset
for help on using the changeset viewer.