Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bail out on missing "no image" tiles #99

Merged
merged 1 commit into from
Apr 10, 2018
Merged

bail out on missing "no image" tiles #99

merged 1 commit into from
Apr 10, 2018

Conversation

pigmonkey
Copy link
Contributor

Using the UTC offset feature can result in "No Image" tiles. himawaripy
will get the timestamp of the latest sattelite image, subtract or add
the offset, and assume an image exists for the newly calculated time.
This is correct most of the time, but occasionally results in a
timestamp for which there is no satellite image. In this case, the
service returns black tiles with the text "No Image".

These blank "No Image" tiles are always 2867 bytes (regardless of the
quality level). Legitimate tiles are always a different size (smaller if
they are the solid black surrounding Earth, larger if they are part of
Earth). By checking the size of each tile immediately after download and
bailing out if the tile is 2867 bytes, we can avoid downloading the
remaining tiles and stitching them together into a large series of "No
Image".

Exiting the program here must be done with os._exit() because this
part is multi-threaded. I'm using exit code 3 just so to have a unique
reason so that other programs can understand why himawaripy exited at
this point.

I've been using this for about a week now and it works great. It is
refreshing to constantly have satellite photos and not see the
occasional "No Image" interruption.

The "No Image" issue was previously discussed in #82 and #68.

Using the UTC offset feature can result in "No Image" tiles. himawaripy
will get the timestamp of the latest sattelite image, subtract or add
the offset, and assume an image exists for the newly calculated time.
This is correct most of the time, but occasionally results in a
timestamp for which there is no satellite image. In this case, the
service returns black tiles with the text "No Image".

These blank "No Image" tiles are always 2867 bytes (regardless of the
quality level). Legitimate tiles are always a different size (smaller if
they are the solid black surrounding Earth, larger if they are part of
Earth). By checking the size of each tile immediately after download and
bailing out if the tile is 2867 bytes, we can avoid downloading the
remaining tiles and stitching them together into a large series of "No
Image".

Exiting the program here must be done with `os._exit()` because this
part is multi-threaded. I'm using exit code 3 just so to have a unique
reason so that other programs can understand why himawaripy exited at
this point.

I've been using this for about a week now and it works great. It is
refreshing to constantly have satellite photos and not see the
occasional "No Image" interruption.

The "No Image" issue was previously discussed in #82 and #68.
@boramalper boramalper merged commit ee237b4 into boramalper:master Apr 10, 2018
@boramalper
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants