-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update Sentinel-5P #167
Update Sentinel-5P #167
Conversation
@pjhartzell sorry, I caused a merge conflict with #166. That just added the Can you comment on what the |
No worries.
I suppose not. These files existed in the sentinel-5p folder before I started this PR. I'll move them out. |
Ah, thanks, I missed that they were a move. I suspect that Rob made those when analyzing the existing STAC items to find good values for summaries. |
Yep, and they were valuable in both content and as an example of generating summary info. I'll hold onto them locally. |
Converting to draft while I add anti-meridian support and fix incorrect datetime strings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirm: we need to add a bit of code here to call the new enclose_poles
?
FWIW, I tried it out on the asset at blob://sentinel5euwest/sentinel-5p-stac/TROPOMI/L2__AER_AI/2023/01/01/S5P_L2_AER_AI_20230101T000319_20230101T014449_27036.json
, and got a ZeroDivisionError when calling it after fix_item
.
# import sys
# sys.path.append("datasets/sentinel-5p/")
# from sentinel_5p import *
from pctasks.core.storage import StorageFactory
from pctasks.core.tokens import *
from pctasks.core.models.tokens import *
import planetary_computer
import pystac
import shapely.geometry
from stactools.core.utils.antimeridian import fix_item, enclose_poles, Strategy
token = planetary_computer.sas.get_token("sentinel5euwest", "sentinel-5p-stac").token
storage_factory = StorageFactory(tokens=Tokens({"sentinel5euwest": StorageAccountTokens(containers={"sentinel-5p-stac": ContainerTokens(token=token)})}))
asset_uri = "blob://sentinel5euwest/sentinel-5p-stac/TROPOMI/L2__AER_AI/2023/01/01/S5P_L2_AER_AI_20230101T000319_20230101T014449_27036.json"
storage, json_path = storage_factory.get_storage_for_file(asset_uri)
item_dict = storage.read_json(json_path)
item = pystac.Item.from_dict(item_dict)
fix_item(item, Strategy.NORMALIZE)
poly = shapely.geometry.shape(item.geometry)
antimeridian.enclose_poles(poly) # ZeroDivisionError
Correct, I'm working this now.
Yeah, enclose poles will have to come first, and I'm doing some testing now to see if we need tl;dr: Antimeridians and poles are hard |
@TomAugspurger got the antimeridian stuff fixed up. Some examples below. There's 100 items from each product in pc-test. One product type ( Right now this code is in a personal repo ... if you'd like, I can port it over to stactools before we merge, but I thought I'd get this up now before I do that work. LMK. FYSA the code appears to work well for sentinel3 as well, though there's an issue with wraparounds (for some files we've seen, there's data from the beginning and the end of a swath in the same spot) that requires another special hack to fix -- we'll put that in the sentinel3 pull request, I haven't seen any s5 data that has that issue. Before for
|
I'm OK with running off your personal repo, but agreed that longer-term this belongs in stactools (or shapley). Just for fun, I made a little thing to browse the footprints (gist). I think these look good. |
I'm 👎 on either of these options, unfortunately. stactools is too heavy for what the antimeridian package does (antimeridian only needs shapely), and shapely intentionally doesn't care about geographic coordinate systems. Maybe there's another good home for this algorithm, but I don't think its either of those spots. Uhhhh that browser is awesome and I'm going to be using it for sentinel3 for sure! Thanks for sharing! |
@TomAugspurger released to PyPI and updated PR to point to the released version, so we aren't dependent on my personal repo url anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Just two small questions.
Can you also copy-paste a Dockerfile to the sentinel-5p
directory (I really need to finish off
#104 so we can stop all this duplication)?
- change s3:spatial_resolution from string to list of integers - add s3:product_name - make asset keys kebab-case - remove redundant asset title prefixes - round geometry and bbox coordinates to original precision after antimeridian fix
* added split * removed limit
Thanks all! |
Description
Adds the
sentinel-5p-l2-netcdf
collection to thesentinel-5p
dataset.The Sentinel-5P payload is a single imaging spectrometer, the TROPOMI sensor. The collected data are processed to Level-2 derived products, 13 of which are included in this PR's
sentinel-5p-l2-netcdf
collection. The products are listed below, each linked to a sample STAC Item in PC Test:L2__AER_AI
: Ultraviolet aerosol indexL2__AER_LH
: Aerosol layer heightL2__CH4___
: Methane (CH4) total columnL2__CLOUD_
: Cloud fraction, albedo, and top pressureL2__CO____
: Carbon monoxide (CO) total columnL2__HCHO__
: Formaldehyde (HCHO) total columnL2__NO2___
: Nitrogen dioxide (NO2) total columnL2__O3____
: Ozone (O3) total columnL2__O3_TCL
: Ozone (O3) tropospheric columnL2__SO2___
: Sulfur dioxide (SO2) total columnL2__NP_BD3
: Cloud from the Suomi NPP mission, band 3L2__NP_BD6
: Cloud from the Suomi NPP mission, band 6L2__NP_BD7
: Cloud from the Suomi NPP mission, band 7You can check out the dataset landing page in PC Test.
Notes
L2__O3__PR
, which is an ozone profile product. The data in Azure for this product starts in November 2021, so perhaps this product became available after the STAC Item creation pipeline was put together.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The Collection and several hundred Items were ingested into PC Test.
Checklist:
Please delete options that are not relevant.