Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
procedure reduce (images, ref, d_ityp, f_ityp, l_ityp, question, question2, question3, question4, question5)
string images {prompt="Input images"}
string d_ityp {prompt="IMAGETYPE of dark"}
string f_ityp {prompt="IMAGETYPE of flat"}
string l_ityp {prompt="IMAGETYPE of light"}
string ref {prompt="Reference ra dec file"}
real hwhm = 1.5 {prompt="Mean HWHM of psf in pixels"}
bool question = yes {prompt="Czy w folderze sa niezredukowane pliki flat?"}
bool question2 = yes {prompt="Czy w folderze sa niezredukowane pliki dark?"}
bool question3 = yes {prompt="Czy w folderze sa niezredukowane pliki light?"}
bool question4 = yes {prompt="Czy ekstrapolowac wartosci brakujacych darkow?"}
bool question5 = yes {prompt="Czy wykonac fotometrie na obrazach light?"}
string obsname = "Torun" {prompt="Nazwa obserwatorium"}
real long = 341.436097222 {prompt="Dlugosc geograficzna obserwatorium"}
real latit = 53.09555555499999 {prompt="Szerokosc geograficzna obserwatorium"}
real alt = 80. {prompt="Wysokosc obserwatorium nad poziomemm morza"}
real tz = -1 {prompt="Strefa czasowa"}
real rdnoise = 16 {prompt="Read noise"}
real gain = 2.2 {prompt="Gain"}
string *list
string *lista
string *listf
string *listg
string *listd
string *listx
string *listy
string *listk
string *listm
string *listn
begin
string l_images, img, tmpfile, darkfile, drkfile, flatfile, exdark, dflats, fltfile, ffltfile, tmpfile2, expfile
string lightfile, dlightfile, imtyp, dl_type, fl_type, ll_type, s1, s2, s3, dcor, inity, l_ref, expt, cmdmst
string ras, decs, filter1, hjd1, mag1, err1, air1, exp1, aps1, rs, ds, magi, db, in, dlights, ffk, ffo
string zfk, zfo
real x, y, z, m, n, k, o, p, r, val, thr, l_ra, l_dec
string a, b, c
int i, nl, nwz
string fifilter, fifilter2, fra, fdec
real fotime, fmag, fmerr, fxairmass, fitime, frapert
real j
bool l_question
bool l_question2
bool l_question3
bool l_question4
bool l_question5
string l_obsname
real l_long
real l_latit
real l_alt
real l_tz
real l_rdnoise
real l_gain
l_obsname = obsname
l_long = long
l_latit = latit
l_alt = alt
l_tz = tz
l_rdnoise = rdnoise
l_gain = gain
z = hwhm
x=0.0
a="x"
l_question = question
l_question2 = question2
l_question3 = question3
l_question4 = question4
l_question5 = question5
dl_type = d_ityp
fl_type = f_ityp
ll_type = l_ityp
l_ref = ref
list = ""
lista = ""
listf = ""
listg = ""
listd = ""
listx = ""
listy = ""
listm = ""
listn = ""
l_images = images
set stdimcur=text
set clobber = yes
if (defpac("noao") == no) {
noao
}
if (defpac("imred") == no) {
imred
}
if (defpac("ccdred") == no) {
ccdred
}
if (defpac("astutil") == no) {
astutil
}
if (defpac("noao") == no) {
noao
}
if (defpac("digiphot") == no) {
digiphot
}
if (! defpac ("apphot")) {
print("Package NOAO.DIGIPHOT.APPHOT needs to be loaded.")
bye
}
tmpfile = mktemp ("tmp$tmp")
darkfile = mktemp ("tmp$darks")
dlights = mktemp ("tmp$dlights")
sections (l_images, opt="full", > tmpfile)
list = tmpfile
print ("///////////////////////////////////////////////")
print ("Tworze liste plikow typu dark")
print ("Zapisuje do niej pliki: ")
while (fscan (list, img) != EOF) {
imgets (img, "imagetyp")
imtyp = imgets.value
if (imtyp == dl_type) {
ccdhedit (img, "imagetype", "dark", type="string")
print (img, >> darkfile)
print (img, " ", "zidentyfikowano jako dark")
}
}
delete (tmpfile, ver-, >& "dev$null")
if (access (darkfile)) {
if (l_question2) {
print ("///////////////////////////////////////////////")
print ("Pliki typu dark o podanym imagetype istnieja")
lista = darkfile
while (fscan (lista, s1) !=EOF) {
imgets (s1, "EXPTIME")
y=real(imgets.value)
if (y !=x ) {
listf = darkfile
while (fscan (listf, s2) !=EOF) {
imgets (s2, "EXPTIME")
z=real(imgets.value)
if (z == y ) {
print (s2, >> z//"dark")
}
}
}
x=y
}
print ("/////////////////////////////////////////////////////")
delete (darkfile, ver-, >& "dev$null")
drkfile = mktemp ("tmp$drk")
print ("Zaczynam usrednianie darkow")
sections (images="*dark", >> drkfile)
listg = drkfile
while (fscan (listg, s3) !=EOF) { # usrednia darki o tych samych czasach
noao; imred; ccdred;
print ("Usredniam darki z listy", " ", s3)
darkcombine ("@"//s3 ,
output=s3//".fits", combine="average", reject="minmax", ccdtype="dark", process=no,
delete=no, clobber=no, scale="exposure", statsec="", nlow=0, nhigh=1, nkeep=1,
mclip=yes, lsigma=3., hsigma=3., rdnoise=l_rdnoise, gain=l_gain, snoise="0.",
pclip=-0.5, blank=0.)
}
}
}
else {
print ("Brak bierzacych plikow typu dark")
}
exdark = mktemp ("tmp$exdark")
sections (images="*dark.fits", > exdark)
list = ""
lista = ""
listf = ""
listg = ""
tmpfile = mktemp ("tmp$tmp")
sections (l_images, opt="full", > tmpfile)
list = tmpfile
print ("///////////////////////////////////////////////////////////")
print ("Tworze liste plikow typu flat")
print ("Zapisuje do niej pliki: ")
flatfile = mktemp ("tmp$flat")
while (fscan (list, img) != EOF) {
imgets (img, "imagetyp")
imtyp = imgets.value
if (imtyp == fl_type) {
ccdhedit (img, "imagetype", "flat", type="string")
print (img, >> flatfile)
print (img, " ", "zidentyfikowano jako flat")
}
}
delete (tmpfile, ver-, >& "dev$null")
dflats = mktemp ("tmp$dflats")
if (access (flatfile)) {
if (l_question) {
lista = flatfile
while (fscan (lista, s1) !=EOF) {
imgets (s1, "EXPTIME")
x=real(imgets.value)
noao; imred; ccdred
if (access(x//"dark.fits")) {
print ("Obraz", " ", s1, " ", "redukuje o dark", " ",x//"dark.fits")
ccdproc (s1,
output="d"//s1, ccdtype="flat", max_cache=0, noproc=no, fixpix=no, overscan=no,
trim=no, zerocor=no, darkcor=yes, flatcor=no, illumcor=no, fringecor=no,
readcor=no, scancor=no, readaxis="line", fixfile="", biassec="", trimsec="",
zero="", dark=x//"dark.fits", flat="", illum="", fringe="", minreplace=1.,
scantype="shortscan", nscan=1, interactive=no, function="legendre", order=1,
sample="*", naverage=1, niterate=1, low_reject=3., high_reject=3., grow=0.)
print ("d"//s1, >> dflats)
}
else {
print ("Nie znaleziono pliku ", x//"dark.fits", ", nie potrafie prosto zredukowac " , s1 , " o dark")
if (l_question4 ) {
listd = exdark
k=0.0
o=1000000.0
while (fscan (listd, s2) !=EOF) {
imstat (s2,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (m)
imgets (s2, "EXPTIME")
n=real(imgets.value)
print (s2, " " , n, " ", m)
if (n > k) {
k=n
zfk=s2
}
if (n < o) {
o=n
zfo=s2
}
}
imstat (zfk,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (p)
imstat (zfo,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (r)
print ("Najwieksza liczba to ", k, " a najmniejsza to ", o)
print ("Odpowiadaja im meany ", p, " oraz ", r)
val = (((p - r)/(k - o))*(x-o))
imarith (val,"+",zfo,x//"dark.fits",title="", divzero=0., hparams="", pixtype="", calctype="",
verbose=no, noact=no)
hedit (x//"dark.fits",
"EXPTIME",x, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit (x//"dark.fits",
"DARKTIME",x, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit (x//"dark.fits",
"EXPTIME",x, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
imarith (s1,
"-",x//"dark.fits", "d"//s1, title="", divzero=0., hparams="", pixtype="", calctype="",
verbose=no, noact=no)
print ("d"//s1, >> dflats)
}
}
}
lista = dflats
while (fscan (lista, s1) !=EOF) {
imgets (s1, "FILTER")
b=imgets.value
if (b !=a ) {
listf = dflats
while (fscan (listf, s2) !=EOF) {
imgets (s2, "FILTER")
c=imgets.value
if (c == b ) {
print (s2, >> c//".flat")
}
}
}
a=b
}
print ("//////////////////////////////////////////////////////")
print ("Zaczynam usrednianie flatow")
fltfile = mktemp ("tmp$fltfile")
sections (images="*.flat", >> fltfile)
listg = fltfile
ffltfile = mktemp ("tmp$ffltfile")
while (fscan (listg, s3) !=EOF) {
noao; imred; ccdred;
print ("Usredniam flaty z listy", " ", s3)
flatcombine ("@"//s3 ,
output=s3//".fits", combine="average", reject="avsigclip", ccdtype="flat", process=no,
subsets=no, delete=no, clobber=no, scale="none", statsec="", nlow=1, nhigh=1,
nkeep=1, mclip=yes, lsigma=3., hsigma=3., rdnoise=l_rdnoise, gain=l_gain,
snoise="0.", pclip=-0.5, blank=1.)
sections (images=s3//".fits", >> ffltfile)
}
delete (fltfile, ver-, >& "dev$null")
print ("Zaczynam normalizacje flatow")
listg = ffltfile
while (fscan (listg, s3) !=EOF) {
imstat (s3,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (x)
imarith (s3,
"/",x , "n"//s3, title="", divzero=0., hparams="", pixtype="", calctype="",
verbose=no, noact=no)
}
}
}
else {
print ("Brak bierzacych plikow typu flat")
}
list = ""
lista = ""
listf = ""
listg = ""
tmpfile = mktemp ("tmp$tmp")
sections (l_images, opt="full", > tmpfile)
lightfile = mktemp ("tmp$light")
list = tmpfile
print ("//////////////////////////////////////////////////")
print ("Tworze liste plikow typu light")
print ("Zapisuje do niej pliki: ")
while (fscan (list, img) != EOF) {
imgets (img, "imagetyp")
imtyp = imgets.value
if (imtyp == ll_type) {
ccdhedit (img, "imagetype", "object", type="string")
print (img, >> lightfile)
print (img, " ", "zidentyfikowano jako light")
}
}
# delete (tmpfile, ver-, >& "dev$null")
list = ""
lista = ""
listf = ""
listg = ""
b=""
if (access (lightfile)) {
dlightfile = mktemp ("tmp$dlight")
if (l_question3) {
print ("//////////////////////////////////////////////")
print ("Zaczynam przetwarzanie plikow typu light")
lista = lightfile
while (fscan (lista, s1) !=EOF) {
imgets (s1, "FILTER")
b=imgets.value
imgets (s1, "EXPTIME")
x=real(imgets.value)
if (access("n"//b//".flat.fits")) {
if (access(x//"dark.fits")) {
print ("Redukuje plik ", s1, " w oparciu o ", "n"//b//".flat.fits" ," oraz ", x//"dark.fits")
noao; imred; ccdred
ccdproc (s1,
output="d"//s1, ccdtype="object", max_cache=100, noproc=no, fixpix=no, overscan=no,
trim=no, zerocor=no, darkcor=yes, flatcor=yes, illumcor=no, fringecor=no,
readcor=no, scancor=no, readaxis="line", fixfile="", biassec="", trimsec="",
zero="", dark=x//"dark.fits", flat="n"//b//".flat.fits", illum="", fringe="", minreplace=1.,
scantype="shortscan", nscan=1, interactive=no, function="legendre", order=1,
sample="*", naverage=1, niterate=1, low_reject=3., high_reject=3., grow=0.)
print ("d"//s1, >> dlights)
}
else {
print ("Nie znaleziono pliku ", x//"dark.fits", ", nie potrafie prosto zredukowac " , s1 , " o dark")
if (l_question4) {
print ("W tym kroku ekstrapoluje darka ", x//"dark.fits")
listd = exdark
k=0.0
o=1000000.0
while (fscan (listd, s2) !=EOF) {
imstat (s2,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (m)
imgets (s2, "EXPTIME")
n=real(imgets.value)
print (s2, " " , n, " ", m)
if (n > k) {
k=n
ffk=s2
}
if (n < o) {
o=n
ffo=s2
}
}
imstat (ffk,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (p)
imstat (ffo,
fields="mean", lower=INDEF, upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (r)
val = (((p - r)/(k - o))*(x-o))
print ("Odejmuje ", val, " od obrazu " , s1, " tworze plik ", "dt"//s1)
imarith (val,"+",ffo,x//"dark.fits",title="", divzero=0., hparams="", pixtype="",
verbose=no, noact=no)
hedit (x//"dark.fits",
"EXPTIME",x, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit (x//"dark.fits",
"DARKTIME",x, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit (x//"dark.fits",
"EXPTIME",x, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
imarith (s1,
"-",x//"dark.fits", "dt"//s1, title="", divzero=0., hparams="", pixtype="", calctype="",
verbose=no, noact=no)
noao; imred; ccdred
print ("Redukuje ", "dt"//s1, " dodatkowo na flat ", "n"//b//".flat.fits", " tworzac plik " , "d"//s1)
ccdproc ("dt"//s1,
output="d"//s1, ccdtype="object", max_cache=0, noproc=no, fixpix=no, overscan=no,
trim=no, zerocor=no, darkcor=no, flatcor=yes, illumcor=no, fringecor=no,
readcor=no, scancor=no, readaxis="line", fixfile="", biassec="", trimsec="",
zero="", dark="", flat="n"//b//".flat.fits", illum="", fringe="", minreplace=1.,
scantype="shortscan", nscan=1, interactive=no, function="legendre", order=1,
sample="*", naverage=1, niterate=1, low_reject=3., high_reject=3., grow=0.)
print ("d"//s1, >> dlights)
}
}
}
else {
print ("Nie znaleziono pliku ", "n"//b//".flat.fits" , ", nie potrafie zredukowac " , s1 , " o flat")
}
}
}
else {
tmpfile2 = mktemp ("tmp$tmp2")
sections (l_images, opt="full", > tmpfile2)
dlights = tmpfile2
}
if (l_question5) {
print ("Zdecydowales sie na fotometrie")
magi = mktemp ("tmp$magi")
db = mktemp ("tmp$db")
in = mktemp ("tmp$in")
if (access (dlights)) {
print ("Istnieja pliki poredukcyjne")
if (access (l_ref)) {
print ("Znaleziono plik z coordynatami")
list = l_ref
while (fscan(list, l_ra, l_dec) !=EOF) {
print("Wspolrzedne gwiazd pola: ", l_ra, l_dec)
}
observatory ("set",
"obspars", " ", " ", verbose=yes, observatory="obspars", name=l_obsname, longitude=l_long,
latitude=l_latit, altitude=l_alt, timezone=l_tz)
hedit ("@"//dlights,
"ra", l_ra, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit ("@"//dlights,
"dec", l_dec, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit ("@"//dlights,
"epoch","2000", add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
hedit ("@"//dlights,
"observat", l_obsname, add=yes, addonly=no, delete=no, verify=no, show=yes, update=yes)
# listk = dlights
#
# a=""
#
# while (fscan (listk, expt) !=EOF) {
# expfile = mktemp ("tmp$expfile")
# hselect (expt,"time-obs","yes", > expfile)
# type (expfile,map_cc=yes, device="terminal") | scan (a)
#
# if (access (a)) {
#
# }
#
# else {
# print ("Nie ma keyworda TIME-OBS")
#
# print ("tutaj obok powinna byc wartopsc:xxx",a,"xxx")
# imgets (expt, "expstart")
# hedit (expt, "time-obs", imgets.value, add+, ver-)
#
# imgets (expt, "exptime")
# hedit (expt, "exposure", imgets.value, add+, ver-)
#
# }
#
# }
#
cmdmst = mktemp ("tmp$cmdmst")
print ("st = mst (@'date-obs', @'time-obs', obsdb (observat, 'longitude'))", >> cmdmst )
print ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
type (cmdmst,map_cc=yes, device="terminal")
asthedit ("@"//dlights, cmdmst,
table="", colnames="", prompt="asthedit>", update=yes, verbose=no,
oldstyle=no)
setairmass ("@"//dlights,
observatory=l_obsname, intype="beginning", outtype="effective", ra="ra",
dec="dec", equinox="epoch", st="st", ut="time-obs", date="date-obs",
exposure="exptime", airmass="airmass", utmiddle="utmiddle", scale=750.,
show=yes, update=yes, override=yes)
setjd ("@"//dlights,
observatory=l_obsname, date="date-obs", time="time-obs", exposure="exptime",
ra="ra", dec="dec", epoch="epoch", jd="jd", hjd="hjd", ljd="ljd", utdate=yes,
uttime=yes, listonly=no)
list = ""
list = dlights
while (fscan (list, inity) != EOF) {
imstat (inity,
fields="midpt,stddev", lower=0., upper=INDEF, nclip=0, lsigma=3., usigma=3.,
binwidth=0.1, format=no, cache=no) | scan (x, y)
thr = x+0.5*y
print (thr)
nwz = 0
for (i=1; i <=3; i+=1) {
starfind (inity,
inity//".coo"//i,z,thr, datamin=INDEF, datamax=INDEF, fradius=2.5, sepmin=5.,
npixmin=5., maglo=INDEF, maghi=INDEF, roundlo=0., roundhi=0.5, sharplo=0.1,
sharphi=7., wcs="", wxformat="", wyformat="", boundary="nearest", constant=0.,
nxblock=INDEF, nyblock=INDEF, verbose=no)
fields (inity//".coo"//i,
"5", lines="1-", quit_if_miss=no, print_file_n=no) | match (".") | count | scan (nl)
if (nl == nwz) {
z = hwhm
}
else {
fields (inity//".coo"//i,
"5", lines="1-", quit_if_miss=no, print_file_n=no) | match (".") | average | scan (z, m)
}
print (z*2)
if (z < hwhm) {
z = hwhm
}
}
sort (inity//".coo3",
column=4, ignore_white=no, numeric_sort=yes, reverse_sort=yes, >inity//".coos")
ccxymatch (inity//".coos",
l_ref, inity//".match", 3., 4., refpoints="", xin=INDEF, yin=INDEF, xmag=INDEF,
ymag=INDEF, xrotation=INDEF, yrotation=INDEF, projection="tan", lngref=INDEF,
latref=INDEF, lngcolumn=1, latcolumn=2, xcolumn=1, ycolumn=2,
lngunits="hours", latunits="degrees", separation=3., pseparation=9.,
matching="triangles", nmatch=50, ratio=10., nreject=30, lngformat="",
latformat="", xformat="%13.3f", yformat="%13.3f", verbose=yes)
ccmap (inity//".match",
inity//".db", solutions="", images=inity, results="", xcolumn=3, ycolumn=4, lngcolumn=1,
latcolumn=2, xmin=INDEF, xmax=INDEF, ymin=INDEF, ymax=INDEF, lngunits="",
latunits="", insystem="j2000", refpoint="coords", lngref="INDEF",
latref="INDEF", refsystem="INDEF", lngrefunits="", latrefunits="",
projection="tan", fitgeometry="general", function="polynomial", xxorder=2,
xyorder=2, xxterms="half", yxorder=2, yyorder=2, yxterms="half", maxiter=0,
reject=3., update=yes, pixsystem="logical", verbose=yes, interactive=no,
graphics="stdgraph", cursor="")
ccfind (l_ref,
inity//".match2",inity, lngcolumn=1, latcolumn=2, lngunits="", latunits="", insystem="j2000",
usewcs=yes, xref=INDEF, yref=INDEF, xmag=INDEF, ymag=INDEF, xrotation=INDEF,
yrotation=INDEF, lngref="INDEF", latref="INDEF", lngrefunits="",
latrefunits="", refsystem="j2000", projection="tan", center=yes, sbox=21,
cbox=9, datamin=INDEF, datamax=INDEF, background=INDEF, maxiter=5,
tolerance=0, xformat="", yformat="", verbose=yes)
fields (inity//".match2",
"3,4", lines="1-", quit_if_miss=no, print_file_n=no, > inity//".match3")
fields (inity//".match2",
"1,2", lines="1-", quit_if_miss=no, print_file_n=no, > inity//".match5")
y=3*z
qphot (inity,
5, 3*y, 2*z,2*y, coords=inity//".match3", output=inity//".mag", plotfile="",
zmag=25., exposure="EXPTIME", airmass="AIRMASS", filter="FILTER",
obstime="HJD", epadu=l_gain, interactive=no, radplots=no, icommands="",
gcommands="", wcsin=")_.wcsin", wcsout=")_.wcsout", cache=")_.cache",
verbose=")_.verbose", graphics=")_.graphics", display=")_.display")
if (access (inity//".mag")) {
sections (inity//".match3",option="fullname", nimages=103, >> magi)
sections (inity//".db",option="fullname", nimages=103, >> db)
sections (inity ,option="fullname", nimages=103, >> in)
# txdump (inity//".mag",
# "IFILTER,OTIME,MAG,MERR,XAIRMASS,ITIME,RAPERT", "yes", headers=no,
# parameters=yes, > inity//".pho" )
#
# type (inity//".match5",
# map_cc=yes, device="terminal") | match("??:??:??", > inity//".match4")
#
# joinlines (inity//".match4",
# inity//".pho", output=inity//".all", delim=" ", missing="Missing", maxchars=161,
# shortest=yes, verbose=yes)
txdump (inity//".mag",
"IFILTER,OTIME,MAG,MERR,XAIRMASS,ITIME,RAPERT", "yes", headers=no,
parameters=yes, > inity//".pho")
translit (inity//".pho", "INDEF","00.000", delete=no, collapse=no, > inity//".pho2")
listm = inity//".pho2"
while (fscan (listm, fifilter, fotime, fmag, fmerr, fxairmass) != EOF) {
fifilter2 = substr (fifilter, 1, 1)
if (fifilter2 == "0") {
fifilter2 = "I"
}
printf ("%s %14.6f %6.3f %5.3f %5.3f\n", fifilter2,fotime,fmag,fmerr,fxairmass, >> inity//".pho3")
}
type (inity//".match5",
map_cc=yes, device="terminal") | match("??:??:??", > inity//".match4")
listn = inity//".match4"
while (fscan (listn, fra, fdec) != EOF) {
printf ("%s %s\n", fra, fdec, >> inity//".match7")
}
joinlines (inity//".match7",
inity//".pho3", output=inity//".all", delim=" ", missing="Missing", maxchars=161,
shortest=yes, verbose=yes)
}
else {
if (access (magi)) {
lista = ""
lista = magi
while (fscan (lista , s1) !=EOF) {
}
}
if (access (db)) {
listf = ""
listf = db
while (fscan (listf , s2) !=EOF) {
}
}
if (access (in)) {
listg = ""
listg = in
while (fscan (listg , s3) !=EOF) {
}
xyxymatch (inity//".coo3",
s1, inity//".sav", 3., refpoints="", xin=INDEF, yin=INDEF,
xmag=INDEF, ymag=INDEF, xrotation=INDEF, yrotation=INDEF, xref=INDEF,
yref=INDEF, xcolumn=1, ycolumn=2, xrcolumn=1, yrcolumn=2, separation=9.,
matching="triangles", nmatch=50, ratio=10., nreject=30, xformat="%13.3f",
yformat="%13.3f", interactive=no, verbose=yes, icommands="")
cctran (inity//".sav",
inity//".mcc", s2,s3 , geometry="geometric", forward=yes, xref=INDEF,
yref=INDEF, xmag=INDEF, ymag=INDEF, xrotation=INDEF, yrotation=INDEF,
lngref=INDEF, latref=INDEF, lngunits="", latunits="", projection="tan",
xcolumn=1, ycolumn=2, lngformat="", latformat="", min_sigdigit=7)
ccmap (inity//".mcc",
inity//".db", solutions="", images=inity, results="", xcolumn=3, ycolumn=4, lngcolumn=1,
latcolumn=2, xmin=INDEF, xmax=INDEF, ymin=INDEF, ymax=INDEF, lngunits="",
latunits="", insystem="j2000", refpoint="coords", lngref="INDEF",
latref="INDEF", refsystem="INDEF", lngrefunits="", latrefunits="",
projection="tan", fitgeometry="general", function="polynomial", xxorder=2,
xyorder=2, xxterms="half", yxorder=2, yyorder=2, yxterms="half", maxiter=0,
reject=3., update=yes, pixsystem="logical", verbose=yes, interactive=no,
graphics="stdgraph", cursor="")
ccfind (l_ref,
inity//".temp",inity, lngcolumn=1, latcolumn=2, lngunits="", latunits="", insystem="j2000",
usewcs=yes, xref=INDEF, yref=INDEF, xmag=INDEF, ymag=INDEF, xrotation=INDEF,
yrotation=INDEF, lngref="INDEF", latref="INDEF", lngrefunits="",
latrefunits="", refsystem="j2000", projection="tan", center=yes, sbox=21,
cbox=9, datamin=INDEF, datamax=INDEF, background=INDEF, maxiter=5,
tolerance=0, xformat="", yformat="", verbose=yes)
fields (inity//".temp",
"3,4", lines="1-", quit_if_miss=no, print_file_n=no, > inity//".temp3")
fields (inity//".temp",
"1,2", lines="1-", quit_if_miss=no, print_file_n=no, > inity//".temp5")
y=3*z
qphot (inity,
5, 3*y, 2*z,2*y, coords=inity//".temp3", output=inity//".mag", plotfile="",
zmag=25., exposure="EXPTIME", airmass="AIRMASS", filter="FILTER",
obstime="HJD", epadu=l_gain, interactive=no, radplots=no, icommands="",
gcommands="", wcsin=")_.wcsin", wcsout=")_.wcsout", cache=")_.cache",
verbose=")_.verbose", graphics=")_.graphics", display=")_.display")
if (access(inity//".mag")) {
# txdump (inity//".mag",
# "IFILTER,OTIME,MAG,MERR,XAIRMASS,ITIME,RAPERT", "yes", headers=no,
# parameters=yes, > inity//".pho" )
#
# type (inity//".temp5",
# map_cc=yes, device="terminal") | match("??:??:??", > inity//".temp4")
#
# joinlines (inity//".temp4",
# inity//".pho", output=inity//".all", delim=" ", missing="Missing", maxchars=161,
# shortest=yes, verbose=yes)
txdump (inity//".mag",
"IFILTER,OTIME,MAG,MERR,XAIRMASS,ITIME,RAPERT", "yes", headers=no,
parameters=yes, > inity//".pho")
translit (inity//".pho", "INDEF", "00.000", delete=no, collapse=no, > inity//".pho2")
listm = inity//".pho2"
while (fscan (listm, fifilter, fotime, fmag, fmerr, fxairmass) != EOF) {
fifilter2 = substr (fifilter, 1, 1)
if (fifilter2 == "0") {
fifilter2 = "I"
}
printf ("%s %14.6f %6.3f %5.3f %5.3f\n", fifilter2,fotime,fmag,fmerr,fxairmass, >> inity//".pho3")
}
type (inity//".temp5",
map_cc=yes, device="terminal") | match("??:??:??", > inity//".match4")
listn = inity//".match4"
while (fscan (listn, fra, fdec) != EOF) {
printf ("%s %s\n", fra, fdec, >> inity//".match7")
}
joinlines (inity//".match7",
inity//".pho3", output=inity//".all", delim=" ", missing="Missing", maxchars=161,
shortest=yes, verbose=yes)
}
}
}
}
}
}
}
}
else {
print ("Brak bierzacych plikow typu light")
}
list = ""
lista = ""
listf = ""
listg = ""
listd = ""
listx = ""
listy = ""
listk = ""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.