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

Blank time-series chart with some datasets + selected AOI #904

Closed
slesaad opened this issue Mar 26, 2024 · 4 comments
Closed

Blank time-series chart with some datasets + selected AOI #904

slesaad opened this issue Mar 26, 2024 · 4 comments

Comments

@slesaad
Copy link
Member

slesaad commented Mar 26, 2024

Description

With some of the datasets, a specific example being the Air Sea CO2 flux in the GHG center, the time series chart values are null even tho the /search returns results. See the attached screenshots.

This happens when the user draws a polygon on land where the data values don't exist. In such cases, the time-series chart should display a message instead of displaying a blank chart.

All the /statistics responses look like this:

 "properties": {
        "statistics": {
            "b1": {
                "min": null,
                "max": null,
                "mean": null,
                "count": 2274.60009765625,
                "sum": null,
                "std": null,
                "median": null,
                "majority": null,
                "minority": null,
                "unique": 0.0,
                "histogram": [
                    [
                        0.0,
                        0.0,
                        0.0,
                        0.0,
                        0.0,
                        0.0,
                        0.0,
                        0.0,
                        0.0,
                        0.0
                    ],
                    [
                        0.0,
                        0.1,
                        0.2,
                        0.30000000000000004,
                        0.4,
                        0.5,
                        0.6000000000000001,
                        0.7000000000000001,
                        0.8,
                        0.9,
                        1.0
                    ]
                ],
                "valid_percent": 0.0,
                "masked_pixels": 4551.0,
                "valid_pixels": 0.0,
                "percentile_2": null,
                "percentile_98": null
            }
        }

See an example here: https://earth.gov/ghgcenter/analysis/results?start=2018-01-01T00%3A00%3A00.000Z&end=2022-12-31T00%3A00%3A00.000Z&datasetsLayers=air-sea-co2&aoi=%7C~%60eTwcvbGftcAli%7B%7D%40%7DnohDuhab%40

It will be less of a problem once E&A is out because users can see where data values exist. However, it should still be handled.

Screenshots

image
image

@j08lue j08lue added the bug label Apr 2, 2024
hanbyul-here added a commit that referenced this issue Apr 24, 2024
**Related Ticket:** #904

### Description of Changes
Handle the case when there is no actual value to display from statistics
requests.

### Notes & Questions About Changes

- I am not sure the wording is clear. Please feel free to change. It
will look like this

<img width="368" alt="Screen Shot 2024-04-23 at 3 24 28 PM"
src="https://github.com/NASA-IMPACT/veda-ui/assets/4583806/f61d052d-850b-4fa4-b97f-c6f89babc692">

- Is it valid to assume that if the 'mean' (average) value doesn't
exist, then other statistical measures also don't exist?

### Validation / Testing
Try datasets that only cover ocean (such as Air-sea co2 flux) , and
select aoi that doesn't have ocean coverage.
@aboydnw
Copy link
Contributor

aboydnw commented May 17, 2024

@hanbyul-here is this ticket actually complete? I see the merged PR linked above, not sure if it was intentionally left open

@j08lue
Copy link
Contributor

j08lue commented May 17, 2024

Hmm, in the current production GHG Center, the /statistics API actually throws a 500 error for analyzing the air-sea flux on land (all-NaN, I assume).

https://earth.gov/ghgcenter/exploration?datasets=%5B%7B%22id%22%3A%22air-sea-co2%22%2C%22settings%22%3A%7B%22isVisible%22%3Atrue%2C%22opacity%22%3A100%2C%22analysisMetrics%22%3A%5B%7B%22id%22%3A%22mean%22%2C%22label%22%3A%22Average%22%2C%22chartLabel%22%3A%22Average%22%2C%22themeColor%22%3A%22infographicB%22%7D%5D%7D%7D%5D&date=2022-11-30T23%3A00%3A00.000Z&selectedForEditing=true&aois=%5B%22j%7Br%7EaA%7B%60%7ElBgroaAssmTiivItgf%7D%40%22%2C%22665a97%22%2Ctrue%5D&dateRange=2022-09-30T22%3A00%3A00.000Z%7C2022-12-31T23%3A00%3A00.000Z

image

This layer with no data outside the US shows the expected response: "No data for the selected time range and area of interest." - which @hanbyul-here implemented in the PR above.

https://earth.gov/ghgcenter/exploration?datasets=%5B%7B%22id%22%3A%22total-methane%22%2C%22settings%22%3A%7B%22isVisible%22%3Atrue%2C%22opacity%22%3A100%2C%22analysisMetrics%22%3A%5B%7B%22id%22%3A%22mean%22%2C%22label%22%3A%22Average%22%2C%22chartLabel%22%3A%22Average%22%2C%22themeColor%22%3A%22infographicB%22%7D%5D%7D%7D%5D&date=2019-12-31T23%3A00%3A00.000Z&selectedForEditing=true&aois=%5B%22j%7Br%7EaA%7B%60%7ElBgroaAssmTiivItgf%7D%40%22%2C%22665a97%22%2Ctrue%5D&dateRange=2015-12-25T23%3A00%3A00.000Z%7C2020-12-31T23%3A00%3A00.000Z&taxonomy=%7B%22Source%22%3A%22epa%22%7D

image

Perhaps we should have a fresh ticket, in https://github.com/US-GHG-Center/ghgc-backend or so, for the API / data issue we are seeing, and close this one here.

@hanbyul-here
Copy link
Collaborator

hanbyul-here commented May 17, 2024

@j08lue The team has noticed the problem with air-sea co2 data. The ticket is : US-GHG-Center/veda-config-ghg#388 We were not sure why we are getting 500 instead of just empty array, if this looks like a backend issue, please move the ticket to the appropriate place.

The original ticket is meant for 'empty statistics' - which we show the correct error message now (No data for the selected time range..), at least for the new exploration page. And we decided not to put any more efforts on old analysis page, so I will say this ticket be closed.

@aboydnw
Copy link
Contributor

aboydnw commented May 18, 2024

Sounds good, I'll close this and @j08lue or @smohiudd you can move the linked ticket to whatever board makes the most sense.

@aboydnw aboydnw closed this as completed May 18, 2024
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

No branches or pull requests

4 participants