def test_making_SJIMap(sji_file): sji_cube = SJICube(sji_file) header = sji_cube.meta(0) data = sji_cube.data[0, :, :] assert isinstance(SJIMap(header, data), SJICube) #def singlefile(): # mc=sji.SJI_fits_to_cube(fname[0],0,10) # mc_db = sji.dustbuster(mc) # print('Single file input Passed') #def listfits(): # mc=sji.SJI_fits_to_cube(fname) # print('Multiple file input Passed') # Bad Pixel Map (BPM) before dustbuster # m1 = ma.masked_inside(mc[0].data, -199, .1) # mc_db=sji.dustbuster(mc) # Fail condition: If mask finds unchanged values in BPM will return 'numpy.array' # Pass condition: If mask finds no unchanged values in BPM will return 'numpy.bool' # fail_count=0 # for i, map in enumerate(mc_db): # m = ma.masked_inside(map.data, -199, .1) # if type(m.mask)==type(m1.mask): # print('DUSTBUSTER Failed: ' +str(i)) # fail_count+=1 # if fail_count==0: # print('DUSTBUSTER Passed') #test1=singlefile() #test2=listfits()
def test_making_SJIMap(sji_file): sji_cube = SJICube(sji_file) header = sji_cube.meta(0) data = sji_cube.data[0,:,:] assert isinstance(SJIMap(header, data), SJICube)
def test_cubes_indexing_to_SJICube(sji_file): assert isinstance(SJICube(sji_file)[0:4], SJICube)
def test_cubes_indexing_to_map(sji_file): assert isinstance(SJICube(sji_file)[0], SJIMap)
def test_cubes_length(sji_file): assert len(SJICube(sji_file)) == SJICube(sji_file).data.shape[0]
def test_cubes_measurement_value_is_correct(sji_file, measurement): assert SJICube(sji_file).measurement.value == measurement
def test_cubes_measurement_is_quantity(sji_file): assert isinstance(SJICube(sji_file).measurement, u.Quantity)
def test_cubes_detector_meta(sji_file): assert SJICube(sji_file).detector == 'SJI'
def test_cubes_observatory_meta(sji_file): assert SJICube(sji_file).observatory == 'IRIS'
def test_open_cubes(sji_file): """test that SJICube open lvl2 sji files""" assert isinstance(SJICube(sji_file), SJICube)