out_data = mgr.dict()
    lock = multiprocessing.Lock()

    n_tot = 0
    n_processed = 0

    with h5py.File(obs_param_name,'r') as obs_params:
        for htmid_query in htmid_list:
            if htmid_query not in htmid_to_obs:
                continue
            n_lc_so_far = 0
            for name in out_data.keys():
                n_lc_so_far += len(out_data[name][0])
            print('now simulating ',htmid_query,n_lc_so_far)
            query_level = htm.levelFromHtmid(htmid_query)
            trixel_query = htm.trixelFromHtmid(htmid_query)
            ra_query, dec_query = trixel_query.get_center()
            radius_query = trixel_query.get_radius()
            print(ra_query, dec_query, radius_query)

            obs_query = ObservationMetaData(pointingRA=ra_query,
                                            pointingDec=dec_query,
                                            boundType='circle',
                                            boundLength=radius_query)

            col_names = ['ra', 'decl',
                         'umag', 'gmag', 'rmag',
                         'imag', 'zmag', 'ymag',
                         'lc_id', 't0', 'var_type',
                         'ebv', 'parallax',
                         'simobjid']
Example #2
0
    htmid_level_of_interest = htm.levelFromHtmid(htmid_of_interest)
    obs_list = np.array(htmid_to_obs[htmid_of_interest])
    obs_dex_list = obs_list-1
    print(len(obs_list))

    with h5py.File(obs_fname, 'r') as obs_file:
        shld_be = 1 + np.arange(len(obs_file['obsHistID'].value), dtype=int)
        np.testing.assert_array_equal(shld_be, obs_file['obsHistID'].value)
        np.testing.assert_array_equal(obs_file['obsHistID'].value[obs_dex_list],
                                      obs_list)

        obs_subset = {}
        for field_name in obs_file.keys():
            obs_subset[field_name] = obs_file[field_name].value[obs_dex_list]

        trixel_of_interest = htm.trixelFromHtmid(htmid_of_interest)
        trixel_ra, trixel_dec = trixel_of_interest.get_center()
        trixel_radius = 1.05*trixel_of_interest.get_radius()
        trixel_obs = sims_utils.ObservationMetaData(pointingRA=trixel_ra,
                                                    pointingDec=trixel_dec,
                                                    boundType='circle',
                                                    boundLength=trixel_radius)

        star_iter = star_db.query_columns(col_names,
                                          obs_metadata=trixel_obs,
                                          chunk_size=100000)

        ct_tot = 0
        ct_kplr = 0
        ct_mlt = 0
        ct_rrly = 0