more apps
This commit is contained in:
0
srgcat/__init__.py
Normal file
0
srgcat/__init__.py
Normal file
8
srgcat/admin.py
Normal file
8
srgcat/admin.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from django.contrib import admin
|
||||
from srgcat.models import ArtCat, SrgDataDump, Selection
|
||||
|
||||
# Register your models here.
|
||||
|
||||
admin.site.register(ArtCat)
|
||||
admin.site.register(SrgDataDump)
|
||||
admin.site.register(Selection)
|
5
srgcat/apps.py
Normal file
5
srgcat/apps.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class SrgcatConfig(AppConfig):
|
||||
name = 'srgcat'
|
32
srgcat/forms.py
Normal file
32
srgcat/forms.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django import forms
|
||||
from srgcat.models import Selection, UserSessionParameters
|
||||
#import urllib
|
||||
|
||||
class SourceNameForm(forms.Form):
|
||||
ra = forms.FloatField(label='RA')
|
||||
dec = forms.FloatField(label='Dec')
|
||||
|
||||
class LookupTargetForm(forms.Form):
|
||||
ra = forms.FloatField(label='RA')
|
||||
dec = forms.FloatField(label='Dec')
|
||||
load_surveypath = forms.BooleanField(required=False, initial=False)
|
||||
|
||||
class SkyMapForm(forms.Form):
|
||||
skymap = forms.IntegerField(label='SkyMap')
|
||||
|
||||
|
||||
class SelectionForm(forms.ModelForm):
|
||||
name = forms.CharField(label='Long name')
|
||||
slug = forms.CharField(label='Short name (slug)')
|
||||
public = forms.BooleanField(required=False, initial=True)
|
||||
class Meta:
|
||||
model = Selection
|
||||
fields = ('name', 'slug', 'public')
|
||||
|
||||
class UserSessionParametersForm(forms.ModelForm):
|
||||
sign_threshold = forms.FloatField(required=False)
|
||||
target_ra = forms.FloatField(required=False)
|
||||
target_dec = forms.FloatField(required=False)
|
||||
class Meta:
|
||||
model = UserSessionParameters
|
||||
fields = ('sign_threshold','target_ra','target_dec')
|
183
srgcat/management/commands/00_init_skymaps.py
Normal file
183
srgcat/management/commands/00_init_skymaps.py
Normal file
@@ -0,0 +1,183 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix, neighbours
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
|
||||
from srgcat.models import SkyMaps
|
||||
from monthplan.models import SurveyHealpixPlate, NSIDE_PLATES, ORDER
|
||||
|
||||
# XMMU JHHMMSS.s+/-DDMMSS.
|
||||
# www.cosmos.esa.int/web/xmm-newton/source-naming-convention
|
||||
def make_source_name(key, ra, dec):
|
||||
c = SkyCoord(ra, dec, frame=FK5(), unit="deg")
|
||||
str1 = c.to_string('hmsdms',alwayssign=False,pad=False,precision=1).split()
|
||||
str2 = c.to_string('hmsdms',alwayssign=False,pad=False,precision=0).split()
|
||||
name = key+" J%s%s" % (str1[0].replace('h','').replace('m','').replace('s',''),
|
||||
str2[1].replace('d','').replace('m','').replace('s',''))
|
||||
|
||||
return name
|
||||
|
||||
|
||||
def load_skymaps(filename):
|
||||
#hdul = fits.open(filename)
|
||||
#hdul.info()
|
||||
|
||||
table = Table.read(filename)
|
||||
df = table.to_pandas()
|
||||
for i in df.index:
|
||||
skymap = SkyMaps(
|
||||
SMAPNR = int(df['SMAPNR'][i]),
|
||||
RA_MIN = float(df['RA_MIN'][i]),
|
||||
RA_MAX = float(df['RA_MAX'][i]),
|
||||
DE_MIN = float(df['DE_MIN'][i]),
|
||||
DE_MAX = float(df['DE_MAX'][i]),
|
||||
RA_CEN = float(df['RA_CEN'][i]),
|
||||
DE_CEN = float(df['DE_CEN'][i]),
|
||||
ELON_CEN = float(df['ELON_CEN'][i]),
|
||||
ELAT_CEN = float(df['ELAT_CEN'][i]),
|
||||
GLON_CEN = float(df['GLON_CEN'][i]),
|
||||
GLAT_CEN = float(df['GLAT_CEN'][i]),
|
||||
X_MIN = float(df['X_MIN'][i]),
|
||||
Y_MIN = float(df['Y_MIN'][i]),
|
||||
OWNER = int(df['OWNER'][i]),
|
||||
N_NBRS = int(df['N_NBRS'][i]),
|
||||
FIELD1 = int(df['FIELD1'][i]),
|
||||
FIELD2 = int(df['FIELD2'][i]),
|
||||
FIELD3 = int(df['FIELD3'][i]),
|
||||
FIELD4 = int(df['FIELD4'][i]),
|
||||
FIELD5 = int(df['FIELD5'][i]),
|
||||
FIELD6 = int(df['FIELD6'][i]),
|
||||
FIELD7 = int(df['FIELD7'][i]),
|
||||
FIELD8 = int(df['FIELD8'][i]),
|
||||
FIELD9 = int(df['FIELD9'][i]))
|
||||
skymap.save()
|
||||
pass
|
||||
|
||||
def find_neighbours():
|
||||
skymaps = SkyMaps.objects.all()
|
||||
for skymap in skymaps:
|
||||
skymap.neighbours.clear()
|
||||
try:
|
||||
if(skymap.FIELD1 > 0):
|
||||
n1 = SkyMaps.objects.get(SMAPNR=skymap.FIELD1)
|
||||
skymap.neighbours.add(n1)
|
||||
if(skymap.FIELD2 > 0):
|
||||
n2 = SkyMaps.objects.get(SMAPNR=skymap.FIELD2)
|
||||
skymap.neighbours.add(n2)
|
||||
if(skymap.FIELD3 > 0):
|
||||
n3 = SkyMaps.objects.get(SMAPNR=skymap.FIELD3)
|
||||
skymap.neighbours.add(n3)
|
||||
if(skymap.FIELD4 > 0):
|
||||
n4 = SkyMaps.objects.get(SMAPNR=skymap.FIELD4)
|
||||
skymap.neighbours.add(n4)
|
||||
if(skymap.FIELD5 > 0):
|
||||
n5 = SkyMaps.objects.get(SMAPNR=skymap.FIELD5)
|
||||
skymap.neighbours.add(n5)
|
||||
if(skymap.FIELD6 > 0):
|
||||
n6 = SkyMaps.objects.get(SMAPNR=skymap.FIELD6)
|
||||
skymap.neighbours.add(n6)
|
||||
if(skymap.FIELD7 > 0):
|
||||
n7 = SkyMaps.objects.get(SMAPNR=skymap.FIELD7)
|
||||
skymap.neighbours.add(n7)
|
||||
if(skymap.FIELD8 > 0):
|
||||
n8 = SkyMaps.objects.get(SMAPNR=skymap.FIELD8)
|
||||
skymap.neighbours.add(n8)
|
||||
if(skymap.FIELD9 > 0):
|
||||
n9 = SkyMaps.objects.get(SMAPNR=skymap.FIELD9)
|
||||
skymap.neighbours.add(n9)
|
||||
except:
|
||||
print(skymap," neighbour not found")
|
||||
skymap.save()
|
||||
|
||||
print(skymap)
|
||||
|
||||
def find_plates():
|
||||
|
||||
skymaps = SkyMaps.objects.all()
|
||||
for skymap in skymaps:
|
||||
skymap.survey_healpix_plate.clear()
|
||||
|
||||
plates = SurveyHealpixPlate.objects.all()
|
||||
for plate in plates:
|
||||
ra = plate.ra
|
||||
dec = plate.dec
|
||||
|
||||
try:
|
||||
skymap = SkyMaps.objects.get(Q(RA_MIN__lte=ra) & Q(RA_MAX__gt=ra) & Q(DE_MIN__lte=dec) & Q(DE_MAX__gt=dec))
|
||||
except Exception as e:
|
||||
print("%s (%s)" % (e.message, type(e)))
|
||||
return
|
||||
|
||||
skymap.survey_healpix_plate.add(plate)
|
||||
skymap.save()
|
||||
|
||||
around = neighbours(plate.healpix, NSIDE_PLATES, order=ORDER)
|
||||
for index in around:
|
||||
if(index<0):
|
||||
continue
|
||||
try:
|
||||
pl = SurveyHealpixPlate.objects.get(healpix=index)
|
||||
except:
|
||||
print("Healpix index {} not found, exit".format(index))
|
||||
return
|
||||
skymap.survey_healpix_plate.add(pl)
|
||||
skymap.save()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
#skymaps = SkyMaps.objects.all()
|
||||
#skymaps.delete()
|
||||
|
||||
#load_skymaps('/data/erosita/SKYMAPS.fits')
|
||||
|
||||
#find_neighbours()
|
||||
|
||||
find_plates()
|
||||
return
|
||||
"""
|
||||
some checks:
|
||||
"""
|
||||
|
||||
skymaps = SkyMaps.objects.all()[:10]
|
||||
for skymap in skymaps:
|
||||
print(skymap, skymap.FIELD1,
|
||||
skymap.FIELD2,
|
||||
skymap.FIELD3,
|
||||
skymap.FIELD4,
|
||||
skymap.FIELD5,
|
||||
skymap.FIELD6,
|
||||
skymap.FIELD7,
|
||||
skymap.FIELD8,
|
||||
skymap.FIELD9)
|
||||
n = skymap.survey_healpix_plate.all()
|
||||
for nn in n:
|
||||
print(nn)
|
||||
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
90
srgcat/management/commands/00_load_art_gc.py
Normal file
90
srgcat/management/commands/00_load_art_gc.py
Normal file
@@ -0,0 +1,90 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
# XMMU JHHMMSS.s+/-DDMMSS.
|
||||
# www.cosmos.esa.int/web/xmm-newton/source-naming-convention
|
||||
def make_source_name(key, ra, dec):
|
||||
c = SkyCoord(ra, dec, frame=FK5(), unit="deg")
|
||||
str1 = c.to_string('hmsdms',alwayssign=False,pad=False,precision=1).split()
|
||||
str2 = c.to_string('hmsdms',alwayssign=False,pad=False,precision=0).split()
|
||||
name = key+" J%s%s" % (str1[0].replace('h','').replace('m','').replace('s',''),
|
||||
str2[1].replace('d','').replace('m','').replace('s',''))
|
||||
|
||||
return name
|
||||
|
||||
|
||||
def load_gc_table(filename, name, e1, e2):
|
||||
datafile='/export/django/srg/data/Rodion_GC/'+filename
|
||||
|
||||
cat = ArtCat(name=name, e1=e1, e2=e2)
|
||||
cat.save()
|
||||
|
||||
table = Table.read(datafile, format='ascii')
|
||||
# ra dec sig cnts/s erg/s/cm^2
|
||||
for item in table:
|
||||
ra=item['ra']
|
||||
dec=item['dec']
|
||||
src_name = make_source_name('IKIa', ra, dec)
|
||||
crd = SkyCoord(ra, dec, frame=FK5(), unit="deg")
|
||||
print(ra,dec,crd.galactic.l,crd.galactic.b)
|
||||
src = ArtSource(catalog=cat,
|
||||
name=src_name,
|
||||
radec_error=30.0,
|
||||
ra=item['ra'],
|
||||
dec=item['dec'],
|
||||
rate=item['cnts/s'],
|
||||
flux=item['erg/s/cm^2'],
|
||||
sign=item['sig'])
|
||||
src.save()
|
||||
print('--> Successfully loaded "%s"' % name)
|
||||
pass
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
# def add_arguments(self, parser):
|
||||
# parser.add_argument('poll_id', nargs='+', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
# create sqlalchemy engine
|
||||
# engine = create_engine("mysql+pymysql://{user}:{pw}@localhost/{db}"
|
||||
# .format(user="heauser",
|
||||
# pw="srg2019@L2_heasarc",
|
||||
# db="heasarc_db"))
|
||||
|
||||
cats = ArtCat.objects.all()
|
||||
cats.delete()
|
||||
|
||||
load_gc_table('src.list', "ArtCat GC e04to12keV v1.0", 4.0, 12.0)
|
||||
load_gc_table('src_10_20.list', "ArtCat GC e10to20keV v1.0", 10.0, 20.0)
|
||||
load_gc_table('src_20_30.list', "ArtCat GC e20to30keV v1.0", 20.0, 30.0)
|
||||
|
||||
hp = HEALPix(nside=NSIDE_SOURCES, order=ORDER, frame=FK5())
|
||||
# update healpix indexes
|
||||
srcs = ArtSource.objects.all()
|
||||
for src in srcs:
|
||||
crd = SkyCoord(src.ra, src.dec, frame="fk5", unit="deg")
|
||||
src.healpix = hp.skycoord_to_healpix(crd)
|
||||
src.save()
|
||||
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
144
srgcat/management/commands/00_load_gyro.py
Normal file
144
srgcat/management/commands/00_load_gyro.py
Normal file
@@ -0,0 +1,144 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.utils import timezone
|
||||
import numpy as np
|
||||
from srglib.utils import slerp, quat_to_pol_and_roll
|
||||
from Quaternion import Quat
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump, Gyro
|
||||
from monthplan.models import SurveyHealpixPlate, Survey
|
||||
from srglib.utils import TZ_UTC, TZ_MSK, load_gyro_file, mission2date
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
|
||||
def find_closest(now, closest_greater_qs, closest_less_qs):
|
||||
|
||||
try:
|
||||
try:
|
||||
closest_greater = closest_greater_qs[0]
|
||||
except IndexError:
|
||||
closest = closest_less_qs[0]
|
||||
|
||||
try:
|
||||
closest_less = closest_less_qs[0]
|
||||
except IndexError:
|
||||
closest = closest_greater_qs[0]
|
||||
except IndexError:
|
||||
raise self.model.DoesNotExist("There is no closest object because there are no objects.")
|
||||
print("closest_less:",closest_less.ra,closest_less.dec)
|
||||
print("closest_greater:",closest_greater.ra,closest_greater.dec)
|
||||
|
||||
|
||||
delta = (closest_greater.dtime-now).total_seconds()/(closest_greater.dtime-closest_less.dtime).total_seconds()
|
||||
#print((now-closest_greater.dtime).total_seconds())
|
||||
#print((closest_greater.dtime-closest_less.dtime).total_seconds())
|
||||
print('delta ',delta)
|
||||
ra = np.interp(delta, [0.0, 1.0], [closest_less.ra, closest_greater.ra])
|
||||
dec = np.interp(delta, [0.0, 1.0], [closest_less.dec, closest_greater.dec])
|
||||
#quat = slerp([1,0,0,0], [0,0,0,1], np.arange(0, 1, 0.001))
|
||||
|
||||
quat = slerp([closest_less.q2, closest_less.q3, closest_less.q4, closest_less.q1],
|
||||
[closest_greater.q2, closest_greater.q3, closest_greater.q4, closest_greater.q1],
|
||||
[delta])
|
||||
qfin=Quat(attitude=quat[0])
|
||||
ra = qfin.ra
|
||||
dec=qfin.dec
|
||||
roll=qfin.roll
|
||||
|
||||
return ra, dec
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
gyros = Gyro.objects.all()
|
||||
#print(gyros.count())
|
||||
|
||||
|
||||
|
||||
#filename='/srg/a1/work/oper/data/2020/srg_20201125_182700/L0/srg_20201125_182700_000_gyro.fits'
|
||||
#load_gyro_file(filename)
|
||||
|
||||
#now_utc = timezone.now()
|
||||
#survey = Survey.objects.filter(Q(start__lte=now_utc) & Q(stop__gte=now_utc))[0]
|
||||
#closest_greater_qs = survey.surveypath_set.filter(dtime__gt=now_utc).order_by('dtime')
|
||||
#closest_less_qs = survey.surveypath_set.filter(dtime__lt=now_utc).order_by('-dtime')
|
||||
#closest_ra, closest_dec = find_closest(now_utc, closest_greater_qs, closest_less_qs)
|
||||
#print(closest_ra, closest_dec)
|
||||
|
||||
#path = survey.surveypath_set.all()
|
||||
#print(path.count())
|
||||
|
||||
#for p in path:
|
||||
# mjd=Time(p.dtime, format='datetime')
|
||||
# #print(p.dtime,mjd)
|
||||
# break
|
||||
|
||||
for g in gyros:
|
||||
dtime=Time(mission2date(g.obt), format='datetime').datetime
|
||||
mjd=Time(g.mjd, format='mjd') - 3*u.hour
|
||||
msk=mjd.to_datetime(timezone=TZ_MSK)
|
||||
utc=mjd.to_datetime(timezone=TZ_UTC)
|
||||
|
||||
try:
|
||||
survey = Survey.objects.filter(Q(start__lte=utc) & Q(stop__gte=utc))[0]
|
||||
except:
|
||||
continue
|
||||
closest_greater_qs = survey.surveypath_set.filter(dtime__gt=utc).order_by('dtime')
|
||||
closest_less_qs = survey.surveypath_set.filter(dtime__lt=utc).order_by('-dtime')
|
||||
try:
|
||||
try:
|
||||
closest_greater = closest_greater_qs[0]
|
||||
except IndexError:
|
||||
closest = closest_less_qs[0]
|
||||
|
||||
try:
|
||||
closest_less = closest_less_qs[0]
|
||||
except IndexError:
|
||||
closest = closest_greater_qs[0]
|
||||
except IndexError:
|
||||
raise self.model.DoesNotExist("There is no closest object because there are no objects.")
|
||||
|
||||
closest_ra, closest_dec = find_closest(utc, closest_greater_qs, closest_less_qs)
|
||||
|
||||
crd_path = SkyCoord(closest_ra, closest_dec, frame="fk5", unit="deg")
|
||||
crd_gyro = SkyCoord(g.ra, g.dec, frame="fk5", unit="deg")
|
||||
print(utc)
|
||||
print(g.ra)
|
||||
print('1 ',closest_greater.dtime)
|
||||
print('1 ',closest_greater.ra)
|
||||
print('2 ',closest_less.dtime)
|
||||
print('2 ',closest_less.ra)
|
||||
print('interp -->',closest_ra)
|
||||
print(crd_gyro.separation(crd_path).arcmin)
|
||||
break
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
@@ -0,0 +1,90 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
import logging
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
from astropy.io import fits
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump, SkyMapSource
|
||||
from monthplan.models import SurveyHealpixPlate
|
||||
from srglib.utils import TZ_MSK, load_srg_data_dumps, make_source_name, load_simbad_sources
|
||||
from srglib.utils import find_heasarc_counterparts, update_all_skymap_sources_counterparts, load_skymap_sources_dir
|
||||
from srglib.utils import mark_new_skymap_sources_in_latest, clean_skymap_sources, update_allsky_missed
|
||||
from srglib.utils import load_skymap_sources_for_artsurvey
|
||||
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
#path='/export/django/srg/data/Rodion_GC/18Apr2022'
|
||||
#load_skymap_sources_for_artsurvey("{}/src_list_0.fits".format(path),'GC.E0',force=True)
|
||||
#return
|
||||
|
||||
#path='/export/django/srg/data/Andy_L20'
|
||||
#load_skymap_sources_for_artsurvey("{}/cat_lp20.fits".format(path),'L20.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/lp20_20220307.fits".format(path),'L20.E0',force=True)
|
||||
|
||||
#path='/export/django/srg/data/Galplane_l20'
|
||||
#load_skymap_sources_for_artsurvey("{}/src_list_0.fits".format(path),'L20rb.E0',force=True)
|
||||
|
||||
#path='/export/django/srg/data/Galplane_l20'
|
||||
#load_skymap_sources_for_artsurvey("{}/src_list_0.fits".format(path),'L20rb_ml.E0',force=True)
|
||||
|
||||
#path='/srg/a1/work/oper/staff/kate/skymap/catalog_artdays/'
|
||||
#load_skymap_sources_for_artsurvey("{}/22y_cat_0.fits".format(path),'22y.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/22y_cat_5.fits".format(path),'22y.E5',force=True)
|
||||
|
||||
path='/srg/a1/work/kate/skymap_artdays/catalog/'
|
||||
load_skymap_sources_for_artsurvey("{}/22y_cat_5.fits".format(path),'22y.E5',force=True)
|
||||
|
||||
|
||||
#load_skymap_sources_for_artsurvey("{}/scan_tot_cat.fits".format(path),'L20.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/scan_0_cat.fits".format(path),'L20p1.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/scan_1_cat.fits".format(path),'L20p2.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/scan_2_cat.fits".format(path),'L20p3.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/scan_3_cat.fits".format(path),'L20p4.E0',force=True)
|
||||
|
||||
|
||||
force=True
|
||||
ebands=['0','1','2','3','4']
|
||||
#fields=['040','025','020','015','010','005','000','355','350','345']
|
||||
#fields=['070','075','080','085','090',]
|
||||
#fields=['270','275','280','285','290','295','300','305','310','215','320','325']
|
||||
#fields=['315']
|
||||
fields=['330','335','340']
|
||||
path='/srg/a1/work/rodion/SRG/art-xc/data/galmap/field_data/'
|
||||
"""
|
||||
for field in fields:
|
||||
for eband in ebands:
|
||||
load_skymap_sources_for_artsurvey("{}/{}/1g/cat_1g_{}.fits".format(path,field,eband),
|
||||
"GP{}.E{}".format(field,eband),
|
||||
force=force)
|
||||
"""
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
50
srgcat/management/commands/01_load_skymap_erosita.py
Normal file
50
srgcat/management/commands/01_load_skymap_erosita.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
import logging
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
from astropy.io import fits
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump, SkyMapSource
|
||||
from monthplan.models import SurveyHealpixPlate
|
||||
from srglib.utils import TZ_MSK, load_srg_data_dumps, make_source_name, load_simbad_sources
|
||||
from srglib.utils import find_heasarc_counterparts, update_all_skymap_sources_counterparts, load_skymap_sources_dir
|
||||
from srglib.utils import mark_new_skymap_sources_in_latest, clean_skymap_sources, update_allsky_missed
|
||||
from srglib.utils import load_skymap_sources_erosita
|
||||
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
import sys
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
logger = logging.getLogger('django')
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
load_skymap_sources_erosita('/data/artxc/erosita/srg_20200322_000000_000.csv')
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
100
srgcat/management/commands/01_load_skymap_for_artsurvey.py
Normal file
100
srgcat/management/commands/01_load_skymap_for_artsurvey.py
Normal file
@@ -0,0 +1,100 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
import logging
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
from astropy.io import fits
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump, SkyMapSource
|
||||
from monthplan.models import SurveyHealpixPlate
|
||||
from srglib.utils import TZ_MSK, load_srg_data_dumps, make_source_name, load_simbad_sources
|
||||
from srglib.utils import find_heasarc_counterparts, update_all_skymap_sources_counterparts, load_skymap_sources_dir
|
||||
from srglib.utils import mark_new_skymap_sources_in_latest, clean_skymap_sources, update_allsky_missed
|
||||
from srglib.utils import load_skymap_sources_for_artsurvey
|
||||
from srglib.utils import update_skymap_sources_for_artsurvey
|
||||
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
path='/srg/work/oper/staff/kate/skymap/catalog'
|
||||
|
||||
"""
|
||||
load_skymap_sources_for_artsurvey("{}/1y_cat_0.fits".format(path),'S12.E0',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1y_cat_1.fits".format(path),'S12.E1',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1y_cat_2.fits".format(path),'S12.E2',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1y_cat_3.fits".format(path),'S12.E3',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1y_cat_4.fits".format(path),'S12.E4',force=True)
|
||||
|
||||
load_skymap_sources_for_artsurvey("{}/1h_cat_0.fits".format(path),'S1.E0',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1h_cat_1.fits".format(path),'S1.E1',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1h_cat_2.fits".format(path),'S1.E2',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1h_cat_3.fits".format(path),'S1.E3',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/1h_cat_4.fits".format(path),'S1.E4',force=True)
|
||||
|
||||
load_skymap_sources_for_artsurvey("{}/2h_cat_0.fits".format(path),'S2.E0',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/2h_cat_1.fits".format(path),'S2.E1',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/2h_cat_2.fits".format(path),'S2.E2',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/2h_cat_3.fits".format(path),'S2.E3',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/2h_cat_4.fits".format(path),'S2.E4',force=True)
|
||||
"""
|
||||
|
||||
"""
|
||||
update_skymap_sources_for_artsurvey("{}/1y_cat_0.fits".format(path),'S12.E0')
|
||||
update_skymap_sources_for_artsurvey("{}/1y_cat_1.fits".format(path),'S12.E1')
|
||||
update_skymap_sources_for_artsurvey("{}/1y_cat_2.fits".format(path),'S12.E2')
|
||||
update_skymap_sources_for_artsurvey("{}/1y_cat_3.fits".format(path),'S12.E3')
|
||||
update_skymap_sources_for_artsurvey("{}/1y_cat_4.fits".format(path),'S12.E4')
|
||||
|
||||
update_skymap_sources_for_artsurvey("{}/1h_cat_0.fits".format(path),'S1.E0')
|
||||
update_skymap_sources_for_artsurvey("{}/1h_cat_1.fits".format(path),'S1.E1')
|
||||
update_skymap_sources_for_artsurvey("{}/1h_cat_2.fits".format(path),'S1.E2')
|
||||
update_skymap_sources_for_artsurvey("{}/1h_cat_3.fits".format(path),'S1.E3')
|
||||
update_skymap_sources_for_artsurvey("{}/1h_cat_4.fits".format(path),'S1.E4')
|
||||
|
||||
update_skymap_sources_for_artsurvey("{}/2h_cat_0.fits".format(path),'S2.E0')
|
||||
update_skymap_sources_for_artsurvey("{}/2h_cat_1.fits".format(path),'S2.E1')
|
||||
update_skymap_sources_for_artsurvey("{}/2h_cat_2.fits".format(path),'S2.E2')
|
||||
update_skymap_sources_for_artsurvey("{}/2h_cat_3.fits".format(path),'S2.E3')
|
||||
update_skymap_sources_for_artsurvey("{}/2h_cat_4.fits".format(path),'S2.E4')
|
||||
"""
|
||||
|
||||
#load_skymap_sources_for_artsurvey("{}/15y_cat_0.fits".format(path),'S123.E0',force=True)
|
||||
|
||||
#load_skymap_sources_for_artsurvey("{}/2y_cat_0.fits".format(path),'S1-4.E0',force=True)
|
||||
|
||||
#load_skymap_sources_for_artsurvey("{}/3h_cat_0.fits".format(path),'S3.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/4h_cat_0.fits".format(path),'S4.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/34h_cat_0.fits".format(path),'S34.E0',force=True)
|
||||
#load_skymap_sources_for_artsurvey("{}/5h_cat_0.fits".format(path),'S5.E0',force=True)
|
||||
load_skymap_sources_for_artsurvey("{}/22y_cat_0.fits".format(path),'S1-5.E0',force=True)
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
80
srgcat/management/commands/01_load_skymap_sources.py
Normal file
80
srgcat/management/commands/01_load_skymap_sources.py
Normal file
@@ -0,0 +1,80 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
import logging
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
from astropy.io import fits
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump, SkyMapSource
|
||||
from monthplan.models import SurveyHealpixPlate
|
||||
from srglib.utils import TZ_MSK, load_srg_data_dumps, make_source_name, load_simbad_sources
|
||||
from srglib.utils import find_heasarc_counterparts, update_all_skymap_sources_counterparts, load_skymap_sources_dir
|
||||
from srglib.utils import mark_new_skymap_sources_in_latest, clean_skymap_sources, update_allsky_missed
|
||||
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
load_skymap_sources_dir('/srg/work/oper/staff/kate/skymap/catalog')
|
||||
|
||||
update_allsky_missed()
|
||||
|
||||
#print('mark_new_skymap_sources_in_latest')
|
||||
#mark_new_skymap_sources_in_latest()
|
||||
#print('update_allsky_missed')
|
||||
#update_allsky_missed()
|
||||
|
||||
"""
|
||||
skymap = SkyMaps.objects.get(SMAPNR=230147)
|
||||
dump=SrgDataDump.objects.get(name='srg_20200310_163523_000')
|
||||
print(skymap)
|
||||
srcs=skymap.skymapsource_set.all().filter(dump=dump).order_by('-rate')
|
||||
clean_skymap_sources(srcs)
|
||||
"""
|
||||
|
||||
"""
|
||||
skymap = SkyMaps.objects.get(SMAPNR=273024)
|
||||
dump=SrgDataDump.objects.get(name='srg_20200311_164642_000')
|
||||
print(skymap)
|
||||
srcs=skymap.skymapsource_set.all().filter(dump=dump).order_by('-rate')
|
||||
for s in srcs:
|
||||
print(s)
|
||||
"""
|
||||
|
||||
|
||||
|
||||
#load_simbad_sources(srcs,minrad=60,maxdist=120)
|
||||
#clean_skymap_sources(srcs)
|
||||
|
||||
return
|
||||
|
||||
load_skymap_sources_file('/srg/work/oper/staff/kate/skymap/catalog/srg_20200302_165649_000.fits')
|
||||
""" update_all_skymap_sources_counterparts() """
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
47
srgcat/management/commands/01_load_skymaps.py
Normal file
47
srgcat/management/commands/01_load_skymaps.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump
|
||||
from monthplan.models import SurveyHealpixPlate
|
||||
from srglib.utils import TZ_MSK, load_srg_data_dumps
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
#dumps = SrgDataDump.objects.all()
|
||||
#dumps.delete()
|
||||
#return
|
||||
|
||||
load_srg_data_dumps('/srg/work/oper/staff/kate/skymap')
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
47
srgcat/management/commands/01_update_allsky_missed.py
Normal file
47
srgcat/management/commands/01_update_allsky_missed.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
import logging
|
||||
from astropy.io import fits
|
||||
from django.db.models import Q
|
||||
from datetime import datetime
|
||||
from astropy.time import Time
|
||||
from astropy.io import fits
|
||||
|
||||
from srgcat.models import SkyMaps, SrgDataDump, SkyMapSource, SelectAllskyMissed
|
||||
from monthplan.models import SurveyHealpixPlate
|
||||
from srglib.utils import TZ_MSK, load_srg_data_dumps, make_source_name, load_simbad_sources
|
||||
from srglib.utils import find_heasarc_counterparts, update_all_skymap_sources_counterparts, load_skymap_sources_dir
|
||||
from srglib.utils import update_allsky_missed
|
||||
|
||||
import glob
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
update_allsky_missed()
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
47
srgcat/management/commands/run_find_heasarc_counterparts.py
Normal file
47
srgcat/management/commands/run_find_heasarc_counterparts.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER, HeasarcXrayMaster, HeasarcXMMSSC, HeasarcBase
|
||||
from srgcat.models import ArtCat, ArtSource, SkyMaps, SkyMapSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix, neighbours
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
from srglib.utils import find_heasarc_counterparts
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
# def add_arguments(self, parser):
|
||||
# parser.add_argument('poll_id', nargs='+', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
"""
|
||||
cats = ArtCat.objects.all()
|
||||
for cat in cats:
|
||||
cat.source_set = cat.artsource_set
|
||||
find_heasarc_counterparts(cat)
|
||||
"""
|
||||
|
||||
skymaps = SkyMaps.objects.all()
|
||||
for cat in skymaps:
|
||||
ntot = cat.skymapsource_set.count()
|
||||
if (ntot):
|
||||
cat.source_set = cat.skymapsource_set
|
||||
find_heasarc_counterparts(cat)
|
||||
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
55
srgcat/management/commands/run_find_simbad_counterparts.py
Normal file
55
srgcat/management/commands/run_find_simbad_counterparts.py
Normal file
@@ -0,0 +1,55 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER, HeasarcXrayMaster, HeasarcXMMSSC, HeasarcBase
|
||||
from srgcat.models import ArtCat, ArtSource, SkyMaps, SkyMapSource, SrgDataDump
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix, neighbours
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
from srglib.utils import find_heasarc_counterparts
|
||||
from srglib.utils import load_simbad_for_skymap_sources
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
# def add_arguments(self, parser):
|
||||
# parser.add_argument('poll_id', nargs='+', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
"""
|
||||
cats = ArtCat.objects.all()
|
||||
for cat in cats:
|
||||
cat.source_set = cat.artsource_set
|
||||
find_heasarc_counterparts(cat)
|
||||
|
||||
|
||||
skymaps = SkyMaps.objects.all()
|
||||
for cat in skymaps:
|
||||
ntot = cat.skymapsource_set.count()
|
||||
if (ntot):
|
||||
cat.source_set = cat.skymapsource_set
|
||||
find_heasarc_counterparts(cat)
|
||||
"""
|
||||
try:
|
||||
dump = SrgDataDump.objects.get(name='srg_20200530_231807_000')
|
||||
except:
|
||||
return
|
||||
srcs = dump.skymapsource_set.all()
|
||||
load_simbad_for_skymap_sources(srcs,minrad=30,maxdist=120)
|
||||
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
75
srgcat/management/commands/simple_healpix_match.py
Normal file
75
srgcat/management/commands/simple_healpix_match.py
Normal file
@@ -0,0 +1,75 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER, HeasarcXrayMaster, HeasarcXMMSSC, HeasarcBase
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix, neighbours
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
# def add_arguments(self, parser):
|
||||
# parser.add_argument('poll_id', nargs='+', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
radius_cut=30.0
|
||||
hp = HEALPix(nside=NSIDE_SOURCES, order=ORDER, frame=FK5())
|
||||
|
||||
srcs = ArtSource.objects.all() # get(name__contains="J175524.3-260347")
|
||||
|
||||
for src in srcs:
|
||||
print("***",src.name,src.healpix)
|
||||
src.heasarc.clear()
|
||||
c = SkyCoord(src.ra, src.dec, frame="fk5", unit="deg")
|
||||
|
||||
"""
|
||||
Add central pixel:
|
||||
"""
|
||||
try:
|
||||
heasarcs = HeasarcBase.objects.filter(healpix=src.healpix)#.distinct('srcid')
|
||||
except:
|
||||
print("healpix not found ", src.healpix)
|
||||
continue
|
||||
|
||||
for heasarc in heasarcs:
|
||||
#print(heasarc.name)
|
||||
c0 = SkyCoord(heasarc.ra, heasarc.dec, frame="fk5", unit="deg")
|
||||
sep=c.separation(c0)
|
||||
if(sep.arcsecond < radius_cut):
|
||||
src.heasarc.add(heasarc)
|
||||
src.save()
|
||||
|
||||
"""
|
||||
Add neighbour pixels:
|
||||
"""
|
||||
around = neighbours(src.healpix, NSIDE_SOURCES, order=ORDER)
|
||||
for index in around:
|
||||
try:
|
||||
heasarcs = HeasarcBase.objects.filter(healpix=index)#.distinct('srcid')
|
||||
except:
|
||||
print("healpix not found ", src.healpix)
|
||||
continue
|
||||
for heasarc in heasarcs:
|
||||
#print(heasarc.name)
|
||||
c0 = SkyCoord(heasarc.ra, heasarc.dec, frame="fk5", unit="deg")
|
||||
sep=c.separation(c0)
|
||||
if(sep.arcsecond < radius_cut):
|
||||
src.heasarc.add(heasarc)
|
||||
src.save()
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
63
srgcat/management/commands/testme_artcat.py
Normal file
63
srgcat/management/commands/testme_artcat.py
Normal file
@@ -0,0 +1,63 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from datetime import date
|
||||
import datetime
|
||||
from django.utils import timezone
|
||||
import astropy
|
||||
from astropy.io import ascii
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
from heasarc.tdat import tDat
|
||||
from heasarc.models import HeasarcTable, TableColumn, HeasarcObjectClass, NSIDE_SOURCES, ORDER, HeasarcXrayMaster, HeasarcXMMSSC, HeasarcBase
|
||||
from srgcat.models import ArtCat, ArtSource
|
||||
from astropy.table import Table
|
||||
from astropy_healpix import HEALPix, neighbours
|
||||
from astropy.coordinates import SkyCoord # High-level coordinates
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5 # Low-level frames
|
||||
from astropy.coordinates import Angle, Latitude, Longitude # Angles
|
||||
import astropy.units as u
|
||||
|
||||
from astropy.config import reload_config
|
||||
from astropy.config import get_config_dir
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Initiates data dase'
|
||||
|
||||
# def add_arguments(self, parser):
|
||||
# parser.add_argument('poll_id', nargs='+', type=int)
|
||||
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
print(get_config_dir())
|
||||
return
|
||||
|
||||
hp = HEALPix(nside=NSIDE_SOURCES, order=ORDER, frame=FK5())
|
||||
|
||||
try:
|
||||
src = ArtSource.objects.get(name='NRTA J175524.3-260347')
|
||||
except:
|
||||
print('Not Found')
|
||||
return
|
||||
|
||||
print('SRC:',src,src.healpix)
|
||||
|
||||
try:
|
||||
refs = HeasarcXMMSSC.objects.filter(name__contains="J175525.1-260403")
|
||||
except:
|
||||
print("no XMMSSC found")
|
||||
print("***")
|
||||
#print("NRTA J175524.3-260347",src.healpix,src.ra, src.dec)
|
||||
around = neighbours(src.healpix, NSIDE_SOURCES, order=ORDER)
|
||||
for index in around:
|
||||
sc=hp.healpix_to_skycoord(index)
|
||||
print(index,sc.ra.deg, sc.dec.deg)
|
||||
|
||||
for ref in refs:
|
||||
print("ref ***")
|
||||
print(ref.name,ref.healpix,src.ra, src.dec)
|
||||
|
||||
|
||||
self.stdout.write(self.style.SUCCESS('Done'))
|
43
srgcat/migrations/0001_initial.py
Normal file
43
srgcat/migrations/0001_initial.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# Generated by Django 2.2.6 on 2020-01-21 10:21
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('heasarc', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ArtCat',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(blank=True, default='', max_length=120, unique=True)),
|
||||
('e1', models.FloatField(default=0)),
|
||||
('e2', models.FloatField(default=0)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ArtSource',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('healpix', models.BigIntegerField(db_index=True, default=0)),
|
||||
('ra', models.FloatField(default=0.0)),
|
||||
('dec', models.FloatField(default=0.0)),
|
||||
('lii', models.FloatField(default=0.0)),
|
||||
('bii', models.FloatField(default=0.0)),
|
||||
('radec_error', models.FloatField(default=0.0)),
|
||||
('name', models.CharField(blank=True, default='', max_length=36)),
|
||||
('sign', models.FloatField(default=0.0)),
|
||||
('rate', models.FloatField(default=0.0)),
|
||||
('flux', models.FloatField(default=0.0)),
|
||||
('catalog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srgcat.ArtCat')),
|
||||
('heasarc', models.ManyToManyField(to='heasarc.HeasarcBase')),
|
||||
],
|
||||
),
|
||||
]
|
44
srgcat/migrations/0002_skymaps.py
Normal file
44
srgcat/migrations/0002_skymaps.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-03 14:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SkyMaps',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('SMAPNR', models.PositiveIntegerField(db_index=True, default=0)),
|
||||
('RA_MIN', models.FloatField(default=0.0)),
|
||||
('RA_MAX', models.FloatField(default=0.0)),
|
||||
('DE_MIN', models.FloatField(default=0.0)),
|
||||
('DE_MAX', models.FloatField(default=0.0)),
|
||||
('RA_CEN', models.FloatField(default=0.0)),
|
||||
('DE_CEN', models.FloatField(default=0.0)),
|
||||
('ELON_CEN', models.FloatField(default=0.0)),
|
||||
('ELAT_CEN', models.FloatField(default=0.0)),
|
||||
('GLON_CEN', models.FloatField(default=0.0)),
|
||||
('GLAT_CEN', models.FloatField(default=0.0)),
|
||||
('X_MIN', models.FloatField(default=0.0)),
|
||||
('Y_MIN', models.FloatField(default=0.0)),
|
||||
('OWNER', models.PositiveIntegerField(default=0)),
|
||||
('N_NBRS', models.PositiveIntegerField(default=0)),
|
||||
('FIELD1', models.PositiveIntegerField(default=0)),
|
||||
('FIELD2', models.PositiveIntegerField(default=0)),
|
||||
('FIELD3', models.PositiveIntegerField(default=0)),
|
||||
('FIELD4', models.PositiveIntegerField(default=0)),
|
||||
('FIELD5', models.PositiveIntegerField(default=0)),
|
||||
('FIELD6', models.PositiveIntegerField(default=0)),
|
||||
('FIELD7', models.PositiveIntegerField(default=0)),
|
||||
('FIELD8', models.PositiveIntegerField(default=0)),
|
||||
('FIELD9', models.PositiveIntegerField(default=0)),
|
||||
('healpix_plate', models.PositiveIntegerField(default=0)),
|
||||
],
|
||||
),
|
||||
]
|
17
srgcat/migrations/0003_remove_skymaps_healpix_plate.py
Normal file
17
srgcat/migrations/0003_remove_skymaps_healpix_plate.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-03 14:55
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0002_skymaps'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='skymaps',
|
||||
name='healpix_plate',
|
||||
),
|
||||
]
|
19
srgcat/migrations/0004_skymaps_survey_healpix_plate.py
Normal file
19
srgcat/migrations/0004_skymaps_survey_healpix_plate.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-03 14:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('monthplan', '0002_auto_20191209_2233'),
|
||||
('srgcat', '0003_remove_skymaps_healpix_plate'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymaps',
|
||||
name='survey_healpix_plate',
|
||||
field=models.ManyToManyField(to='monthplan.SurveyHealpixPlate'),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0005_skymaps_neighbours.py
Normal file
18
srgcat/migrations/0005_skymaps_neighbours.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-03 15:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0004_skymaps_survey_healpix_plate'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymaps',
|
||||
name='neighbours',
|
||||
field=models.ManyToManyField(blank=True, related_name='_skymaps_neighbours_+', to='srgcat.SkyMaps'),
|
||||
),
|
||||
]
|
29
srgcat/migrations/0006_srgdatadump.py
Normal file
29
srgcat/migrations/0006_srgdatadump.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-03 16:36
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0005_skymaps_neighbours'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SrgDataDump',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=23)),
|
||||
('date', models.DateTimeField()),
|
||||
('start', models.DateTimeField(blank=True, null=True)),
|
||||
('stop', models.DateTimeField(blank=True, null=True)),
|
||||
('tstart', models.BigIntegerField(default=0)),
|
||||
('tstop', models.BigIntegerField(default=0)),
|
||||
('mjd_start', models.FloatField(default=0.0)),
|
||||
('mjd_stop', models.FloatField(default=0.0)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('skymap', models.ManyToManyField(to='srgcat.SkyMaps')),
|
||||
],
|
||||
),
|
||||
]
|
18
srgcat/migrations/0007_srgdatadump_version.py
Normal file
18
srgcat/migrations/0007_srgdatadump_version.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-03 19:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0006_srgdatadump'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='srgdatadump',
|
||||
name='version',
|
||||
field=models.PositiveIntegerField(default=0),
|
||||
),
|
||||
]
|
44
srgcat/migrations/0008_skymapsource.py
Normal file
44
srgcat/migrations/0008_skymapsource.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-10 12:23
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('heasarc', '0005_heasarcrass2rxs_detection_likelihood'),
|
||||
('srgcat', '0007_srgdatadump_version'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SkyMapSource',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name_orig', models.CharField(max_length=20)),
|
||||
('healpix', models.BigIntegerField(db_index=True, default=0)),
|
||||
('ra', models.FloatField(default=0.0)),
|
||||
('dec', models.FloatField(default=0.0)),
|
||||
('lii', models.FloatField(default=0.0)),
|
||||
('bii', models.FloatField(default=0.0)),
|
||||
('radec_error', models.FloatField(default=0.0)),
|
||||
('name', models.CharField(blank=True, default='', max_length=36)),
|
||||
('x', models.FloatField(default=0.0)),
|
||||
('y', models.FloatField(default=0.0)),
|
||||
('cnts', models.FloatField(default=0.0)),
|
||||
('cnts_err', models.FloatField(default=0.0)),
|
||||
('cnts_bg', models.FloatField(default=0.0)),
|
||||
('exptime', models.FloatField(default=0.0)),
|
||||
('rate', models.FloatField(default=0.0)),
|
||||
('rate_err', models.FloatField(default=0.0)),
|
||||
('flux', models.FloatField(default=0.0)),
|
||||
('flux_err', models.FloatField(default=0.0)),
|
||||
('sig', models.FloatField(default=0.0)),
|
||||
('nfalse', models.FloatField(default=0.0)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('heasarc', models.ManyToManyField(to='heasarc.HeasarcBase')),
|
||||
('skymap', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srgcat.SkyMaps')),
|
||||
],
|
||||
),
|
||||
]
|
19
srgcat/migrations/0009_skymapsource_simbad.py
Normal file
19
srgcat/migrations/0009_skymapsource_simbad.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2.6 on 2020-02-28 09:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('astrobasis', '0035_auto_20200225_1625'),
|
||||
('srgcat', '0008_skymapsource'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='simbad',
|
||||
field=models.ManyToManyField(to='astrobasis.Simbad'),
|
||||
),
|
||||
]
|
19
srgcat/migrations/0010_skymapsource_gaia.py
Normal file
19
srgcat/migrations/0010_skymapsource_gaia.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-04 07:47
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('astrobasis', '0035_auto_20200225_1625'),
|
||||
('srgcat', '0009_skymapsource_simbad'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='gaia',
|
||||
field=models.ManyToManyField(to='astrobasis.GAIADR2'),
|
||||
),
|
||||
]
|
19
srgcat/migrations/0011_skymapsource_dump.py
Normal file
19
srgcat/migrations/0011_skymapsource_dump.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-07 09:12
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0010_skymapsource_gaia'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='dump',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='srgcat.SrgDataDump'),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0012_srgdatadump_catalog_loaded.py
Normal file
18
srgcat/migrations/0012_srgdatadump_catalog_loaded.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-07 09:18
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0011_skymapsource_dump'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='srgdatadump',
|
||||
name='catalog_loaded',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0013_skymapsource_new.py
Normal file
18
srgcat/migrations/0013_skymapsource_new.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-07 19:11
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0012_srgdatadump_catalog_loaded'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='new',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0014_skymapsource_bad.py
Normal file
18
srgcat/migrations/0014_skymapsource_bad.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-12 09:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0013_skymapsource_new'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='bad',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0015_skymapsource_healpix_plate.py
Normal file
18
srgcat/migrations/0015_skymapsource_healpix_plate.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-12 10:02
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0014_skymapsource_bad'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='healpix_plate',
|
||||
field=models.IntegerField(db_index=True, default=0),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0016_skymapsource_good.py
Normal file
18
srgcat/migrations/0016_skymapsource_good.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-12 10:56
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0015_skymapsource_healpix_plate'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='good',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
22
srgcat/migrations/0017_selectallskymissed.py
Normal file
22
srgcat/migrations/0017_selectallskymissed.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-18 19:31
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0016_skymapsource_good'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SelectAllskyMissed',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('dump', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srgcat.SrgDataDump')),
|
||||
('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srgcat.SkyMapSource')),
|
||||
],
|
||||
),
|
||||
]
|
26
srgcat/migrations/0018_selection.py
Normal file
26
srgcat/migrations/0018_selection.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-25 13:25
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('srgcat', '0017_selectallskymissed'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Selection',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(default='', max_length=36)),
|
||||
('public', models.BooleanField(default=True)),
|
||||
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
('skymap_sources', models.ManyToManyField(to='srgcat.SkyMapSource')),
|
||||
],
|
||||
),
|
||||
]
|
16
srgcat/migrations/0019_delete_selection.py
Normal file
16
srgcat/migrations/0019_delete_selection.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-25 13:33
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0018_selection'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='Selection',
|
||||
),
|
||||
]
|
27
srgcat/migrations/0020_selection.py
Normal file
27
srgcat/migrations/0020_selection.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-25 13:33
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('srgcat', '0019_delete_selection'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Selection',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(default='', max_length=36)),
|
||||
('slug', models.SlugField()),
|
||||
('public', models.BooleanField(default=True)),
|
||||
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
('skymap_sources', models.ManyToManyField(to='srgcat.SkyMapSource')),
|
||||
],
|
||||
),
|
||||
]
|
18
srgcat/migrations/0021_auto_20200325_2157.py
Normal file
18
srgcat/migrations/0021_auto_20200325_2157.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-25 18:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0020_selection'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='selection',
|
||||
name='skymap_sources',
|
||||
field=models.ManyToManyField(blank=True, to='srgcat.SkyMapSource'),
|
||||
),
|
||||
]
|
19
srgcat/migrations/0022_skymapsource_catalog.py
Normal file
19
srgcat/migrations/0022_skymapsource_catalog.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-27 11:32
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0021_auto_20200325_2157'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='catalog',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='srgcat.ArtCat'),
|
||||
),
|
||||
]
|
28
srgcat/migrations/0023_erositamatch.py
Normal file
28
srgcat/migrations/0023_erositamatch.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-27 15:40
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0022_skymapsource_catalog'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='eRositaMatch',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('exp', models.FloatField(default=0.0)),
|
||||
('sep', models.FloatField(default=0.0)),
|
||||
('ra', models.FloatField(default=0.0)),
|
||||
('dec', models.FloatField(default=0.0)),
|
||||
('lkh', models.FloatField(default=0.0)),
|
||||
('cts', models.FloatField(default=0.0)),
|
||||
('flux', models.FloatField(default=0.0)),
|
||||
('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srgcat.SkyMapSource')),
|
||||
],
|
||||
),
|
||||
]
|
17
srgcat/migrations/0024_remove_erositamatch_source.py
Normal file
17
srgcat/migrations/0024_remove_erositamatch_source.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-27 15:52
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0023_erositamatch'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='erositamatch',
|
||||
name='source',
|
||||
),
|
||||
]
|
16
srgcat/migrations/0025_delete_erositamatch.py
Normal file
16
srgcat/migrations/0025_delete_erositamatch.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-27 15:55
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0024_remove_erositamatch_source'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='eRositaMatch',
|
||||
),
|
||||
]
|
28
srgcat/migrations/0026_erositamatch.py
Normal file
28
srgcat/migrations/0026_erositamatch.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 2.2.6 on 2020-03-27 15:56
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0025_delete_erositamatch'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='eRositaMatch',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('exp', models.FloatField(default=0.0)),
|
||||
('sep', models.FloatField(default=0.0)),
|
||||
('ra', models.FloatField(default=0.0)),
|
||||
('dec', models.FloatField(default=0.0)),
|
||||
('lkh', models.FloatField(default=0.0)),
|
||||
('cts', models.FloatField(default=0.0)),
|
||||
('flux', models.FloatField(default=0.0)),
|
||||
('source', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='srgcat.SkyMapSource')),
|
||||
],
|
||||
),
|
||||
]
|
24
srgcat/migrations/0027_usersessionparameters.py
Normal file
24
srgcat/migrations/0027_usersessionparameters.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-03 11:09
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('srgcat', '0026_erositamatch'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='UserSessionParameters',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('snr_threshold', models.FloatField(blank=True, default=0.0)),
|
||||
('owner', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='session', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
18
srgcat/migrations/0028_auto_20200503_1438.py
Normal file
18
srgcat/migrations/0028_auto_20200503_1438.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-03 11:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0027_usersessionparameters'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='usersessionparameters',
|
||||
name='snr_threshold',
|
||||
field=models.FloatField(blank=True, default=0.0, null=True),
|
||||
),
|
||||
]
|
23
srgcat/migrations/0029_auto_20200505_0947.py
Normal file
23
srgcat/migrations/0029_auto_20200505_0947.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-05 06:47
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0028_auto_20200503_1438'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='usersessionparameters',
|
||||
name='target_dec',
|
||||
field=models.FloatField(blank=True, default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='usersessionparameters',
|
||||
name='target_ra',
|
||||
field=models.FloatField(blank=True, default=0.0, null=True),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0030_auto_20200505_1338.py
Normal file
18
srgcat/migrations/0030_auto_20200505_1338.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-05 10:38
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0029_auto_20200505_0947'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='usersessionparameters',
|
||||
old_name='snr_threshold',
|
||||
new_name='sign_threshold',
|
||||
),
|
||||
]
|
27
srgcat/migrations/0031_trackstats.py
Normal file
27
srgcat/migrations/0031_trackstats.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-15 12:53
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('srgcat', '0030_auto_20200505_1338'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TrackStats',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ip_address', models.GenericIPAddressField()),
|
||||
('url_name', models.CharField(blank=True, default='', max_length=50)),
|
||||
('path_info', models.CharField(blank=True, default='', max_length=50)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trackstats', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
18
srgcat/migrations/0032_auto_20200515_1706.py
Normal file
18
srgcat/migrations/0032_auto_20200515_1706.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-15 14:06
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0031_trackstats'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='trackstats',
|
||||
name='path_info',
|
||||
field=models.CharField(blank=True, default='', max_length=150),
|
||||
),
|
||||
]
|
20
srgcat/migrations/0033_trackstats_group.py
Normal file
20
srgcat/migrations/0033_trackstats_group.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-15 16:37
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0011_update_proxy_permissions'),
|
||||
('srgcat', '0032_auto_20200515_1706'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='trackstats',
|
||||
name='group',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='trackstats', to='auth.Group'),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0034_skymapsource_simbad_failed.py
Normal file
18
srgcat/migrations/0034_skymapsource_simbad_failed.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-05-30 17:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0033_trackstats_group'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='simbad_failed',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0035_auto_20200601_2317.py
Normal file
18
srgcat/migrations/0035_auto_20200601_2317.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-06-01 20:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0034_skymapsource_simbad_failed'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='simbad_failed',
|
||||
field=models.BooleanField(default=False, null=True),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0036_skymapsource_simbad_notfound.py
Normal file
18
srgcat/migrations/0036_skymapsource_simbad_notfound.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 2.2.6 on 2020-06-02 06:56
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0035_auto_20200601_2317'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='simbad_notfound',
|
||||
field=models.BooleanField(default=False, null=True),
|
||||
),
|
||||
]
|
20
srgcat/migrations/0037_skymapsource_artsurvey_source.py
Normal file
20
srgcat/migrations/0037_skymapsource_artsurvey_source.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 2.2.6 on 2020-06-19 15:03
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('artsurvey', '0001_initial'),
|
||||
('srgcat', '0036_skymapsource_simbad_notfound'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='artsurvey_source',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='artsurvey.ArtSurveySource'),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0038_auto_20210311_1313.py
Normal file
18
srgcat/migrations/0038_auto_20210311_1313.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-11 10:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0037_skymapsource_artsurvey_source'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='srgdatadump',
|
||||
name='skymap',
|
||||
field=models.ManyToManyField(blank=True, to='srgcat.SkyMaps'),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0039_skymapsource_ext.py
Normal file
18
srgcat/migrations/0039_skymapsource_ext.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-11 10:18
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0038_auto_20210311_1313'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ext',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0040_skymapsource_cnts_tot.py
Normal file
18
srgcat/migrations/0040_skymapsource_cnts_tot.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-11 10:34
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0039_skymapsource_ext'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_tot',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
48
srgcat/migrations/0041_auto_20210311_1338.py
Normal file
48
srgcat/migrations/0041_auto_20210311_1338.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-11 10:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0040_skymapsource_cnts_tot'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='exptime0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux_err0',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0042_auto_20210311_1340.py
Normal file
18
srgcat/migrations/0042_auto_20210311_1340.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-11 10:40
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0041_auto_20210311_1338'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='skymapsource',
|
||||
old_name='flux_err0',
|
||||
new_name='flux_er0',
|
||||
),
|
||||
]
|
153
srgcat/migrations/0043_auto_20210311_1342.py
Normal file
153
srgcat/migrations/0043_auto_20210311_1342.py
Normal file
@@ -0,0 +1,153 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-11 10:42
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0042_auto_20210311_1340'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='exptime1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='exptime2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='exptime3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='exptime4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
19
srgcat/migrations/0044_auto_20210315_1542.py
Normal file
19
srgcat/migrations/0044_auto_20210315_1542.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 3.0.8 on 2021-03-15 12:42
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0043_auto_20210311_1342'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='skymap',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='srgcat.SkyMaps'),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0045_srgdatadump_gyro_loaded.py
Normal file
18
srgcat/migrations/0045_srgdatadump_gyro_loaded.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-04-26 14:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0044_auto_20210315_1542'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='srgdatadump',
|
||||
name='gyro_loaded',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
21
srgcat/migrations/0046_gyro.py
Normal file
21
srgcat/migrations/0046_gyro.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 3.0.8 on 2021-04-26 14:44
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0045_srgdatadump_gyro_loaded'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Gyro',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('dump', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='srgcat.SrgDataDump')),
|
||||
],
|
||||
),
|
||||
]
|
53
srgcat/migrations/0047_auto_20210426_1746.py
Normal file
53
srgcat/migrations/0047_auto_20210426_1746.py
Normal file
@@ -0,0 +1,53 @@
|
||||
# Generated by Django 3.0.8 on 2021-04-26 14:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0046_gyro'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='dec',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='mjd',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='obt',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='ra',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
29
srgcat/migrations/0048_auto_20210426_1805.py
Normal file
29
srgcat/migrations/0048_auto_20210426_1805.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Generated by Django 3.0.8 on 2021-04-26 15:05
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0047_auto_20210426_1746'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='gyro',
|
||||
name='q1',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gyro',
|
||||
name='q2',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gyro',
|
||||
name='q3',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gyro',
|
||||
name='q4',
|
||||
),
|
||||
]
|
18
srgcat/migrations/0049_gyro_healpix.py
Normal file
18
srgcat/migrations/0049_gyro_healpix.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-04-26 15:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0048_auto_20210426_1805'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='healpix',
|
||||
field=models.BigIntegerField(db_index=True, default=0),
|
||||
),
|
||||
]
|
33
srgcat/migrations/0050_auto_20210426_1836.py
Normal file
33
srgcat/migrations/0050_auto_20210426_1836.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 3.0.8 on 2021-04-26 15:36
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0049_gyro_healpix'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q1',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q2',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q3',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gyro',
|
||||
name='q4',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0051_skymapsource_ext_id.py
Normal file
18
srgcat/migrations/0051_skymapsource_ext_id.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-05-24 09:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0050_auto_20210426_1836'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ext_id',
|
||||
field=models.CharField(blank=True, default='', max_length=100),
|
||||
),
|
||||
]
|
33
srgcat/migrations/0052_auto_20210615_0831.py
Normal file
33
srgcat/migrations/0052_auto_20210615_0831.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 3.0.8 on 2021-06-15 05:31
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0051_skymapsource_ext_id'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='detlike',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='flux_uplim',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='fluxerr_hi',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='fluxerr_lo',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0053_auto_20210615_0902.py
Normal file
18
srgcat/migrations/0053_auto_20210615_0902.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.0.8 on 2021-06-15 06:02
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0052_auto_20210615_0831'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='skymapsource',
|
||||
old_name='fluxerr_hi',
|
||||
new_name='fluxerr_up',
|
||||
),
|
||||
]
|
68
srgcat/migrations/0054_auto_20211229_1259.py
Normal file
68
srgcat/migrations/0054_auto_20211229_1259.py
Normal file
@@ -0,0 +1,68 @@
|
||||
# Generated by Django 3.2.10 on 2021-12-29 09:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0053_auto_20210615_0902'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='artcat',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='artsource',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='erositamatch',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='gyro',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='selectallskymissed',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='selection',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymaps',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='srgdatadump',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='trackstats',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='usersessionparameters',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
]
|
17
srgcat/migrations/0055_remove_skymapsource_gaia.py
Normal file
17
srgcat/migrations/0055_remove_skymapsource_gaia.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 3.2.10 on 2022-01-12 09:01
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0054_auto_20211229_1259'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='skymapsource',
|
||||
name='gaia',
|
||||
),
|
||||
]
|
18
srgcat/migrations/0056_alter_skymapsource_name_orig.py
Normal file
18
srgcat/migrations/0056_alter_skymapsource_name_orig.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.12 on 2022-03-02 16:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0055_remove_skymapsource_gaia'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='name_orig',
|
||||
field=models.CharField(max_length=22),
|
||||
),
|
||||
]
|
263
srgcat/migrations/0057_auto_20220303_1826.py
Normal file
263
srgcat/migrations/0057_auto_20220303_1826.py
Normal file
@@ -0,0 +1,263 @@
|
||||
# Generated by Django 3.2.12 on 2022-03-03 15:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0056_alter_skymapsource_name_orig'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_bg4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_er4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_err',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_t4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='cnts_tot',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='detlike',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='exptime',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='exptime0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='exptime1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='exptime2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='exptime3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='exptime4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='ext',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er0',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er1',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er2',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er3',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_er4',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_err',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='flux_uplim',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='fluxerr_lo',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='fluxerr_up',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='nfalse',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='rate',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='rate_err',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='sig',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
]
|
18
srgcat/migrations/0058_alter_skymapsource_ext_id.py
Normal file
18
srgcat/migrations/0058_alter_skymapsource_ext_id.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.12 on 2022-03-03 15:27
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0057_auto_20220303_1826'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='skymapsource',
|
||||
name='ext_id',
|
||||
field=models.CharField(blank=True, default='', max_length=100, null=True),
|
||||
),
|
||||
]
|
63
srgcat/migrations/0059_auto_20230516_1536.py
Normal file
63
srgcat/migrations/0059_auto_20230516_1536.py
Normal file
@@ -0,0 +1,63 @@
|
||||
# Generated by Django 3.2.13 on 2023-05-16 12:36
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('srgcat', '0058_alter_skymapsource_ext_id'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_dec',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_detlike',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_exp',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_flux',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_flux_err',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_nfalse',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_ra',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_radec_err_90',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_radec_err_98',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='skymapsource',
|
||||
name='ml_sig',
|
||||
field=models.FloatField(default=0.0, null=True),
|
||||
),
|
||||
]
|
0
srgcat/migrations/__init__.py
Normal file
0
srgcat/migrations/__init__.py
Normal file
367
srgcat/models.py
Normal file
367
srgcat/models.py
Normal file
@@ -0,0 +1,367 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.models import Group
|
||||
|
||||
from heasarc.models import NSIDE_SOURCES, ORDER
|
||||
from heasarc.models import HeasarcBase, HeasarcSwiftBAT105m, Heasarc4XMMDR9, HeasarcRASS2RXS, HeasarcIntRefCat
|
||||
import os
|
||||
import math
|
||||
from astropy import units as u
|
||||
from astropy.coordinates import SkyCoord
|
||||
from astrobasis.models import Simbad
|
||||
#from astrobasis.models import GAIADR2
|
||||
from artsurvey.models import ArtSurveySource
|
||||
|
||||
#from srghub.models import Connection
|
||||
|
||||
# Create your models here.
|
||||
|
||||
#SKYMAP_DIR='/srg/work/oper/staff/kate/skymap'
|
||||
SKYMAP_DIR='/data/kate/skymap'
|
||||
|
||||
class SkyMaps(models.Model):
|
||||
""" SkyMaps eRosita plates """
|
||||
SMAPNR = models.PositiveIntegerField(db_index=True, default=0)
|
||||
RA_MIN = models.FloatField(default=0.0)
|
||||
RA_MAX = models.FloatField(default=0.0)
|
||||
DE_MIN = models.FloatField(default=0.0)
|
||||
DE_MAX = models.FloatField(default=0.0)
|
||||
RA_CEN = models.FloatField(default=0.0)
|
||||
DE_CEN = models.FloatField(default=0.0)
|
||||
ELON_CEN = models.FloatField(default=0.0)
|
||||
ELAT_CEN = models.FloatField(default=0.0)
|
||||
GLON_CEN = models.FloatField(default=0.0)
|
||||
GLAT_CEN = models.FloatField(default=0.0)
|
||||
X_MIN = models.FloatField(default=0.0)
|
||||
Y_MIN = models.FloatField(default=0.0)
|
||||
OWNER = models.PositiveIntegerField(default=0)
|
||||
N_NBRS = models.PositiveIntegerField(default=0)
|
||||
FIELD1 = models.PositiveIntegerField(default=0)
|
||||
FIELD2 = models.PositiveIntegerField(default=0)
|
||||
FIELD3 = models.PositiveIntegerField(default=0)
|
||||
FIELD4 = models.PositiveIntegerField(default=0)
|
||||
FIELD5 = models.PositiveIntegerField(default=0)
|
||||
FIELD6 = models.PositiveIntegerField(default=0)
|
||||
FIELD7 = models.PositiveIntegerField(default=0)
|
||||
FIELD8 = models.PositiveIntegerField(default=0)
|
||||
FIELD9 = models.PositiveIntegerField(default=0)
|
||||
survey_healpix_plate = models.ManyToManyField('monthplan.SurveyHealpixPlate')
|
||||
neighbours = models.ManyToManyField("self", blank=True)
|
||||
def __str__(self):
|
||||
return "%06d" % (self.SMAPNR)
|
||||
def get_absolute_url(self):
|
||||
return "/srgcat/%i/skymap" % (self.pk)
|
||||
|
||||
def get_absolute_path(self):
|
||||
return "10.5.2.26:{}/{:06d}".format(SKYMAP_DIR, self.SMAPNR)
|
||||
@property
|
||||
def is_L3_valid(self):
|
||||
return os.path.exists(self.get_absolute_path()+'/L3')
|
||||
|
||||
def get_neighbours(self):
|
||||
return self.neighbours.order_by("DE_CEN")
|
||||
|
||||
|
||||
class SrgDataDump(models.Model):
|
||||
name = models.CharField(max_length=23)
|
||||
date = models.DateTimeField()
|
||||
start = models.DateTimeField(blank=True,null=True)
|
||||
stop = models.DateTimeField(blank=True,null=True)
|
||||
tstart = models.BigIntegerField(default=0)
|
||||
tstop = models.BigIntegerField(default=0)
|
||||
mjd_start = models.FloatField(default=0.0)
|
||||
mjd_stop = models.FloatField(default=0.0)
|
||||
skymap = models.ManyToManyField('SkyMaps', blank=True)
|
||||
catalog_loaded = models.BooleanField(default=False)
|
||||
gyro_loaded = models.BooleanField(default=False)
|
||||
version = models.PositiveIntegerField(default=0)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
""" Date and time of creation. Fully automatic. """
|
||||
def __str__(self):
|
||||
return self.name
|
||||
def get_absolute_url(self):
|
||||
"""Class method docstrings go here."""
|
||||
return "/srgcat/%i/ddump" % (self.pk)
|
||||
|
||||
def get_update_catalog_url(self):
|
||||
return "/srgcat/%i/ddump/update" % (self.pk)
|
||||
|
||||
def get_catalog_absolute_path(self):
|
||||
return "{}/catalog/{}.fits".format(SKYMAP_DIR,self.name)
|
||||
|
||||
class ArtCat(models.Model):
|
||||
""" ArtCat makes high-level description of ART-XC catalogue. """
|
||||
name = models.CharField(max_length=120,blank=True, unique=True, default='')
|
||||
e1 = models.FloatField(default=0)
|
||||
e2 = models.FloatField(default=0)
|
||||
def __str__(self):
|
||||
return self.name
|
||||
def get_absolute_url(self):
|
||||
"""Class method docstrings go here."""
|
||||
return "/srgcat/erosita/%i/list" % (self.pk)
|
||||
def get_erosita_matched_url(self):
|
||||
return "/srgcat/erosita/%i/matched" % (self.pk)
|
||||
def get_erosita_nomatch_url(self):
|
||||
return "/srgcat/erosita/%i/nomatch" % (self.pk)
|
||||
|
||||
class Gyro(models.Model):
|
||||
dump = models.ForeignKey(SrgDataDump, null=True, on_delete=models.CASCADE)
|
||||
healpix = models.BigIntegerField(db_index=True, default=0)
|
||||
ra = models.FloatField(default=0.0)
|
||||
""" RA """
|
||||
dec = models.FloatField(default=0.0)
|
||||
""" Dec """
|
||||
q1 = models.FloatField(default=0.0)
|
||||
""" Quat 1 """
|
||||
q2 = models.FloatField(default=0.0)
|
||||
""" Quat 2 """
|
||||
q3 = models.FloatField(default=0.0)
|
||||
""" Quat 3 """
|
||||
q4 = models.FloatField(default=0.0)
|
||||
""" Quat 4 """
|
||||
mjd = models.FloatField(default=0.0)
|
||||
""" MJD """
|
||||
obt = models.FloatField(default=0.0)
|
||||
def __str__(self):
|
||||
return self.dump.name
|
||||
|
||||
class SkyMapSource(models.Model):
|
||||
name_orig = models.CharField(max_length=22)
|
||||
skymap = models.ForeignKey(SkyMaps, null=True, on_delete=models.CASCADE)
|
||||
dump = models.ForeignKey(SrgDataDump, null=True, on_delete=models.CASCADE)
|
||||
artsurvey_source = models.ForeignKey(ArtSurveySource, null=True, on_delete=models.SET_NULL)
|
||||
catalog = models.ForeignKey(ArtCat, null=True, on_delete=models.CASCADE)
|
||||
heasarc = models.ManyToManyField(HeasarcBase)
|
||||
simbad = models.ManyToManyField(Simbad)
|
||||
simbad_failed = models.BooleanField(default=False, null=True)
|
||||
""" Simbad failed to respond """
|
||||
simbad_notfound = models.BooleanField(default=False, null=True)
|
||||
""" No astronomical object found """
|
||||
#gaia = models.ManyToManyField(GAIADR2)
|
||||
healpix = models.BigIntegerField(db_index=True, default=0)
|
||||
healpix_plate = models.IntegerField(db_index=True, default=0)
|
||||
new = models.BooleanField(default=False)
|
||||
bad = models.BooleanField(default=False)
|
||||
good = models.BooleanField(default=False)
|
||||
""" New in this data dump """
|
||||
ra = models.FloatField(default=0.0)
|
||||
""" Right Ascension of the Source """
|
||||
dec = models.FloatField(default=0.0)
|
||||
""" Declination of the Source """
|
||||
lii = models.FloatField(default=0.0)
|
||||
""" Galactic Longitude """
|
||||
bii = models.FloatField(default=0.0)
|
||||
""" Galactic Latitude """
|
||||
radec_error = models.FloatField(default=0.0)
|
||||
""" Positional Uncertainty (arcsec)
|
||||
|
||||
Must be exactly radec_error to be consistent with EroTransSource and EroSurveySource
|
||||
"""
|
||||
name = models.CharField(max_length=36,blank=True, default='') # source name
|
||||
x = models.FloatField(default=0.0)
|
||||
y = models.FloatField(default=0.0)
|
||||
|
||||
cnts = models.FloatField(default=0.0)
|
||||
cnts_err = models.FloatField(default=0.0,null=True)
|
||||
cnts_bg = models.FloatField(default=0.0,null=True)
|
||||
cnts_tot = models.FloatField(default=0.0,null=True)
|
||||
exptime = models.FloatField(default=0.0,null=True)
|
||||
rate = models.FloatField(default=0.0,null=True)
|
||||
rate_err = models.FloatField(default=0.0,null=True)
|
||||
flux = models.FloatField(default=0.0,null=True)
|
||||
flux_err = models.FloatField(default=0.0,null=True)
|
||||
""" obsolete """
|
||||
fluxerr_lo = models.FloatField(default=0.0,null=True)
|
||||
fluxerr_up = models.FloatField(default=0.0,null=True)
|
||||
flux_uplim = models.FloatField(default=0.0,null=True)
|
||||
"""
|
||||
33 CNTS0 1E cnts
|
||||
34 CNTS_ER0 1E cnts
|
||||
35 CNTS_T0 1E cnts
|
||||
36 CNTS_BG0 1E cnts
|
||||
37 EXPTIME0 1E s
|
||||
38 FLUX0 1E erg/s/cm^2
|
||||
39 FLUX_ER0 1E erg/s/cm^2
|
||||
"""
|
||||
cnts0 = models.FloatField(default=0.0,null=True)
|
||||
cnts_er0 = models.FloatField(default=0.0,null=True)
|
||||
cnts_bg0 = models.FloatField(default=0.0,null=True)
|
||||
cnts_t0 = models.FloatField(default=0.0,null=True)
|
||||
exptime0 = models.FloatField(default=0.0,null=True)
|
||||
flux0 = models.FloatField(default=0.0,null=True)
|
||||
flux_er0 = models.FloatField(default=0.0,null=True)
|
||||
|
||||
cnts1 = models.FloatField(default=0.0,null=True)
|
||||
cnts_er1 = models.FloatField(default=0.0,null=True)
|
||||
cnts_bg1 = models.FloatField(default=0.0,null=True)
|
||||
cnts_t1 = models.FloatField(default=0.0,null=True)
|
||||
exptime1 = models.FloatField(default=0.0,null=True)
|
||||
flux1 = models.FloatField(default=0.0,null=True)
|
||||
flux_er1 = models.FloatField(default=0.0,null=True)
|
||||
|
||||
cnts2 = models.FloatField(default=0.0,null=True)
|
||||
cnts_er2 = models.FloatField(default=0.0,null=True)
|
||||
cnts_bg2 = models.FloatField(default=0.0,null=True)
|
||||
cnts_t2 = models.FloatField(default=0.0,null=True)
|
||||
exptime2 = models.FloatField(default=0.0,null=True)
|
||||
flux2 = models.FloatField(default=0.0,null=True)
|
||||
flux_er2 = models.FloatField(default=0.0,null=True)
|
||||
|
||||
cnts3 = models.FloatField(default=0.0,null=True)
|
||||
cnts_er3 = models.FloatField(default=0.0,null=True)
|
||||
cnts_bg3 = models.FloatField(default=0.0,null=True)
|
||||
cnts_t3 = models.FloatField(default=0.0,null=True)
|
||||
exptime3 = models.FloatField(default=0.0,null=True)
|
||||
flux3 = models.FloatField(default=0.0,null=True)
|
||||
flux_er3 = models.FloatField(default=0.0,null=True)
|
||||
|
||||
cnts4 = models.FloatField(default=0.0,null=True)
|
||||
cnts_er4 = models.FloatField(default=0.0,null=True)
|
||||
cnts_bg4 = models.FloatField(default=0.0,null=True)
|
||||
cnts_t4 = models.FloatField(default=0.0,null=True)
|
||||
exptime4 = models.FloatField(default=0.0,null=True)
|
||||
flux4 = models.FloatField(default=0.0,null=True)
|
||||
flux_er4 = models.FloatField(default=0.0,null=True)
|
||||
|
||||
sig = models.FloatField(default=0.0,null=True)
|
||||
nfalse = models.FloatField(default=0.0,null=True)
|
||||
detlike = models.FloatField(default=0.0,null=True)
|
||||
ext = models.FloatField(default=0.0,null=True)
|
||||
ext_id = models.CharField(max_length=100,blank=True, default='',null=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
ml_sig = models.FloatField(default=0.0,null=True)
|
||||
ml_detlike = models.FloatField(default=0.0,null=True)
|
||||
ml_nfalse = models.FloatField(default=0.0,null=True)
|
||||
ml_ra = models.FloatField(default=0.0,null=True)
|
||||
ml_dec = models.FloatField(default=0.0,null=True)
|
||||
ml_radec_err_90 = models.FloatField(default=0.0,null=True)
|
||||
ml_radec_err_98 = models.FloatField(default=0.0,null=True)
|
||||
ml_flux = models.FloatField(default=0.0,null=True)
|
||||
ml_flux_err = models.FloatField(default=0.0,null=True)
|
||||
ml_exp = models.FloatField(default=0.0,null=True)
|
||||
|
||||
""" Date and time of creation. Fully automatic. """
|
||||
def __str__(self):
|
||||
return self.name
|
||||
def get_absolute_url(self):
|
||||
return "/srgcat/%i/skymapsource" % (self.pk)
|
||||
def get_new_artsurvey_url(self):
|
||||
return "/artsurvey/%i/new" % (self.pk)
|
||||
|
||||
def get_last_data_dump(self):
|
||||
dump = self.skymap.srgdatadump_set.latest(field_name='date')
|
||||
return dump.date
|
||||
|
||||
def get_swiftbat_count(self):
|
||||
swiftbat = HeasarcBase.objects.instance_of(HeasarcSwiftBAT105m).filter(healpix=self.healpix)
|
||||
return swiftbat.count()
|
||||
|
||||
def get_4xmm_count(self):
|
||||
return HeasarcBase.objects.instance_of(Heasarc4XMMDR9).filter(healpix=self.healpix).count()
|
||||
|
||||
def get_rosat_count(self):
|
||||
return HeasarcBase.objects.instance_of(HeasarcRASS2RXS).filter(healpix=self.healpix).count()
|
||||
|
||||
def get_integral_count(self):
|
||||
return HeasarcBase.objects.instance_of(HeasarcIntRefCat).filter(healpix=self.healpix).count()
|
||||
|
||||
def get_log10_nfalse(self):
|
||||
log10 = -100.0
|
||||
if(self.nfalse > 0.0):
|
||||
log10 = math.log10(self.nfalse)
|
||||
return log10
|
||||
|
||||
def get_erosita_ratio(self):
|
||||
ratio=-1.0
|
||||
if(hasattr(self, 'erositamatch')):
|
||||
ratio = float(self.flux/self.erositamatch.flux)
|
||||
return ratio
|
||||
|
||||
class eRositaMatch(models.Model):
|
||||
source = models.OneToOneField(SkyMapSource, on_delete=models.CASCADE)
|
||||
exp = models.FloatField(default=0.0)
|
||||
sep = models.FloatField(default=0.0)
|
||||
ra = models.FloatField(default=0.0)
|
||||
dec = models.FloatField(default=0.0)
|
||||
lkh = models.FloatField(default=0.0)
|
||||
cts = models.FloatField(default=0.0)
|
||||
flux = models.FloatField(default=0.0)
|
||||
def __str__(self):
|
||||
return self.source.name
|
||||
|
||||
|
||||
class SelectAllskyMissed(models.Model):
|
||||
dump = models.ForeignKey(SrgDataDump, on_delete=models.CASCADE)
|
||||
source = models.ForeignKey(SkyMapSource, on_delete=models.CASCADE)
|
||||
|
||||
|
||||
|
||||
class Selection(models.Model):
|
||||
owner = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=36,blank=False, default='')
|
||||
slug = models.SlugField()
|
||||
skymap_sources = models.ManyToManyField(SkyMapSource, blank=True)
|
||||
public = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
def get_absolute_url(self):
|
||||
return "/srgcat/%i/selection" % (self.pk)
|
||||
def get_edit_url(self):
|
||||
return "/srgcat/%i/selection/edit" % (self.pk)
|
||||
def get_delete_url(self):
|
||||
return "/srgcat/%i/selection/delete" % (self.pk)
|
||||
def get_download_url(self):
|
||||
return "/srgcat/%i/selection/download" % (self.pk)
|
||||
|
||||
def is_selected(self, skymapsource):
|
||||
if self.skymap_sources.filter(pk=skymapsource.pk).exists():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
class TrackStats(models.Model):
|
||||
user = models.ForeignKey(User, related_name="trackstats", on_delete=models.CASCADE)
|
||||
group = models.ForeignKey(Group, related_name="trackstats", null=True, blank=True, on_delete=models.SET_NULL)
|
||||
ip_address = models.GenericIPAddressField()
|
||||
url_name = models.CharField(max_length=50, blank=True, default='')
|
||||
path_info = models.CharField(max_length=150, blank=True, default='')
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.url_name
|
||||
|
||||
class UserSessionParameters(models.Model):
|
||||
owner = models.OneToOneField(User, related_name="session", on_delete=models.CASCADE)
|
||||
sign_threshold = models.FloatField(default=0.0, blank=True, null=True)
|
||||
target_ra = models.FloatField(default=0.0, blank=True, null=True)
|
||||
target_dec = models.FloatField(default=0.0, blank=True, null=True)
|
||||
|
||||
class ArtSource(models.Model):
|
||||
catalog = models.ForeignKey(ArtCat, on_delete=models.CASCADE)
|
||||
heasarc = models.ManyToManyField(HeasarcBase)
|
||||
|
||||
healpix = models.BigIntegerField(db_index=True, default=0)
|
||||
ra = models.FloatField(default=0.0)
|
||||
""" Right Ascension of the Source """
|
||||
dec = models.FloatField(default=0.0)
|
||||
""" Declination of the Source """
|
||||
lii = models.FloatField(default=0.0)
|
||||
""" Galactic Longitude """
|
||||
bii = models.FloatField(default=0.0)
|
||||
""" Galactic Latitude """
|
||||
radec_error = models.FloatField(default=0.0)
|
||||
""" Positional Uncertainty (arcsec)
|
||||
|
||||
Must be exactly radec_error to be consistent with EroTransSource and EroSurveySource
|
||||
"""
|
||||
name = models.CharField(max_length=36,blank=True, default='') # source name
|
||||
sign = models.FloatField(default=0.0)
|
||||
rate = models.FloatField(default=0.0)
|
||||
flux = models.FloatField(default=0.0)
|
||||
def __str__(self):
|
||||
return "%s" % (self.name)
|
||||
def get_absolute_url(self):
|
||||
return "/srgcat/%i/artsource" % (self.pk)
|
||||
|
0
srgcat/templatetags/__init__.py
Normal file
0
srgcat/templatetags/__init__.py
Normal file
10
srgcat/templatetags/srgcat_templates.py
Normal file
10
srgcat/templatetags/srgcat_templates.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.simple_tag
|
||||
def is_skymapsource_in_selection(selection, source):
|
||||
return selection.is_selected(source)
|
||||
|
||||
|
||||
|
3
srgcat/tests.py
Normal file
3
srgcat/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
66
srgcat/urls.py
Normal file
66
srgcat/urls.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from django.urls import path, re_path, register_converter, include
|
||||
|
||||
from . import views
|
||||
from . import utils
|
||||
|
||||
"""
|
||||
https://www.webforefront.com/django/accessurlparamstemplates.html
|
||||
"""
|
||||
register_converter(utils.FloatConverter, 'float')
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='art-xc survey index'),
|
||||
path('srga', views.get_name, name='srga'),
|
||||
path('aladin', views.show_aladin_healpix, name='art-xc aladin healpix'),
|
||||
path('stats', views.show_stats, name='show stats'),
|
||||
path('stats/<int:group_id>/group', views.show_stats_by_group, name='show stats by group'),
|
||||
path('gaia', views.show_gaia, name='skymap sources gaia'),
|
||||
path('heasarc', views.show_heasarc, name='skymap sources heasarc'),
|
||||
path('simbad', views.show_simbad, name='skymap sources simbad'),
|
||||
path('integral2020', views.show_integral2020, name='skymap sources integral2020'),
|
||||
path('intrefcat', views.show_intrefcat, name='skymap sources intrefcat'),
|
||||
path('intrefcat_csv', views.get_intrefcat_csv, name='skymap sources intrefcat csv'),
|
||||
path('xss', views.show_xss, name='skymap sources xss'),
|
||||
path('xss_csv', views.get_xss_csv, name='skymap sources xss csv'),
|
||||
path('csv', views.get_csv, name='skymap sources csv'),
|
||||
path('3maxi', views.show_3maxi, name='skymap sources 3maxi'),
|
||||
path('3maxi_csv', views.get_3maxi_csv, name='skymap sources 3maxi csv'),
|
||||
path('maxi_gsc', views.show_maxi_gsc, name='skymap sources maxi gsc'),
|
||||
path('maxi_gsc_csv', views.get_maxi_gsc_csv, name='skymap sources maxi gsc csv'),
|
||||
path('swiftbat105m', views.show_swiftbat105m, name='skymap sources swiftbat105m'),
|
||||
path('swiftbat105m_csv', views.get_swiftbat105m_csv, name='skymap sources swiftbat105m csv'),
|
||||
path('rass2rxs', views.show_rass2rxs, name='skymap sources rass2rxs'),
|
||||
path('rass2rxs_csv', views.get_rass2rxs_csv, name='skymap sources rass2rxs csv'),
|
||||
path('xmmsl2', views.show_xmmsl2, name='skymap sources xmmsl2'),
|
||||
path('xmmsl2_csv', views.get_xmmsl2_csv, name='skymap sources xmmsl2 csv'),
|
||||
path('exclude_allsky', views.show_exclude_allsky, name='skymap sources exclude allsky'),
|
||||
path('exclude_allsky_csv', views.get_exclude_allsky, name='skymap sources exclude allsky csv'),
|
||||
path('latest', views.show_latest, name='skymap sources latest'),
|
||||
path('erosita', views.show_erosita_matched_catalogs, name='skymap sources erosita catalogs'),
|
||||
path('erosita/<int:catalog_id>/list', views.show_erosita_matched_catalog, name='skymap sources erosita catalog list'),
|
||||
path('erosita/<int:catalog_id>/matched', views.show_erosita_matched, name='skymap sources erosita matched'),
|
||||
path('erosita/<int:catalog_id>/nomatch', views.show_erosita_nomatch, name='skymap sources erosita nomatch'),
|
||||
path('target', views.get_target_survey_post, name='target survey POST'),
|
||||
path('target_get', views.get_target_survey_get, name='target survey GET'),
|
||||
path('ddumps', views.show_srg_data_dumps, name='srg data dumps'),
|
||||
path('<int:cat_id>/info', views.show_cat, name='show info'),
|
||||
path('<int:dump_id>/ddump', views.show_data_dump, name='show data dump'),
|
||||
path('<int:dump_id>/ddump/update', views.update_catalog_data_dump, name='update catalog data dump'),
|
||||
path('create_new_selection', views.create_new_selection, name='create new selection'),
|
||||
path('session', views.user_session_parameters, name='user session parameters'),
|
||||
path('edit_all_selections', views.edit_all_selections, name='edit all selections'),
|
||||
path('<int:selection_id>/selection', views.show_selection, name='show selection'),
|
||||
path('<int:selection_id>/selection/edit', views.edit_selection, name='edit selection'),
|
||||
path('<int:selection_id>/selection/delete', views.delete_selection, name='delete selection'),
|
||||
path('<int:selection_id>/selection/download', views.download_selection, name='download selection'),
|
||||
path('<int:selection_id>/selection/<int:skymapsource_id>/add', views.add_skymapsource_to_selection, name='add to selection'),
|
||||
path('<int:selection_id>/selection/<int:skymapsource_id>/delete', views.delete_skymapsource_in_selection, name='delete in selection'),
|
||||
path('<int:dump_id>/<int:skymap_id>/skymap', views.show_dump_skymap, name='show dump sky map'),
|
||||
path('<int:skymap_id>/skymap', views.show_skymap, name='show sky map'),
|
||||
path('<int:skymap_id>/skymap_radec/<float:ra>/<float:dec>/', views.show_skymap_radec, name='show sky map radec'),
|
||||
path('<int:field>/field_radec/<float:ra>/<float:dec>/', views.show_field_radec, name='show field radec'),
|
||||
path('<int:skymap_id>/name_skymap', views.show_skymap_by_name, name='show sky map by name'),
|
||||
path('skymap', views.show_skymap_form, name='show sky map form'),
|
||||
path('<int:artsource_id>/artsource', views.show_artsource, name='show art source'),
|
||||
path('<int:skymapsource_id>/skymapsource', views.show_skymapsource, name='show skymap source'),
|
||||
]
|
45
srgcat/utils.py
Normal file
45
srgcat/utils.py
Normal file
@@ -0,0 +1,45 @@
|
||||
from astropy.coordinates import SkyCoord
|
||||
from astropy.coordinates import ICRS, Galactic, FK4, FK5
|
||||
from astropy.coordinates import Angle, Latitude, Longitude
|
||||
import astropy.units as u
|
||||
|
||||
class FloatConverter:
|
||||
regex = '[-?\d\.\d]+'
|
||||
|
||||
def to_python(self, value):
|
||||
return float(value)
|
||||
|
||||
def to_url(self, value):
|
||||
return '{}'.format(value)
|
||||
|
||||
|
||||
def make_source_name(key, ra, dec):
|
||||
""" Makes source name in format JHHMMSS.s+/-DDMMSS based on input RA and Dec. """
|
||||
try:
|
||||
c = SkyCoord(ra, dec, frame=FK5(), unit="deg")
|
||||
str1 = c.to_string('hmsdms',alwayssign=False,pad=False,precision=1).split()
|
||||
str2 = c.to_string('hmsdms',alwayssign=True,pad=False,precision=0).split()
|
||||
name = key+" J%s%s" % (str1[0].replace('h','').replace('m','').replace('s',''),
|
||||
str2[1].replace('d','').replace('m','').replace('s',''))
|
||||
return(name)
|
||||
except:
|
||||
return('None')
|
||||
|
||||
status_code = {0:"No error",
|
||||
1:'<a href="/">SRG arXiv</a>: User is not authenticated',
|
||||
2:'<a href="/">SRG arXiv</a>: User has no user profile',
|
||||
3:'<a href="/">SRG arXiv</a>: User has no appropriate group to access this page',}
|
||||
|
||||
def srg_group_auth(user, group):
|
||||
|
||||
if not user.is_authenticated:
|
||||
return 1
|
||||
try:
|
||||
user_profile=user.profile
|
||||
except:
|
||||
return 2
|
||||
|
||||
if not user.groups.filter(name=group).exists():
|
||||
return 3
|
||||
|
||||
return 0
|
1150
srgcat/views.py
Normal file
1150
srgcat/views.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user