args = parser.parse_args()

print(args.seed)

np.random.seed(8910 + args.seed * 17)
_ = torch.manual_seed(8910 + args.seed * 13)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False

###############
# load psf
###############
bands = [2, 3]
psfield_file = '../sdss_stage_dir/2583/2/136/psField-002583-2-0136.fit'
init_psf_params = psf_transform_lib.get_psf_params(
                                    psfield_file,
                                    bands = bands)

power_law_psf = psf_transform_lib.PowerLawPSF(init_psf_params.to(device))
psf_og = power_law_psf.forward().detach()

###############
# Get image
###############
if args.test_image == 'small': 
    # test image file
    test_image_file = './test_image_20x20.npz'
    
    # parameters for encoder
    ptile_slen = 10
    step = 10
Exemplo n.º 2
0
#######################
with open('../model_params/default_star_parameters.json', 'r') as fp:
    data_params = json.load(fp)

data_params['alpha'] = args.prior_alpha
data_params['mean_stars'] = args.prior_mu
print(data_params)


###############
# load model parameters
###############
#### the psf
psfield_file = '../sdss_stage_dir/2583/2/136/psField-002583-2-0136.fit'
init_psf_params = psf_transform_lib.get_psf_params(
                                    psfield_file,
                                    bands = [2, 3]).to(device)

model_params = wake_lib.ModelParams(sdss_image,
                                init_psf_params = init_psf_params,
                                init_background_params = None)
psf_og = model_params.get_psf().detach()
background_og = model_params.get_background().detach().squeeze(0)

###############
# draw data
###############
print('generating data: ')
n_images = 200
t0 = time.time()
star_dataset = \