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

DM-22655: Genericize gen2to3.py to be useable with any gen2 repo #202

Merged
merged 16 commits into from Mar 11, 2020

Conversation

parejkoj
Copy link
Collaborator

No description provided.

@parejkoj parejkoj force-pushed the tickets/DM-22655 branch 4 times, most recently from 25118e6 to 55b5e80 Compare February 27, 2020 23:13
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Convert a gen2 butler repo to gen 3. See
`lsst.obs.base.ConvertRepoConfig` for most of the config options.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick note. Please use the new scheme for writing scripts when you create new ones. We now have minimalist scripts in bin.src and place the argument parsing and main in the module itself. Please see https://community.lsst.org/t/new-tools-for-documenting-ad-hoc-scripts-in-the-lsst-science-pipelines/3784

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but unfortunately I have lots of comments and questions. Please also follow up on moving the code in bin.src into the module following current practice.

bin.src/convert_gen2_repo_to_gen3.py Outdated Show resolved Hide resolved
bin.src/convert_gen2_repo_to_gen3.py Outdated Show resolved Hide resolved
bin.src/convert_gen2_repo_to_gen3.py Outdated Show resolved Hide resolved
bin.src/convert_gen2_repo_to_gen3.py Outdated Show resolved Hide resolved
bin.src/convert_gen2_repo_to_gen3.py Outdated Show resolved Hide resolved
python/lsst/obs/base/gen2to3/rootRepoConverter.py Outdated Show resolved Hide resolved
python/lsst/obs/base/gen2to3/translators.py Show resolved Hide resolved
python/lsst/obs/base/gen2to3/translators.py Outdated Show resolved Hide resolved
This script is based of one built by Jim Bosch for ci_hsc.

Add bin/ to .gitignore
Better error messages on failed skymaps.
Pull out skymap dict population so we can reuse it.
DECam raw and Community Pipeline calibs are stored in multi-extension
FITS files, which we handle by stripping 'ccdnum' from the gen2
template and then scanning the file for what HDUs it contains.

* Strip off `[HDU]` from filenames
* Change Builders, Handlers, and expandDataIds to support multi-HDU FITS.
* In expandDataIds, strip the items we can't get the full dataId for (e.g. not in
the gen2 calibRegistry) and prevent repeating FileDatasets.
In the default configuration, `isDatasetTypeIncluded` returns True for
any input, but we can't do `os.listdir` on a nonexistent directory, so
we also have to check that any refcats are configured to convert.
Some templates were magically expanded in the gen2 mapper: we need to
support converting those here, without duplicating walker entries.
Gen2 was inconsistent in its use of filter names in calibReigstries, so we need
multiple ways of managing that conversion.
htm.depth=7 is what we've settled on for all our refcats, not just
ci_hsc.
@parejkoj parejkoj merged commit 940be9f into master Mar 11, 2020
@timj timj deleted the tickets/DM-22655 branch August 17, 2020 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants