40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
from django.core.management.base import BaseCommand, CommandError
|
|
|
|
from datetime import date
|
|
from heasarc.models import INPUT_DATA_DIR
|
|
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
|
|
import numpy.ma as ma
|
|
|
|
from astrobasis.models import GaiaSourceFile, GAIADR3
|
|
|
|
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 time
|
|
|
|
|
|
import os
|
|
import glob
|
|
import logging
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Initiates data dase'
|
|
|
|
def handle(self, *args, **options):
|
|
|
|
start_time = time.time()
|
|
srcs=GAIADR3.objects.filter(healpix=38837101).count()
|
|
#for src in srcs:
|
|
# print(src.name)
|
|
print("Total Gaia found %d" % srcs)
|
|
print("--- %s seconds ---" % (time.time() - start_time))
|
|
|