pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.06k stars 292 forks source link

Cannot read AVHRR in HRPT format (geoloc dtype error) #175

Closed howff closed 3 years ago

howff commented 6 years ago

satpy 0.8.1 pyorbital 1.1.1

Trying to load AVHRR in HRPT format


satpy/readers/hrpt.py calls
        s_times = sgeom.times(
            self.times[:, np.newaxis]).ravel()
pyorbital/geoloc.py calls
        tds = [timedelta(seconds=i) for i in self._times]
        return np.array(tds) + start_of_scan

The last line gives the error:
TypeError: ufunc add cannot use operands with types dtype('O') and dtype('<M8[ms]')

  File "/packages/pytroll/bin/satpy_to_png.py", line 229, in process_list_of_filenames
    global_scene.load([band_name])
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/scene.py", line 564, in load
    self.read(**kwargs)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/scene.py", line 505, in read
    return self.read_datasets(nodes, **kwargs)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/scene.py", line 378, in read_datasets
    new_datasets = reader_instance.load(ds_ids, **kwargs)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/yaml_reader.py", line 875, in load
    ds = self._load_dataset_with_area(dsid, coords)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/yaml_reader.py", line 853, in _load_dataset_with_area
    ds = self._load_dataset_data(file_handlers, dsid, **slice_kwargs)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/yaml_reader.py", line 713, in _load_dataset_data
    proj = self._load_entire_dataset(dsid, ds_info, file_handlers)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/yaml_reader.py", line 631, in _load_entire_dataset
    projectable = fh.get_dataset(dsid, ds_info)
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/hrpt.py", line 149, in get_dataset
    lons, lats = self.get_lonlats()
  File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/hrpt.py", line 236, in get_lonlats
    self.times[:, np.newaxis]).ravel()
  File "/packages/pytroll/local/lib/python2.7/site-packages/pyorbital/geoloc.py", line 128, in times
    return np.array(tds) + start_of_scan
TypeError: ufunc add cannot use operands with types dtype('O') and dtype('<M8[ms]')
howff commented 3 years ago

Trying satpy==0.23

error: cannot import name 'Dataset'

Trying satpy==0.22

error: operands could not be broadcast together with shapes and 'str' object has no attribute 'date_of_launch'

djhoese commented 3 years ago

It seems this isn't the highest priority for the original developers. I'll let them comment if there has been any progress, but otherwise (since we are doing this when we have free time) I'm not sure when it will get worked on.

gerritholl commented 3 years ago

@howff I think most users preprocess HRPT data with AAPP, then use the avhrr_l1b_aapp reader to read the AAPP output. I didn't even know Satpy had a reader for reading HRPT data directly.

mraspaud commented 3 years ago

@howff I just pushed PR #1531, could you check if it fixes the problem for you?