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

Breizorro: Problem in writing outfile #786

Open
rramij opened this issue Aug 14, 2023 · 3 comments
Open

Breizorro: Problem in writing outfile #786

rramij opened this issue Aug 14, 2023 · 3 comments

Comments

@rramij
Copy link

rramij commented Aug 14, 2023

I am trying to make mask with breizorro.

# Make mask using breizorro
recipe.add("cab/breizorro", "test_mask", {
	"restored-image": "initial_image-MFS-image.fits",
	"threshold": 6.5,
	"boxsize": 50,
	"number-islands": True,
	"make-binary": True,
	"fill-holes": True,
	"outfile": "Test_breizorro_mask.fits"
	}, input=OUTPUT, output=OUTPUT, label="test mask")

But it is showing error at the time of writing the output file.

breizorro.breizorro - 2023-08-14 18:46:39,691 INFO - Welcome to breizorro
breizorro.breizorro - 2023-08-14 18:46:39,768 INFO - Version: 0.1.0
breizorro.breizorro - 2023-08-14 18:46:39,768 INFO - Usage: breizorro --help
breizorro.breizorro - 2023-08-14 18:46:39,769 INFO - Reading /stimela_mount/input/initial_image-MFS-image.fits data
breizorro.breizorro - 2023-08-14 18:46:39,871 INFO - Generating mask using threshold 6.5
breizorro.breizorro - 2023-08-14 18:46:39,871 INFO - Generating noise map
breizorro.breizorro - 2023-08-14 18:46:48,264 INFO - Median noise value is 1.8788927263813093e-05
breizorro.breizorro - 2023-08-14 18:46:48,423 INFO - (Re)numbering islands
breizorro.breizorro - 2023-08-14 18:46:48,779 INFO - Number of islands: 372
breizorro.breizorro - 2023-08-14 18:46:48,779 INFO - Converting mask to binary
breizorro.breizorro - 2023-08-14 18:46:48,820 INFO - Filling closed regions
Traceback (most recent call last):
  File "/usr/local/bin/breizorro", line 5, in <module>
    main()
  File "/usr/local/lib/python3.6/dist-packages/breizorro/breizorro.py", line 355, in main
    shutil.copyfile(input_file, out_mask_fits)  # to provide a template
  File "/usr/lib/python3.6/shutil.py", line 122, in copyfile
    copyfileobj(fsrc, fdst)
  File "/usr/lib/python3.6/shutil.py", line 82, in copyfileobj
    fdst.write(buf)
OSError: [Errno 28] No space left on device
Traceback (most recent call last):
  File "/stimela_mount/code/run.py", line 39, in <module>
    subprocess.check_call(shlex.split(_runc))
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['breizorro', '--restored-image', '/stimela_mount/input/initial_image-MFS-image.fits', '--threshold', '6.5', '--boxsize', '50', '--number-islands', '--make-binary', '--fill-holes', '--outfile', 'Test_breizorro_mask.fits']' returned non-zero exit status 1.

However, there is no lack of space in the disk.

### THESE ARE YOUR DISK QUOTA USAGES
     Filesystem   space   quota   limit   grace   files   quota   limit   grace
          /home   8104G  10189G  10189G            350k       0       0        
###

Furthermore, if I comment out the "outfile" parameter.

 # Make mask using breizorro
recipe.add("cab/breizorro", "test_mask", {
	"restored-image": "initial_image-MFS-image.fits",
	"threshold": 6.5,
	"boxsize": 50,
	"number-islands": True,
	"make-binary": True,
	"fill-holes": True,
#	"outfile": "Test_breizorro_mask.fits"
	}, input=OUTPUT, output=OUTPUT, label="test mask")

The error changes to

breizorro.breizorro - 2023-08-14 18:54:50,816 INFO - Welcome to breizorro
breizorro.breizorro - 2023-08-14 18:54:50,892 INFO - Version: 0.1.0
breizorro.breizorro - 2023-08-14 18:54:50,892 INFO - Usage: breizorro --help
breizorro.breizorro - 2023-08-14 18:54:50,893 INFO - Reading /stimela_mount/input/initial_image-MFS-image.fits data
breizorro.breizorro - 2023-08-14 18:54:50,994 INFO - Generating mask using threshold 6.5
breizorro.breizorro - 2023-08-14 18:54:50,994 INFO - Generating noise map
breizorro.breizorro - 2023-08-14 18:54:58,019 INFO - Median noise value is 1.8788927263813093e-05
breizorro.breizorro - 2023-08-14 18:54:58,181 INFO - (Re)numbering islands
breizorro.breizorro - 2023-08-14 18:54:58,537 INFO - Number of islands: 372
breizorro.breizorro - 2023-08-14 18:54:58,537 INFO - Converting mask to binary
breizorro.breizorro - 2023-08-14 18:54:58,580 INFO - Filling closed regions
Traceback (most recent call last):
  File "/usr/local/bin/breizorro", line 5, in <module>
    main()
  File "/usr/local/lib/python3.6/dist-packages/breizorro/breizorro.py", line 355, in main
    shutil.copyfile(input_file, out_mask_fits)  # to provide a template
  File "/usr/lib/python3.6/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
OSError: [Errno 30] Read-only file system: '/stimela_mount/input/initial_image-MFS-image.mask.fits'
Traceback (most recent call last):
  File "/stimela_mount/code/run.py", line 39, in <module>
    subprocess.check_call(shlex.split(_runc))
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['breizorro', '--restored-image', '/stimela_mount/input/initial_image-MFS-image.fits', '--threshold', '6.5', '--boxsize', '50', '--number-islands', '--make-binary', '--fill-holes']' returned non-zero exit status 1.
cd /home/rramij/Work_Dir/A85_700MHz/GWB/GMRT_DI_pipe_run/Useful/selfcal/2run/.stimela_workdir-1692032083524032 && singularity run --workdir /home/rramij/Work_Dir/A85_700MHz/GWB/GMRT_DI_pipe_run/Useful/selfcal/2run/.stimela_workdir-1692032083524032 --containall returns error code 1

Please help me resolve the error.

@o-smirnov
Copy link
Collaborator

Is there a reason you're using Stimela classic and not stimela2? https://github.com/caracal-pipeline/stimela

@rramij
Copy link
Author

rramij commented Aug 15, 2023

I am shifting to stimela2 and familiarising myself with the syntax and notations. In the meantime, I was trying to add Breizorro cab to my already working stimela1 selfcal pipeline and test out the results.
I guess, I should re-script the pipeline to stimela2 and run to see if I get any errors.

@Athanaseus
Copy link
Member

Sorry about this issue @rramij.
It should be fixed (via #779) in the latest release of the stimela-classic or >=v1.7.7.

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

No branches or pull requests

3 participants