LightCurve Estimation from ZTF data
- M. Rigault m.rigault@ipnl.in2p3.fr, CNRS/IN2P3
- S. Reusch: simeon.reusch@desy.de, DESY
ztflc
is however based on ztfquery.
If you have used ztflc
for a research you are publishing, please include the following in your acknowledgments:
"The ztflc code was funded by the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement n°759194 - USNAC, PI: Rigault)."
- You may want to make sure
$ZTFDATA
is defined (see ztfquery.) - You should first run Storing or updating marshal data. for your marshal's science program.
For a target with coordinates ra
, dec
, you want to do force photometry on ZTF data from julian data jdmin
up to julian date jdmax
:
from ztflc import forcephotometry
# Setup the target
fp = forcephotometry.ForcePhotometry.from_coords(ra, dec, jdmin=jdmin,jdmax=jdmax)
# Load the ztf metadata
fp.load_metadata()
# Load the ztf file you are going to need (diffimg and psfimg)
fp.load_filepathes()
# and run the forcephotometry
fp.run_forcefit(verbose=True)
Once the force photometry has run, data are stored as:
fp.data_forcefit
and use fp.show_lc()
to plot the lightcurve.
To store the date_forcefit
, simply do:
fp.store()
the dataframe will be store in $ZTFDATA/forcephotometry/name.csv
(c.f. ztfquery
for $ZTFDATA
). you can also directly provide the filename if you want to dataframe stored elsewhere fp.store(filename)
.
Say you want to get the force photometry from a ztf target named ZTF18aaaaaaa
. Use the same code as example 1, except that, this time, you load fp
using:
from ztflc import forcephotometry
# Setup the target
fp = forcephotometry.ForcePhotometry.from_name(ZTF18aaaaaaa)
the code will use ztfquery.marshal
to recover the information you need (ra, dec jdmin, jdmax).
You can store ztf mashal target information locally using ztfquery
. For instance, if you want to store the "Cosmology" program, simply do:
from ztfquery import marshal
m = marshal.MarshalAccess()
m.load_target_sources("Cosmology")
m.store()
Once you did that, the code will use the locally stored data when you use forcephotometry.ForcePhotometry.from_name(ZTF18aaaaaaa)
The first time you are going to run the forcephotometry for a given target, you most likely need to download the associated data. For instance for ZTF18aaaaaaa
from ztflc import forcephotometry
# Setup the target
fp = forcephotometry.ForcePhotometry.from_name(ZTF18aaaaaaa)
# Download the data:
fp.io.download_data()