Ejemplo n.º 1
0
Read in the PSF measurements, to find out what subfields have the best PSFs
"""

import momentsml
import momentsml.plot
import config
import numpy as np
import matplotlib.pyplot as plt
from momentsml.tools.feature import Feature

import logging
logging.basicConfig(format=config.loggerformat, level=logging.DEBUG)
logger = logging.getLogger(__name__)

# Loading the run
great3 = config.load_run()
"""
# Read in the star measurements
cat = momentsml.tools.io.readpickle(great3.path("obs", "allstars_meascat.pkl"))

# Compute stats per subfield, by first restructuring the catalog
cat = momentsml.tools.table.groupreshape(cat, groupcolnames=["subfield"])

cat["psf_adamom_g"] = np.hypot(cat["psf_adamom_g1"], cat["psf_adamom_g2"])
momentsml.tools.table.addstats(cat, "psf_adamom_sigma")
momentsml.tools.table.addstats(cat, "psf_adamom_g")
#print cat
#print momentsml.tools.table.info(cat)

cat = momentsml.tools.io.writepickle(cat, great3.path("obs", "allstars_meascat_restruct.pkl"))
"""
Ejemplo n.º 2
0
"""

import momentsml
import momentsmlgreat3
import momentsml.plot
from momentsml.tools.feature import Feature
import matplotlib.pyplot as plt
import numpy as np

import config

import os
import logging
logging.basicConfig(format=config.loggerformat, level=logging.INFO)

run = config.load_run()

# Best subfield:
subfield = 99

spname = "G3Sersics_nn"
#spname = run.simparams.name

simcat = momentsml.tools.io.readpickle(
    os.path.join(run.measdir, run.simparams.name, "groupmeascat.pkl"))
#print momentsml.tools.table.info(simcat)

bestsub = momentsml.tools.table.Selector("bestsub",
                                         [("is", "subfield", subfield)])
simcat = bestsub.select(simcat)