# How many filter layers are there (check a row with some)
            pixel_result = connection.execute(
                select([PIXEL_RESULT]).where(
                    and_(PIXEL_RESULT.c.galaxy_id == galaxy_id1,
                         PIXEL_RESULT.c.i_sfh != None))).first()
            if pixel_result is not None:
                filter_layers = connection.execute(
                    select([
                        func.count(PIXEL_FILTER.c.pxfilter_id)
                    ]).where(PIXEL_FILTER.c.pxresult_id == pixel_result[
                        PIXEL_RESULT.c.pxresult_id])).first()[0]

                # Store the values associated with a pixel
                pixel_count = store_pixels(connection, galaxy_id_aws,
                                           pixel_group,
                                           galaxy[GALAXY.c.dimension_x],
                                           galaxy[GALAXY.c.dimension_y],
                                           filter_layers,
                                           galaxy[GALAXY.c.pixel_count])

            # Flush the HDF5 data to disk
            h5_file.flush()
            h5_file.close()

            # Move the file
            to_store = os.path.join(OUTPUT_DIRECTORY, 'to_store')
            LOG.info('Moving the file %s to %s', filename, to_store)
            if not os.path.exists(to_store):
                os.makedirs(to_store)
            shutil.move(filename, to_store)

            connection.execute(GALAXY.update().where(
示例#2
0
            galaxy_id_aws = galaxy[GALAXY.c.galaxy_id]

            # Store the data associated with the galaxy
            store_fits_header(connection, galaxy_id_aws, galaxy_group)
            store_image_filters(connection, galaxy_id_aws, galaxy_group)

            # Store the data associated with the areas
            area_count = store_area(connection, galaxy_id_aws, area_group)
            store_area_user(connection, galaxy_id_aws, area_group)
            h5_file.flush()

            # Store the values associated with a pixel
            pixel_count = store_pixels(
                connection, galaxy_file_name, pixel_group,
                galaxy[GALAXY.c.dimension_x], galaxy[GALAXY.c.dimension_y],
                galaxy[GALAXY.c.dimension_z], area_count, OUTPUT_DIRECTORY,
                map_parameter_name)

            # Flush the HDF5 data to disk
            h5_file.flush()
            h5_file.close()

            # Move the file
            to_store = os.path.join(OUTPUT_DIRECTORY, 'to_store')
            LOG.info('Moving the file %s to %s', filename, to_store)
            if not os.path.exists(to_store):
                os.makedirs(to_store)
            shutil.move(filename, to_store)

            connection.execute(
            # Store the data associated with the areas
            area_count = store_area(connection, galaxy_id_aws, area_group)
            store_area_user(connection, galaxy_id_aws, area_group)
            h5_file.flush()

            # How many filter layers are there (check a row with some)
            pixel_result = connection.execute(select([PIXEL_RESULT]).where(and_(PIXEL_RESULT.c.galaxy_id == galaxy_id1, PIXEL_RESULT.c.i_sfh != None))).first()
            if pixel_result is not None:
                filter_layers = connection.execute(select([func.count(PIXEL_FILTER.c.pxfilter_id)]).where(PIXEL_FILTER.c.pxresult_id == pixel_result[PIXEL_RESULT.c.pxresult_id])).first()[0]

                # Store the values associated with a pixel
                pixel_count = store_pixels(connection,
                    galaxy_id_aws,
                    pixel_group,
                    galaxy[GALAXY.c.dimension_x],
                    galaxy[GALAXY.c.dimension_y],
                    filter_layers,
                    galaxy[GALAXY.c.pixel_count])

            # Flush the HDF5 data to disk
            h5_file.flush()
            h5_file.close()

            # Move the file
            to_store = os.path.join(OUTPUT_DIRECTORY, 'to_store')
            LOG.info('Moving the file %s to %s', filename, to_store)
            if not os.path.exists(to_store):
                os.makedirs(to_store)
            shutil.move(filename, to_store)
            # Store the data associated with the galaxy
            store_fits_header(connection, galaxy_id_aws, galaxy_group)
            store_image_filters(connection, galaxy_id_aws, galaxy_group)

            # Store the data associated with the areas
            area_count = store_area(connection, galaxy_id_aws, area_group)
            store_area_user(connection, galaxy_id_aws, area_group)
            h5_file.flush()

            # Store the values associated with a pixel
            pixel_count = store_pixels(connection,
                                       galaxy_file_name,
                                       pixel_group,
                                       galaxy[GALAXY.c.dimension_x],
                                       galaxy[GALAXY.c.dimension_y],
                                       galaxy[GALAXY.c.dimension_z],
                                       area_count,
                                       OUTPUT_DIRECTORY,
                                       map_parameter_name)

            # Flush the HDF5 data to disk
            h5_file.flush()
            h5_file.close()

            # Move the file
            to_store = os.path.join(OUTPUT_DIRECTORY, 'to_store')
            LOG.info('Moving the file %s to %s', filename, to_store)
            if not os.path.exists(to_store):
                os.makedirs(to_store)
            shutil.move(filename, to_store)