Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
spherelib
Spherelib
Commits
4c30aa98
Commit
4c30aa98
authored
Oct 15, 2010
by
Maude Martin
Browse files
write_table dmc
parent
7c0f6c4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
python/spherelib/myIO.py
python/spherelib/myIO.py
+26
-2
No files found.
python/spherelib/myIO.py
View file @
4c30aa98
...
...
@@ -226,7 +226,7 @@ def read_cat (file):
return
cat
def
write_covmat
(
file
,
cov
,
nbmodes
=
None
):
""" Write c
l
to file.
""" Write c
ov mat
to file.
Parameters
----------
...
...
@@ -253,5 +253,29 @@ def write_covmat(file, cov, nbmodes=None):
def
write_table
(
file
,
tab
):
""" Write table to file.
Parameters
----------
file: string, FITS file name or DMC object name
tab: array-like
"""
if
__piolib
(
file
):
try
:
grpname
=
pio
.
GetGrpName
(
file
)
checkgroup
(
grpname
,
"TAB2D"
)
grp
=
pio
.
OpenTAB2DGrp
(
grpname
,
"w"
)
val
=
pio
.
CreateTAB2DObject
(
file
,
'PIODOUBLE'
)
nr
=
shape
(
tab
)[
0
]
nc
=
shape
(
tab
)[
1
]
val
=
pio
.
WriteTAB2DObject
(
tab
,
file
,
'PIO'
+
precision
,
"tab=0:%d,0:%d"
%
((
nc
-
1
),(
nr
-
1
))
,
grp
)
pio
.
CloseTAB2DGrp
(
grp
)
except
pio
.
pioError
,
val
:
return
str
(
val
)
else
:
sp
.
write_table
(
file
,
tab
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment