Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contsub/parser/imcontsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def runit(**kwargs):
chunks = dict(ra = opts.ra_chunks or 64, dec=None, spectral=None)

rest_freq = opts.rest_freq
zds = zds_from_fits(infits, chunks=chunks, rest_freq=rest_freq)
zds = zds_from_fits(infits, chunks=chunks, rest_freq=rest_freq, hdu_idx=opts.hdu_index)
base_dims = ["ra", "dec", "spectral", "stokes"]
if not hasattr(zds, "stokes"):
base_dims.remove("stokes")
Expand Down
5 changes: 5 additions & 0 deletions contsub/parser/imcontsub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ inputs:
info: "### DEPRECATED #### Set this flag if the input image has a stokes dimension. (Default is True)."
default: yes
dtype: bool
hdu-index:
info: FITS primary HDU index
dtype: int
default: 0
abbreviation: hi
ra-chunks:
info: Chunking along RA-axis. If set to zero, no Chunking is perfomed.
dtype: int
Expand Down
4 changes: 2 additions & 2 deletions contsub/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_automask(xspec, cube, sigma_clip=5, order=3, segments=400):
return mask


def zds_from_fits(fname, chunks=None, rest_freq=None):
def zds_from_fits(fname, chunks=None, rest_freq=None, hdu_idx=0):
""" Creates Zarr store from a FITS file. The resulting array has
dimensions = RA, DEC, SPECTRAL[, STOKES]

Expand All @@ -59,7 +59,7 @@ def zds_from_fits(fname, chunks=None, rest_freq=None):
Zarr: Zarr array (persistant store, mode=w)
"""
chunks = chunks or dict(ra=64,dec=None, spectral=None)
fds = xds_from_fits(fname)[0]
fds = xds_from_fits(fname, hdus=hdu_idx)[0]

header = fds.hdu.header
if rest_freq:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "contsub"
version = "1.0.3"
version = "1.0.4"
description = "Radio astronomy data continuum subtraction tools"
authors = ["Amir Kazemi-Moridani, Sphesihle Makhathini, Mika Naidoo"]
license = "MIT"
Expand Down