Code Monkey home page Code Monkey logo

pyird's Introduction

PYIRD

Free from messy directory and file management of IRD analysis. Currently under heavily construction. Use develop branch for dev.

Core Pipelines

  • pyird.utils -- setting us free from file name managements
  • pyird.image -- reducing systematics in the image level and extracting raw spectra
  • pyird.spec -- assigning wavelength reference (wavref) to pixel coordinates in the raw spectra

Classes

  • fitsset.FitsSet -- sets of fits files
  • irdstream.Stream2D -- 2D fits stream from raw images
  • aperture.TraceAperture -- aperture class for trace

Aperture

Mask: n=42 (H) apertures extracted from FLAT for aperture mask.

Star: aperture.TraceAperture.mmf2() sets n=21 (H) apertures of star fiber.

pyird's People

Contributors

hajimekawahara avatar kemasuda avatar yuikasagi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ykawashima

pyird's Issues

linelist identification

we definitely need ecidentify like module. No more wavelength val by manual.

  • load Thar_ird2.dat
  • allocate the line positions in pixcoord
  • make a prediction by some interpolation or GP? #25
  • (postpone) I would include uncertain estimate for wavelength position, probably GP is better than interpolation.

get_radec returning coordinates of a nearby object

In my environment (astroquery v0.4.7.dev7761) Simbad.query_object('HR 8799') in get_radec returns a single object HD 218396 at 23 07 28.7157 +21 08 03.310 and test_getinfo.py fails. The coordinates written in test_get_radec() corresponds to 23 07 28.7156 +21 08 03.302, which are coordinates for one of the HR 8799 planets (presumably picked up by result_table['RA'][0] etc).

test_aptrace.py does not work anymore

Now I am checking unit tests and found that test_aptrace.py does not work anymore.

shirochan:~/pyird/tests(stream2d_continue)>pytest
================================================= test session starts ==================================================
platform linux -- Python 3.8.8, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/kawahara/pyird
plugins: anyio-2.2.0, asdf-2.8.1
collected 8 items                                                                                                      

image/test_aptrace.py F                                                                                          [ 12%]
image/test_bias.py .                                                                                             [ 25%]
io/test_iraf_trace.py ..                                                                                         [ 50%]
spec/test_wavcal.py .                                                                                            [ 62%]
utils/test_getinfo.py .                                                                                          [ 75%]
utils/test_stream2d.py ..                                                                                        [100%]

======================================================= FAILURES =======================================================
_____________________________________________________ test_aptrace _____________________________________________________

    def test_aptrace():
        import numpy as np
    
        npix = 2048
        step = 100
        nap = npix//step
    
        dat_test = np.zeros((npix,npix))
        for x in range(0,npix,step):
            dat_test[:,x-2:x+2] = 1000
    
        cutrow = 1000
>       y0, xmin, xmax, coeff = aptrace(dat_test,cutrow,nap)
E       TypeError: cannot unpack non-iterable NoneType object

image/test_aptrace.py:16: TypeError
------------------------------------------------- Captured stdout call -------------------------------------------------
Please set nap = 42 (for H band) or nap = 102 (for YJ band).
=============================================== short test summary info ================================================
FAILED image/test_aptrace.py::test_aptrace - TypeError: cannot unpack non-iterable NoneType object
============================================= 1 failed, 7 passed in 1.64s ==============================================

aperture extraction

Substitution of apall in IRAF.
We plan to remove all the IRAF routine from pyird.

offset in wavelength calibration?

I reduced IRDA00041511.fits using IRD_stream.py in examples/python, and computed cross correlation with model telluric spectra to derive radial velocities (RVs) for telluric lines. The result is shown below: I expected ~0km/s but found ~-2km/s, which is close to the velocity shift corresponding to 1pixel.
IRDA00041511_fl_telrv

I analyzed another higher S/N spectrum (IRDA00042313) and obtained a similar result: about -2km/s RV for telluric lines. In fact the same spectrum was reduced manually by Kawahara-san before, and this one does give ~0km/s RV for telluric lines. The difference is shown below for some deep telluric lines:
IRDA00042313_fl_order10

I haven't yet figured out what might be going wrong (or I may just be making some mistake) but thought I'd share it in case anyone has a better idea of what's going on.

rough plan for v0.1

goal: self-contained well-documented pipeline w/o IRAF

  • bias
  • readout pattern (for dark)
  • readout pattern (for faint object)
  • aperture extraction
  • wavelength calibration
  • connection to exojax analysis

some report from irdstream

irdstream automatically does everything and the user cannot see what is happening in the pipeline. So, I think we need to make some figures during running irdstream. Here are some idea

  • masking image used for image cleaning
  • corrected 2D image
  • aperture used for flatten
  • wavelength cal info

non common trend of readout pattern in each channel

I observed a non-common trend of the readout pattern in some order:
See #5 (comment).
This results in artifact in one-d raw spectrum for a faint object (can find it by performing REACH.py)

To remove this, some preparations are needed

  • RSD (raw spectral detector) matrix (rsdmat.py in spec) to see the effect (by taking median axis=1)
  • allocate channel position in a 1D raw spec

After that, consider how to remove it. probably GP?

hot pixel mask

Using sep, I constructed the hotpixel identification, though not well-tested.

Flux jumps in ncw*.dat (combined spectrum)

I found that there were unintentional flux jumps in the order combined spectrum (ncw?????_m?.dat; normalized and combined spectrum, green lines on the figure). It seems to be caused by including the non-signal region at the edge of each order when adding the fluxes in overlap wavelengths. (I will fix it...)
issue_combined

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.