ssec / polar2grid

Tools for reading, remapping, and writing satellite instrument data.
http://www.ssec.wisc.edu/software/polar2grid/
GNU General Public License v3.0
71 stars 33 forks source link

Failed conversion from NPP and JP1 #625

Closed islomjn closed 11 months ago

islomjn commented 11 months ago

Hello,

As far as I understood correctly, polar2grid takes h5 files to convert to geotiff files. I had some raw files from NPP and JP1 sensors, I converted them to h5 files with RT-STPS software with respective default sensors configurations. However, when I try to convert output files with polar2grid it shows the following error:

$POLAR2GRID_HOME/bin/polar2grid.sh -r viirs_sdr -w geotiff -f NPP_59360_230412080255_7812R/ -vvv

DEBUG    : Starting script with arguments: -r viirs_sdr -w geotiff -f NPP_59360_230412080255_7812R/ -vvv -vv
INFO     : Sorting and reading input files...
DEBUG    : Setting preferred chunk size to 6400 pixels or 312MiB
DEBUG    : Reading ('/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/etc/readers/viirs_sdr.yaml',)
DEBUG    : Creating converter from 7 to 5
DEBUG    : Creating converter from 5 to 7
DEBUG    : Creating converter from 7 to 5
DEBUG    : Creating converter from 5 to 7
DEBUG    : Assigning to viirs_sdr: ['NPP_59360_230412080255_7812R/RNSCA-ROTCS_npp_d20230412_t0805559_e0813248_b00001_c20230627115950527000_drlu_ops.h5', 'NPP_59360_230412080255_7812R/RCRIS-RNSCA_npp_d20230412_t0805321_e0813321_b00001_c20230627115950531000_drlu_ops.h5', 'NPP_59360_230412080255_7812R/RNSCA-RVIRS_npp_d20230412_t0804382_e0813103_b00001_c20230627115949751000_drlu_ops.h5', 'NPP_59360_230412080255_7812R/RNSCA-RONPS_npp_d20230412_t0805185_e0812473_b00001_c20230627115950523000_drlu_ops.h5', 'NPP_59360_230412080255_7812R/RATMS-RNSCA_npp_d20230412_t0805321_e0813001_b00001_c20230627115950125000_drlu_ops.h5']
ERROR    : Unexpected error. Enable debug messages (-vvv) or see log file for details.
DEBUG    : Unexpected error exception: 
Traceback (most recent call last):
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/polar2grid/glue.py", line 494, in <module>
    sys.exit(main())
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/polar2grid/glue.py", line 277, in main
    ret = processor()
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/polar2grid/glue.py", line 331, in __call__
    return self._run_processing()
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/polar2grid/glue.py", line 338, in _run_processing
    scn = _create_scene(arg_parser._scene_creation)
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/polar2grid/glue.py", line 171, in _create_scene
    scn = Scene(**scene_creation)
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/scene.py", line 133, in __init__
    self._readers = self._create_reader_instances(filenames=filenames,
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/scene.py", line 154, in _create_reader_instances
    return load_readers(filenames=filenames,
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/readers/__init__.py", line 570, in load_readers
    reader_instance.create_filehandlers(
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/readers/yaml_reader.py", line 616, in create_filehandlers
    filehandlers = self._new_filehandlers_for_filetype(filetype_info,
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/readers/yaml_reader.py", line 604, in _new_filehandlers_for_filetype
    return list(filtered_iter)
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/readers/yaml_reader.py", line 573, in filter_fh_by_metadata
    filehandler.metadata['start_time'] = filehandler.start_time
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/readers/viirs_atms_sdr_base.py", line 118, in start_time
    date_var_path = self._get_aggr_path("start_date", "AggregateBeginningDate")
  File "/home/usman/Downloads/polar2grid_v_3_0/libexec/python_runtime/lib/python3.10/site-packages/satpy/readers/viirs_atms_sdr_base.py", line 142, in _get_aggr_path
    dataset_group = DATASET_KEYS[self.datasets[0]]
KeyError: 'RNSCA'

What can be the reason for this? Should this be due to initial conversion of raw files with RT-STPS?

Thank you for your assitance.

djhoese commented 11 months ago

Polar2Grid requires files to have a certain filename. For VIIRS SDR files, they usually start with GITCO, GMTCO, SVI01, SVM01, SVDNB, or something similar. It seems like the files you're providing are not normal SDR files. I'm not very familiar with VIIRS raw files either so I may be missing something about the files you are providing.

islomjn commented 11 months ago

I solved the issue. It turns out there is an intermediate software used to convert from RDR to SDR, and then Polar2Grid successfully converted this files to GeoTiff.