Ejemplo n.º 1
0
 def test_date_validation_fail(self):
     temp_file = NamedTemporaryFile()
     with pytest.raises(ValueError):
         disdrometer.disdrometer2nc(self.filename,
                                    temp_file.name,
                                    self.site_meta,
                                    date="2022-04-05")
Ejemplo n.º 2
0
class TestParsivel3(Check):
    date = "2021-04-16"
    temp_file = NamedTemporaryFile()
    filename = f"{SCRIPT_PATH}/data/parsivel/ny-alesund.log"
    site_meta = SITE_META
    uuid = disdrometer.disdrometer2nc(filename,
                                      temp_file.name,
                                      site_meta,
                                      date=date)
Ejemplo n.º 3
0
class TestThies(Check):
    date = "2021-09-15"
    temp_file = NamedTemporaryFile()
    filename = f"{SCRIPT_PATH}/data/thies-lnm/2021091507.txt"
    site_meta = SITE_META
    uuid = disdrometer.disdrometer2nc(filename,
                                      temp_file.name,
                                      site_meta,
                                      date=date)

    def test_processing(self):
        assert self.nc.title == "Disdrometer file from Kumpula"
        assert self.nc.year == "2021"
        assert self.nc.month == "09"
        assert self.nc.day == "15"
        assert self.nc.location == "Kumpula"
        assert self.nc.cloudnet_file_type == "disdrometer"
Ejemplo n.º 4
0
class TestParsivel2(Check):
    date = "2019-11-09"
    temp_file = NamedTemporaryFile()
    filename = f"{SCRIPT_PATH}/data/parsivel/norunda.log"
    site_meta = SITE_META
    uuid = disdrometer.disdrometer2nc(filename,
                                      temp_file.name,
                                      site_meta,
                                      date=date)

    def test_date_validation_fail(self):
        temp_file = NamedTemporaryFile()
        with pytest.raises(ValueError):
            disdrometer.disdrometer2nc(self.filename,
                                       temp_file.name,
                                       self.site_meta,
                                       date="2022-04-05")
Ejemplo n.º 5
0
class TestParsivel(Check):
    date = "2021-03-18"
    temp_file = NamedTemporaryFile()
    site_meta = SITE_META
    filename = f"{SCRIPT_PATH}/data/parsivel/juelich.log"
    uuid = disdrometer.disdrometer2nc(filename, temp_file.name, site_meta)

    def test_global_attributes(self):
        assert "Parsivel" in self.nc.source
        assert self.nc.cloudnet_file_type == "disdrometer"
        assert self.nc.title == "Disdrometer file from Kumpula"
        assert self.nc.year == "2021"
        assert self.nc.month == "03"
        assert self.nc.day == "18"
        assert self.nc.location == "Kumpula"

    def test_dimensions(self):
        assert self.nc.dimensions["time"].size > 1000
        assert self.nc.dimensions["velocity"].size == 32
        assert self.nc.dimensions["diameter"].size == 32