How to output the DATE_OBS #543
Replies: 1 comment
-
Hi @simonlucalandi, from sourcextractor.config import *
from glob import glob
import numpy as np
top = load_fits_images(
sorted(glob('im_?_??.fits')),
sorted(glob('im_?_??.psf')),
)
# Split the top list by filter
top.split(ByKeyword('FILTER'))
# Split each band by image filename (one image per subgroup)
for n,filter in top:
filter.split(ByKeyword('IMAGE_FILENAME'))
mesgroup = MeasurementGroup(top)
MAG_ZEROPOINT = 32.19
i = 0
flux = {}
mag = {}
x,y = get_pos_parameters()
pmx = FreeParameter(0.0, Range((-100.0,100.0), RangeType.LINEAR))
pmy = FreeParameter(0.0, Range((-100.0,100.0), RangeType.LINEAR))
add_output_column('pmx', pmx)
add_output_column('pmy', pmy)
for band, group in mesgroup:
flux[i] = get_flux_parameter()
mag[i] = DependentParameter(lambda f: -2.5 * np.log10(f) + MAG_ZEROPOINT, flux[i])
add_output_column(f'mag_{band}', mag[i])
n = 1
for filename, ima in group:
tp = ConstantParameter((float(ima[0].meta["MJD-OBS"]) - 6000.0) / 365.25)
add_output_column(f'mjd_{band}_{n}', tp)
xr = DependentParameter(lambda x, dx, tp: x + tp*dx, x, pmx, tp)
yr = DependentParameter(lambda y, dy, tp: y + tp*dy, y, pmy, tp)
ra,de = get_world_position_parameters(xr, yr)
add_model(ima, PointSourceModel(xr, yr, flux[i]))
add_output_column(f'ra_{band}_{n}', ra)
add_output_column(f'dec_{band}_{n}', de)
n += 1
i += 1 SX++ was run with $ sourcextractor++ --detection-image=im_detection.fits --output-properties=FlexibleModelFitting --python-config-file=pm.py --output-catalog-filename=pm.cat I hope this helps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all.
In the last few months I collected several hours of sky data using my simple setup and manually extracted the photometry for a few variable stars.
But I don't want to waste all the other data captured... so I'm thinking to build a kind of "survey" tool, using Sourcextractor++ to analize images and create a catalog with the photometry for all the objects found, and than import the catalog in a database.
How to add the date of the observation to the output catalog? What is the best practice here?
Any suggestion is really appreciated.
Beta Was this translation helpful? Give feedback.
All reactions