Skip to content

Commit

Permalink
fix up no calibs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfitzasp committed May 28, 2024
1 parent 69bd90c commit 1b0af91
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
16 changes: 14 additions & 2 deletions astrosource/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,17 @@ def photometric_calculations(targets, paths, targetRadius, errorReject=0.1, file
starRejected=0
if (less(d2d, targetRadius)):
#magErrVar = 1.0857 * (photFile[idx][5]/photFile[idx][4])
magErrVar = photFile[idx][5]



# If the file hasn't been calibrated, then it still contains the countrate in it.
# So convert these to mags, otherwise use the calibrated error.
if photFile[idx][4] > 50:
magErrVar = 1.0857 * (photFile[idx][5]/photFile[idx][4])
else:
magErrVar = photFile[idx][5]


if magErrVar < errorReject:

magErrEns = 1.0857 * (allCountsArray[allcountscount][1]/allCountsArray[allcountscount][0])
Expand Down Expand Up @@ -390,6 +400,8 @@ def photometric_calculations(targets, paths, targetRadius, errorReject=0.1, file
fileCount.append(allCountsArray[allcountscount][0])
allcountscount=allcountscount+1

#breakpoint()

# Check for dud images
imageReject=[]
for j in range(asarray(outputPhot).shape[0]):
Expand Down Expand Up @@ -451,7 +463,7 @@ def photometric_calculations(targets, paths, targetRadius, errorReject=0.1, file

except ValueError:
#raise AstrosourceException("No target stars were detected in your dataset. Check your input target(s) RA/Dec")
#print(traceback.print_exc())
print(traceback.print_exc())
logger.error("This target star was not detected in your dataset. Check your input target(s) RA/Dec")
#logger.info("Rejected Stdev Measurements: : {}".format(stdevReject))
#logger.error("Rejected Error Measurements: : {}".format(starErrorRejCount))
Expand Down
5 changes: 5 additions & 0 deletions astrosource/astrosource.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def __init__(self, targets, indir, **kwargs):
self.nopanstarrs = kwargs.get('nopanstarrs', False)
self.nosdss = kwargs.get('nosdss', False)
self.noskymapper = kwargs.get('noskymapper', False)

self.nocalib = kwargs.get('nocalib', False)
self.closerejectd = kwargs.get('closerejectd', 5.0)
self.targetradius = kwargs.get('targetradius', 1.5)
self.matchradius = kwargs.get('matchradius', 1.0)
Expand Down Expand Up @@ -171,6 +173,9 @@ def analyse(self, calib=True, usescreenedcomps=False, usecompsused=False, usecom

# Check that it is a filter that can actually be calibrated - in the future I am considering calibrating w against V to give a 'rough V' calibration, but not for now.

if self.nocalib==True:
calib=False

print ("calib: " + str(calib))

if usecompletedcalib == False:
Expand Down
4 changes: 3 additions & 1 deletion astrosource/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
@click.option('--nopanstarrs', is_flag=True, help='Do not use the PanSTARRS catalogue for calibration')
@click.option('--nosdss', is_flag=True, help='Do not use the SDSS catalogue for calibration')
@click.option('--noskymapper', is_flag=True, help='Do not use the Skymapper catalogue for calibration')
@click.option('--nocalib', is_flag=True, help='Do not undertake calibration')
@click.option('--varsearch', is_flag=True, help='Undertake variability calculations for identified stars')

@click.option('--varsearchglobalstdev', type=float, default=-99.9, help='Just detect variables above a certain variability not variability by magnitude')
Expand Down Expand Up @@ -114,7 +115,7 @@ def main(full, stars, comparison, variablehunt, notarget, lowestcounts, usescree
varsearchminimages, ignoreedgefraction, usecompsused, usecompletedcalib, mincompstarstotal, calc, \
calib, phot, plot, detrend, eebls, period, indir, ra, dec, target_file, format, imgreject, \
mincompstars, maxcandidatestars, closerejectd, bjd, clean, verbose, debug, periodlower, periodupper, \
periodtests, thresholdcounts, nopanstarrs, nosdss, noskymapper, varsearch, varsearchthresh, starreject, hicounts, \
periodtests, thresholdcounts, nopanstarrs, nosdss, noskymapper, nocalib, varsearch, varsearchthresh, starreject, hicounts, \
lowcounts, colourdetect, linearise, colourterm, colourerror, targetcolour, restrictmagbrightest, \
restrictmagdimmest, rejectmagbrightest, rejectmagdimmest,targetradius, matchradius, racut, deccut, \
radiuscut, restrictcompcolourcentre, restrictcompcolourrange, detrendfraction, minfractionimages):
Expand Down Expand Up @@ -166,6 +167,7 @@ def main(full, stars, comparison, variablehunt, notarget, lowestcounts, usescree
nopanstarrs=nopanstarrs,
nosdss=nosdss,
noskymapper=noskymapper,
nocalib=nocalib,
closerejectd=closerejectd,
maxcandidatestars=maxcandidatestars,
verbose=verbose,
Expand Down

0 comments on commit 1b0af91

Please sign in to comment.