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=] //"

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=] //

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

[link=] //

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

[link=] //

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=] //

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...


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