Regular DRP processing of LAM and Subaru data
(PIPE2D-423)
|
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Sub-task | Priority: | Normal |
| Reporter: | sogo.mineo | Assignee: | sogo.mineo |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Sprint: | 2DDRP-2019 E, 2DDRP-2021 A, 2DDRP-2021 A 2 | ||||||||
| Reviewers: | price | ||||||||
| Description |
|
Write a python script that generates from a yaml a bash script to create calibs and run science pipeline. |
| Comments |
| Comment by sogo.mineo [ 23/Apr/20 ] |
|
Wrote one. (But I don't know where to push it) |
| Comment by hassan [ 25/Apr/20 ] |
|
Can you initially add the python script to this ticket please? |
| Comment by sogo.mineo [ 27/Apr/20 ] |
|
I uploaded the python script forked from https://github.com/lsst-dm/generateCalibrations |
| Comment by sogo.mineo [ 30/Apr/20 ] |
|
Added the code to pfs_pipe2d and pushed branch tickets/ |
| Comment by price [ 14/May/20 ] |
|
I think this needs some more work to achieve what we need. This could supplant pfs_build_calibs.sh, but it's missing some important features. |
| Comment by sogo.mineo [ 25/May/20 ] |
|
I think I have made all required changes, except for adding capability of specifying more keys for --id.
CREATE TABLE raw (
id integer primary key autoincrement,
site text,
category text,
field text,
visit int,
ccd int,
filter text,
arm text,
spectrograph int,
dateObs text,
expTime double,
dataType text,
taiObs text,
pfsDesignId int,
slitOffset double,
dither double,
shift double,
focus double,
lamps text,
attenuator double,
photodiode double,
)
|
| Comment by price [ 26/May/20 ] |
|
Even the double fields can be used in the --id, e.g., --id field=FLAT exptime=10.0. |
| Comment by sogo.mineo [ 26/May/20 ] |
|
Thank you. I made all fields available in the YAML spec file. |
| Comment by price [ 27/May/20 ] |
|
I'm not sure hard-coding all the available keys is the right thing to do. The command-line syntax is free-form, and I think that's the way to go here too. For example:
id: field=FLAT exptime=10.0
Are you concerned about spelling mistakes? I see both advantages and disadvantages to your chosen implementation. Can you explain your reasoning, please? |
| Comment by sogo.mineo [ 27/May/20 ] |
|
I wanted to check the syntax of "value" in "--id key=value", needed to know the type of "value" in advance, and enumerated all key s with their types. But this is not essential. And I agree that writing "id: [key=value, key=value]" is clearer than mixing these "key=value" with other things like "config:..." and "validity:...". I am revising the code. |
| Comment by sogo.mineo [ 27/May/20 ] |
|
Currently, the output shell script is not a self-contained executable script but a mere function body. One has to source it (source out.sh) in order to execute it. Now that the shell script is written to a file, I think the shell script should be a self-contained executable script that begins with #!/bin/sh. Is it OK to make this change? |
| Comment by sogo.mineo [ 27/May/20 ] |
|
https://developer.lsst.io/work/flow.html#git-commit-organization-best-practices seems to say that I have to squash all commits made after the first review, rebase tickets/ |
| Comment by price [ 28/May/20 ] |
|
Most important is that there is one functional change per commit. Ideally, there should be a one-to-one relationship between functional changes and commits (e.g., changes to the same code made before and after review get squashed together), but sometimes that is difficult to achieve, and so there may be multiple commits to achieve one overall functional change. But there should not be two functional changes in the same commit if you can at all help it. Does that make sense? |
| Comment by price [ 28/May/20 ] |
|
I think having the script be executable rather than sourced is a good idea. |
| Comment by sogo.mineo [ 29/May/20 ] |
|
I changed my code so that it will produce an executable script, and also added bootstrap functionality just now. Though I said in slack that I would provide lineList field for bootstrap, I decided not to provide it because it was not provided for reduceArc.py either. I believe the overall code is ready for re-review. Could you check the new code? (I'm sorry for its big change from what it was on the first review) |
| Comment by sogo.mineo [ 01/Jun/20 ] |
|
I changed a few lines in order to promote --output parameter to a positional parameter, and to replace logger.info(f"message {s}") to logger.info("message %s", s). I squashed this change onto the existing commit and pushed it. I wrongly thought github would still be able to show diffs, but what I see now is only the new code of 1500 lines with no history. I should not have done this... |
| Comment by sogo.mineo [ 01/Jun/20 ] |
|
Ah, I found how to view diffs. Sorry for making a noise. |
| Comment by sogo.mineo [ 04/Jun/20 ] |
|
I learned just now that it is I who have to merge this ticket branch to master. The latest code (as I have pushed to github) is a little different from what Paul approved, but am I still allowed to merge this branch? |
| Comment by price [ 04/Jun/20 ] |
|
Please go ahead. |
| Comment by sogo.mineo [ 04/Jun/20 ] |
|
Thank you. I have merged this ticket branch to master. |