Skip to content

Issues and suggested enhancements for MRMS Dataset #354

Description

@kevinyang-cky

Issue

The Dataset won't return the target/label when the data loading mode is set to "remote."

__getitem__ won't return target/label when self.file_dict.get(field_type) returns None:

if self.file_dict.get(field_type) and field_type in self.var_dict:
self._extract_field(field_type, t_target, target_data)

which is always the case (see _register_field()):

else:
# Remote mode: S3 path is constructed at runtime from the timestamp
self.file_dict[field_type] = None

One can remove the safeguard if self.file_dict.get(field_type) to temporarily bypass the issue, but the question remains: where is the appropriate place for the safeguard.

Enhancement

  1. Local files may be stored in subdirectories:

Current code assumes all files are stored in the same directory (see _register_field()):

if self.mode == "local":
files = sorted(glob(d.get("path", "")))

It would be nice to support a recursive search through all subdirectories.

  1. Handle irregular timestamps in files:

The current code can only retrieve data for the exact requested timestamp, but since some MRMS products have filenames like MRMS_MergedReflectivityQC_00.50_20201014-000227.grib2.gz, a scheme to search for the nearest timestamp is needed. The current GOES Dataset can handle this and should be straightforward to implement here.

  1. Initialize the s3fs on the first call to __getitem__

Next steps

Would like to hear feedback from @charlie-becker and decide how to move forward. Happy to take the lead on the modification as well.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions