{
  "id": 425821,
  "title": "Unable to understand the r, g, b value calculation",
  "url": "/competitions/google-research-identify-contrails-reduce-global-warming/discussion/425821",
  "author_name": "Shreya",
  "post_date": "2023-07-20T14:24:53.181000",
  "votes": 2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>This code has been shared by <a href=\"url\" target=\"_blank\">https://www.kaggle.com/code/inversion/visualizing-contrails/notebook</a> and has been utilized by many people in their notebooks.</p>\n<p>`_T11_BOUNDS = (243, 303)<br>\n_CLOUD_TOP_TDIFF_BOUNDS = (-4, 5)<br>\n_TDIFF_BOUNDS = (-4, 2)</p>\n<p>def normalize_range(data, bounds):<br>\n    \"\"\"Maps data to the range [0, 1].\"\"\"<br>\n    return (data - bounds[0]) / (bounds[1] - bounds[0])</p>\n<p>r = normalize_range(band15 - band14, _TDIFF_BOUNDS)<br>\ng = normalize_range(band14 - band11, _CLOUD_TOP_TDIFF_BOUNDS)<br>\nb = normalize_range(band14, _T11_BOUNDS)<br>\nfalse_color = np.clip(np.stack([r, g, b], axis=2), 0, 1)`</p>\n<p>Here I cannot understand how the origin of the first three variables and how the r, g, and b values have been calculated. I would really appreciate if if someone could help me understand this.</p>",
  "messages": [
    {
      "id": 2352052,
      "postDate": "2023-07-20T15:41:37.140Z",
      "content": "<p>The raw values in each band are <a href=\"https://en.wikipedia.org/wiki/Brightness_temperature\" target=\"_blank\">brightness_temperatures</a>, measured in degrees Kelvin. The _T11_BOUNDS are simply the range of degrees Kelvin that are useful for this visualization in band14 (which roughly 11 microns, hence the name). The other two are ranges of expected differences of the brightness temperatures between band14 and band11, and band15 and band14, respectively. While there is likely some physical explanation for the selected value ranges, I believe they were mostly tuned empirically. The notebook links to a paper that first introduced this visualization, if you'd like more details.</p>",
      "rawMarkdown": "The raw values in each band are [brightness_temperatures](https://en.wikipedia.org/wiki/Brightness_temperature), measured in degrees Kelvin. The _T11_BOUNDS are simply the range of degrees Kelvin that are useful for this visualization in band14 (which roughly 11 microns, hence the name). The other two are ranges of expected differences of the brightness temperatures between band14 and band11, and band15 and band14, respectively. While there is likely some physical explanation for the selected value ranges, I believe they were mostly tuned empirically. The notebook links to a paper that first introduced this visualization, if you'd like more details.",
      "votes": 1,
      "replies": [
        {
          "id": 2360305,
          "postDate": "2023-07-26T17:05:12.533Z",
          "content": "<p>2)</p>\n<p>also i saw the contents of <a href=\"https://arxiv.org/pdf/2304.02122.pdf\" target=\"_blank\">https://arxiv.org/pdf/2304.02122.pdf</a> :<br>\nWe want to detect contrails throughout both day and night,<br>\nso we show imagery to human labelers in an “ash” false color<br>\nscheme that combines three longwave GOES-16 brightness<br>\ntemperatures [27]. The red, blue and green channels are<br>\nrepresented by the 12μm, difference between 12μm and 11μm,<br>\nand difference between 11μm and 8μm respectively. This color<br>\nscheme is chosen to help identify contrails by highlighting ice-<br>\nclouds as darker colors.<br>\nwhy use 15,14 and 11 ?</p>",
          "rawMarkdown": "2)\n\nalso i saw the contents of https://arxiv.org/pdf/2304.02122.pdf :\nWe want to detect contrails throughout both day and night,\nso we show imagery to human labelers in an “ash” false color\nscheme that combines three longwave GOES-16 brightness\ntemperatures [27]. The red, blue and green channels are\nrepresented by the 12μm, difference between 12μm and 11μm,\nand difference between 11μm and 8μm respectively. This color\nscheme is chosen to help identify contrails by highlighting ice-\nclouds as darker colors.\nwhy use 15,14 and 11 ?",
          "votes": 1,
          "replies": [
            {
              "id": 2360829,
              "postDate": "2023-07-27T03:38:27.287Z",
              "content": "<p>The band name (index) and the wavelength in µm are different things. Check <a href=\"https://www.goes-r.gov/spacesegment/ABI-tech-summary.html\" target=\"_blank\">this table</a> to match them up.</p>",
              "rawMarkdown": "The band name (index) and the wavelength in µm are different things. Check [this table](https://www.goes-r.gov/spacesegment/ABI-tech-summary.html) to match them up.",
              "votes": 1
            },
            {
              "id": 2360907,
              "postDate": "2023-07-27T05:12:10.817Z",
              "content": "<p>got it . That was very helpful</p>",
              "rawMarkdown": "got it . That was very helpful"
            }
          ]
        }
      ]
    },
    {
      "id": 2351972,
      "postDate": "2023-07-20T14:24:53.183Z",
      "content": "<p>This code has been shared by <a href=\"url\" target=\"_blank\">https://www.kaggle.com/code/inversion/visualizing-contrails/notebook</a> and has been utilized by many people in their notebooks.</p>\n<p>`_T11_BOUNDS = (243, 303)<br>\n_CLOUD_TOP_TDIFF_BOUNDS = (-4, 5)<br>\n_TDIFF_BOUNDS = (-4, 2)</p>\n<p>def normalize_range(data, bounds):<br>\n    \"\"\"Maps data to the range [0, 1].\"\"\"<br>\n    return (data - bounds[0]) / (bounds[1] - bounds[0])</p>\n<p>r = normalize_range(band15 - band14, _TDIFF_BOUNDS)<br>\ng = normalize_range(band14 - band11, _CLOUD_TOP_TDIFF_BOUNDS)<br>\nb = normalize_range(band14, _T11_BOUNDS)<br>\nfalse_color = np.clip(np.stack([r, g, b], axis=2), 0, 1)`</p>\n<p>Here I cannot understand how the origin of the first three variables and how the r, g, and b values have been calculated. I would really appreciate if if someone could help me understand this.</p>",
      "rawMarkdown": "This code has been shared by [https://www.kaggle.com/code/inversion/visualizing-contrails/notebook](url) and has been utilized by many people in their notebooks.\n\n\n`_T11_BOUNDS = (243, 303)\n_CLOUD_TOP_TDIFF_BOUNDS = (-4, 5)\n_TDIFF_BOUNDS = (-4, 2)\n\ndef normalize_range(data, bounds):\n    \"\"\"Maps data to the range [0, 1].\"\"\"\n    return (data - bounds[0]) / (bounds[1] - bounds[0])\n\nr = normalize_range(band15 - band14, _TDIFF_BOUNDS)\ng = normalize_range(band14 - band11, _CLOUD_TOP_TDIFF_BOUNDS)\nb = normalize_range(band14, _T11_BOUNDS)\nfalse_color = np.clip(np.stack([r, g, b], axis=2), 0, 1)`\n\nHere I cannot understand how the origin of the first three variables and how the r, g, and b values have been calculated. I would really appreciate if if someone could help me understand this.",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 2352052,
      "author_name": "Aaron Sarna",
      "author_url": "",
      "post_date": "2023-07-20T15:41:37.140000",
      "content": "<p>The raw values in each band are <a href=\"https://en.wikipedia.org/wiki/Brightness_temperature\" target=\"_blank\">brightness_temperatures</a>, measured in degrees Kelvin. The _T11_BOUNDS are simply the range of degrees Kelvin that are useful for this visualization in band14 (which roughly 11 microns, hence the name). The other two are ranges of expected differences of the brightness temperatures between band14 and band11, and band15 and band14, respectively. While there is likely some physical explanation for the selected value ranges, I believe they were mostly tuned empirically. The notebook links to a paper that first introduced this visualization, if you'd like more details.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2360305,
          "author_name": "ADITHYA L BHAT",
          "author_url": "",
          "post_date": "2023-07-26T17:05:12.533000",
          "content": "<p>2)</p>\n<p>also i saw the contents of <a href=\"https://arxiv.org/pdf/2304.02122.pdf\" target=\"_blank\">https://arxiv.org/pdf/2304.02122.pdf</a> :<br>\nWe want to detect contrails throughout both day and night,<br>\nso we show imagery to human labelers in an “ash” false color<br>\nscheme that combines three longwave GOES-16 brightness<br>\ntemperatures [27]. The red, blue and green channels are<br>\nrepresented by the 12μm, difference between 12μm and 11μm,<br>\nand difference between 11μm and 8μm respectively. This color<br>\nscheme is chosen to help identify contrails by highlighting ice-<br>\nclouds as darker colors.<br>\nwhy use 15,14 and 11 ?</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2360829,
              "author_name": "zacstewart",
              "author_url": "",
              "post_date": "2023-07-27T03:38:27.287000",
              "content": "<p>The band name (index) and the wavelength in µm are different things. Check <a href=\"https://www.goes-r.gov/spacesegment/ABI-tech-summary.html\" target=\"_blank\">this table</a> to match them up.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2360907,
              "author_name": "ADITHYA L BHAT",
              "author_url": "",
              "post_date": "2023-07-27T05:12:10.817000",
              "content": "<p>got it . That was very helpful</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2352052": "The raw values in each band are [brightness_temperatures](https://en.wikipedia.org/wiki/Brightness_temperature), measured in degrees Kelvin. The _T11_BOUNDS are simply the range of degrees Kelvin that are useful for this visualization in band14 (which roughly 11 microns, hence the name). The other two are ranges of expected differences of the brightness temperatures between band14 and band11, and band15 and band14, respectively. While there is likely some physical explanation for the selected value ranges, I believe they were mostly tuned empirically. The notebook links to a paper that first introduced this visualization, if you'd like more details.",
    "2351972": "This code has been shared by [https://www.kaggle.com/code/inversion/visualizing-contrails/notebook](url) and has been utilized by many people in their notebooks.\n\n\n`_T11_BOUNDS = (243, 303)\n_CLOUD_TOP_TDIFF_BOUNDS = (-4, 5)\n_TDIFF_BOUNDS = (-4, 2)\n\ndef normalize_range(data, bounds):\n    \"\"\"Maps data to the range [0, 1].\"\"\"\n    return (data - bounds[0]) / (bounds[1] - bounds[0])\n\nr = normalize_range(band15 - band14, _TDIFF_BOUNDS)\ng = normalize_range(band14 - band11, _CLOUD_TOP_TDIFF_BOUNDS)\nb = normalize_range(band14, _T11_BOUNDS)\nfalse_color = np.clip(np.stack([r, g, b], axis=2), 0, 1)`\n\nHere I cannot understand how the origin of the first three variables and how the r, g, and b values have been calculated. I would really appreciate if if someone could help me understand this."
  }
}