def test_plot_agulhas(self): ''' Tests the SARWind.plot method. Remember to update the file basic_agulhas_ref.png if plot method is changed. If adding more test plots, please make sure the indices are correct ''' if len(self.test_data.asar) == 0: raise IOError('No ASAR data - try adding some as ' \ 'described in templates/openwind_local_archive.py' ) w = SARWind(self.test_data.asar[0], wind_direction=self.test_data.ncep4asar[0]) w.plot(filename=os.path.join(dirname_test_plots, 'agulhas_test_plot.png'), show=False, landmask=False) if sys.version_info < (2, 7): self.assertTrue( filecmp.cmp( os.path.join(dirname_test_plots, 'agulhas_test_plot.png'), os.path.join(dirname_test_plots, 'agulhas_test_plot_ref.png')) in [True]) else: self.assertTrue( filecmp.cmp( os.path.join(dirname_test_plots, 'agulhas_test_plot.png'), os.path.join(dirname_test_plots, 'agulhas_test_plot_ref.png')))
def test_plot_barents(self): if len(self.test_data.radarsat2)==0: raise IOError('No Radarsat-2 data - try adding some as ' \ 'described in templates/openwind_local_archive.py' ) w = SARWind(self.test_data.radarsat2[0]) w.plot(filename=os.path.join(dirname_test_plots, 'rs2_barents_test_plot.png'), show=False, landmask=False) if sys.version_info < (2, 7): self.assertTrue(filecmp.cmp( os.path.join(dirname_test_plots, 'rs2_barents_test_plot.png'), os.path.join(dirname_test_plots, 'rs2_barents_test_plot_ref.png')) in [True]) else: self.assertTrue(filecmp.cmp( os.path.join(dirname_test_plots,'rs2_barents_test_plot.png'), os.path.join(dirname_test_plots,'rs2_barents_test_plot_ref.png')))
def test_plot_barents(self): if len(self.test_data.radarsat2) == 0: raise IOError('No Radarsat-2 data - try adding some as ' \ 'described in templates/openwind_local_archive.py' ) w = SARWind(self.test_data.radarsat2[0]) w.plot(filename=os.path.join(dirname_test_plots, 'rs2_barents_test_plot.png'), show=False, landmask=False) if sys.version_info < (2, 7): self.assertTrue( filecmp.cmp( os.path.join(dirname_test_plots, 'rs2_barents_test_plot.png'), os.path.join(dirname_test_plots, 'rs2_barents_test_plot_ref.png')) in [True]) else: self.assertTrue( filecmp.cmp( os.path.join(dirname_test_plots, 'rs2_barents_test_plot.png'), os.path.join(dirname_test_plots, 'rs2_barents_test_plot_ref.png')))
def test_plot_agulhas(self): ''' Tests the SARWind.plot method. Remember to update the file basic_agulhas_ref.png if plot method is changed. If adding more test plots, please make sure the indices are correct ''' if len(self.test_data.asar)==0: raise IOError('No ASAR data - try adding some as ' \ 'described in templates/openwind_local_archive.py' ) w = SARWind(self.test_data.asar[0], wind_direction=self.test_data.ncep4asar[0]) w.plot(filename=os.path.join(dirname_test_plots, 'agulhas_test_plot.png'), show=False, landmask=False) if sys.version_info < (2, 7): self.assertTrue(filecmp.cmp( os.path.join(dirname_test_plots,'agulhas_test_plot.png'), os.path.join(dirname_test_plots,'agulhas_test_plot_ref.png')) in [True]) else: self.assertTrue(filecmp.cmp( os.path.join(dirname_test_plots,'agulhas_test_plot.png'), os.path.join(dirname_test_plots,'agulhas_test_plot_ref.png')))