Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4f5c9ce
added CD GitHub action
sfarrens Mar 14, 2022
6389e87
Merge branch 'develop' of github.com:CosmoStat/shapepipe into develop
sfarrens Mar 18, 2022
ff83cb2
sync with master
sfarrens Mar 18, 2022
3bb1fea
fixed bug in RunLog class (#548)
martinkilbinger Mar 18, 2022
fa5b78a
800deg2 (#544)
martinkilbinger Mar 18, 2022
2d32697
Tutorial documentation (#543)
martinkilbinger Mar 23, 2022
becdc9b
added contribution guidelines (#550)
sfarrens Mar 23, 2022
371ed61
tutorial bugfixes (#552)
Mar 24, 2022
d50b80c
removed pep8 error exceptions (#554)
sfarrens Mar 24, 2022
ead41d1
Understanding the API docs (#553)
sfarrens Mar 24, 2022
4784b14
Update package versions (#539)
sfarrens Mar 24, 2022
b2a69ae
Config file clean up (#556)
martinkilbinger Mar 29, 2022
d0934b2
Update docs/source/configuration.md
sfarrens Mar 29, 2022
9e8278c
final clean up
sfarrens Apr 1, 2022
76e39c6
Merge branch 'master' into develop
sfarrens Apr 1, 2022
72d6bb8
removed obsolete distance-based overlap region flagging
martinkilbinger Apr 19, 2022
9080701
Merge pull request #565 from martinkilbinger/overlap
martinkilbinger May 24, 2022
b573f67
removed errornous mccd_interp_runner call
martinkilbinger May 25, 2022
487a09a
Added Tobias' MCCD plot config file to validate joint cat
martinkilbinger May 31, 2022
e3258e2
Added Tobias' MCCD plot config file to validate joint cat
martinkilbinger May 31, 2022
cab915b
removed duplicate config file
martinkilbinger Jun 8, 2022
98ed470
Random catalogue improvements (#570)
martinkilbinger Jun 8, 2022
96d10b1
Merge pull request #568 from martinkilbinger/mccd_int
tobias-liaudat Jun 9, 2022
22c10da
Merge pull request #569 from martinkilbinger/res_plots
tobias-liaudat Jun 9, 2022
d903709
Updated docs and references (#579)
sfarrens Jul 6, 2022
87974b2
Random runner updates (#573)
martinkilbinger Sep 8, 2022
aa602a1
added masking for NGC objects (#575)
martinkilbinger Sep 16, 2022
9ad1df7
update patch version
sfarrens Sep 16, 2022
9254baa
random runner: hp masks working; doc updated (#580)
martinkilbinger Oct 5, 2022
1254ce3
Bug fix(es) for v1.0.1 (#586)
martinkilbinger Oct 12, 2022
44deadf
Merge branch 'master' into develop
sfarrens Oct 12, 2022
a7979fc
fixed blank lines
sfarrens Oct 12, 2022
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 docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cd shapepipe

where `<VERSION>` is a
[tagged release](https://github.com/CosmoStat/shapepipe/releases) of ShapePipe
(e.g. `v1.0.0`). It is recommend to use the
(e.g. `v1.0.1`). It is recommend to use the
[latest release](https://github.com/CosmoStat/shapepipe/releases/latest)
unless you want to reproduce an older set of results.

Expand Down
9 changes: 9 additions & 0 deletions example/cfis/config_Rc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ N_RANDOM = 50000

# N_RANDOM is per square degrees if True
DENSITY = True

# Output healpix mask if True
SAVE_MASK_AS_HEALPIX = True

# Healpix mask file base name (used if SAVE_MASK_AS_HEALPIX is True)
HEALPIX_OUT_FILE_BASE = mask_hp

# Healpix mask nside (used if SAVE_MASK_AS_HEALPIX is True)
HEALPIX_OUT_NSIDE = 1024
2 changes: 1 addition & 1 deletion example/cfis/config_make_cat_mccd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ FILE_EXT = .fits, .fits, .sqlite, .fits
NUMBERING_SCHEME = -000-000

SM_DO_CLASSIFICATION = True
SM_STAR_STRESH = 0.003
SM_STAR_THRESH = 0.003
SM_GAL_THRESH = 0.01

SHAPE_MEASUREMENT_TYPE = ngmix
Expand Down
4 changes: 2 additions & 2 deletions example/cfis/config_tile_MiViSmVi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ME_LOG_WCS = $SP_RUN/output/log_exp_headers.sqlite

[VIGNETMAKER_RUNNER_RUN_1]

# Create vignets for tiles weights
# Create vignets for tile weights

INPUT_DIR = last:sextractor_runner_run_1, last:uncompress_fits_runner

Expand Down Expand Up @@ -177,5 +177,5 @@ PREFIX =
# Additional parameters for path and file pattern corresponding to single-exposure
# run outputs
ME_IMAGE_DIR = split_exp_runner, split_exp_runner, split_exp_runner, sextractor_runner_run_2
ME_IMAGE_PATTERN = flag, image, weight, sexcat_background
ME_IMAGE_PATTERN = flag, image, weight, background
ME_LOG_WCS = $SP_RUN/output/log_exp_headers.sqlite
10 changes: 8 additions & 2 deletions shapepipe/modules/mask_package/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def make_mask(self):
self._config[_type]['cat_path'],
size_plus=self._config[_type]['size_plus'],
flag_value=self._config[_type]['flag'],
typ=_type,
obj_type=_type,
)

if not self._err:
Expand Down Expand Up @@ -535,7 +535,13 @@ def mask_border(self, width=100, flag_value=4):

return flag

def mask_dso(self, cat_path, size_plus=0.1, flag_value=8, typ='Messier'):
def mask_dso(
self,
cat_path,
size_plus=0.1,
flag_value=8,
obj_type='Messier',
):
"""Mask DSO.

Create a circular patch for deep-sky objects (DSOs), e.g.
Expand Down
9 changes: 7 additions & 2 deletions shapepipe/modules/random_cat_package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
DENSITY : bool, optional
Option to interpret the number of random objects per square degree; the
default is ``False``
TILE_LIST : str, optional
Path to tile IDs for overlap flagging
SAVE_MASK_AS_HEALPIX : bool
Output healpix mask if ``True``
HEALPIX_OUT_FILE_BASE : str, optional
Output halpix mask file base name; used only if SAVE_MASK_AS_HEALPIX is
``True``
HEALPIX_OUT_NSIDE : int, optional
Output healpix mask nside; used only if SAVE_MASK_AS_HEALPIX is ``True``

"""

Expand Down
32 changes: 18 additions & 14 deletions shapepipe/modules/random_cat_package/random_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,38 +72,42 @@ def __init__(
self._w_log = w_log
self._healpix_options = healpix_options

def save_as_healpix(self, hdu_mask, header):
def save_as_healpix(self, mask, header):
"""Save As Healpix.

Save mask as healpix FITS file.

Parameters
----------
hdu_mask : class HDUList
HDU with 2D pixel mask image
mask : numpy.ndarray
2D pixel mask image

header : class Header
Image header with WCS information

"""
if not self._healpix_options:
return

# Tranform config entry from str to int
nside = int(self._healpix_options['NSIDE'])

mask_1d, footprint = reproject_to_healpix(
(hdu_mask, header),
(mask, header),
'galactic',
nside=self._healpix_options['OUT_NSIDE']
nside=nside,
)

t = Table()
t['flux'] = mask_1d
t.meta['ORDERING'] = 'RING'
t.meta['COORDSYS'] = 'G'
t.meta['NSIDE'] = self._healpix_options['OUT_NSIDE']
t.meta['NSIDE'] = nside
t.meta['INDXSCHM'] = 'IMPLICIT'

output_path = (
f'{output_dir}/{self._healpix_options["FILE_BASE"]}-'
+ f'{file_number_string}.fits'
f'{self._output_dir}/{self._healpix_options["FILE_BASE"]}-'
+ f'{self._file_number_string}.fits'
)
t.write(output_path)

Expand Down Expand Up @@ -135,15 +139,15 @@ def process(self):
mask = hdu_mask[0].data

# Save mask in healpix format (if option is set)
self._save_as_healpix(hdu_mask, header)
self.save_as_healpix(mask, header)

# Number of pixels
n_pix_x = mask.data.shape[0]
n_pix_y = mask.data.shape[1]
n_pix = n_pix_x * n_pix_y

# Number of non-masked pixels
n_unmasked = len(np.where(hdu_mask[0].data == 0)[0])
n_unmasked = len(np.where(mask == 0)[0])

# Compute various areas

Expand Down Expand Up @@ -209,10 +213,10 @@ def process(self):

# Tile ID
output_path = (
f'{output_dir}/{output_file_pattern}-'
+ f'{file_number_string}.fits'
f'{self._output_dir}/{self._output_file_pattern}-'
+ f'{self._file_number_string}.fits'
)
file_name = os.path.split(self._output_path)[1]
file_name = os.path.split(output_path)[1]
file_base = os.path.splitext(file_name)[0]
tile_ID_str = re.split('-', file_base)[1:]
tile_id = float('.'.join(tile_ID_str))
Expand All @@ -230,7 +234,7 @@ def process(self):

# TODO: Add units to header
output = file_io.FITSCatalogue(
self._output_path,
output_path,
open_mode=file_io.BaseCatalogue.OpenMode.ReadWrite
)
output.save_as_fits(cat_out, names=column_names)
Expand Down
2 changes: 1 addition & 1 deletion shapepipe/modules/random_cat_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def random_cat_runner(
)
if save_mask_as_healpix:
healpix_options = {}
for option_trunc in ['FILE_BASE', 'OUT_NSIDE']:
for option_trunc in ['FILE_BASE', 'NSIDE']:
option = f'HEALPIX_OUT_{option_trunc}'
healpix_options[option_trunc] = config.get(
module_config_sec,
Expand Down