pycontrails 0.54.9__cp310-cp310-win_amd64.whl → 0.54.10__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pycontrails might be problematic. Click here for more details.

pycontrails/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.54.9'
21
- __version_tuple__ = version_tuple = (0, 54, 9)
20
+ __version__ = version = '0.54.10'
21
+ __version_tuple__ = version_tuple = (0, 54, 10)
@@ -543,7 +543,7 @@ class Model(ABC):
543
543
 
544
544
  See Also
545
545
  --------
546
- - :meth:`eval`
546
+ eval
547
547
  """
548
548
  self.source = self._get_source(source)
549
549
 
@@ -744,8 +744,8 @@ class Model(ABC):
744
744
 
745
745
  See Also
746
746
  --------
747
- - get_source_param
748
- - GeoVectorDataset.get_data_or_attr
747
+ get_source_param
748
+ pycontrails.core.vector.GeoVectorDataset.get_data_or_attr
749
749
  """
750
750
  marker = self.__marker
751
751
 
@@ -805,8 +805,8 @@ class Model(ABC):
805
805
 
806
806
  See Also
807
807
  --------
808
- - get_data_param
809
- - GeoVectorDataset.get_data_or_attr
808
+ get_data_param
809
+ pycontrails.core.vector.GeoVectorDataset.get_data_or_attr
810
810
  """
811
811
  return self.get_data_param(self.source, key, default, set_attr=set_attr)
812
812
 
@@ -59,6 +59,22 @@ DEFAULT_CHANNELS = "C11", "C14", "C15"
59
59
  #: See `GOES ABI scan information <https://www.goes-r.gov/users/abiScanModeInfo.html>`_.
60
60
  GOES_SCAN_MODE_CHANGE = datetime.datetime(2019, 4, 2, 16)
61
61
 
62
+ #: The date at which GOES-19 data started being available. This is used to
63
+ #: determine the source (GOES-16 or GOES-19) of requested. In particular,
64
+ #: Mesoscale images are only available for GOES-East from GOES-19 after this date.
65
+ #: See the `NOAA press release <https://www.noaa.gov/news-release/noaas-goes-19-satellite-now-operational-providing-critical-new-data-to-forecasters>`_.
66
+ GOES_16_19_SWITCH_DATE = datetime.datetime(2025, 4, 4)
67
+
68
+ #: The GCS bucket for GOES-East data before ``GOES_16_19_SWITCH_DATE``.
69
+ GOES_16_BUCKET = "gcp-public-data-goes-16"
70
+
71
+ #: The GCS bucket for GOES-West data. Note that GOES-17 has degraded data quality
72
+ #: and is not recommended for use. This bucket isn't used by the ``GOES`` handler by default.
73
+ GOES_18_BUCKET = "gcp-public-data-goes-18"
74
+
75
+ #: The GCS bucket for GOES-East data after ``GOES_16_19_SWITCH_DATE``.
76
+ GOES_19_BUCKET = "gcp-public-data-goes-19"
77
+
62
78
 
63
79
  class GOESRegion(enum.Enum):
64
80
  """GOES Region of interest.
@@ -187,7 +203,7 @@ def gcs_goes_path(
187
203
  time: datetime.datetime,
188
204
  region: GOESRegion,
189
205
  channels: str | Iterable[str] | None = None,
190
- bucket: str = "gcp-public-data-goes-16",
206
+ bucket: str | None = None,
191
207
  fs: gcsfs.GCSFileSystem | None = None,
192
208
  ) -> list[str]:
193
209
  """Return GCS paths to GOES data at the given time for the given region and channels.
@@ -208,6 +224,12 @@ def gcs_goes_path(
208
224
  set ``channels=("C11", "C14", "C15")``. For the true color scheme,
209
225
  set ``channels=("C01", "C02", "C03")``. By default, the channels
210
226
  required by the SEVIRI ash color scheme are used.
227
+ bucket : str | None
228
+ GCS bucket for GOES data. If None, the bucket is automatically
229
+ set to ``GOES_16_BUCKET`` if ``time`` is before
230
+ ``GOES_16_19_SWITCH_DATE`` and ``GOES_19_BUCKET`` otherwise.
231
+ fs : gcsfs.GCSFileSystem | None
232
+ GCS file system instance. If None, a default anonymous instance is created.
211
233
 
212
234
  Returns
213
235
  -------
@@ -236,6 +258,11 @@ def gcs_goes_path(
236
258
  >>> pprint(paths)
237
259
  ['gcp-public-data-goes-16/ABI-L2-CMIPM/2023/093/02/OR_ABI-L2-CMIPM1-M6C01_G16_s20230930211249_e20230930211309_c20230930211386.nc']
238
260
 
261
+ >>> t = datetime.datetime(2025, 5, 4, 3, 2)
262
+ >>> paths = gcs_goes_path(t, GOESRegion.M2, channels="C01")
263
+ >>> pprint(paths)
264
+ ['gcp-public-data-goes-19/ABI-L2-CMIPM/2025/124/03/OR_ABI-L2-CMIPM2-M6C01_G19_s20251240302557_e20251240303014_c20251240303092.nc']
265
+
239
266
  """
240
267
  time = _check_time_resolution(time, region)
241
268
  year = time.strftime("%Y")
@@ -247,7 +274,10 @@ def gcs_goes_path(
247
274
  product_name = "CMIP" # Cloud and Moisture Imagery
248
275
  product = f"{sensor}-{level}-{product_name}{region.name[0]}"
249
276
 
250
- bucket = bucket.removeprefix("gs://")
277
+ if bucket is None:
278
+ bucket = GOES_16_BUCKET if time < GOES_16_19_SWITCH_DATE else GOES_19_BUCKET
279
+ else:
280
+ bucket = bucket.removeprefix("gs://")
251
281
 
252
282
  path_prefix = f"gs://{bucket}/{product}/{year}/{yday}/{hour}/"
253
283
 
@@ -267,7 +297,13 @@ def gcs_goes_path(
267
297
  time_str = f"{time_str[:-1]}6"
268
298
 
269
299
  name_prefix = f"OR_{product[:-1]}{region.name}-{mode}"
270
- name_suffix = f"_G16_s{time_str}*"
300
+
301
+ try:
302
+ satellite_number = int(bucket[-2:]) # 16 or 18 or 19 -- this may fail for custom buckets
303
+ except (ValueError, IndexError) as exc:
304
+ msg = f"Bucket name {bucket} does not end with a valid satellite number."
305
+ raise ValueError(msg) from exc
306
+ name_suffix = f"_G{satellite_number}_s{time_str}*"
271
307
 
272
308
  channels = _parse_channels(channels)
273
309
 
@@ -323,8 +359,12 @@ class GOES:
323
359
  cachestore : cache.CacheStore | None
324
360
  Cache store for GOES data. If None, data is downloaded directly into
325
361
  memory. By default, a :class:`cache.DiskCacheStore` is used.
326
- goes_bucket : str = "gcp-public-data-goes-16"
327
- GCP bucket for GOES data. AWS access is not supported.
362
+ goes_bucket : str | None = None
363
+ GCP bucket for GOES data. If None, the bucket is automatically
364
+ set to ``GOES_16_BUCKET`` if the requested time is before
365
+ ``GOES_16_19_SWITCH_DATE`` and ``GOES_19_BUCKET`` otherwise.
366
+ The satellite number used for filename construction is derived from the
367
+ last two characters of this bucket name.
328
368
 
329
369
  See Also
330
370
  --------
@@ -396,7 +436,7 @@ class GOES:
396
436
  region: GOESRegion | str = GOESRegion.F,
397
437
  channels: str | Iterable[str] | None = None,
398
438
  cachestore: cache.CacheStore | None = __marker, # type: ignore[assignment]
399
- goes_bucket: str = "gcp-public-data-goes-16",
439
+ goes_bucket: str | None = None,
400
440
  ) -> None:
401
441
  self.region = _parse_region(region)
402
442
  self.channels = _parse_channels(channels)
@@ -435,7 +475,7 @@ class GOES:
435
475
  List of GCS paths to GOES data.
436
476
  """
437
477
  channels = channels or self.channels
438
- return gcs_goes_path(time, self.region, channels, self.goes_bucket)
478
+ return gcs_goes_path(time, self.region, channels, bucket=self.goes_bucket, fs=self.fs)
439
479
 
440
480
  def _lpaths(self, time: datetime.datetime) -> dict[str, str]:
441
481
  """Construct names for local netcdf files using the :attr:`cachestore`.
@@ -217,6 +217,8 @@ class DryAdvection(models.Model):
217
217
  - ``age``: Age of plume.
218
218
  - ``waypoint``: Identifier for each waypoint.
219
219
 
220
+ If ``flight_id`` is present in :attr:`source`, it is retained.
221
+
220
222
  If `"azimuth"` is present in :attr:`source`, `source.attrs`, or :attr:`params`,
221
223
  the following variables will also be added:
222
224
 
@@ -236,6 +238,9 @@ class DryAdvection(models.Model):
236
238
  self.source.setdefault("waypoint", np.arange(self.source.size))
237
239
 
238
240
  columns = ["longitude", "latitude", "level", "time", "age", "waypoint"]
241
+ if "flight_id" in self.source:
242
+ columns.append("flight_id")
243
+
239
244
  azimuth = self.get_source_param("azimuth", set_attr=False)
240
245
  if azimuth is None:
241
246
  # Early exit for pointwise only simulation
@@ -541,6 +546,10 @@ def _evolve_one_step(
541
546
  }
542
547
  )
543
548
 
549
+ flight_id = vector.get("flight_id")
550
+ if flight_id is not None:
551
+ out["flight_id"] = flight_id
552
+
544
553
  azimuth = vector.get("azimuth")
545
554
  if azimuth is None:
546
555
  # Early exit for "pointwise only" simulation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycontrails
3
- Version: 0.54.9
3
+ Version: 0.54.10
4
4
  Summary: Python library for modeling aviation climate impacts
5
5
  Author-email: "Contrails.org" <py@contrails.org>
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
1
  pycontrails/__init__.py,sha256=mKNmGUS5wW1n1PukeaOkmLwQVN24i1__mk0odjBzwEE,2107
2
- pycontrails/_version.py,sha256=577cE47qIYB88v4CDza3alm_spIkYihWh6u-GZrOEyY,534
2
+ pycontrails/_version.py,sha256=_ZQqpCJ-0uRjzaGF7Uf1XCw_aXZF9SzE3qUBfCzdM7s,536
3
3
  pycontrails/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  pycontrails/core/__init__.py,sha256=kOAehIZBbvksSW3MuU2DfzsyeE4PaFnOTpYMeq2ZDPE,886
5
5
  pycontrails/core/aircraft_performance.py,sha256=dasanaqfm5eP9XUDhgoKGj-eQHTWwMZ_mN6_ZdFulT0,28911
@@ -13,12 +13,12 @@ pycontrails/core/fuel.py,sha256=06YUDhvC8Rx6KbUXRB9qLTsJX2V7tLbzjwAfDH0R6l8,4472
13
13
  pycontrails/core/interpolation.py,sha256=-GC3T6yh3nMtt7JCawoYeCUnDNRY9GHhxhkRhhnntxE,26437
14
14
  pycontrails/core/met.py,sha256=a6BHxO6Thlj85uFB5F7zrZkEupStU1FL9tc_m-Ipobg,106903
15
15
  pycontrails/core/met_var.py,sha256=bFpBFpQnN6osVAuxNNhG6vG_NMThEIhDcL2B9VpXgww,12407
16
- pycontrails/core/models.py,sha256=S-smQKIyl0HWrpcOfDAigKa80OdLXmjoRCflq6JP_PY,45132
16
+ pycontrails/core/models.py,sha256=erfCRH_N9Xjs7x0pxakwuc0eLLDnkk4D6AJlXvRqEzc,45162
17
17
  pycontrails/core/polygon.py,sha256=NZ4YBhdALidXYOPsSX1cwGQ022j-AXgbWIQg7LA-f-I,18593
18
- pycontrails/core/rgi_cython.cp310-win_amd64.pyd,sha256=UHoy1KtQJsSqmtamUACOnQe8D-M8eT754yAv46kBCTs,256000
18
+ pycontrails/core/rgi_cython.cp310-win_amd64.pyd,sha256=rUS6CYVrtVyN920zWmJ9DSJ6SDBLMIgSnctOGi5IfH4,234496
19
19
  pycontrails/core/vector.py,sha256=sMhBfCmwmIcexIBe-aJc5sSbzbSOL1dzvbwwiiz7Rdw,75857
20
20
  pycontrails/datalib/__init__.py,sha256=Q2RrnjwtFzfsmJ2tEojDCzDMkd8R0MYw4mQz3YwUsqI,381
21
- pycontrails/datalib/goes.py,sha256=v8fYi6LPp-40jm2TTGDkja77FZIj-th39KNI88p5OYE,32835
21
+ pycontrails/datalib/goes.py,sha256=v68dMaaFf_WvikQMTPU_L-J723pJEqqPrDw59JB3AGg,35037
22
22
  pycontrails/datalib/landsat.py,sha256=YrDpngF5HtvWFVwxN0FLFxCfZIEmeBMiifdkbH7fQTk,20263
23
23
  pycontrails/datalib/sentinel.py,sha256=ukzdSeHKC1UBWEYzehS2LqtKoCpKpaPobLfbZDGy6KU,17679
24
24
  pycontrails/datalib/_leo_utils/search.py,sha256=8JzT56ps3SH1W-5rwL8BWuxLLljwxa_5fjLAuZdL_Vg,8937
@@ -48,7 +48,7 @@ pycontrails/ext/empirical_grid.py,sha256=mveQltokaGeQcxxbdMSLQ6wQ14oh3XX5dfzjWaF
48
48
  pycontrails/ext/synthetic_flight.py,sha256=dEWm9vrg6SAWieh6GLAE0m1orTrApav8HHP42-4bIHg,17233
49
49
  pycontrails/models/__init__.py,sha256=TKhrXe1Pu1-mV1gctx8cUAMrVxCCAtBkbZi9olfWq8s,34
50
50
  pycontrails/models/accf.py,sha256=llpEtvEqrA0N2iefEpj8wbObHPhWkuoMpfln0wu7fBc,14026
51
- pycontrails/models/dry_advection.py,sha256=vDPjNrECefMvRVnfkhWCWbYQPpB2YYhGUvLiIuW10TM,19727
51
+ pycontrails/models/dry_advection.py,sha256=4GQht5UPQ2IgitIxBIeuXGI9cXScdb9vdq60KCHVGaw,19996
52
52
  pycontrails/models/issr.py,sha256=J6mh4pze31XpD2_zD9ujzYPXsZFrmSwNcRORCcLoOVI,7588
53
53
  pycontrails/models/pcc.py,sha256=7k8kICqDeZ99O2n2Zpnu7EFNGjEpPka_9cu9nrmP44s,11394
54
54
  pycontrails/models/pcr.py,sha256=G_0yR5PsCMeJBP6tZFi3M7A6Wcq8s71UvosdA7ozUkI,5502
@@ -105,9 +105,9 @@ pycontrails/utils/iteration.py,sha256=En2YY4NiNwCNtAVO8HL6tv9byBGKs8MKSI7R8P-gZy
105
105
  pycontrails/utils/json.py,sha256=Pqashwoupuf_GfrrSfHclwug9Hg-kYQ4WNxEqay_0Rc,6083
106
106
  pycontrails/utils/temp.py,sha256=5XXqQoEfWjz1OrhoOBZD5vkkCFeuq9LpZkyhc38gIeY,1159
107
107
  pycontrails/utils/types.py,sha256=hPqUwaeRLgga69nj7LVbPojPg1k7pUSvYzFlGAiPKIM,5154
108
- pycontrails-0.54.9.dist-info/licenses/LICENSE,sha256=HVr8JnZfTaA-12BfKUQZi5hdrB3awOwLWs5X_ga5QzA,10353
109
- pycontrails-0.54.9.dist-info/licenses/NOTICE,sha256=VIhzKNYi4lQx6fpZyqiY6eMHpLuwp-_G0JQkmYYa7h0,2005
110
- pycontrails-0.54.9.dist-info/METADATA,sha256=Bm45DhhjF9mTc3c2r-aeMqGv0f5BToLFFyTHz7hoVaY,9311
111
- pycontrails-0.54.9.dist-info/WHEEL,sha256=cApr8aT7ro1gNNNzftTDVqaaXPK4_jWf4Qi4QFW6aVk,101
112
- pycontrails-0.54.9.dist-info/top_level.txt,sha256=dwaYXVcMhF92QWtAYcLvL0k02vyBqwhsv92lYs2V6zQ,23
113
- pycontrails-0.54.9.dist-info/RECORD,,
108
+ pycontrails-0.54.10.dist-info/licenses/LICENSE,sha256=HVr8JnZfTaA-12BfKUQZi5hdrB3awOwLWs5X_ga5QzA,10353
109
+ pycontrails-0.54.10.dist-info/licenses/NOTICE,sha256=VIhzKNYi4lQx6fpZyqiY6eMHpLuwp-_G0JQkmYYa7h0,2005
110
+ pycontrails-0.54.10.dist-info/METADATA,sha256=bVmYFhUPLAYbnwLuf1BrYCGf080o1yGKTqugeMozNnI,9312
111
+ pycontrails-0.54.10.dist-info/WHEEL,sha256=KuuxPnOSDo1K7Ftl6Qe10qwYOgcJ4uyjbQRY_npPeyg,101
112
+ pycontrails-0.54.10.dist-info/top_level.txt,sha256=dwaYXVcMhF92QWtAYcLvL0k02vyBqwhsv92lYs2V6zQ,23
113
+ pycontrails-0.54.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp310-cp310-win_amd64
5
5