[INSTRM-1463] Insert FITS headers into opdb Created: 18/Nov/21 Updated: 18/May/23 |
|
| Status: | Open |
| Project: | Instrument control development |
| Component/s: | ics_gen2Actor |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Normal |
| Reporter: | cloomis | Assignee: | cloomis |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | EngRun, SPS, opDB | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Story Points: | 1 |
| Description |
|
When we request PFSx file archiving, add the headers. Just PHDU for now. Sample code was: import opdb.obslog import astropy.io.fits as pyfits from opdb.models import pfs_visit db = SessionClass() pfs_visit_id = 66453 filestem = 'PFSA06645311' hdul = pyfits.HDUList([ pyfits.PrimaryHDU(header=pyfits.Header([ ('PI', 3.14, "ratio of a circle's circumference to its diameter"), ])), ]) db.add_all(opdb.obslog.fits_headers_from_hdulist(hdul, pfs_visit_id, filestem): db.commit() |
| Comments |
| Comment by cloomis [ 30/Mar/22 ] |
|
Bump. Completely forgot about this. |
| Comment by Kiyoto Yabe [ 15/Apr/22 ] |
|
Do you have time to work on this? I recently noticed that the header search is very useful not only for commissioning but also for our analysis of SuNSS data at IPMU. |
| Comment by hassan [ 06/Jan/23 ] |
|
cloomisKiyoto Yabe is this something that we need to implement early this year? |
| Comment by Kiyoto Yabe [ 10/Jan/23 ] |
|
JFYI, `obslog_fits_header` table has been updated manually by michitaro. The command to ingest using a script is something like this:
find /data/raw/ -name PFS*.fits | xargs -r ./.venv/bin/python -m opdb.obslog -d postgresql://dbuser@dbhost/dbname --no-echo register --commit-each
|