Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bo Zhang
csst
Commits
59ec96bd
Commit
59ec96bd
authored
Jun 01, 2022
by
BO ZHANG
🏀
Browse files
replaced CONFIG_PATH for photometry
parent
43cc6dc5
Changes
1
Show whitespace changes
Inline
Side-by-side
csst/msc/_photometry/csst_photometry.py
View file @
59ec96bd
...
...
@@ -35,8 +35,12 @@ import stats
# import system
from
shutil
import
which
prog_dir
=
sys
.
path
[
0
]
config_path
=
os
.
path
.
join
(
prog_dir
,
'config/'
)
# prog_dir = sys.path[0]
# CONFIG_PATH = os.path.join(prog_dir, 'config/')
from
csst
import
PACKAGE_PATH
CONFIG_PATH
=
PACKAGE_PATH
+
"/msc/phot_config/"
__version__
=
"1.2.3"
...
...
@@ -151,11 +155,11 @@ def closest_match(coord1, coord2, min_dist=1.0):
# if not system.cmd_exists('sex') or not system.cmd_exists('psfex'):
# raise OSError('No sex or psfex SHELL command found! Please install')
#
# sexfile = os.path.join(
config_path
, 'csst_psfex.sex')
# covfile = os.path.join(
config_path
, 'gauss_4.0_7x7.conv')
# nnwfile = os.path.join(
config_path
, 'default.nnw')
# parfile = os.path.join(
config_path
, 'csst_psfex.param')
# pexfile = os.path.join(
config_path
, 'csst.psfex')
# sexfile = os.path.join(
CONFIG_PATH
, 'csst_psfex.sex')
# covfile = os.path.join(
CONFIG_PATH
, 'gauss_4.0_7x7.conv')
# nnwfile = os.path.join(
CONFIG_PATH
, 'default.nnw')
# parfile = os.path.join(
CONFIG_PATH
, 'csst_psfex.param')
# pexfile = os.path.join(
CONFIG_PATH
, 'csst.psfex')
# psffile = fitsname + '_psf.fits'
#
# # head=fits.getheader(fitsfile)
...
...
@@ -286,11 +290,11 @@ def get_psf(fitsfile, outdir=None, psf_size=101, degree=2, variability=0.3, fwhm
_
,
filename
=
os
.
path
.
split
(
rootname
[:
indpos
])
fitsname
=
os
.
path
.
join
(
outdir
,
filename
)
sexfile
=
os
.
path
.
join
(
config_path
,
'csst_psfex.sex'
)
covfile
=
os
.
path
.
join
(
config_path
,
filter_name
)
nnwfile
=
os
.
path
.
join
(
config_path
,
'default.nnw'
)
parfile
=
os
.
path
.
join
(
config_path
,
'csst_psfex.param'
)
pexfile
=
os
.
path
.
join
(
config_path
,
'csst.psfex'
)
sexfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'csst_psfex.sex'
)
covfile
=
os
.
path
.
join
(
CONFIG_PATH
,
filter_name
)
nnwfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'default.nnw'
)
parfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'csst_psfex.param'
)
pexfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'csst.psfex'
)
psffile
=
fitsname
+
'_psf.fits'
command
=
'sex '
+
fitsfile
+
' -c '
+
sexfile
+
' -CATALOG_NAME '
+
psffile
+
' -PARAMETERS_NAME '
+
parfile
+
' -DETECT_MINAREA '
+
str
(
...
...
@@ -361,13 +365,13 @@ def photometry(fitsfile, outdir=None, detect_thresh=1.0, analysis_thresh=1.0, cl
_
,
rootname
=
os
.
path
.
split
(
fitsname
)
fitsname
=
os
.
path
.
join
(
outdir
,
rootname
)
sexfile
=
os
.
path
.
join
(
config_path
,
'csst_phot.sex'
)
covfile
=
os
.
path
.
join
(
config_path
,
'default.conv'
)
nnwfile
=
os
.
path
.
join
(
config_path
,
'default.nnw'
)
sexfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'csst_phot.sex'
)
covfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'default.conv'
)
nnwfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'default.nnw'
)
if
phot_type
==
"psf"
:
parfile
=
os
.
path
.
join
(
config_path
,
'csst_psfphot.params'
)
parfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'csst_psfphot.params'
)
else
:
parfile
=
os
.
path
.
join
(
config_path
,
'csst_modphot.params'
)
parfile
=
os
.
path
.
join
(
CONFIG_PATH
,
'csst_modphot.params'
)
psffile
=
fitsname
+
'_psf.fits'
head
=
fits
.
getheader
(
fitsfile
,
0
)
head1
=
fits
.
getheader
(
fitsfile
,
1
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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