desihub / tutorials

DESI tutorials
BSD 3-Clause "New" or "Revised" License
43 stars 17 forks source link

FiberAssignDECaLS tutorial is not running #32

Closed andluizsouza closed 5 years ago

andluizsouza commented 5 years ago

Hi people.

I am facing some problems in running the FiberAssignDECaLS tutorial at NERSC Jupyter on the DESI master kernel.

Firstly, in cell 13 that compute MTL, there is no definition to obscond into the desitarget.mtl.make_mtl function. Should obscond be 'DARK', 'GRAY', or 'DARK|GRAY'?

Another problem is, in fact, to run fiberassign in cell 15:

fiberassign --overwrite --mtl mtl.fits --stdstar std.fits --sky sky.fits --footprint ./tiles.fits --outdir ./output/

There is no error or log message. I can not reproduce those results in the tutorial. Could anyone please help me?

Thanks a lot!

sbailey commented 5 years ago

@andluizsouza thanks for reporting this. @forero could you help with getting this tutorial working again? Thanks.

forero commented 5 years ago

@sbailey sure

forero commented 5 years ago

@andluizsouza I have updated the notebook in the branch 19.9: https://github.com/desihub/tutorials/blob/19.9/FiberAssignDECaLS.ipynb It works for me using the DESI master kernel.

forero commented 5 years ago

@andluizsouza Did you succeed in running the new notebook?

andluizsouza commented 5 years ago

@forero I can not run this notebook. There is a similar problem to that from the previous version running the fiberassign:

fiberassign --overwrite --mtl mtl.fits --sky sky.fits --footprint ./tiles.fits --outdir ./output/


AssertionError Traceback (most recent call last)

in 2 err = subprocess.call(cmd.split()) 3 print(err) ----> 4 assert err == 0 AssertionError:
forero commented 5 years ago

@andluizsouza you should be able to run fiberassign --overwrite --mtl mtl.fits --sky sky.fits --footprint ./tiles.fits --outdir ./output/ from the command line inside the directory created by the notebook to store the data. Please do that and let me know what is the output.

andluizsouza commented 5 years ago

@forero, running directly from the command line, this is the output:

INFO: sciencemask LRG ELG QSO BAD_SKY BGS_ANY MWS_ANY SECONDARY_ANY INFO: stdmask STD_FAINT STD_WD STD_BRIGHT INFO: skymask SKY INFO: safemask BAD_SKY INFO: excludemask BRIGHT_OBJECT IN_BRIGHT_OBJECT INFO: Reading fiber positions from /global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/code/desimodel/0.9.10/data/focalplane/fiberpos-all.fits INFO: Target file mtl.fits has 297129 rows. Reading in chunks of 100000 INFO: Read target file mtl.fits: 0.59 seconds (1 calls) INFO: Target file sky.fits has 165849 rows. Reading in chunks of 100000 INFO: Read target file sky.fits: 0.22 seconds (1 calls)

Traceback (most recent call last): File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/code/fiberassign/1.0.0/bin/fba_run", line 4, in import('pkg_resources').run_script('fiberassign==1.0.0', 'fba_run') File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/conda/lib/python3.6/site-packages/pkg_resources/init.py", line 654, in run_script self.require(requires)[0].run_script(script_name, ns) File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/conda/lib/python3.6/site-packages/pkg_resources/init.py", line 1434, in run_script exec(code, namespace, namespace) File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/code/fiberassign/1.0.0/lib/python3.6/site-packages/fiberassign-1.0.0-py3.6-linux-x86_64.egg/EGG-INFO/scripts/fba_run", line 299, in main() File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/code/fiberassign/1.0.0/lib/python3.6/site-packages/fiberassign-1.0.0-py3.6-linux-x86_64.egg/EGG-INFO/scripts/fba_run", line 227, in main excludemask=args.excludemask) File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/code/fiberassign/1.0.0/lib/python3.6/site-packages/fiberassign-1.0.0-py3.6-linux-x86_64.egg/fiberassign/targets.py", line 262, in load_target_file fits = fitsio.FITS(tfile, mode="r") File "/global/common/software/desi/cori/desiconda/20180709-1.2.6-spec/conda/lib/python3.6/site-packages/fitsio/fitslib.py", line 351, in init raise IOError("File not found: '%s'" % filename) OSError: File not found: 'None'

forero commented 5 years ago

I see what is the problem. You are using an older version of the software.

Running which fiberassign should give you something like /global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/code/fiberassign/master/bin/fiberassign

Note the version 20190804-1.3.0-spec versus your 20180709-1.2.6-spec.

You should source source /project/projectdirs/desi/software/desi_environment.sh master to have the latest. Inside jupyterlab you should use the DESI master kernel to have the latest.

andluizsouza commented 5 years ago

Thanks, @forero! I was following the tutorial suggestions that say to do:

source /project/projectdirs/desi/software/desi_environment.sh 19.2 $DESIMODULES/install_jupyter_kernel.sh 19.2

Now I am using the DESI master kernel. But there is a new problem during the reading raw of fba.fits files.

INFO: Reading raw tile data ./output/fba-000543.fits multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/conda/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/conda/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/code/fiberassign/master/py/fiberassign/assign.py", line 963, in merge_results_tile tile_targets[nm][orw] = tgview[c][irw] ValueError: setting an array element with a sequence. """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/code/fiberassign/master/bin/fiberassign", line 168, in run_merge(merge_args) File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/code/fiberassign/master/py/fiberassign/scripts/merge.py", line 153, in run_merge copy_fba=(not args.skip_raw)) File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/code/fiberassign/master/py/fiberassign/assign.py", line 1341, in merge_results results = pool.map(merge_tile, tile_map_list) File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/conda/lib/python3.6/multiprocessing/pool.py", line 266, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/conda/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value ValueError: setting an array element with a sequence.

andluizsouza commented 5 years ago

@forero, any suggestion? Now I'm using the latest version: "/global/common/software/desi/cori/desiconda/20190804-1.3.0-spec/code/fiberassign/master/py/fiberassign/assign.py"

The error is in the merge_results_tile function: in merge_results_tile tile_targets[nm][orw] = tgview[c][irw] ValueError: setting an array element with a sequence.

forero commented 5 years ago

@andluizsouza Did you run everything again from scratch? The only way I see that you can have that problem is that you keep the files generated in the notebook with the old version of the code and now are trying to run with the new version.

andluizsouza commented 5 years ago

sorry, @forero. This is it! I removed all old outputs and did rerun the pipeline with the latest version desi environment master. Now it is ok, I can complete the running.

forero commented 5 years ago

good @andluizsouza I am going to close this issue now 👍