Page 1 of 1

Adding legend to precipitation data image

Posted: Thu Mar 03, 2022 4:36 pm America/New_York
by EarthdataForumContributor
(Edited user inquiry)

I’m working on Python script that makes a request to a NASA server:

[link=] //pmmpublisher.pps.eosdis.nasa.gov/opensearch?q=precip_30mn&lat=25.6&lon=-103.39&limit=1&startTime=2022-01-01&//"

the result is an image that shows aspects of rainfall amounts. The display comes ok but I want to include the legend in the requested image. Can you help me on this.

Re: Adding legend to precipitation data image

Posted: Thu Mar 03, 2022 4:39 pm America/New_York
by EarthdataForumContributor
(Edited response to user)
I believe that the sample URL that you included in your email was truncated because it did not include an endTime keyword. I modified your URL slightly to obtain the 30-minute results for the date you specified...

[link=] //pmmpublisher.pps.eosdis.nasa.gov/opensearch?q=precip_30mn&lat=25.6&lon=-103.39&limit=10&startTime=2022-01-01&endTime=2022-01-01

Then I picked the first image in the JSON response from that URL, which was the following...

[link=] //pmmpublisher.pps.eosdis.nasa.gov/products/s3/r01/gpm_30mn/2022/001/gpm_30mn.20220101.235959_thn.png

The legend for the 30-minute IMERG imagery is fixed and can be downloaded from this URL:

[link=] //pmmpublisher.pps.eosdis.nasa.gov/mapinfo/gpm_30mn/legend?product=gpm_30mn

In the future, if you are looking at a different dataset from the PMM publisher, the way to figure out the URL for the legend is to use the human-readable interface. To do so, visit the PMM publisher homepage...

[link=] //pmmpublisher.pps.eosdis.nasa.gov/

Then click on OpenSearch near the upper left of the page. In the left column of the page, fill out the form and click the Submit button. Scroll down to the search results, and click on the Actions tab. Within the Actions tab, you can download the browse image of precipitation or the map legend. The general format of the URL of the legend image is the following...

https://{serverName}/mapinfo/{prodName}/legend?product={prodName}

...where {serverName} is pmmpublisher.pps.eosdis.nasa.gov and {prodName} is the name of the data product such as gpm_30mn in the example in this email message.