goestools: assertion failure: Expected to extract mode and channel from file name

I’ll try to poke at this later, but just making a record of this here for now

terminate called after throwing an instance of 'std::runtime_error'
  what():  Assertion `rv == 2` failed at /nas/achin/devel/goestools/src/goesproc/handler_goesr.cc:29, Expected to extract mode and channel from file name (OR_ABI-L2-RRQPEF-M6_G16_s20191981650398_e20191981700106_c20191981700191.lrit)
Aborted

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 27 (13 by maintainers)

Commits related to this issue

Most upvoted comments

This is awesome guys!

I took the fix and threw a bunch of refactoring on top to hopefully arrive at the same functionality you’re getting now, but with the addition of a products configurable in the configuration.

Some relevant commits:

  • 878326a2f7bbc19d36c84f0d5f08890e22558fd2 renames product to origin to make room for a new products configurable that’s used for the actual L2 product names.
  • 980d169dc46a6b4e63614d8fcdba023a769d794d adds the products field and indeed extracts the product name from the filename as @eminence suggested earlier in this thread. I didn’t find any other place where it is encoded. I would have expected it to sit in the ancillary text header tbqh.
  • 647f8acb20974c70d52408324a613f800969399c adds support for negative matching. This means we don’t have to list all L2 products in a products field for the handler to pick it up (and to differentiate between CMIP and non-CMIP handlers), but instead can have one with products = [ "cmip" ] and another with products = [ "^cmip" ]. Of course you can still list them out if you want to use different directories, filenames, etc.
  • 24c7fcb26dbf90257c7428f29dd28378dcc6bca0 uses the product name as lookup key in the gradient map, so that all these awesome gradient maps work out of the box.

I ran the following configuration against a few sample L2 LRITs and it looks like it works:

[[handler]]
type = "image"
origin = "goes16"
products = [ "^cmip" ]
directory = "./goes16/non-cmip/{product:short|lower}/{time:%Y-%m-%d}"
filename = "GOES16_{product:short}_{region:short}_{time:%Y%m%dT%H%M%SZ}"
format = "jpg"

  [[handler.map]]
  path = "/usr/local/share/goestools/ne/ne_50m_admin_0_countries_lakes.json"
  color = "#FFFF00"

  [[handler.map]]
  path = "/usr/local/share/goestools/ne/ne_50m_admin_1_states_provinces_lakes.json"
  color = "#FFFF00"

I’m working on the lookups now, here’s a pair of examplers for RRQPEF and LSTF: https://imgur.com/a/peEYjTE