How to use the hendrics.io.load_data function in hendrics

To help you get started, we’ve selected a few hendrics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github StingraySoftware / dave / src / main / python / utils / dave_reader.py View on Github external
if len(hdulist[hduname].data[ratecolumn].shape) != 1 \
        or not (isinstance(hdulist[hduname].data[ratecolumn][0], int) \
        or isinstance(hdulist[hduname].data[ratecolumn][0], np.integer) \
        or isinstance(hdulist[hduname].data[ratecolumn][0], float) \
        or isinstance(hdulist[hduname].data[ratecolumn][0], np.floating)):
        logging.warn("Wrong data type found for column: " + str(ratecolumn) + " in " + str(hduname) + " HDU, expected Integer or Float.")
        return None

    header, header_comments = get_header(hdulist, hduname)

    # Reads the lightcurve with HENDRICS
    outfile = lcurve_from_fits(destination, gtistring=get_hdu_string_from_hdulist(gtistring, hdulist),
                             timecolumn=column, ratecolumn=ratecolumn, ratehdu=1,
                             fracexp_limit=CONFIG.FRACEXP_LIMIT)[0]

    lcurve, events_start_time = substract_tstart_from_lcurve(load_data(outfile), time_offset)

    dataset = DataSet.get_lightcurve_dataset_from_stingray_lcurve(lcurve, header, header_comments,
                                                                    hduname, column)

    # Stores the events_start_time in time column extra
    dataset.tables[hduname].columns[column].set_extra("TSTART", events_start_time)

    logging.debug("Read Lightcurve fits with stingray file successfully: " + str(destination) + ", tstart: " + str(events_start_time) + ", rate: " + str(len(lcurve["counts"])))

    return dataset

hendrics

"High ENergy Data Reduction Interface from the Command Shell"

BSD-2-Clause
Latest version published 21 days ago

Package Health Score

73 / 100
Full package analysis

Similar packages