fitscube 2.1.0__tar.gz → 2.2.0__tar.gz

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.
Files changed (32) hide show
  1. {fitscube-2.1.0 → fitscube-2.2.0}/.pre-commit-config.yaml +2 -2
  2. {fitscube-2.1.0 → fitscube-2.2.0}/PKG-INFO +1 -1
  3. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/_version.py +2 -2
  4. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/combine_fits.py +14 -4
  5. {fitscube-2.1.0 → fitscube-2.2.0}/.github/CONTRIBUTING.md +0 -0
  6. {fitscube-2.1.0 → fitscube-2.2.0}/.github/dependabot.yml +0 -0
  7. {fitscube-2.1.0 → fitscube-2.2.0}/.github/release.yml +0 -0
  8. {fitscube-2.1.0 → fitscube-2.2.0}/.github/workflows/cd.yml +0 -0
  9. {fitscube-2.1.0 → fitscube-2.2.0}/.github/workflows/ci.yml +0 -0
  10. {fitscube-2.1.0 → fitscube-2.2.0}/.gitignore +0 -0
  11. {fitscube-2.1.0 → fitscube-2.2.0}/CHANGELOG.md +0 -0
  12. {fitscube-2.1.0 → fitscube-2.2.0}/LICENSE +0 -0
  13. {fitscube-2.1.0 → fitscube-2.2.0}/README.md +0 -0
  14. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/__init__.py +0 -0
  15. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/asyncio.py +0 -0
  16. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/cli.py +0 -0
  17. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/exceptions.py +0 -0
  18. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/extract.py +0 -0
  19. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/logging.py +0 -0
  20. {fitscube-2.1.0 → fitscube-2.2.0}/fitscube/version.pyi +0 -0
  21. {fitscube-2.1.0 → fitscube-2.2.0}/noxfile.py +0 -0
  22. {fitscube-2.1.0 → fitscube-2.2.0}/pyproject.toml +0 -0
  23. {fitscube-2.1.0 → fitscube-2.2.0}/tests/__init__.py +0 -0
  24. {fitscube-2.1.0 → fitscube-2.2.0}/tests/conftest.py +0 -0
  25. {fitscube-2.1.0 → fitscube-2.2.0}/tests/data/cube.zip +0 -0
  26. {fitscube-2.1.0 → fitscube-2.2.0}/tests/data/images.zip +0 -0
  27. {fitscube-2.1.0 → fitscube-2.2.0}/tests/data/time_images.zip +0 -0
  28. {fitscube-2.1.0 → fitscube-2.2.0}/tests/data/timecube.zip +0 -0
  29. {fitscube-2.1.0 → fitscube-2.2.0}/tests/test_extract.py +0 -0
  30. {fitscube-2.1.0 → fitscube-2.2.0}/tests/test_frequencies.py +0 -0
  31. {fitscube-2.1.0 → fitscube-2.2.0}/tests/test_package.py +0 -0
  32. {fitscube-2.1.0 → fitscube-2.2.0}/tests/test_times.py +0 -0
@@ -33,14 +33,14 @@ repos:
33
33
  - id: rst-inline-touching-normal
34
34
 
35
35
  - repo: https://github.com/astral-sh/ruff-pre-commit
36
- rev: "v0.12.5"
36
+ rev: "v0.12.7"
37
37
  hooks:
38
38
  - id: ruff
39
39
  args: ["--fix", "--show-fixes"]
40
40
  - id: ruff-format
41
41
 
42
42
  - repo: https://github.com/pre-commit/mirrors-mypy
43
- rev: "v1.17.0"
43
+ rev: "v1.17.1"
44
44
  hooks:
45
45
  - id: mypy
46
46
  files: src|tests
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fitscube
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: A package to produce produce FITS cubes.
5
5
  Project-URL: Homepage, https://github.com/AlecThomson/fitscube
6
6
  Project-URL: Bug Tracker, https://github.com/AlecThomson/fitscube/issues
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.1.0'
21
- __version_tuple__ = version_tuple = (2, 1, 0)
20
+ __version__ = version = '2.2.0'
21
+ __version_tuple__ = version_tuple = (2, 2, 0)
@@ -160,7 +160,13 @@ async def create_cube_from_scratch_coro(
160
160
  if output_file.exists() and overwrite:
161
161
  output_file.unlink()
162
162
 
163
- output_wcs = WCS(output_header)
163
+ try:
164
+ output_wcs = WCS(output_header)
165
+ except Exception as e:
166
+ logger.error("Error creating new header")
167
+ for k in output_header:
168
+ logger.error(f"{k} = {output_header[k]}")
169
+ raise e
164
170
  output_shape = output_wcs.array_shape
165
171
  msg = f"Creating a new FITS file with shape {output_shape}"
166
172
  logger.info(msg)
@@ -324,6 +330,13 @@ async def create_output_cube_coro(
324
330
  key = f"{k}{fits_idx}"
325
331
  logger.debug(f"{key}={new_header[key]}")
326
332
 
333
+ # Add extra transform fields for consistency
334
+ if ("CD1_1" in new_header or "PC1_1" in new_header) and fits_idx != 1:
335
+ transform_type = "CD" if "CD1_1" in new_header else "PC"
336
+ pv1 = f"{transform_type}{fits_idx}_{fits_idx}"
337
+ logger.info(f"Adding {pv1} to header")
338
+ new_header[pv1] = 1.0
339
+
327
340
  if ignore_spec or not even_spec:
328
341
  logger.info(
329
342
  f"Ignore the specrency information, {ignore_spec=} or {not even_spec=}"
@@ -345,9 +358,6 @@ async def create_output_cube_coro(
345
358
  )
346
359
  del new_header["BMAJ"], new_header["BMIN"], new_header["BPA"]
347
360
 
348
- if time_domain_mode:
349
- new_header["COMMENT"] = "The frequency/chan axis in this cube represents TIME."
350
-
351
361
  plane_shape = list(old_data.shape)
352
362
  cube_shape = plane_shape.copy()
353
363
  if is_2d:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes