desihub / desimeter

DESI coordinates and transformations
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

New petal-alignments.yaml needed #188

Open kfanning opened 2 years ago

kfanning commented 2 years ago

New focal plane metrology (petal alignments) provided by Steve is needed for offline FP calibration analysis.

json copied to text below with updated information: {
"type": "group", "name": "focal_plane_metrology", "version": 200, "elements": [

        {   
            "name":         "0",
            "version":      76298,
            "constants":    {
"petal_id":4,
"petal_offset_x":0.1224,
"petal_offset_y":0.0528,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":-1.885369086

} },

        {   
            "name":         "1",
            "version":      76299,
            "constants":    {
"petal_id":5,
"petal_offset_x":0.0105,
"petal_offset_y":0.0005,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":-1.256580211

} },

        {   
            "name":         "2",
            "version":      76300,
            "constants":    {
"petal_id":6,
"petal_offset_x":-0.0265,
"petal_offset_y":0.0415,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":-0.628353415

} },

        {   
            "name":         "3",
            "version":      76301,
            "constants":    {
"petal_id":3,
"petal_offset_x":-0.048,
"petal_offset_y":-0.0299,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":0.000150777

} },

        {   
            "name":         "4",
            "version":      76302,
            "constants":    {
"petal_id":8,
"petal_offset_x":-0.0196,
"petal_offset_y":0.0459,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":0.628496576

} },

        {   
            "name":         "5",
            "version":      76303,
            "constants":    {
"petal_id":10,
"petal_offset_x":-0.0794,
"petal_offset_y":-0.0113,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":1.256632524

} },

        {   
            "name":         "6",
            "version":      76304,
            "constants":    {
"petal_id":11,
"petal_offset_x":-0.0412,
"petal_offset_y":0.003,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":1.885139556

} },

        {   
            "name":         "7",
            "version":      76305,
            "constants":    {
"petal_id":2,
"petal_offset_x":0.0904,
"petal_offset_y":-0.102,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":2.51321797

} },

        {   
            "name":         "8",
            "version":      76306,
            "constants":    {
"petal_id":7,
"petal_offset_x":0.0056,
"petal_offset_y":-0.0267,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":3.14148172

} },

        {   
            "name":         "9",
            "version":      76307,
            "constants":    {
"petal_id":9,
"petal_offset_x":-0.014,
"petal_offset_y":0.0264,
"petal_offset_z":0.0,
"petal_rot_1":0.0,
"petal_rot_2":0.0,
"petal_rot_3":3.769961549

} }

]

}

dkirkby commented 2 years ago

Note that simply replacing data/petal-alignments.yaml is probably not sufficient here since that would overwrite the metrology needed to analyze all pre-shutdown FVC data.

The minimal change is probably to update the API by adding an optional date or exposure ID parameter to the ptl2fp and fp2ptl methods of desimeter.transform.

julienguy commented 2 years ago

We need time dependent configurations for desimeter. One approach would be to list the calibration files (petal transformation, but also fiducials and positioners IDs in the metrology table, new metrology table patch if some fiducials have moved, new distortion coefficients for the transforms) would be listed in a configuration yaml file, with several configurations depending on the date of the observations, like we do for the spectroscopic pipeline (see https://desi.lbl.gov/trac/wiki/Pipeline/SpectroCalib and the calibration finder code https://github.com/desihub/desispec/blob/master/py/desispec/calibfinder.py)

dkirkby commented 2 years ago

For reference, the before/after alignments are displayed in this interactive notebook.

dkirkby commented 2 years ago

I just created a new branch where the yaml file is updated for the post-shutdown alignment. This is not the way forward (so should not be merged), but at least allows @deisenstein to continue analyzing the new calibration data via:

git fetch
git checkout new-petal-align
pip install .

More details: the new branch has separate petal-alignments-121.yaml (before) and petal-alignments-200.yaml (after) files with petal-alignment.yaml a soft link to the newer parameters.

dkirkby commented 2 years ago

I just rebased the new-petal-align branch onto #189 with

git rebase --onto fvcproc master new-petal-align