Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on command line option with Gemini GMOS 2D spectrum #11

Open
Karuntg opened this issue Apr 5, 2023 · 4 comments
Open

Error on command line option with Gemini GMOS 2D spectrum #11

Karuntg opened this issue Apr 5, 2023 · 4 comments

Comments

@Karuntg
Copy link

Karuntg commented Apr 5, 2023

Hi Chengyuan
I am testing Cosmic-Conn for CR masking on Gemini-S GMOS 2D spectrum

When I tried the command line option:

cosmic-conn -i cr_tst -e SCI

INFO:root:Initializing Cosmic-CoNN CR detection ground_imaging model...

INFO:root:...GPU or CUDA not detected, using CPU (slower).
INFO:root:...training on CPU is not recommended.
INFO:root:ground_imaging model initialized.

1 FITS found in cr_tst
ERROR:root:No valid data found in extention 0, 1 or SCI, to specify extension name: -e SCI.

GMOS fits has the SCI extension in extension 2. I tried -e 2, but still no success

I have posted the 2D spectrum at:
https://www.astro.uvic.ca/~karun/tgsqgsS20221115S0065.fits
if you wish to try

pls advise. I also embedded cosmic-conn in a py script, but am getting a different error, will post it as a separate issue
thx
karun

@cy-xu
Copy link
Owner

cy-xu commented Apr 5, 2023

Hi Karun,

Thanks for providing the sample file, which helps identify the problem.

It turns out that this file's SCI extension name is a string with extra spaces in it. I found out by checking its header info in DS9. So I managed to process the file successfully with the following command (note the quotation marks to include the two spaces) --

cosmic-conn -i tgsqgsS20221115S0065.fits -e "SCI  "

Then you should be able to check the processed file in the "cosmic_conn_output" directory --> Open as "Multiple Extension Frames" --> the CR mask is appended in a new frame with the extension "CR_PROBABILITY".

Screenshot 2023-04-05 at 3 21 02 PM

If this is a common issue in other GMOS fits as well, I will make a simple update in the package to handle this.

Thanks for reporting the issue!

Best,
CY

@Karuntg
Copy link
Author

Karuntg commented Apr 5, 2023

Great, thanks a lot, CY! Given this header issue in the GMOS fits, and perhaps with fits files from other instruments too, perhaps, after reading the header of each fits extension, Cosmic-cnn could use, sci_header.strip() before comparing? I am sure you have a neater way of addressing this

On a related note, why didn't the option, -e 2 for extension 2 not work? just curious?
thx
karun

@Karuntg
Copy link
Author

Karuntg commented Apr 5, 2023 via email

@cy-xu
Copy link
Owner

cy-xu commented Apr 26, 2023

Hi karun, sorry for the late reply. We had a baby girl four weeks ago, and I am behind on many things. What you suggested seems like a straightforward fix. Please feel free to make a pull request! Also please suggest other features or improvements to make the tool easier for you and other astronomers! Thanks!

Best,
CY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants