Changeset 19426 for trunk/FACT++/src


Ignore:
Timestamp:
01/16/19 18:26:10 (6 years ago)
Author:
tbretz
Message:
Some more flexibility in source selection:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/makeplots.cc

    r19234 r19426  
    5353        ("no-limits", po_switch(), "Switch off limits in plots")
    5454        ("no-ToO", po_switch(), "Skip all sources marked as target-of-opportunity (ToO)")
     55        ("where", var<string>(), "Define a where clause (it will be concatenate to the xisting ones with AND for source selection)")
     56        ("print-query", po_switch(), "Print query for source selection")
    5557        ;
    5658
     
    129131
    130132    const string isToO = conf.Has("no-ToO") && conf.Get<bool>("no-ToO") ? " AND fIsToO=0" : "";
     133    const string where = conf.Has("where") ? " AND ("+conf.Get<string>("where")+")" : "";
     134
     135    const string query = "SELECT fSourceName, fRightAscension, fDeclination FROM Source WHERE fSourceTypeKEY=1"+isToO+where;
     136
     137    if (conf.Get<bool>("print-query"))
     138        cout << "\nQuery:\n" << query << "\n" << endl;
    131139
    132140    const mysqlpp::StoreQueryResult res =
    133         Database(fDatabase).query("SELECT fSourceName, fRightAscension, fDeclination FROM Source WHERE fSourceTypeKEY=1"+isToO).store();
     141        Database(fDatabase).query(query).store();
    134142
    135143    // ------------- Create canvases and frames ---------------------
Note: See TracChangeset for help on using the changeset viewer.