desihub / timedomain

Time-domain code.
MIT License
3 stars 14 forks source link

Modification of PGManager.py #62

Closed rknop closed 3 years ago

rknop commented 3 years ago

(1) Added some command-line parsing to do different things from the command line. For it to do what it used to do when you just ran the script, run "PGManager.py -a daily-fill". (I could make that the default, but was nervous about having it do things if I accidentally just ran it without any arguments.) Among other things, this lets you specify where the "secrets" file is; it defaults to what Alex had hardcoded in before. (2) Made a base class for most of the tables that has a create_table() method in it, and removed the individual create_table functions. Most of them were doing the same thing. Added a tablename and createstatements variable to every class. The second one is an array, so that multiple statements can be run (i.e. with indexes in addition to the creation of the table). (3) Made two classes for everest creation, rather than one class that created two tables from the two HDUs. This fit with the way I was doing superclasses, so that I could just have the one create statement. Because most of the code was common between the two (as it used to just be one class with an if statement partway through), I made them subclasses of a class "zpix_everest" that had that common code. (4) Added the mosthosts table (which was the original motivation for starting all of this anyway).