### Navigate to Example Repository Directory Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/uber-cal.rst Start your shell session in the top directory of the example git repository. This sets up the environment for subsequent commands. ```bash cd $RC2_SUBSET_DIR ``` -------------------------------- ### Setup Top-Level Package Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/setup.rst After loading the environment, use the 'setup' command followed by a top-level package name to configure it for use. Examples include 'lsst_apps' or 'lsst_distrib'. ```bash setup ``` -------------------------------- ### Install and Setup lsst_apps Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/top-level-packages.rst Installs the lsst_apps package, providing core frameworks and algorithmic code. This is a more space-efficient option. ```bash eups distrib install lsst_apps -t setup lsst_apps ``` -------------------------------- ### Setup Science Pipelines Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Set up the installed Science Pipelines environment using the 'setup' command. This makes the packages available in the current shell session. ```bash setup lsst_distrib ``` -------------------------------- ### Install and Setup lsst_distrib Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/top-level-packages.rst Installs the lsst_distrib package, which includes core Science Pipelines functionality, measurement algorithms, and cluster execution middleware. Use this for a comprehensive installation. ```bash eups distrib install lsst_distrib -t setup lsst_distrib ``` -------------------------------- ### Create and navigate to installation directory Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstinstall.rst Create a directory for the LSST Science Pipelines installation and change into it. ```bash mkdir -p lsst_stack cd lsst_stack ``` -------------------------------- ### Run LSST Science Pipelines Docker Image Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/docker.rst Downloads a current version of the LSST Science Pipelines Docker image, starts a container, and opens a prompt. This is a quick way to get started with the LSST environment. ```bash docker run -ti lsstsqre/centos:7-stack-lsst_distrib-{{ release_eups_tag }} ``` -------------------------------- ### Verify LSST Distribution Setup Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/data-setup.rst Run this command to ensure the LSST distribution environment is correctly set up. It should output a line containing the word 'setup'. ```bash eups list lsst_distrib ``` -------------------------------- ### List All Installed Packages Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/setup.rst Execute 'eups list' to view all packages that are installed in your environment, regardless of whether they are currently set up. ```bash eups list ``` -------------------------------- ### Setup and Run Demo Script Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/demo.rst Set up the processing package for the current directory and execute the demo script. This will process sample data and create a Butler repository. ```bash setup -r . ./bin/run_demo.sh ``` -------------------------------- ### Install git on Debian/Ubuntu Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/prereqs.rst Installs the 'git' version control system on Debian/Ubuntu systems using apt-get. This is recommended for users following the lsstsw instructions. ```bash sudo apt-get update && sudo apt-get install git ``` -------------------------------- ### Install git on AlmaLinux 9 Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/prereqs.rst Installs the 'git' version control system on AlmaLinux 9 systems using dnf. This is recommended for users following the lsstsw instructions. ```bash sudo dnf install git ``` -------------------------------- ### Install xpa-tools on Debian/Ubuntu Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/prereqs.rst Installs 'xpa-tools' on Debian/Ubuntu systems to potentially resolve xpa-related errors when displaying images in DS9. ```bash sudo apt install xpa-tools; xpans ``` -------------------------------- ### Install LSST Science Pipelines packages Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstinstall.rst Install the lsst_distrib EUPS package using the same release tag used for lsstinstall, and then set it up. ```bash eups distrib install -t {{ release_eups_tag }} lsst_distrib setup lsst_distrib ``` -------------------------------- ### Example mask plane colors Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst This is an example output showing the colors assigned to different mask planes. It is for reference and does not execute code. ```text BAD: red CR: magenta CROSSTALK: None DETECTED: blue DETECTED_NEGATIVE: cyan EDGE: yellow INTRP: green NOT_DEBLENDED: None NO_DATA: orange SAT: green SUSPECT: yellow UNMASKEDNAN: None ``` -------------------------------- ### Switch to Released LSST Science Pipelines Package Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/package-development.rst Use this command to revert from a development package setup to the installed LSST Science Pipelines distribution. 'current' is the default tag for the installed software stack. ```bash setup -j -t current ``` -------------------------------- ### Build Science Pipelines Packages Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Build the 'lsst_distrib' package using the 'rebuild' command with the 'current' tag. This command automatically marks installed packages for easy setup. ```bash rebuild -t current lsst_distrib ``` -------------------------------- ### Check Git LFS Installation Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/git-lfs.rst Verify if Git LFS is installed on your system. This command is useful for initial setup or troubleshooting. ```bash git-lfs version ``` -------------------------------- ### Setup Sample Data Package Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/data-setup.rst After cloning the `rc2_subset` repository, set up the package to add it to the EUPS stack. The '-j' flag ensures only this package is set up without affecting others. ```bash setup -j -r rc2_subset ``` -------------------------------- ### Install patch on AlmaLinux 9 Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/prereqs.rst Installs the 'patch' utility on AlmaLinux 9 systems using dnf. ```bash sudo dnf install patch ``` -------------------------------- ### lsstinstall Argument Reference Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstinstall.rst Displays the usage and available options for the `lsstinstall` command-line tool. Use this to understand how to specify tags, environments, and other installation parameters. ```text usage: lsstinstall [-n] [-T EUPS_TAG | -X EUPS_TAG | -v RUBINENV_VERSION] [-e ENV_NAME] [-u] [-d] [-p CONDA_PATH] [-P] [-C CHANNEL] [-E EUPS_URL] [-B] [-S] [-h] .. option:: -n No-op. Echo commands instead of running. .. option:: -T Select the rubin-env version used to build the given EUPS_TAG. .. option:: -X Select the exact environment used to build the given EUPS_TAG. .. option:: -v Select a particular rubin-env version (default=latest). .. option:: -e ``` -------------------------------- ### Install Xcode Command Line Tools on macOS Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/prereqs.rst Installs the Xcode Command Line Tools on macOS systems. This is a prerequisite for certain development tasks. ```bash xcode-select --install ``` -------------------------------- ### Get Display Instance with Firefly Backend Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Explicitly get a display instance configured to use the Firefly viewer backend. ```python display = afwDisplay.getDisplay(backend='firefly') ``` -------------------------------- ### Setup and Build LSST Package in Container Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/docker.rst Navigates to the cloned package directory within the container, sets up the package for development (without EUPS tagging), and builds it using scons. ```bash cd mnt/pipe_tasks setup -r . scons -Q -j 6 opt=3 ``` -------------------------------- ### Install Git LFS (Read-Only Access) Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/git-lfs.rst Initialize Git LFS for read-only access after installing the binaries. This command must be run on each machine where LFS-stored artifacts will be accessed. ```bash git-lfs install ``` -------------------------------- ### Load LSST Environment in Docker Container Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/docker.rst Loads the LSST environment and activates the 'lsst_distrib' package within a running Docker container. This is equivalent to the setup instructions for a source-based installation. ```bash source /opt/lsst/software/stack/loadLSST.bash setup lsst_distrib ``` -------------------------------- ### Example Dataset Table Output Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst This is an example of the output from a dataset table, showing various metrics for different datasets. It is used to illustrate the state of quanta during processing. ```sh Dataset Visible Shadowed Predicted Only Unsuccessful Cursed TOTAL EXPECTED -------------------------------------------- ------- -------- -------------- ------------ ------ ----- -------- deepCoadd_directWarp 6384 0 457 0 0 6841 6841 deepCoadd_psfMatchedWarp 6369 0 472 0 0 6841 6841 makeWarp_metadata 6841 0 0 0 0 6841 6841 makeWarp_log 6841 0 0 0 0 6841 6841 deepCoaddVisits 294 0 0 0 0 294 294 selectDeepCoaddVisits_metadata 294 0 0 0 0 294 294 selectDeepCoaddVisits_log 294 0 0 0 0 294 294 goodSeeingVisits 294 0 0 0 0 294 294 selectGoodSeeingVisits_metadata 294 0 0 0 0 294 294 selectGoodSeeingVisits_log 294 0 0 0 0 294 294 goodSeeingCoadd 288 0 0 6 0 294 294 goodSeeingCoadd_nImage 288 0 0 6 0 294 294 templateGen_metadata 288 0 0 6 0 294 294 templateGen_log 288 0 0 6 0 294 294 ``` -------------------------------- ### Get the Default Display Instance Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Obtain an instance of the display framework. By default, it uses the DS9 backend. ```python display = afwDisplay.getDisplay() ``` -------------------------------- ### Download and Extract Demo Project (Main Branch) Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/demo.rst Download the latest version of the demo project from the main branch using curl and extract it. This is recommended for users with newer installations. ```bash curl -L https://github.com/lsst/pipelines_check/archive/main.tar.gz | tar xvzf - cd pipelines_check-main ``` -------------------------------- ### LSSTSW Deploy Command Usage Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Displays the help message for the 'deploy.sh' script, which automates LSST development environment setup. ```text usage: deploy.sh [-2|-3] [-b] [-h] ``` -------------------------------- ### Install curl and patch on Debian/Ubuntu Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/prereqs.rst Installs 'curl' and 'patch' utilities on Debian/Ubuntu systems using apt-get. This command first updates the package list. ```bash sudo apt-get update && sudo apt-get install curl patch ``` -------------------------------- ### Example LSST Docker Image Tag Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/docker.rst An example of a specific LSST Science Pipelines Docker image tag, corresponding to CentOS 7, lsst_distrib, and a particular EUPS tag. ```text 7-stack-lsst_distrib-{{ release_eups_tag }} ``` -------------------------------- ### Query Datasets with Multiple Collections (CLI) Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Demonstrates how to query for a specific dataset type across multiple collections using the butler command-line tool. This example shows the raw output before duplicate removal. ```sh $ butler query-datasets /repo/main calexp \ --collections HSC/runs/RC2/w_2021_06/DM-28654 \ --collections HSC/runs/RC2/w_2021_02/DM-28282 \ --where "instrument='HSC' AND visit=1228 AND detector=40" ``` -------------------------------- ### Verify RC2_SUBSET_DIR Environment Variable Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/data-setup.rst Check that the `$RC2_SUBSET_DIR` environment variable correctly points to the path of the `rc2_subset` directory after setup. ```bash echo $RC2_SUBSET_DIR ``` -------------------------------- ### Alternative: Get PhotoCalib from deepCoadd_calexp Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/multiband-analysis.rst Demonstrates an alternative method to obtain the 'lsst.afw.image.PhotoCalib' object by first retrieving the 'deepCoadd_calexp' dataset and then calling its 'getPhotoCalib()' method. ```python rCoaddCalexp = butler.get('deepCoadd_calexp', band='r', tract=9813, patch=41) rCoaddPhotoCalib = rCoaddCalexp.getPhotoCalib() ``` -------------------------------- ### Example Data ID Output Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Illustrates the format of data IDs returned when querying for 'calexp' datasets with the 'HSC-R' physical filter. ```text {band: 'r', instrument: 'HSC', detector: 41, physical_filter: 'HSC-R', visit_system: 0, visit: 23718} {band: 'r', instrument: 'HSC', detector: 42, physical_filter: 'HSC-R', visit_system: 0, visit: 23718} {band: 'r', instrument: 'HSC', detector: 47, physical_filter: 'HSC-R', visit_system: 0, visit: 23718} {band: 'r', instrument: 'HSC', detector: 49, physical_filter: 'HSC-R', visit_system: 0, visit: 23718} {band: 'r', instrument: 'HSC', detector: 50, physical_filter: 'HSC-R', visit_system: 0, visit: 23718} {band: 'r', instrument: 'HSC', detector: 58, physical_filter: 'HSC-R', visit_system: 0, visit: 23718} {band: 'r', instrument: 'HSC', detector: 41, physical_filter: 'HSC-R', visit_system: 0, visit: 1214} {band: 'r', instrument: 'HSC', detector: 42, physical_filter: 'HSC-R', visit_system: 0, visit: 1214} ``` -------------------------------- ### Clone Sample Data Repository Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/data-setup.rst Clone the `rc2_subset` package, which contains sample Hyper Suprime-Cam (HSC) exposure data for the tutorial. Ensure Git LFS is installed and configured for LSST. ```bash git clone -b {{ release_eups_tag }} https://github.com/lsst/rc2_subset ``` -------------------------------- ### Pipetask Report Quanta Table Example Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst This table displays the status of task quanta for a specific reprocessing run. It shows counts for Unknown, Successful, Blocked, Failed, and Wonky states for each task. ```sh Task Unknown Successful Blocked Failed Wonky TOTAL EXPECTED ---------------------- ------- ---------- ------- ------ ----- ----- -------- makeWarp 0 6596 0 0 0 6596 6596 selectDeepCoaddVisits 0 294 0 0 0 294 294 selectGoodSeeingVisits 0 294 0 0 0 294 294 templateGen 0 288 0 6 0 294 294 assembleCoadd 0 280 0 14 0 294 294 detection 0 280 14 0 0 294 294 healSparsePropertyMaps 0 1 5 0 0 6 6 mergeDetections 0 36 13 0 0 49 49 deblend 0 36 13 0 0 49 49 measure 0 216 78 0 0 294 294 mergeMeasurements 0 36 13 0 0 49 49 forcedPhotCoadd 0 216 78 0 0 294 294 writeObjectTable 0 36 13 0 0 49 49 transformObjectTable 0 36 13 0 0 49 49 consolidateObjectTable 0 0 1 0 0 1 1 matchObjectToTruth 0 0 1 0 0 1 1 compareObjectToTruth 0 0 1 0 0 1 1 ``` -------------------------------- ### Run LSST Docker Container Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/docker.rst Starts an LSST Science Pipelines Docker container in detached mode, mounting the current working directory. The container is named 'lsst'. ```bash docker run -itd -v `pwd`:/home/lsst/mnt --name lsst lsstsqre/centos:7-stack-lsst_distrib-{{ release_eups_tag }} ``` -------------------------------- ### Create and Navigate to Demo Directory Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/demo.rst Use these bash commands to create a directory for the demo data and change into it. ```bash mkdir -p demo_data cd demo_data ``` -------------------------------- ### List a specific set up package Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/package-development.rst Review the version of a single package that is currently set up in the active Science Pipelines software stack. ```bash eups list ``` -------------------------------- ### Set up a package in the EUPS stack Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/package-development.rst From the package's directory, set up the package itself in the EUPS stack. This makes the package available for building and use. ```bash setup -r . -t $USER ``` -------------------------------- ### List Currently Set Up Packages Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/setup.rst Run 'eups list -s' to display all packages that are currently set up and active in your shell session. ```bash eups list -s ``` -------------------------------- ### Download and run lsstinstall Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstinstall.rst Download the lsstinstall script, make it executable, and run it with a specified release tag. ```bash curl -OL https://ls.st/lsstinstall chmod u+x lsstinstall ./lsstinstall -T {{ release_eups_tag }} ``` -------------------------------- ### Import the Display Framework Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Import the necessary module for astronomical data visualization. This framework supports multiple display backends. ```python import lsst.afw.display as afwDisplay ``` -------------------------------- ### Set Permissions for Shared Installations Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstinstall.rst Adjust permissions for shared LSST installations to allow group access and prevent conda from recording user environment information. ```bash chmod go-w ${CONDA_EXE%bin/conda}/pkgs/urls* ``` -------------------------------- ### Download and Extract Demo Project (Specific Version) Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/demo.rst Download a specific version of the demo project using curl and extract it. Replace {{ pipelines_demo_ref }} with the desired Git reference. ```bash curl -L https://github.com/lsst/pipelines_check/archive/{{ pipelines_demo_ref }}.tar.gz | tar xvzf - cd pipelines_check-{{ pipelines_demo_ref }} ``` -------------------------------- ### Import Good Seeing Templates Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/dc2-guide.rst Use the 'import_templates.py' script to import good seeing templates. This script requires the Butler repository path, a collection name, and a WHERE clause to filter data. ```bash import_templates.py \ -b /repo/dc2 \ -t $MY_COLLECTION \ -w "skymap='DC2_cells_v1' and tract=4431 and patch IN (9,10,16,17) and band='r'" ``` -------------------------------- ### Upgrade lsstsw Installation Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Upgrade an existing lsstsw installation by pulling the latest changes, redeploying the environment, and rebuilding the Science Pipelines codebase. Ensure the shell environment is correctly configured after the upgrade. ```bash git pull bin/deploy rebuild -u -t current lsst_distrib ``` -------------------------------- ### Get Static Dimensions Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Retrieves a list of static dimensions available in the Butler repository. This is a basic exploration command. ```python >>> print(butler.dimensions.getStaticDimensions()) ``` -------------------------------- ### Query Datasets with findFirst (CLI) Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Shows how to use the --find-first flag with the butler command-line tool to retrieve only the first matching dataset from the ordered list of collections. This is useful for avoiding duplicate results when collections are chained. ```sh $ butler query-datasets /repo/main calexp --find-first \ --collections HSC/runs/RC2/w_2021_06/DM-28654 \ --collections HSC/runs/RC2/w_2021_02/DM-28282 \ --where "instrument='HSC' AND visit=1228 AND detector=40" ``` -------------------------------- ### Create Butler Client Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Initialize a Butler client to access data from the specified repository and collection. Ensure the LSST environment is set up. ```python from lsst.daf.butler import Butler collection = f"u/{os.environ['USER']}/single_frame" butler = Butler('SMALL_HSC', collections=collection, instrument='HSC') ``` -------------------------------- ### Get source catalog column names Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Extract and print only the names of the columns present in the source catalog schema. ```python print(src.getSchema().getNames()) ``` -------------------------------- ### Get Dimension Schema Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Prints the schema for a specific dimension table, such as 'exposure'. This helps understand the available metadata fields. ```python >>> print(butler.dimensions["exposure"].schema) exposure: instrument: string id: int physical_filter: string obs_id: string exposure_time: float Duration of the exposure with shutter open (seconds). dark_time: float Duration of the exposure with shutter closed (seconds). observation_type: string The observation type of this exposure (e.g. dark, bias, science). observation_reason: string The reason this observation was taken. (e.g. science, filter scan, unknown). day_obs: int Day of observation as defined by the observatory (YYYYMMDD format). seq_num: int Counter for the observation within a larger sequence. Context of the sequence number is observatory specific. Can be a global counter or counter within day_obs. group_name: string String group identifier associated with this exposure by the acquisition system. group_id: int Integer group identifier associated with this exposure by the acquisition system. target_name: string Object of interest for this observation or survey field name. science_program: string Observing program (survey, proposal, engineering project) identifier. tracking_ra: float Tracking ICRS Right Ascension of boresight in degrees. Can be NULL for observations that are not on sky. tracking_dec: float Tracking ICRS Declination of boresight in degrees. Can be NULL for observations that are not on sky. sky_angle: float Angle of the instrument focal plane on the sky in degrees. Can be NULL for observations that are not on sky, or for observations where the sky angle changes during the observation. zenith_angle: float Angle in degrees from the zenith at the start of the exposure. timespan: timespan ``` -------------------------------- ### Get metadata for a specific schema column Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Find and print metadata for a specific column in the source catalog schema, such as 'calib_psf_used'. ```python print(src.schema.find("calib_psf_used")) ``` -------------------------------- ### Get Instrumental Flux Units Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/multiband-analysis.rst Access the schema of the 'iSources' dataset to find the 'base_PsfFlux_instFlux' field and retrieve its units, which are counts. ```python iSources.getSchema().find('base_PsfFlux_instFlux').field.getUnits() ``` -------------------------------- ### Initialize Butler with Data Collections Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/multiband-analysis.rst Initialize the Butler to access data, specifying the collections where the forced photometry measurement catalogs are stored. Ensure the 'lsst_distrib' package is set up in your environment. ```python import os from lsst.daf.butler import Butler collections = [f"u/{os.environ['USER']}/objects", f"u/{os.environ['USER']}/coadd_meas"] butler = Butler('SMALL_HSC', collections=collections) ``` -------------------------------- ### Get source catalog column values as Numpy array Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Access the values of a specific column from a SourceCatalog as a Numpy array for further analysis. ```python print(src['base_PsfFlux_instFlux']) ``` -------------------------------- ### Visualize Quantum Graph using Graphviz Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/singleframe.rst Convert the generated dot file into a PDF for visualization using the graphviz 'dot' command. ```bash dot single_frame.dot -Tpdf -o single_frame.pdf ``` -------------------------------- ### Command-line to query RUN collections matching a pattern Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Command-line equivalent to query RUN collections that match a pattern, potentially including datasets from CALIBRATION collections. ```sh $ butler query-collections /repo/main --collection-type RUN \ HSC/calib/gen2/20200115/* ``` -------------------------------- ### Create a Simple Movie from Calibrated Exposures Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Iterates through calibrated exposures and displays each one sequentially to create a simple movie. Requires importing necessary modules and initializing the display. A short sleep is included between frames. ```python import os from time import sleep import lsst.afw.display as afwDisplay display = afwDisplay.getDisplay() for ref in butler.registry.queryDatasets('calexp', physical_filter='HSC-R'): calexp = butler.get(ref) display.image(calexp) sleep(1) ``` -------------------------------- ### Get Documentation for Classification Column Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/multiband-analysis.rst This Python snippet retrieves the documentation string for the 'base_ClassificationExtendedness_value' column, which indicates if a source is extended (galaxy) or point-like (star). ```python iSources.schema.find('base_ClassificationExtendedness_value').field.getDoc() ``` -------------------------------- ### Manually Tag Packages Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Manually tag installed packages with a specific tag, such as 'current', using the 'eups tags' command. This is an alternative to the automatic tagging by 'rebuild'. ```bash eups tags --clone bNNNN current ``` -------------------------------- ### Load calibration dataset using Butler.get Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Directly loads the appropriate calibration dataset for a given raw data ID using Butler.get. This is the recommended approach for loading calibration data. ```python flat = butler.get( "flat", instrument="HSC", exposure=903334, detector=0, collections="HSC/calib" ) ``` -------------------------------- ### Get All Column Names from Schema Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/multiband-analysis.rst Retrieve a list of all available column names from a table's schema using this Python command. This helps in exploring the table structure. ```python refTable.schema.getNames() ``` -------------------------------- ### Retrieve source catalog from Butler Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Get the source catalog generated by the single frame processing pipeline using the Butler. This catalog contains information about detected sources. ```python import os src = butler.get('src', visit=23718, detector=41) ``` -------------------------------- ### Running Pipetask Report Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Use this command to analyze quantum graphs and store a full summary report. Ensure you provide the Butler repository and the sequence of quantum graphs. ```sh pipetask report --full-output-filename .json --force-v2 REPO QGRAPHS ``` -------------------------------- ### Get and display mask plane colors Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Retrieve a dictionary of mask plane names and their corresponding colors as rendered by the display framework. This is useful for interpreting mask data. ```python mask = calexp.getMask() for maskName, maskBit in mask.getMaskPlaneDict().items(): print('{}: {}'.format(maskName, display.getMaskPlaneColor(maskName))) ``` -------------------------------- ### Deploy lsstsw Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Clone the lsstsw repository, navigate into it, deploy the environment, and configure the shell environment variables. Use the .csh version for csh/tcsh shells. ```bash git clone https://github.com/lsst/lsstsw.git cd lsstsw ./bin/deploy source bin/envconfig ``` ```bash source bin/envconfig.csh ``` -------------------------------- ### Release Notes Template Source: https://github.com/lsst/pipelines_lsst_io/blob/main/releases/README.md Template for creating release notes, including versioning, build information, and sections for changes. ```rst .. _release-latest: .. _release-vNN-N: ################################################## LSST Science Pipelines XX.Y.Z Release (YYYY-MM-DD) ################################################## .. toctree:: :hidden: tickets/vXX_Y_Z +-------------------------------------------+------------+ | Source | Identifier | +===========================================+============+ | Git tag | XX.Y.Z | +-------------------------------------------+------------+ | :doc:`EUPS distrib ` | vXX_Y_Z | +-------------------------------------------+------------+ This release is based on the ``w_YYYY_NN`` weekly build. These release notes highlight significant changes to the Science Pipelines codebase which are likely to be of wide interest. For a complete list of changes made, see :doc:`tickets/vXX_Y_Z`. - :ref:`release-vXX-Y-Z-functionality` - :ref:`release-vXX-Y-Z-interface` - :ref:`release-vXX-Y-Z-pending-deprecations` - :ref:`release-vXX-Y-Z-deprecations` *See also:* .. todo:: Insert link to the CMR when it is available. .. todo:: Insert link to Doxygen documentation when the release is frozen. - :doc:`Installation instructions ` - :doc:`Known issues ` - `Characterization Metric Report (DMTR-NNN) `_ - `Doxygen Documentation`__ __ http://doxygen.lsst.codes/stack/doxygen/xlink_master_XXXX/ .. _release-vXX-Y-Z-functionality: Major New Features ================== .. Insert list of :ref:`..` to individual items .. Add items here .. _release-vXX-Y-Z-interface: Significant Interface Changes ============================= .. Insert list of :ref:`..` to individual items .. Add items here .. _release-vXX-Y-Z-pending-deprecations: Pending Deprecations ==================== .. That is, items that we anticipate deprecating in the next release .. Insert list of :ref:`..` to individual items .. Add items here .. _release-vXX-Y-Z-deprecations: Deprecations ============ .. That is, items that are deprecated in this releas .. Insert list of :ref:`..` to individual items .. Add items here ``` -------------------------------- ### Run Docker Container in Detached Mode Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/docker.rst Starts a Docker container in detached mode with a specified name ('lsst'). The container runs in the background and does not immediately open a shell. ```bash docker run -itd --name lsst lsstsqre/centos:7-stack-lsst_distrib-{{ release_eups_tag }} ``` -------------------------------- ### Create SQLite APDB Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/dc2-guide.rst Use the 'apdb-cli' command to create an empty SQLite APDB and set its instrument metadata. This is suitable for smaller data volumes. ```bash apdb-cli create-sql sqlite:////path/to/my/database/apdb.sqlite3 apdb_config.yaml apdb-cli metadata set apdb_config.yaml instrument LSSTCam-imSim ``` -------------------------------- ### Create Butler Object for HSC Data Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/data-setup.rst Instantiate a Butler object in Python to manage data. This example constructs a Butler for a local repository located within the `rc2_subset` directory. ```python from lsst.daf.butler import Butler import os repo_path = os.path.join(os.environ['RC2_SUBSET_DIR'], 'SMALL_HSC') butler = Butler(repo_path) ``` -------------------------------- ### Apply asinh stretch with explicit thresholds Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Manually set the black and white thresholds for the 'asinh' stretch when automatic scaling is not desired. ```python display.scale("asinh", -1, 30) ``` -------------------------------- ### Access Skymap and Patch Information Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/coaddition.rst Use the Butler to access the skymap and retrieve tract and patch information. This snippet shows how to get the skymap, generate a tract, and find the index of a specific patch. ```python from lsst.daf.butler import Butler butler = Butler('SMALL_HSC') skymap = butler.get('skyMap', skymap='hsc_rings_v1', collections='HSC/RC2/defaults') tractInfo = skymap.generateTract(9813) patch = tractInfo[41] patch.getIndex() --> (5, 4) ``` -------------------------------- ### Source Environment Configuration (csh/tcsh) Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/lsstsw.rst Use this command to set up the LSST development environment if you are using csh or tcsh shells. ```bash source bin/envconfig.csh ``` -------------------------------- ### Retrieve a Calibrated Exposure Dataset Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Retrieve a specific 'calexp' dataset using the Butler's 'get' method, specifying the dataset type and relevant data ID components like visit and detector. ```python import os calexp = butler.get('calexp', visit=23718, detector=41) ``` -------------------------------- ### Submit BPS Run Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/dc2-guide.rst Use this command to submit a BPS run configuration file. Ensure the configuration file is correctly set up with necessary input collections. ```bash bps submit ApPipe-DC2-bps.yaml ``` -------------------------------- ### Dataset Query for Coaddition Subset Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/coaddition.rst Specify a subset of data for coaddition, including tract, skymap, and patch information. This example filters for tract 9813, skymap 'hsc_rings_v1', and patches 38, 39, 40, 41. ```bash -d "tract = 9813 AND skymap = 'hsc_rings_v1' AND patch in (38, 39, 40, 41)" ``` -------------------------------- ### Query Collections in Data Repository Source: https://github.com/lsst/pipelines_lsst_io/blob/main/middleware/faq.rst Use 'butler query-collections' to get a high-level view of a data repository's contents. The '--chains=tree' format provides a hierarchical view. It's recommended to use wildcards or specific paths to avoid overwhelming results in large repositories. ```sh $ butler query-collections /repo/main HSC/runs/RC2/* --chains=tree Name Type -------------------------------------- ----------- HSC/runs/RC2/w_2021_02/DM-28282/sfm RUN HSC/runs/RC2/w_2021_02/DM-28282/rest RUN HSC/runs/RC2/w_2021_06/DM-28654 CHAINED HSC/runs/RC2/w_2021_06/DM-28654/rest RUN HSC/runs/RC2/w_2021_06/DM-28654/sfm RUN HSC/raw/RC2/9615 TAGGED HSC/raw/RC2/9697 TAGGED HSC/raw/RC2/9813 TAGGED HSC/calib/gen2/20180117 CALIBRATION HSC/calib/DM-28636 CALIBRATION HSC/calib/gen2/20180117/unbounded RUN HSC/calib/DM-28636/unbounded RUN HSC/masks/s18a RUN skymaps RUN refcats/DM-28636 RUN HSC/runs/RC2/w_2021_02/DM-28282 CHAINED HSC/runs/RC2/w_2021_02/DM-28282/rest RUN HSC/runs/RC2/w_2021_02/DM-28282/sfm RUN HSC/raw/RC2/9615 TAGGED HSC/raw/RC2/9697 TAGGED HSC/raw/RC2/9813 TAGGED HSC/calib/gen2/20180117 CALIBRATION HSC/calib/DM-28636 CALIBRATION HSC/calib/gen2/20180117/unbounded RUN HSC/calib/DM-28636/unbounded RUN HSC/masks/s18a RUN skymaps RUN refcats/DM-28636 RUN HSC/runs/RC2/w_2021_06/DM-28654/sfm RUN HSC/runs/RC2/w_2021_06/DM-28654/rest RUN ``` -------------------------------- ### Run the AP Pipeline Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/dc2-guide.rst Execute the AP Pipeline with specified parameters, including input/output collections, pipeline configuration, and APDB configuration. Ensure the APDB exists and is empty before running. ```bash pipetask run -j 4 -b /repo/dc2 -d "skymap='DC2_cells_v1' AND band='r'" -i u/USERNAME/OUTPUT-COLLECTION-1,u/mrawls/DM-34827/defaults/4patch_4431 -o u/USERNAME/OUTPUT-COLLECTION-2 -p $AP_PIPE_DIR/pipelines/LSSTCam-imSim/ApPipe.yaml -c parameters:apdb_config=apdb_config.yaml ``` -------------------------------- ### Clone an LSST package repository Source: https://github.com/lsst/pipelines_lsst_io/blob/main/install/package-development.rst Use Git to clone the package you want to work on from the LSST GitHub organization. This is the first step before setting up and building the package. ```bash git clone https://github.com/lsst/pipe_tasks cd pipe_tasks ``` -------------------------------- ### Apply asinh stretch with zscale algorithm Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/display.rst Use the 'asinh' stretch with the 'zscale' algorithm to automatically determine black and white thresholds for image display. ```python display.scale("asinh", "zscale") ``` -------------------------------- ### Display AP Pipeline YAML Source: https://github.com/lsst/pipelines_lsst_io/blob/main/getting-started/dc2-guide.rst Display the YAML configuration file for the AP Pipeline using the 'cat' command. ```bash cat $AP_PIPE_DIR/pipelines/LSSTCam-imSim/ApPipe.yaml ```