[PIPE2D-1365] Make the current detectorMapQa.py workable Created: 31/Jan/24  Updated: 02/Feb/24

Status: Open
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: Kiyoto Yabe Assignee: Wilfred Gee
Resolution: Unresolved Votes: 0
Labels: EDR, EngRun, QualityAssurance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The current detectorMapQa.py does not work (Masayuki Tanaka can report the problem here), so please investigate the issue. Also, please make sure that the script provide all plots including 2D and 1D.



 Comments   
Comment by Masayuki Tanaka [ 31/Jan/24 ]

On the pfsa server, I setup the current pipeline (w.2023.30a). Following Yabe-kun's suggestion, I did

$ setup -jr /work/wtg/obs_pfs
$ setup -jr /work/wtg/drp_qa

Then I ran

detectorMapQa.py /work/drp/ --calib /work/drp/CALIB --rerun pfs/internal/edr2-20231203/ --id visit=92743 --clobber-versions

 This resulted in the following error:

$ detectorMapQa.py /work/drp/ --calib /work/drp/CALIB --rerun pfs/internal/edr2-20231203/ --id visit=92743 --clobber-versions
lsst.CameraMapper INFO: Loading exposure registry from /work/drp/registry.pgsql
lsst.CameraMapper INFO: Loading calib registry from /work/drp/CALIB/calibRegistry.sqlite3
lsst.CameraMapper INFO: Loading calib registry from /work/drp/CALIB/calibRegistry.sqlite3
root INFO: Running: /work/wtg/drp_qa/bin/detectorMapQa.py /work/drp/ --calib /work/drp/CALIB --rerun pfs/internal/edr2-20231203/ --id visit=92743 --clobber-versions
conda.core.prefix_data INFO: Package conda-forge/linux-64::psycopg-3.1.8-py38h838c7ec_0 has multiple python anchor files.
{{ Using lib/python3.8/site-packages/psycopg-3.1.8.dist-info/RECORD}}
detectorMapQa FATAL: Failed in task initialization: [Errno 1] Operation not permitted: '/work/drp/rerun/pfs/internal/edr2-20231203/config/packages.pickle~3'
Traceback (most recent call last):
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 377, in precall}}
{{ self._precallImpl(task, parsedCmd)}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 350, in _precallImpl}}
{{ task.writePackageVersions(parsedCmd.butler, clobber=parsedCmd.clobberVersions)}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 877, in writePackageVersions}}
{{ return butler.put(packages, dataset, doBackup=doBackup)}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/daf_persistence/g6a31054a6e+4ae6138134/python/lsst/daf/persistence/butler.py", line 1454, in put}}
{{ location.getRepository().backup(location.datasetType, dataId)}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/daf_persistence/g6a31054a6e+4ae6138134/python/lsst/daf/persistence/repository.py", line 271, in backup}}
{{ self._mapper.backup(*args, **kwargs)}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/obs_base/gc18b5ea8f9+af69d5793a/python/lsst/obs/base/cameraMapper.py", line 726, in backup}}
{{ self.rootStorage.copyFile(oldPath, "%s~%d" % (newPath, n))}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/daf_persistence/g6a31054a6e+4ae6138134/python/lsst/daf/persistence/posixStorage.py", line 365, in copyFile}}
{{ shutil.copy(os.path.join(self.root, fromLocation), os.path.join(self.root, toLocation))}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-3.0.0/lib/python3.8/shutil.py", line 419, in copy}}
{{ copymode(src, dst, follow_symlinks=follow_symlinks)}}
{{ File "/work/tanaka/pipe2d/26apr2023/stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-3.0.0/lib/python3.8/shutil.py", line 308, in copymode}}
{{ chmod_func(dst, stat.S_IMODE(st.st_mode))}}
PermissionError: [Errno 1] Operation not permitted: '/work/drp/rerun/pfs/internal/edr2-20231203/config/packages.pickle~3'

 

This pickle file is owned by Yabe-kun and it is entirely possible that I am doing something stupid. For your information,

$ eups list | grep setup
afw g31dc256b76+308b63831b current w_2022_17 setup
astro_metadata_translator g1ca0471399+c55107240f current w_2022_17 setup
astshim gb04e0da5b2+ce83317b7e current w_2022_17 setup
base gc57f72a14a+ce83317b7e current w_2022_17 setup
coadd_utils g169eefeba3+e480a1db32 current w_2022_17 setup
cp_pipe ge16c6bda5e+9234ee834c current w_2022_17 setup
cpputils g1ffd6c4751+50c04d9c73 current w_2022_17 setup
ctrl_mpexec gb02ad94e9c+e480a1db32 current w_2022_17 setup
ctrl_pool g6ea9deef35+e480a1db32 current w_2022_17 setup
daf_base gcc072456be+b6f9ac6643 current w_2022_17 setup
daf_butler gb7ebdee0ea+6728436f39 current w_2022_17 setup
daf_persistence g6a31054a6e+4ae6138134 current w_2022_17 setup
datamodel w.2023.30a current setup
dax_apdb g7e0c5f63d1+18023899f9 current w_2022_17 setup
drp_pfs_data w.2023.30-2-g9ad6703 current setup
drp_stella w.2023.30a current setup
dustmaps_cachedata g41a3ec361e+ce83317b7e current w_2022_17 setup
eigen g04a8d4365e current w_2022_17 setup
geom g491c310abf+35ead245fa current w_2022_17 setup
ip_diffim g4d7a404405+e7a229012f current w_2022_17 setup
ip_isr g8142d5ee96+96f555657d current w_2022_17 setup
kht g14ffe67dc2+c057cea34b current w_2022_17 setup
log gd27fc4addd+b6f9ac6643 current w_2022_17 setup
meas_algorithms gf36ae6ace1+1d7ae49801 current w_2022_17 setup
meas_astrom gaab3d2dbd9+96f555657d current w_2022_17 setup
meas_base g0129b61b94+2131942eb1 current w_2022_17 setup
meas_deblender gf9afb8a27f+3d65f423aa current w_2022_17 setup
meas_extensions_convolved ge96dbbe9aa+56b954ee52 current w_2022_17 setup
meas_extensions_gaap g8ae2c9d62c+51b14322dc current w_2022_17 setup
meas_extensions_photometryKron g235fec5482+96f555657d current w_2022_17 setup
meas_extensions_piff g4882acf283+96f555657d current w_2022_17 setup
meas_extensions_scarlet g746e97fe6b+efc4113c79 current w_2022_17 setup
meas_extensions_shapeHSM gfbfb15d729+96f555657d current w_2022_17 setup
meas_extensions_trailedSources gbacec6188e+a1e9a24ff9 current w_2022_17 setup
meas_modelfit g8cdf404ddd+53ad3d90d7 current w_2022_17 setup
obs_base gc18b5ea8f9+af69d5793a current w_2022_17 setup
obs_pfs LOCAL:/work/wtg/obs_pfs setup
obs_test g26fc4c0ca3+1efc28e7e0 current w_2022_17 setup
obs_test_data g86cffb07a8 current w_2022_17 setup
pex_config g9aff22451c+c55107240f current w_2022_17 setup
pex_exceptions g958458c828+fc3c6d1a77 current w_2022_17 setup
pfs_pipe2d w.2023.30a current setup
pfs_qa LOCAL:/work/wtg/drp_qa setup
pfs_utils w.2023.30a current setup
pipe_base g590c34a36e+5da9528084 current w_2022_17 setup
pipe_drivers gef6abdcebb+582a64c339 current w_2022_17 setup
pipe_tasks gb1d6de0934+6a8639994f current w_2022_17 setup
proxmin g33b4157f25 current w_2022_17 setup
resources gf1bf1f77a0+b6f9ac6643 current w_2022_17 setup
scarlet g6315d299d3+4083830bf8 current w_2022_17 setup
scarlet_extensions g9d18589735+0af1cd992e current w_2022_17 setup
sconsUtils g26c60a276e current w_2022_17 setup
shapelet gd79a88f3f0+ec8e2bba64 current w_2022_17 setup
skymap g602c5592b1+bd95241bbd current w_2022_17 setup
sphgeom g0f31348038+ce83317b7e current w_2022_17 setup
utils g62e1f4f43a+9633a190c8 current w_2022_17 setup
verify ga2309f1883+eca4149912 current w_2022_17 setup
verify_metrics g4cd34326d0+ce83317b7e current w_2022_17 setup

 

Comment by price [ 01/Feb/24 ]

I don't see a problem with packages.pickle~3, but maybe you dealt with that problem. I do see a problem with packages.pickle:

-rw-r--r-- 1 tanaka   pfs 17231 Jan 29 19:40 packages.pickle

This file is missing a group write permission. I think both Masayuki Tanaka and Kiyoto Yabe need to check that they have umask 2 set in their shell startup scripts.

Comment by price [ 01/Feb/24 ]

BTW, your use of --clobber-versions is triggering this problem. If you used --no-versions, you wouldn't see it, and that's probably what you want anyway when you're working on a shared rerun.

Comment by Kiyoto Yabe [ 02/Feb/24 ]

Now I see an error like this:

(lsst-scipipe-3.0.0) detectorMapQa.py /work/drp/ --calib /work/drp/CALIB --rerun pfs/internal/edr2-20231203/ --id visit=92743 --no-versions
lsst.CameraMapper INFO: Loading exposure registry from /work/drp/registry.pgsql
lsst.CameraMapper INFO: Loading calib registry from /work/drp/CALIB/calibRegistry.sqlite3
lsst.CameraMapper INFO: Loading calib registry from /work/drp/CALIB/calibRegistry.sqlite3
root INFO: Running: /work/wtg/drp_qa/bin/detectorMapQa.py /work/drp/ --calib /work/drp/CALIB --rerun pfs/internal/edr2-20231203/ --id visit=92743 --no-versions
Traceback (most recent call last):
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 436, in __call__
    result = self.runTask(task, dataRef, kwargs)
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 504, in runTask
    return task.runDataRef(dataRef, **kwargs)
  File "/work/wtg/drp_qa/python/pfs/qa/detectorMapQa.py", line 704, in runDataRef
    return self.run(detectorMapList, arcLinesList, pfsArmList)
  File "/work/wtg/drp_qa/python/pfs/qa/detectorMapQa.py", line 731, in run
    self.plotResidual.run(dd, aa, pp)
  File "/work/wtg/drp_qa/python/pfs/qa/detectorMapQa.py", line 84, in run
    arc_data = stability.getArclineData(arcLines, statusTypes=list(), dropNa=True, dropColumns=['xx', 'yy', 'xy'])
AttributeError: module 'pfs.qa.utils.stability' has no attribute 'getArclineData'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/wtg/drp_qa/bin/detectorMapQa.py", line 4, in <module>
    DetectorMapQaTask.parseAndRun()
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 688, in parseAndRun
    resultList = taskRunner.run(parsedCmd)
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 244, in run
    resultList = list(mapFunc(self, targetList))
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 450, in __call__
    ", ".join(str(ref.dataId) for ref in dataRef),
  File "/work/stack_INFRA-312/stack/miniconda3-py38_4.9.2-3.0.0/Linux64/pipe_base/g590c34a36e+5da9528084/python/lsst/pipe/base/cmdLineTask.py", line 450, in <genexpr>
    ", ".join(str(ref.dataId) for ref in dataRef),
AttributeError: 'list' object has no attribute 'dataId'

This is purely a problem of detectorMapQa.py.

Comment by Masayuki Tanaka [ 02/Feb/24 ]

Yes, I saw the same problem. price , just for my own education, what is the difference between --clobber-versions and --no-versions?

Comment by Wilfred Gee [ 02/Feb/24 ]

Thanks for trying this. Kiyoto Yabe I'll look into that error and get fixed. I think it's just pointing in some wrong places so hopefully an easy fix.

Comment by price [ 02/Feb/24 ]

--clobber-versions removes the existing file that records the versions and writes a new one. --no-versions doesn't do any version checking or recording. In general, you should not use either during production. If the stack has upgraded during a production, you could use --clobber-versions to record that. --no-versions is for development.

Generated at Sat Feb 10 16:06:39 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.