Skip to content

Commit aed28e6

Browse files
authored
fix more numpy dtypes (hpc4cmb#672)
* replace np.int by np.int64 * replace np.float by np.float64 * replace np.complex by np.complex128
1 parent 2b7d6cf commit aed28e6

29 files changed

Lines changed: 143 additions & 143 deletions

pipelines/toast_cov_invert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def main():
6262
"--threshold",
6363
required=False,
6464
default=1e-3,
65-
type=np.float,
65+
type=np.float64,
6666
help="Reciprocal condition number threshold",
6767
)
6868

pipelines/toast_fake_focalplane.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def main():
128128
parser.add_argument(
129129
"--random_seed",
130130
required=False,
131-
type=np.int,
131+
type=np.int64,
132132
default=123456,
133133
help="Random number generator seed for randomized " "detector parameters",
134134
)

pipelines/toast_ground_sim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import numpy as np
1616
import time
1717

18-
delay = np.float(os.environ["TOAST_STARTUP_DELAY"])
18+
delay = np.float64(os.environ["TOAST_STARTUP_DELAY"])
1919
wait = np.random.rand() * delay
2020
# print('Sleeping for {} seconds before importing TOAST'.format(wait),
2121
# flush=True)

pipelines/toast_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def main():
7979
"--samplerate",
8080
required=False,
8181
default=100.0,
82-
type=np.float,
82+
type=np.float64,
8383
help="Detector sample rate (Hz)",
8484
)
8585

src/toast/fod/noise_estimation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ def exec(self, data):
162162
# Extend the gap between intervals to prevent sample pairs
163163
# that cross the gap.
164164

165-
gap_min = np.int(self._lagmax) + 1
165+
gap_min = np.int64(self._lagmax) + 1
166166
# Downsampled data requires longer gaps
167-
gap_min_nsum = np.int(self._lagmax * self._nsum) + 1
167+
gap_min_nsum = np.int64(self._lagmax * self._nsum) + 1
168168
offset, nsamp = tod.local_samples
169169
gapflags = np.zeros_like(commonflags)
170170
gapflags_nsum = np.zeros_like(commonflags)

src/toast/fod/psd_math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def crosscov_psd(
135135
# for the unflagged samples
136136
naverage = lagmax
137137

138-
nreal = np.int(np.ceil((time_stop - time_start) / stationary_period))
138+
nreal = np.int64(np.ceil((time_stop - time_start) / stationary_period))
139139

140140
# Communicate lagmax samples from the beginning of the array
141141
# backwards in the MPI communicator
@@ -222,7 +222,7 @@ def crosscov_psd(
222222
# Collect the estimated covariance functions
223223

224224
my_covs = {}
225-
nreal_task = np.int(np.ceil(nreal / ntask))
225+
nreal_task = np.int64(np.ceil(nreal / ntask))
226226

227227
if comm is None:
228228
for ireal in range(nreal):

src/toast/pipeline_tools/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def add_mc_args(parser):
6565
"--MC-start",
6666
required=False,
6767
default=0,
68-
type=np.int,
68+
type=np.int64,
6969
help="First Monte Carlo noise realization",
7070
)
7171
parser.add_argument(
7272
"--MC-count",
7373
required=False,
7474
default=1,
75-
type=np.int,
75+
type=np.int64,
7676
help="Number of Monte Carlo noise realizations",
7777
)
7878
return

src/toast/pipeline_tools/atm.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,134 +78,134 @@ def add_atmosphere_args(parser):
7878
parser.add_argument(
7979
"--focalplane-radius-deg",
8080
required=False,
81-
type=np.float,
81+
type=np.float64,
8282
help="Override focal plane radius [deg]",
8383
)
8484

8585
parser.add_argument(
8686
"--atm-verbosity",
8787
required=False,
8888
default=0,
89-
type=np.int,
89+
type=np.int64,
9090
help="Atmospheric sim verbosity level",
9191
)
9292
parser.add_argument(
9393
"--atm-lmin-center",
9494
required=False,
9595
default=0.01,
96-
type=np.float,
96+
type=np.float64,
9797
help="Kolmogorov turbulence dissipation scale center",
9898
)
9999
parser.add_argument(
100100
"--atm-lmin-sigma",
101101
required=False,
102102
default=0.001,
103-
type=np.float,
103+
type=np.float64,
104104
help="Kolmogorov turbulence dissipation scale sigma",
105105
)
106106
parser.add_argument(
107107
"--atm-lmax-center",
108108
required=False,
109109
default=10.0,
110-
type=np.float,
110+
type=np.float64,
111111
help="Kolmogorov turbulence injection scale center",
112112
)
113113
parser.add_argument(
114114
"--atm-lmax-sigma",
115115
required=False,
116116
default=10.0,
117-
type=np.float,
117+
type=np.float64,
118118
help="Kolmogorov turbulence injection scale sigma",
119119
)
120120
parser.add_argument(
121121
"--atm-gain",
122122
required=False,
123123
default=2e-5,
124-
type=np.float,
124+
type=np.float64,
125125
help="Atmospheric gain factor.",
126126
)
127127
parser.add_argument(
128128
"--atm-gain-coarse",
129129
required=False,
130130
default=8e-5,
131-
type=np.float,
131+
type=np.float64,
132132
help="Coarse atmospheric gain factor.",
133133
)
134134
parser.add_argument(
135135
"--atm-zatm",
136136
required=False,
137137
default=40000.0,
138-
type=np.float,
138+
type=np.float64,
139139
help="atmosphere extent for temperature profile",
140140
)
141141
parser.add_argument(
142142
"--atm-zmax",
143143
required=False,
144144
default=200.0,
145-
type=np.float,
145+
type=np.float64,
146146
help="atmosphere extent for water vapor integration",
147147
)
148148
parser.add_argument(
149149
"--atm-xstep",
150150
required=False,
151151
default=10.0,
152-
type=np.float,
152+
type=np.float64,
153153
help="size of volume elements in X direction",
154154
)
155155
parser.add_argument(
156156
"--atm-ystep",
157157
required=False,
158158
default=10.0,
159-
type=np.float,
159+
type=np.float64,
160160
help="size of volume elements in Y direction",
161161
)
162162
parser.add_argument(
163163
"--atm-zstep",
164164
required=False,
165165
default=10.0,
166-
type=np.float,
166+
type=np.float64,
167167
help="size of volume elements in Z direction",
168168
)
169169
parser.add_argument(
170170
"--atm-nelem-sim-max",
171171
required=False,
172172
default=10000,
173-
type=np.int,
173+
type=np.int64,
174174
help="controls the size of the simulation slices",
175175
)
176176
parser.add_argument(
177177
"--atm-wind-dist",
178178
required=False,
179179
default=3000.0,
180-
type=np.float,
180+
type=np.float64,
181181
help="Maximum wind drift to simulate without discontinuity",
182182
)
183183
parser.add_argument(
184184
"--atm-z0-center",
185185
required=False,
186186
default=2000.0,
187-
type=np.float,
187+
type=np.float64,
188188
help="central value of the water vapor distribution",
189189
)
190190
parser.add_argument(
191191
"--atm-z0-sigma",
192192
required=False,
193193
default=0.0,
194-
type=np.float,
194+
type=np.float64,
195195
help="sigma of the water vapor distribution",
196196
)
197197
parser.add_argument(
198198
"--atm-T0-center",
199199
required=False,
200200
default=280.0,
201-
type=np.float,
201+
type=np.float64,
202202
help="central value of the temperature distribution",
203203
)
204204
parser.add_argument(
205205
"--atm-T0-sigma",
206206
required=False,
207207
default=10.0,
208-
type=np.float,
208+
type=np.float64,
209209
help="sigma of the temperature distribution",
210210
)
211211
parser.add_argument(
@@ -223,31 +223,31 @@ def add_atmosphere_args(parser):
223223
parser.add_argument(
224224
"--weather-pwv",
225225
required=False,
226-
type=np.float,
226+
type=np.float64,
227227
help="Override randomized PWV [mm]",
228228
)
229229
parser.add_argument(
230230
"--weather-temperature",
231231
required=False,
232-
type=np.float,
232+
type=np.float64,
233233
help="Override randomized air temperature [K]",
234234
)
235235
parser.add_argument(
236236
"--weather-pressure",
237237
required=False,
238-
type=np.float,
238+
type=np.float64,
239239
help="Override randomized surface pressure [Pa]",
240240
)
241241
parser.add_argument(
242242
"--weather-west-wind",
243243
required=False,
244-
type=np.float,
244+
type=np.float64,
245245
help="Override randomized West wind [m/s]",
246246
)
247247
parser.add_argument(
248248
"--weather-south-wind",
249249
required=False,
250-
type=np.float,
250+
type=np.float64,
251251
help="Override randomized South wind [m/s]",
252252
)
253253
# Common flag mask may already be added

src/toast/pipeline_tools/binning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def add_binner_args(parser):
9494
# `nside` may already be added
9595
try:
9696
parser.add_argument(
97-
"--nside", required=False, default=512, type=np.int, help="Healpix NSIDE"
97+
"--nside", required=False, default=512, type=np.int64, help="Healpix NSIDE"
9898
)
9999
except argparse.ArgumentError:
100100
pass

src/toast/pipeline_tools/dist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def add_dist_args(parser):
1717
parser.add_argument(
1818
"--group-size",
1919
required=False,
20-
type=np.int,
20+
type=np.int64,
2121
help="Size of a process group assigned to an observation",
2222
)
2323
try:

0 commit comments

Comments
 (0)