Exemplo n.º 1
0
 def test_merge_datasets_by_proximity(self):
     df_weather = pd.DataFrame(
         np.array(
             [
                 [5.876, 23.875, "2019-06-24"],
                 [3.286, 12.978, "2019-10-02"],
                 [8.564, 10.764, "2019-03-12"],
             ]
         ),
         columns=["latitude", "longitude", "time"],
     )
     df_weather["latitude"] = df_weather["latitude"].astype(float)
     df_weather["longitude"] = df_weather["longitude"].astype(float)
     df_weather["time"] = pd.to_datetime(
         df_weather["time"], format="%Y-%m-%d", errors="coerce"
     )
     nasa_firms = nasa_wildfires.NASAFIRMS_VIIRS()
     df = merge_by_proximity(nasa_firms, "acq_date", df_weather, "time", "right")
     self.assertIsInstance(df, pd.DataFrame)
Exemplo n.º 2
0
 def test_nasaviirs_json(self):
     ds = nasa_wildfires.NASAFIRMS_VIIRS(
         source_path=cfg.TEST_FR_VIIRS_JSON_FALLBACK, fmt="json"
     )
     self.assertIsInstance(ds, pd.DataFrame)
Exemplo n.º 3
0
 def test_nasaviirs_csv(self):
     ds = nasa_wildfires.NASAFIRMS_VIIRS()
     self.assertIsInstance(ds, pd.DataFrame)