pypeit / PypeIt

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

run_pypeit fail #1826

Open folykkkkk opened 1 week ago

folykkkkk commented 1 week ago

image (pypeit) user@System:~/SN/P200/output/blue$ run_pypeit /home/user/SN/P200/output/blue/p200_dbsp_blue_A/p200_dbsp_blue_A.pypeit -o [INFO] :: inputfiles.py 136 from_file() - Loading the reduction file [INFO] :: inputfiles.py 214 from_file() - PypeIt input file loaded successfully. [INFO] :: inputfiles.py 672 vet() - PypeIt file successfully vetted. [INFO] :: pypeit.py 103 init() - Loaded spectrograph p200_dbsp_blue [INFO] :: pypeit.py 104 init() - Setting configuration-specific parameters using blue0064.fits. [WARNING] :: parset.py 656 to_config() - Selected configuration file already exists and will be overwritten! [INFO] :: pypeit.py 120 init() - Compiling metadata [INFO] :: metadata.py 206 _build() - Building metadata for 22 files. [INFO] :: metadata.py 235 _build() - Adding metadata for blue0011.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0012.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0013.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0001.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0002.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0003.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0004.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0005.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0006.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0007.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0008.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0009.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0010.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0026.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0027.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0028.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0029.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0030.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0064.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0065.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0042.fits [INFO] :: metadata.py 235 _build() - Adding metadata for blue0043.fits [WARNING] :: metadata.py 1400 get_frame_types() - Removing existing frametype and framebit columns. [INFO] :: metadata.py 1407 get_frame_types() - Typing files [INFO] :: metadata.py 1417 get_frame_types() - Using user-provided frame types. [INFO] :: calibrations.py 1456 check_for_calibs() - Congrats!! You passed the calibrations inspection!! [INFO] :: metadata.py 723 unique_configurations() - Setup column already set. Finding unique configurations. [INFO] :: metadata.py 733 unique_configurations() - Found 1 unique configurations. [INFO] :: calibrations.py 1341 association_summary() - Calibration association file written to: /home/user/SN/P200/output/blue/p200_dbsp_blue_A/p200_dbsp_blue_A.calib [INFO] :: pypeit.py 155 init() - Setting reduction path to /home/user/SN/P200/output/blue [INFO] :: pypeit.py 156 init() - Calibration frames saved to: /home/user/SN/P200/output/blue/Calibrations [INFO] :: pypeit.py 157 init() - Science data output to: /home/user/SN/P200/output/blue/Science [INFO] :: pypeit.py 158 init() - Quality assessment plots output to: /home/user/SN/P200/output/blue/QA [INFO] :: pypeit.py 321 reduce_all() - Found 2 standard frames to reduce. [INFO] :: pypeit.py 326 reduce_all() - Found 2 science frames to reduce. [INFO] :: pypeit.py 351 reduce_all() - Found 2 standard frames in calibration group 0. [INFO] :: pypeit.py 541 reduce_exposure() - Reducing target Feige34 Combining frames: blue0042.fits

[INFO] :: pypeit.py 552 reduce_exposure() - Detectors to work on: [1] [INFO] :: pypeit.py 557 reduce_exposure() - Reducing detector 1 [INFO] :: pypeit.py 696 calib_one() - Building/loading calibrations for detector 1 [INFO] :: datamodel.py 1547 from_file() - Loading BiasImage from /home/user/SN/P200/output/blue/Calibrations/Bias_A_0_DET01.fits [WARNING] :: calibrations.py 496 get_dark() - No raw dark frames found and unable to identify a relevant processed calibration frame. Continuing... [INFO] :: spectrograph.py 591 bpm() - Generating a BPM using bias for det=(1,) for p200_dbsp_blue [INFO] :: calibrations.py 877 get_slits() - Creating edge tracing calibration frame using files: calibrations.py 879 get_slits() - blue0026.fits calibrations.py 879 get_slits() - blue0027.fits calibrations.py 879 get_slits() - blue0028.fits calibrations.py 879 get_slits() - blue0029.fits calibrations.py 879 get_slits() - blue0030.fits [INFO] :: spectrograph.py 591 bpm() - Generating a BPM using bias for det=(1,) for p200_dbsp_blue [INFO] :: rawimage.py 539 process() - Performing basic image processing on blue0026.fits. [INFO] :: rawimage.py 539 process() - Performing basic image processing on blue0027.fits. [INFO] :: rawimage.py 539 process() - Performing basic image processing on blue0028.fits. [INFO] :: rawimage.py 539 process() - Performing basic image processing on blue0029.fits. [INFO] :: rawimage.py 539 process() - Performing basic image processing on blue0030.fits. [INFO] :: edgetrace.py 959 initial_trace() - -------------------------------------------------- [INFO] :: edgetrace.py 960 initial_trace() - Initialize Edge Tracing
[INFO] :: edgetrace.py 961 initial_trace() - -------------------------------------------------- [INFO] :: trace.py 87 detect_slit_edges() - Detecting slit edges in the trace image [INFO] :: trace.py 130 detect_slit_edges() - Applying bad pixel mask [INFO] :: trace.py 171 identify_traces() - Finding unique traces among detected edges. [INFO] :: edgetrace.py 1835 centroid_refine() - -------------------------------------------------- [INFO] :: edgetrace.py 1836 centroid_refine() - Edge Centroid Refinement
[INFO] :: edgetrace.py 1837 centroid_refine() - -------------------------------------------------- [INFO] :: edgetrace.py 1838 centroid_refine() - Width of window for centroiding the edges: 6.0 [INFO] :: edgetrace.py 1839 centroid_refine() - Max shift between spectrally adjacent pixels: 0.15 [INFO] :: edgetrace.py 1840 centroid_refine() - Max centroid error: None [INFO] :: edgetrace.py 1841 centroid_refine() - Minimum spectral pixels for a valid trace: 935.5500000000001 [INFO] :: edgetrace.py 1880 centroid_refine() - Found 1 left edge trace(s) to refine [INFO] :: edgetrace.py 1900 centroid_refine() - Following 1 left edge(s) from row 1570; 0 trace(s) remain. [INFO] :: edgetrace.py 2077 check_traces() - Tolerance for finding repeat traces: 3.0 [INFO] :: edgetrace.py 2098 check_traces() - Minimum spectral length of any trace (pixels): 935.55 [INFO] :: edgetrace.py 2103 check_traces() - Found 1 short trace(s). [INFO] :: edgetrace.py 2139 check_traces() - Identified 1 bad trace(s) in all. [INFO] :: edgetrace.py 1880 centroid_refine() - Found 3 right edge trace(s) to refine [INFO] :: edgetrace.py 1900 centroid_refine() - Following 1 right edge(s) from row 1155; 2 trace(s) remain. [INFO] :: edgetrace.py 1900 centroid_refine() - Following 1 right edge(s) from row 2303; 1 trace(s) remain. [INFO] :: edgetrace.py 1900 centroid_refine() - Following 1 right edge(s) from row 2605; 0 trace(s) remain. [INFO] :: edgetrace.py 2077 check_traces() - Tolerance for finding repeat traces: 3.0 [INFO] :: edgetrace.py 2098 check_traces() - Minimum spectral length of any trace (pixels): 935.55 [INFO] :: edgetrace.py 2103 check_traces() - Found 3 short trace(s). [INFO] :: edgetrace.py 2139 check_traces() - Identified 3 bad trace(s) in all. [WARNING] :: edgetrace.py 2746 remove_traces() - All traces removed! [WARNING] :: edgetrace.py 2866 clean_traces() - No traces to clean. [WARNING] :: calibrations.py 909 get_slits() - Edge tracing failed. Continuing, but likely to fail soon... [WARNING] :: pypeit.py 561 reduce_exposure() - Calibrations for detector 1 were unsuccessful! The step that failed was get_slits. Continuing by skipping this detector. Traceback (most recent call last): File "/home/user/anaconda3/envs/pypeit/bin/run_pypeit", line 8, in sys.exit(RunPypeIt.entry_point()) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/anaconda3/envs/pypeit/lib/python3.11/site-packages/pypeit/scripts/scriptbase.py", line 113, in entry_point cls.main(cls.parse_args()) File "/home/user/anaconda3/envs/pypeit/lib/python3.11/site-packages/pypeit/scripts/run_pypeit.py", line 105, in main pypeIt.reduce_all() File "/home/user/anaconda3/envs/pypeit/lib/python3.11/site-packages/pypeit/pypeit.py", line 369, in reduce_all self.save_exposure(frames[0], std_spec2d, std_sobjs, self.basename, history) File "/home/user/anaconda3/envs/pypeit/lib/python3.11/site-packages/pypeit/pypeit.py", line 1182, in save_exposure outfile2d = os.path.join(self.sciencepath, 'spec2d{:s}.fits'.format(basename)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: unsupported format string passed to NoneType.format

folykkkkk commented 1 week ago

I have checked all my input files and there seems to be no issue; RED is executable. How should I resolve this problem?

kbwestfall commented 1 week ago

Hi @folykkkkk . First, if you haven't already, I suggest you join the User's Slack. The dev team is more responsive to troubleshooting questions there.

As for the failure, it looks like the code was unable to identify/trace the slit edges in your data. I would try using the pypeit_trace_edges script to see if you can determine the issue. Mostly likely you need to decrease the edge_thresh parameter. See here: https://pypeit.readthedocs.io/en/latest/calibrations/slit_tracing.html

folykkkkk commented 1 week ago

Thank you very much! I have joined Slack.

Hi @folykkkkk . First, if you haven't already, I suggest you join the User's Slack. The dev team is more responsive to troubleshooting questions there.

As for the failure, it looks like the code was unable to identify/trace the slit edges in your data. I would try using the pypeit_trace_edges script to see if you can determine the issue. Mostly likely you need to decrease the edge_thresh parameter. See here: https://pypeit.readthedocs.io/en/latest/calibrations/slit_tracing.html