ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
121 stars 77 forks source link

Change Contents so that "genthumb" setting of channel applies #971

Closed ejeschke closed 2 years ago

ejeschke commented 2 years ago

This makes the Contents plugin in the reference viewer behave so that if the genthumb setting in the channel is set to False that no entry is made in Contents. Additionally, if an individual image has nothumb == True then no entry is added.

This makes Contents behave similarly to Thumbs for channel and image settings.

pllim commented 2 years ago

I can see why someone might not want thumbnails, but I don't see why Contents also needs to hide them. How does one remove data from channel or move it to another channel if it is not visible in Contents? Can you please clarify? Thanks!

ejeschke commented 2 years ago

@pllim, I agree for typical use. However, there are cases where you don't want Contents to be cluttered up with hundreds of entries for particular channels. A good example is receiving guider images every few seconds throughout a night. It just doesn't make sense to add a Contents entry for every one of these. In our case we don't even save most of these guider images on disk and they just disappear after exiting the channel buffer.

It was for this purpose that the "nothumb" flag in images and the "genthumb" setting in a channel were implemented. At the time, the Contents plugin did not exist (thus the naming scheme for these flags). But currently the rationale for using these in the case of the example above is the same for Contents as it is for Thumbs.

In any case, the default is always to create Thumbs and Contents entries. It would be worth thinking about a future PR in which there could be a separate setting for whether Contents entries are created.

pllim commented 2 years ago

Thanks for the explanation! In that case, perhaps the docstring of Contents.py needs to be updated to explain the usage of this option.

ejeschke commented 2 years ago

@pllim, good suggestion. I added some info to the docstrings of both Contents and Thumbs.

ejeschke commented 2 years ago

@pllim, OKTM?

pllim commented 2 years ago

FFTM 😸