-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adds support for amptek detector files #7
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
==========================================
+ Coverage 56.30% 62.38% +6.07%
==========================================
Files 10 10
Lines 595 731 +136
==========================================
+ Hits 335 456 +121
- Misses 260 275 +15 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11024020059/artifacts/1974472210 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11024046119/artifacts/1974479076 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11032939286/artifacts/1976727130 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11143408317/artifacts/2005618929 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11370965566/artifacts/2064883527 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11376173449/artifacts/2066472762 |
padre_meddea/io/amptek.py
Outdated
value = float(value) | ||
except ValueError: | ||
pass | ||
hdr.append((keyword.replace(" ", "")[0:7], value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running Line 119 returns the following error:
ERROR: ValueError: FITS header values must contain standard printable ASCII characters; '27°C' contains characters not representable in ASCII or non-printable characters. [astropy.io.fits.card]
I have not found a way to easily get around this. Perhaps the easiest thing to do is to modify the .mca file itself, since it's just this one character that is causing the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird. My test mca file does not have this symbol in it (see here) which has the lines
2143 TEC Temp: 252K
2144 Board Temp: 29C
at the bottom of the file. Can you paste the offending line from your file here please?
padre_meddea/io/file_tools.py
Outdated
if filename.suffix == "bin": # raw binary file | ||
result = read_raw_file(filename) | ||
if filename.suffix == ".bin": # raw binary file | ||
result = read_raw_file(Path(filename)) | ||
elif filename.suffix == "fits": # level 0 or above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a "." in front of "fits"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I actually fixed this in my other pull request.
padre_meddea/io/amptek.py
Outdated
value = float(value) | ||
except ValueError: | ||
pass | ||
hdr.append((keyword.replace(" ", "")[0:7], value, description)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running Line 111 returns the following warnings:
WARNING: VerifyWarning: Keyword name 'DESCRIPTION' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'THRESHOLD' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'LIVE_MODE' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'PRESET_TIME' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'LIVE_TIME' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'REAL_TIME' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'START_TIME' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
WARNING: VerifyWarning: Keyword name 'SERIAL_NUMBER' is greater than 8 characters or contains characters not allowed by the FITS standard; a HIERARCH card will be created. [astropy.io.fits.card]
ERROR: ValueError: FITS header values must contain standard printable ASCII characters; '27°C' contains characters not representable in ASCII or non-printable characters. [astropy.io.fits.card]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of those warnings can be ignored. The ERROR at the bottom is what is important but you already referred to it in your previous comment.
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11693830291/artifacts/2149474081 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11900626846/artifacts/2203824507 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11900730590/artifacts/2203857307 |
The processed files are available as an artifact: https://github.com/PADRESat/padre_meddea/actions/runs/11905671750/artifacts/2205219950 |
This adds preliminary support for amptek detector files which are used for ground-based calibration.