Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regrid clean mask cube to broader channel width fails #1570

Open
Fil8 opened this issue Feb 6, 2024 · 3 comments
Open

regrid clean mask cube to broader channel width fails #1570

Fil8 opened this issue Feb 6, 2024 · 3 comments

Comments

@Fil8
Copy link
Collaborator

Fil8 commented Feb 6, 2024

the line_worker fails when regridding the mask to clean the datacube.

The user may want to create a datacube with a different binsize than the original dataset (the input .ms file). When this happens, sofia creates a cleanmask with naxis3 of same size of the requested output datacube.

Then the pipeline crashes when checking the size of the cleanmask, right before cleaning.

# 2024-01-06 02:19:34: Running mProjectCube /stimela_mount/input/NGC3557_r10_t90_3kms_3kms_cleanmask_0_mask_01.fits /stimela_mount/output/NGC3557_r10_t90_3kms_3kms_cleanmask_
0_mask_comb_NGC3557_regrid.fits /stimela_mount/input/tmp.hdr
# [struct stat="OK", module="mProjectCube", time=5.0]
# INFO:    Converting SIF file to temporary sandbox...
# INFO:    Cleaning up image...
2024-01-06 02:19:40 CARACal.Stimela.reprojectMask-field0 INFO: job complete at 2024-01-06 02:19:40.344020 after 0:00:15.385101
2024-01-06 02:19:40 CARACal.Stimela.line__comb INFO: Saving pipeline information in .last_line__comb.json
2024-01-06 02:19:40 CARACal.Stimela.line__comb INFO: Recipe executed successfully
2024-01-06 02:19:40 CARACal INFO: Reprojecting mask NGC3557_r10_t90_3kms_3kms_cleanmask_0_mask_comb_NGC3557_regrid.fits to match the spectral axis of the cube.
2024-01-06 02:19:40 CARACal ERROR: Requested channels are not contained in mask NGC3557_r10_t90_3kms_3kms_cleanmask_0_mask_comb_NGC3557_regrid.fits. [OSError]
@Fil8
Copy link
Collaborator Author

Fil8 commented Feb 6, 2024

I suspect it is because in this case the pipeline enters in this loop, because it does not enter in any other ifs.

doSpec = None # likely will fail/produce incorrect result in the case that the ms file and mask were not created with the same original spectral grid.

@Fil8 Fil8 self-assigned this Feb 6, 2024
@Fil8
Copy link
Collaborator Author

Fil8 commented Feb 6, 2024

or maybe is because of this typo:

dpSpec = None # this should work in both a request for a subset, and if the cube is to be binned.

@Fil8
Copy link
Collaborator Author

Fil8 commented Jul 2, 2024

I also found out that the pipeline fails if a binned mask is given as input.

For example one can make cube_0 binning channels, run sofia to create a mask and then make cube_1. At this point line_worker.py fails because it counter checks the size of the mask against the size of the ms-file and product for binchans is forgotten at this line.

if np.round(cdelt,1) > np.round(chanwidth[0],1):

this is now solved in maskForn repo:

if np.round(cdelt) > np.round(chanwidth[0]*binchans,5):

The issue above still needs to be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants