Language

         

 Advertising by Adpathway

Digitized Sky Survey POSS-1

5 hours ago 5

PROTECT YOUR DNA WITH QUANTUM TECHNOLOGY

Orgo-Life the new way to the future

  Advertising by Adpathway

import csv import os import glob from astropy.io import fits from astropy.time import Time from earthshadow import get_shadow_center, get_shadow_radius, dist_from_shadow_center from astropy.coordinates import Angle import astropy.units as u from astropy.coordinates import SkyCoord import matplotlib.pyplot as plt import numpy as np def fits_time( date_obs, ut ) : date_split = date_obs.split( "/" ) return f"19{date_split[2]}-{date_split[1]}-{date_split[0]}T{ut}" def in_shadow( ra_value, dec_value, time ) : center = get_shadow_center( time, obs='Palomar', orbit='GEO') radius = get_shadow_radius(orbit='GEO') dist = dist_from_shadow_center( ra_value, dec_value, time=time, obs='Palomar', orbit='GEO') return dist < radius - 2*u.deg def get_metadata(): output_csv_file = "extracted_data.csv" metadata_list = [] fits_files = glob.glob('fits_files/*.fits') for fits_file in fits_files: with fits.open(fits_file) as hdul: header = hdul[0].header c = SkyCoord( header["OBJCTRA"], header["OBJCTDEC"], unit=(u.hourangle, u.deg), frame='icrs') ra_deg = c.ra.degree dec_deg = c.dec.degree metadata = { "file_name" : os.path.basename(fits_file), "DATE-OBS" : header["DATE-OBS"], "UT" : header["UT"], "SITELAT" : header["SITELAT"], "SITELONG" : header["SITELONG"], "OBJCTRA" : header["OBJCTRA"], "OBJCTDEC" : header["OBJCTDEC"], "EQUINOX" : header["EQUINOX"], "EPOCH" : header["EPOCH"], "EXPOSURE" : header["EXPOSURE"], "SHADOW" : in_shadow( ra_deg, dec_deg, time=Time( fits_time( header["DATE-OBS"], header["UT"] ), format='fits') )[0] } metadata_list.append( metadata ) with open(output_csv_file, 'w', newline='') as csvfile: fieldnames = list(metadata_list[0].keys()) writer = csv.DictWriter(csvfile, fieldnames=fieldnames) writer.writeheader() writer.writerows(metadata_list) if __name__ == "__main__": get_metadata()
Read Entire Article

         

        

HOW TO FIGHT BACK WITH THE 5G  

Protect your whole family with Quantum Orgo-Life® devices

  Advertising by Adpathway