Skip to content

Commit

Permalink
Add functions for baseline conversion and conversion of the parameter…
Browse files Browse the repository at this point in the history
… array to a matrix form that can be used to do the correction.
  • Loading branch information
jrhosk committed Feb 7, 2025
1 parent 6ada27d commit 5661ba6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
30 changes: 13 additions & 17 deletions factory_jones.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[\u001b[38;2;128;05;128m2025-02-07 12:23:34,948\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m Module path: \u001b[38;2;50;50;205m/home/mystletainn/Development/calviper/src/calviper\u001b[0m \n"
"[\u001B[38;2;128;05;128m2025-02-07 12:23:34,948\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m Module path: \u001B[38;2;50;50;205m/home/mystletainn/Development/calviper/src/calviper\u001B[0m \n"
]
}
],
Expand All @@ -291,9 +291,7 @@
"id": "6403894b-a634-45a8-9219-05aed71457f1",
"metadata": {},
"outputs": [],
"source": [
"G.gain.empty()"
]
"source": "G.gain.initialize()"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -1039,16 +1037,16 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,194\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 0\tloss: 3.851602077484131 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,195\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 5\tloss: 0.010313255712389946 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,197\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 10\tloss: 0.0034813820384442806 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,198\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 15\tloss: 0.0034759799018502235 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,199\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 20\tloss: 0.0034757850226014853 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,200\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 25\tloss: 0.003475750330835581 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,202\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 30\tloss: 0.003475742880254984 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,203\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 35\tloss: 0.0034757456742227077 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,204\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 40\tloss: 0.0034757573157548904 \n",
"[\u001b[38;2;128;05;128m2025-02-07 12:23:38,206\u001b[0m] \u001b[38;2;50;50;205m INFO\u001b[0m\u001b[38;2;112;128;144m viperlog: \u001b[0m iteration: 45\tloss: 0.003475775709375739 \n"
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,194\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 0\tloss: 3.851602077484131 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,195\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 5\tloss: 0.010313255712389946 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,197\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 10\tloss: 0.0034813820384442806 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,198\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 15\tloss: 0.0034759799018502235 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,199\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 20\tloss: 0.0034757850226014853 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,200\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 25\tloss: 0.003475750330835581 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,202\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 30\tloss: 0.003475742880254984 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,203\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 35\tloss: 0.0034757456742227077 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,204\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 40\tloss: 0.0034757573157548904 \n",
"[\u001B[38;2;128;05;128m2025-02-07 12:23:38,206\u001B[0m] \u001B[38;2;50;50;205m INFO\u001B[0m\u001B[38;2;112;128;144m viperlog: \u001B[0m iteration: 45\tloss: 0.003475775709375739 \n"
]
}
],
Expand Down Expand Up @@ -1145,9 +1143,7 @@
"id": "5acbfa41-2068-4aff-9636-ffd08bfd1199",
"metadata": {},
"outputs": [],
"source": [
"converted = to_baseline(parameter)"
]
"source": "converted = calviper.math.tools.to_baseline(parameter)"
},
{
"cell_type": "code",
Expand Down
4 changes: 1 addition & 3 deletions factory_methods.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@
"id": "1132e46e-545c-45e7-a69b-2591c43bb5de",
"metadata": {},
"outputs": [],
"source": [
"jones.gain.empty()"
]
"source": "jones.gain.initialize()"
},
{
"cell_type": "code",
Expand Down
2 changes: 1 addition & 1 deletion src/calviper/factory/gain.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def matrix(self, array: np.ndarray) -> None:
def example(self):
logger.info("This is a gain matrix specific function that does something with the data.")

def empty(self):
def initialize(self):
identity = np.identity(self._object.sizes["polarization"], dtype=self.dtype)

matrix = xr.DataArray(
Expand Down

0 comments on commit 5661ba6

Please sign in to comment.