diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cc74ac..c4a7d1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -12,17 +12,17 @@ repos: - id: check-ast - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.15.10 hooks: - id: ruff args: [--fix] - - repo: https://github.com/psf/black - rev: 24.8.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black language_version: python3 - repo: https://github.com/keewis/blackdoc - rev: v0.3.9 + rev: v0.4.6 hooks: - id: blackdoc additional_dependencies: ["black[jupyter]"] @@ -32,13 +32,13 @@ repos: - id: prettier types_or: [yaml, html, css, scss, javascript, json] # markdown to avoid conflicts with mdformat - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.2 hooks: - id: codespell types_or: [python, markdown, rst] additional_dependencies: [tomli] - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.21.2 hooks: - id: pyupgrade - repo: https://github.com/MarcoGorelli/madforhooks @@ -47,18 +47,18 @@ repos: # - id: conda-env-sorter # conflicts with prettier - id: check-execution-order - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 1.0.0 hooks: - id: mdformat additional_dependencies: [mdformat-gfm, mdformat-black] exclude: ^.github/ # this avoid the hook to wrongly reformats md issue template files - repo: https://github.com/kynan/nbstripout - rev: 0.7.1 + rev: 0.9.1 hooks: - id: nbstripout args: [--keep-output] - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.7 + rev: 1.9.1 hooks: - id: nbqa-black - id: nbqa-ruff diff --git a/CHANGELOG.md b/CHANGELOG.md index d568c59..47cf001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,6 @@ All notable changes to **GOES-API** will be documented in this file. -## \[0.0.1\] - GOES-API Birth Date - 2023-03-27 +## [0.0.1] - GOES-API Birth Date - 2023-03-27 First release of GOES-API. diff --git a/docs/ABI_SCAN_MODES.md b/docs/ABI_SCAN_MODES.md index 650e10c..50365c7 100644 --- a/docs/ABI_SCAN_MODES.md +++ b/docs/ABI_SCAN_MODES.md @@ -7,14 +7,14 @@ Mode 3 (GOES16, GOES17) - Default operational mode till April 2, 2019 - FULL DISK every 15 minutes - CONUS/PACUS every 5 minutes -- Mesoscale every 1 minutes (TODO: when 30 seconds) +- Mesoscale every 1 minutes (TODO: when 30 seconds) -Mode 6 (difference between GOES-16 and GOES-17) +Mode 6 (difference between GOES-16 and GOES-17) - Default operational mode till since April 2, 2019 - FULL DISK every 10 minutes - CONUS/PACUS every 5 minutes -- Mesoscale every 1 minutes (TODO: when 30 seconds) +- Mesoscale every 1 minutes (TODO: when 30 seconds) Mode 4 diff --git a/docs/DOCUMENTATION.md b/docs/DOCUMENTATION.md index 44f6a44..c3143ec 100644 --- a/docs/DOCUMENTATION.md +++ b/docs/DOCUMENTATION.md @@ -2,7 +2,7 @@ GOES-16 (GOES-R) -- November 30 - December 11 2017: Drifting from 89.5 °W to the GOES-East operational location (75.2° W) \[todo: check if 89.5 is correct\] +- November 30 - December 11 2017: Drifting from 89.5 °W to the GOES-East operational location (75.2° W) [todo: check if 89.5 is correct] - Nominal operation resumed on December 18, 2017 - Declared GOES-EAST on December 18, 2017 - Biased IR bands before June 19, 2018 @@ -62,7 +62,7 @@ Calibration event log Precomputed angles/latlon -- https://www.star.nesdis.noaa.gov/pub/smcd/spb/fwu/tmp/latlon_angle/ (lon=-135.0 deg) and East (lon=-75.0) +- https://www.star.nesdis.noaa.gov/pub/smcd/spb/fwu/tmp/latlon_angle/ (lon=-135.0 deg) and East (lon=-75.0) GOES weighting functions @@ -142,7 +142,7 @@ The L2 Cloud and Moisture Imagery (MCMIP) products contains all the 16 spectral ## ABI Raw Data Data are saved as 16-bit scaled integers, rather than 32-bit floating point values. -To unpack: unpacked_value = packed_value * scale_factor + add_offset +To unpack: unpacked_value = packed_value * scale_factor + add_offset To pack: packed_value = (unpacked_value - add_offset) / scale_factor --> The scale factor is calculated with the formula (Max Value - Min Value)/65530 @@ -202,7 +202,7 @@ Oracle cloud storage - https://opendata.oraclecloud.com/ords/r/opendata/opendata/details?data_set_id=2&clear=CR,8&session=2142808942446 -Microsoft West Europe Azure Blob Storage (only limited products) +Microsoft West Europe Azure Blob Storage (only limited products) - https://planetarycomputer.microsoft.com/dataset/goes-cmi - https://planetarycomputer.microsoft.com/dataset/goes-cmi#Storage-Documentation @@ -216,7 +216,7 @@ Microsoft West Europe Azure Blob Storage (only limited products) - [fsspec](https://github.com/fsspec) - [s3fs](https://s3fs.readthedocs.io/en/latest/) (via boto3) - [gcsfs](https://gcsfs.readthedocs.io/en/latest/index.html) -- [adlfs](https://github.com/fsspec/adlfs) (via azure.storage.blob ???) +- [adlfs](https://github.com/fsspec/adlfs) (via azure.storage.blob ???) ## Example cloud bucket url diff --git a/goes_api/__init__.py b/goes_api/__init__.py index 1ff9c30..b55c311 100644 --- a/goes_api/__init__.py +++ b/goes_api/__init__.py @@ -62,41 +62,41 @@ ) __all__ = [ - "define_configs", - "read_configs", - "available_protocols", - "available_sensors", - "available_satellites", - "available_sectors", - "available_product_levels", - "available_products", - "available_scan_modes", "available_channels", "available_connection_types", "available_group_keys", - "get_available_online_product", - "download_files", + "available_product_levels", + "available_products", + "available_protocols", + "available_satellites", + "available_scan_modes", + "available_sectors", + "available_sensors", + "define_configs", "download_closest_files", + "download_daily_files", + "download_files", "download_latest_files", + "download_monthly_files", "download_next_files", "download_previous_files", - "download_daily_files", - "download_monthly_files", - "find_files", - "find_latest_files", - "find_closest_files", - "find_previous_files", - "find_next_files", - "find_closest_start_time", - "find_latest_start_time", - "group_files", - "ensure_operational_data", "ensure_data_availability", + "ensure_operational_data", "ensure_regular_timesteps", "filter_files", + "find_closest_files", + "find_closest_start_time", + "find_files", + "find_latest_files", + "find_latest_start_time", + "find_next_files", + "find_previous_files", "generate_kerchunk_files", - "open_explorer", - "open_explorer_dir", + "get_available_online_product", + "group_files", "open_abi_channel_guide", "open_abi_product_guide", + "open_explorer", + "open_explorer_dir", + "read_configs", ] diff --git a/goes_api/configs.py b/goes_api/configs.py index 4f88a23..26a053c 100644 --- a/goes_api/configs.py +++ b/goes_api/configs.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import os from typing import Dict diff --git a/goes_api/operations.py b/goes_api/operations.py index bac31d3..747a79a 100644 --- a/goes_api/operations.py +++ b/goes_api/operations.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import numpy as np from goes_api.info import get_key_from_filepaths, group_files diff --git a/goes_api/scripts/compute_ABI_pixel_time_offset.py b/goes_api/scripts/compute_ABI_pixel_time_offset.py index 2268381..4c7c4de 100644 --- a/goes_api/scripts/compute_ABI_pixel_time_offset.py +++ b/goes_api/scripts/compute_ABI_pixel_time_offset.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import os from goes_api.abi_pixel_time import _get_native_pixel_time_offset diff --git a/goes_api/search.py b/goes_api/search.py index 2f62bb9..4687338 100644 --- a/goes_api/search.py +++ b/goes_api/search.py @@ -81,7 +81,7 @@ def decorator(*args, **kwargs): # Multiproduct case if isinstance(kwargs["product"], list): products = kwargs["product"] - group_by_key = kwargs.get("group_by_key", None) + group_by_key = kwargs.get("group_by_key") operational_checks = kwargs.get("operational_checks", True) list_fpaths = [] for product in products: diff --git a/goes_api/utils/timing.py b/goes_api/utils/timing.py index 2d7984c..b425315 100644 --- a/goes_api/utils/timing.py +++ b/goes_api/utils/timing.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import datetime from time import perf_counter diff --git a/tutorials/Others/ABI_fixed_grid_area.py b/tutorials/Others/ABI_fixed_grid_area.py index 75cd4f5..4ab1386 100644 --- a/tutorials/Others/ABI_fixed_grid_area.py +++ b/tutorials/Others/ABI_fixed_grid_area.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import cartopy.crs as ccrs import matplotlib.pyplot as plt diff --git a/tutorials/Others/ABI_fixed_grid_notes.py b/tutorials/Others/ABI_fixed_grid_notes.py index e3058e9..39ce530 100644 --- a/tutorials/Others/ABI_fixed_grid_notes.py +++ b/tutorials/Others/ABI_fixed_grid_notes.py @@ -4,6 +4,7 @@ @author: ghiggi """ + ####--------------------------------------------------------------------------. #### Define GEOS AreaDefinition from fixed position # - GOES16 definition took from https://github.com/pytroll/satpy/blob/main/satpy/etc/areas.yaml#L443 diff --git a/tutorials/Others/ABI_pixel_scan_time.py b/tutorials/Others/ABI_pixel_scan_time.py index 56697b6..779613e 100644 --- a/tutorials/Others/ABI_pixel_scan_time.py +++ b/tutorials/Others/ABI_pixel_scan_time.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import xarray as xr from goes_api import find_latest_files diff --git a/tutorials/Others/ABI_pixel_scan_time_with_satpy.py b/tutorials/Others/ABI_pixel_scan_time_with_satpy.py index 60bc859..c5db1ce 100644 --- a/tutorials/Others/ABI_pixel_scan_time_with_satpy.py +++ b/tutorials/Others/ABI_pixel_scan_time_with_satpy.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import fsspec from satpy import Scene from satpy.readers import FSFile diff --git a/tutorials/Others/ex_ACHA.py b/tutorials/Others/ex_ACHA.py index b3a89a5..5daf815 100644 --- a/tutorials/Others/ex_ACHA.py +++ b/tutorials/Others/ex_ACHA.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_ACHT.py b/tutorials/Others/ex_ACHT.py index a5c74e4..4d497fa 100644 --- a/tutorials/Others/ex_ACHT.py +++ b/tutorials/Others/ex_ACHT.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_ACM.py b/tutorials/Others/ex_ACM.py index 6ec86f1..aaa0f23 100644 --- a/tutorials/Others/ex_ACM.py +++ b/tutorials/Others/ex_ACM.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_ACTP.py b/tutorials/Others/ex_ACTP.py index 5ab2367..77e38f8 100644 --- a/tutorials/Others/ex_ACTP.py +++ b/tutorials/Others/ex_ACTP.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_COD.py b/tutorials/Others/ex_COD.py index 9e232b5..7c92338 100644 --- a/tutorials/Others/ex_COD.py +++ b/tutorials/Others/ex_COD.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_CPS.py b/tutorials/Others/ex_CPS.py index 322d7f4..06ee913 100644 --- a/tutorials/Others/ex_CPS.py +++ b/tutorials/Others/ex_CPS.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_CTP.py b/tutorials/Others/ex_CTP.py index 19960ce..4290e5c 100644 --- a/tutorials/Others/ex_CTP.py +++ b/tutorials/Others/ex_CTP.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_DSI.py b/tutorials/Others/ex_DSI.py index 36e9554..c1e9558 100644 --- a/tutorials/Others/ex_DSI.py +++ b/tutorials/Others/ex_DSI.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_LVMP.py b/tutorials/Others/ex_LVMP.py index 684b833..22cd0aa 100644 --- a/tutorials/Others/ex_LVMP.py +++ b/tutorials/Others/ex_LVMP.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_LVTP.py b/tutorials/Others/ex_LVTP.py index c66eaae..b268815 100644 --- a/tutorials/Others/ex_LVTP.py +++ b/tutorials/Others/ex_LVTP.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_RRQPE.py b/tutorials/Others/ex_RRQPE.py index 934fc28..c3168a2 100644 --- a/tutorials/Others/ex_RRQPE.py +++ b/tutorials/Others/ex_RRQPE.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/ex_TPW.py b/tutorials/Others/ex_TPW.py index 8f2b6e0..6be082f 100644 --- a/tutorials/Others/ex_TPW.py +++ b/tutorials/Others/ex_TPW.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import matplotlib.pyplot as plt diff --git a/tutorials/Others/plot_ABI_with_netCDF.py b/tutorials/Others/plot_ABI_with_netCDF.py index a284fab..f28e963 100644 --- a/tutorials/Others/plot_ABI_with_netCDF.py +++ b/tutorials/Others/plot_ABI_with_netCDF.py @@ -4,6 +4,7 @@ @author: ghiggi """ + import cartopy import cartopy.crs as ccrs import matplotlib.pyplot as plt diff --git a/tutorials/Others/plot_ABI_with_xarray.py b/tutorials/Others/plot_ABI_with_xarray.py index 4fc0eb7..8e81b8f 100644 --- a/tutorials/Others/plot_ABI_with_xarray.py +++ b/tutorials/Others/plot_ABI_with_xarray.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import cartopy diff --git a/tutorials/Others/plot_SUVI_with_xarray.py b/tutorials/Others/plot_SUVI_with_xarray.py index 0846c4d..90e440b 100644 --- a/tutorials/Others/plot_SUVI_with_xarray.py +++ b/tutorials/Others/plot_SUVI_with_xarray.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import requests diff --git a/tutorials/Others/read_GLM_with_xarray.py b/tutorials/Others/read_GLM_with_xarray.py index 80365ff..da26f38 100644 --- a/tutorials/Others/read_GLM_with_xarray.py +++ b/tutorials/Others/read_GLM_with_xarray.py @@ -4,6 +4,7 @@ @author: ghiggi """ + from io import BytesIO import requests