Giter VIP home page Giter VIP logo

ds9imagesaver's Introduction

DS9RegionSaver

A Python script to automate the process of saving regions from DS9 images, with custom scaling, zooming, and labeling options.

Features

  • Load multiple FITS files in different colors.
  • Apply custom scaling parameters for each FITS file.
  • Zoom and pan to specific regions based on RA and Dec.
  • Label images with source names from a specified file.
  • Save images with custom filenames.

Requirements

  • Python 3.x
  • DS9
  • XPA (X Public Access)

Installation

  1. Install DS9 and XPA:

  2. Clone this repository:

    git clone https://github.com/your-username/DS9RegionSaver.git
    cd DS9RegionSaver
    
    

Usage

  1. Prepare the source file (pan_zoom.txt) with the following format:

    RA Dec Radius
    56.67657665 68.160590675005 2.6687305341091236
    56.68005265 68.036525675005 3.1234567890123456
    ...
    
  2. Prepare the name file (name.txt) with the following format:

    Name RA Dec
    034642.35+680938.2 56.67657665 68.160590675005
    034643.19+680211.6 56.68005265 68.036525675005
    ...
    
    
  3. Update the file paths in the script.

    For example:

    fits_files = [
     '/path/to/f606w_drc.fits',
     '/path/to/f435w_drc.fits'
    ]
    colors = ['green', 'blue']  # Colors for the FITS files
    scaling_params = [
        {'scaling': 'log', 'scale_min': 0, 'scale_max': 1.6e6, 'contrast': 3.3, 'bias': 0.25},
        {'scaling': 'log', 'scale_min': 0, 'scale_max': 740000, 'contrast': 6.6, 'bias': 0.12}
    ]
    region_files = [
        '/path/to/xray99_hst.reg',
        '/path/to/X_ray99_final_123sig.reg'
    ]
    source_file = '/path/to/pan_zoom.txt'
    name_file = '/path/to/name.txt'
    output_dir = 'images/'
    
  4. Run the script:

    python ds9_region_saver.py
    
    
    
    

You can install the package directly from GitHub:

pip install git+https://github.com/JustinPerea/DS9ImageSaver.git

git clone https://github.com/JustinPerea/DS9ImageSaver.git
cd DS9ImageSaver

pip install -e .

ds9imagesaver's People

Contributors

justinperea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.