diff --git a/data-access/engine/src/common/src/ast_frameset.cpp b/data-access/engine/src/common/src/ast_frameset.cpp index b540ea61cad28812f702998cbd99962742bd97c3..caffcc8c293b8c94877ea587b512b58398a66cd0 100644 --- a/data-access/engine/src/common/src/ast_frameset.cpp +++ b/data-access/engine/src/common/src/ast_frameset.cpp @@ -668,7 +668,7 @@ void ast::frameset::write2(std::string fits_pathname, int hdunum) while ( astFindFits( fchan, "%f", card, 1 ) ) { if(0 ==string(card).compare(0,7,"WCSAXES")) continue; // writes this key after other existing CRxxx keys, which is illegal - cout << string(card) << endl; + cerr << string(card) << endl; hdr.update(card); } } diff --git a/data-access/engine/src/vlkb/src/ast.cpp b/data-access/engine/src/vlkb/src/ast.cpp index 5cdeeeaef3151bc49c336d4bec4e9677e8a01ab5..60c05835e7f6730500b6d3a2b406afedab857c3a 100644 --- a/data-access/engine/src/vlkb/src/ast.cpp +++ b/data-access/engine/src/vlkb/src/ast.cpp @@ -114,7 +114,7 @@ int header_modif_coordsys(const string& skysys_str, const string& specsys_str, c for(unsigned int i=0; i<allHdus.size(); i++) { - cout << "HDU#" << i << endl; + cerr << "HDU#" << i << endl; fitsfiles::Hdu hd = allHdus.at(i); diff --git a/data-access/engine/src/vlkb/src/main.cpp b/data-access/engine/src/vlkb/src/main.cpp index 0fca1465f7595f4f09a31270de37826531d37635..741b14edd2c2c9797d8d0383658cd615bb828151 100644 --- a/data-access/engine/src/vlkb/src/main.cpp +++ b/data-access/engine/src/vlkb/src/main.cpp @@ -324,10 +324,10 @@ int cmd_header(int argc, char * argv[]) { int rc; - if (!((argc == 2) || (argc == 3) || (argc == 4))) + if (argc < 2) { std::cerr - << "Usage: header <filename.fits> <SkySystem> <SpecSystem>\n" + << "Usage: header --sky=<SkySystem> --spec=<SpecSystem> <filename.fits>... \n" << "\n" << "Modify header for new coord system.\n" << "Arguments:\n" @@ -337,24 +337,28 @@ int cmd_header(int argc, char * argv[]) } else { - string pathname(argv[1]); string skySystem; string specSystem; - if(argc >= 3) + for(int i=1; i<argc; i++) { - skySystem = argv[2]; - } - if(argc == 4) - { - specSystem = argv[3]; + if(0 == (string(argv[i]).substr(0,2+3+1)).compare("--sky=")) + { + skySystem = string(argv[i]).substr(2+3+1); + } + else if(0 == (string(argv[i]).substr(0,2+4+1)).compare("--spec=")) + { + specSystem = string(argv[i]).substr(2+4+1); + } + else + { + string pathname(argv[i]); + cout << to_string(i) << " : " << pathname << endl; + rc = header_modif_coordsys(skySystem, specSystem, pathname); + std::cout << "header_modif_coordsys rc: " << rc << std::endl; + } } - - cout << string{argv[0]} << ": " << pathname << " '" << skySystem << "' " << specSystem << endl; - - rc = header_modif_coordsys(skySystem, specSystem, pathname); - std::cout << "header_modif_coordsys rc: " << rc << std::endl; rc = EXIT_SUCCESS; } return rc;