pietern / goestools

Tools to work with signals and files from GOES satellites
https://pietern.github.io/goestools/
BSD 2-Clause "Simplified" License
374 stars 83 forks source link

Expose M1 location info #28

Closed eminence closed 5 years ago

eminence commented 6 years ago

As I understand it, the M1 payloads contain info about the area that GOES-16 is looking at. This info is how goesproc is able to correctly project the map overlay. Can this data be exposed to the user somehow? (Perhaps via exif info in the images or something). This would be useful for an end-user who wants to scan a bunch of images and find ones that are looking at particular areas of the globe.

pietern commented 6 years ago

Great point. The first thing that comes to mind is optionally writing a separate JSON file for every image file that contains all the LRIT headers verbatim. EXIF is not an option because OpenCV doesn't support it. Also EXIF would only apply to JPEG files and not PNGs, PGMs, etc.

eminence commented 6 years ago

a JSON file per image sounds perfect, too!

pietern commented 5 years ago

@eminence Check out the linked commit. Make sure to set json = true for every handler where you want a header written as JSON file. This is still a bit clunky in my opinion, but it does the job, and done is better than perfect. Let me know what you think. And if we come up with a better solution we can always change of course.

pietern commented 5 years ago

Example JSON: https://gist.github.com/pietern/842202a5464cb4523e94b253dfa0415f

eminence commented 5 years ago

Following up on this after a long winter hiatus. This new feature is working great, thank you! Using the ImageNavagation header I can run my own projections to figure out what cities and states are included in an image (and thank you for the well-written comment about the projection in map_drawer.cc).

I'm curious about the Table structure. Can you point me in the direction of some documentation that might describe what this table is used for?

pietern commented 5 years ago

Thanks for the feedback. Glad to hear it's working for you.

Can you share a demo of where/how you're using it?

The Table in the ImageDataFunction is a mapping of the 8 bit integer pixel values to the values in the underlying measurement system. It depends on the channel what you're looking at. These values are what's used for the gradient mapping, so you can express the colors gradient in Kelvin, and not worry how they are mapped to the pixel values.

pietern commented 5 years ago

You can search for "image data function" in the LRIT specs (for example here) for more info.

eminence commented 5 years ago

Thanks for the tips about the image data function info, I'll take a look

Can you share a demo of where/how you're using it?

Sure! It's being used for a personal dashboard I wrote to give me a quick interface to the images produced by goesproc. https://goes.em32.net/ In the "Latest GOES-16 section" you can see that some images are labeled with some of the cites in view, and this was calculated using the ImageNavigation data from the json files