spacetelescope / jwst_mast_query

Command line tool for querying MAST and downloading JWST data products
BSD 3-Clause "New" or "Revised" License
18 stars 11 forks source link

Sort the obs and product tables #46

Open bhilbert4 opened 1 year ago

bhilbert4 commented 1 year ago

Would be nice if the results shown in the productTable and obsTable were sorted by observation and productFilename. The results would be easier to examine.

It's just a little complicated because the way the code is at the moment, the unwanted rows are not filtered out from the tables until within the call to the write() function. Might be better to cut the tables down to the wanted rows earlier, and then do something like the lines below, and then write the tables to the screen/files.

    # Sort the productTable to make it easier to read
    if "obsnum" in self.productTable.t and "obs_id" in self.productTable.t:
        self.productTable.t.sort_values(by=["obsnum", "obs_id"], ascending=[True, True])