Skip to content

Commit

Permalink
change test.ylm
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-takase committed Apr 25, 2024
1 parent c89c9b6 commit becb635
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
8 changes: 5 additions & 3 deletions grasp2alm/beam_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from dataclasses import dataclass, field
import numpy as np
import matplotlib.pyplot as plt
from typing import Union
from .beam_polar import BeamPolar

@dataclass
Expand Down Expand Up @@ -34,12 +35,13 @@ class BeamCut:
vini: float = 0.0
vinc: float = 0.0
vnum: int = 0
c: np.ndarray = np.array([]) # TODO check is it needed variable
c: np.ndarray = None # TODO check is it needed variable

icomp: int = 0
icut: int = 0
ncomp: int = 0
ncut: int = 0
amp: np.ndarray = field(default_factory=lambda: np.array([]))
amp: np.ndarray = None

def __init__(self, filepath):
super().__init__()
Expand Down Expand Up @@ -76,7 +78,7 @@ def __post_init__(self):
break
data = line.split()
if len(data) == 7:
self.vini, self.vinc, self.vnum, c, self.icomp, self.icut, self.ncomp = map(float, data)
self.vini, self.vinc, self.vnum, self.c, self.icomp, self.icut, self.ncomp = map(float, data)
self.vnum, self.icomp, self.icut, self.ncomp = map(int, (self.vnum, self.icomp, self.icut, self.ncomp))
for i in range(self.vnum):
line = fi.readline()
Expand Down
2 changes: 1 addition & 1 deletion grasp2alm/beam_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BeamGrid:
ny: int = 0
freq: float = 0.0
frequnit: str = ""
amp: np.ndarray = field(default_factory=lambda: np.array([]))
amp: np.ndarray = None


def __init__(self, filepath):
Expand Down
25 changes: 10 additions & 15 deletions notebooks/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"gridfile = \"../grasp2alm/test/beam_files/test.grd\"\n",
"cutfile = \"../grasp2alm/test/beam_files/test.cut\"\n",
"gridfile = \"../test/beam_files/test.grd\"\n",
"cutfile = \"../test/beam_files/test.cut\"\n",
"grid = g2a.BeamGrid(gridfile)\n",
"cut = g2a.BeamCut(cutfile)"
]
Expand All @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -204,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -248,7 +248,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -322,19 +322,14 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"galm = gmap.to_alm()\n",
"calm = cmap.to_alm()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -344,7 +339,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -354,7 +349,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit becb635

Please sign in to comment.