def test_rename_noobject(): header = { "FILTER1": "ip", "FILTER2": "air", "FILTER3": "air", 'EXPTIME': 20.0, 'DATE-OBS': "2019-01-25T15:54:10.861857", 'AIRMASS': 1.6, 'INSTRUME': 'kb92', 'MJD-OBS': 58508.3265502, } name = rename_data_file(header) exp_name = "UNKNOWN_ip_58508d3265502000_2019d01d25T15d54d10d861857_1a6_20d0_kb92.npy" assert name == exp_name
def test_rename_nomjd(): header = { "OBJECT" : "M1", "FILTER1" : "ip", "FILTER2" : "air", "FILTER3" : "air", 'EXPTIME' : 20.0, 'DATE-OBS' : "2019-01-25T15:54:10.861857", 'AIRMASS' : 1.6, 'INSTRUME' : 'kb92', 'MJD-OBS' :'UNKNOWN', } name = rename_data_file(header) exp_name = "M1_ip_UNKNOWN_2019d01d25T15d54d10d861857_1a6_20d0_kb92.npy" assert name == exp_name