pypeit / PypeIt

The Python Spectroscopic Data Reduction Pipeline
BSD 3-Clause "New" or "Revised" License
160 stars 102 forks source link

Flux calibration of NIRES data #787

Closed gterreran closed 4 years ago

gterreran commented 4 years ago

Hello, I'm trying to reduce NIRES data using pypeIt. The pipeline seems to work nice during the extraction, however when I try to flux calibrate my spectra I get an error which I don't understand how to interpret. I'm using a telluric standard to calibrate my data. I'm trying to create the sensitivity curve from it first, and I think it's already at this level that the script fails. This is the flux file I'm using

># User-defined fluxing parameters
[rdx]
   spectrograph = keck_nires
[fluxcalib]
   std_file = Science/spec1d_s191109_0045-HIP111538_NIRES_2019Nov09T065046.139.fits
   sensfunc = HIP111538.sens.fits
   telluric = True
   std_obj_id = 1
   star_type = A0
   star_mag = 9.39
   echelle = True
   debug = True

and this is the pipeline output

[INFO]    :: Loading the fluxcalib file
Writing the parameters to fluxing.par
[INFO]    :: Using mkoextinct.dat for extinction corrections.
[WARNING] :: No sensfunc file found with filename HIP111538.sens.fits
[INFO]    :: Loaded 10 spectra from the spec1d standard star file: Science/spec1d_s191109_0045-HIP111538_NIRES_2019Nov09T065046.139.fits
[INFO]    :: Putative standard star <Table length=1>
 shape [2]   slit_spat_pos ...           idx          
   int64         object    ...          str23         
------------ ------------- ... -----------------------
2048 .. 1024          None ... OBJ0001-ORDER0000-DET01 has a median boxcar count of 0.0
[INFO]    :: Applying extinction correction
[INFO]    :: Using mkoextinct.dat for extinction corrections.
[INFO]    :: Extinction data covered the whole spectra. Correct it!
[INFO]    :: Using vega spectrum to correct telluric
[INFO]    ::  Masking bad pixels
[INFO]    ::  Masking edges
[INFO]    ::  Masking Below the atmospheric cutoff
[INFO]    :: Masking recombination lines:
[INFO]    ::  Masking Balmer
[INFO]    ::  Masking Paschen
[INFO]    ::  Masking Brackett
[INFO]    ::  Masking Pfund
[INFO]    :: The binning of the wavelength array at 10029.099999999999 is: 0.1999999999989086
[INFO]    :: Covolving with a Gaussian kernel with sigma = 7.7044880738261705 pixels
Traceback (most recent call last):
  File "//anaconda3/envs/myenv/bin/pypeit_flux_spec", line 11, in <module>
    flux_spec.main(args)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/pypeit/scripts/flux_spec.py", line 135, in main
    _ = FxSpec.generate_sensfunc()
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/pypeit/fluxspec.py", line 476, in generate_sensfunc
    polycorrect=self.polycorrect, debug=self.debug)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/pypeit/core/flux.py", line 283, in generate_sensfunc
    BALM_MASK_WID=BALM_MASK_WID, trans_thresh=0.9)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/pypeit/core/flux.py", line 442, in get_mask
    central_wl='midpt', debug=False)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/pypeit/wavemodel.py", line 576, in conv2res
    flux_convolved = convolve(flux, gauss_kernel)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/astropy/nddata/decorators.py", line 246, in wrapper
    result = func(data, *args, **kwargs)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/astropy/convolution/convolve.py", line 207, in convolve
    fill_value=np.nan)
  File "//anaconda3/envs/myenv/lib/python3.7/site-packages/astropy/convolution/convolve.py", line 62, in _copy_input_if_needed
    input = input.value
AttributeError: 'Column' object has no attribute 'value'

I haven't coadded the spectra yet, I wonder if this is something I should do before flux calibrating echelle spectra. Any help on this would be really appreciated. Thanks!

profxj commented 4 years ago

@gterreran -- Is this still an Issue?

gterreran commented 4 years ago

@profxj Not in the latest releases no. I'm not sure what was the problem, but it is not there now. Thanks!