Commit 5f0c3dfa authored by Carl Schaffer's avatar Carl Schaffer
Browse files

removing sort_file capabilities

parent 7e1e7139
from sda_kharon.file_sorter import sort_file
from .SDCMongoClient import SDCMongoClient from .SDCMongoClient import SDCMongoClient
from .field_list import chrotel_fields from .field_list import chrotel_fields
...@@ -24,7 +24,7 @@ def cleaner(instrument): ...@@ -24,7 +24,7 @@ def cleaner(instrument):
db[c].drop() db[c].drop()
def get_file_wrapper(filename, instrument=None): def get_file_wrapper(filename,instrument):
""" """
Get file wrapper (FitsFile or child class) for a fits file Get file wrapper (FitsFile or child class) for a fits file
Args: Args:
...@@ -41,8 +41,5 @@ def get_file_wrapper(filename, instrument=None): ...@@ -41,8 +41,5 @@ def get_file_wrapper(filename, instrument=None):
bbi=FitsFile, bbi=FitsFile,
lars=FitsFile lars=FitsFile
) )
if instrument is None:
res = sort_file(filename)
instrument = res.instrument
wrapper = wrappers[instrument] wrapper = wrappers[instrument]
return wrapper(filename) return wrapper(filename)
...@@ -220,10 +220,6 @@ class TestGeneric(unittest.TestCase): ...@@ -220,10 +220,6 @@ class TestGeneric(unittest.TestCase):
instance = get_file_wrapper(test_file, inst) instance = get_file_wrapper(test_file, inst)
self.assertTrue(hasattr(instance,"get_cleaned_header")) self.assertTrue(hasattr(instance,"get_cleaned_header"))
# Try with a file without specifying the instrument
instance = get_file_wrapper(test_file)
self.assertTrue(hasattr(instance, "get_cleaned_header"))
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment