<commit_before>package org.helioviewer.jhv.plugins.pfss.data;

import java.awt.Color;
import java.io.ByteArrayInputStream;
import java.nio.FloatBuffer;

import nom.tam.fits.BasicHDU;
import nom.tam.fits.BinaryTableHDU;
import nom.tam.fits.Fits;

import org.helioviewer.jhv.base.astronomy.Position;
import org.helioviewer.jhv.base.astronomy.Sun;
import org.helioviewer.jhv.base.time.JHVDate;
import org.helioviewer.jhv.plugins.pfss.PfssSettings;

import com.jogamp.common.nio.Buffers;

public class PfssData {

    private enum FieldLineColor {
        OPENFIELDCOLOR(Color.RED), LOOPCOLOR(Color.WHITE), INSIDEFIELDCOLOR(Color.BLUE);

        public final Color color;

        FieldLineColor(Color _color) {
            color = _color;
        }
    }

    private final byte[] gzipFitsFile;

    public FloatBuffer vertices;

    public int lastQuality;
    public boolean lastFixedColor;

    private JHVDate dateObs;
    final long time;

    public PfssData(byte[] _gzipFitsFile, long _time) {
        gzipFitsFile = _gzipFitsFile;
        time = _time;
        readFitsFile();
    }

    private void readFitsFile() {
        if (gzipFitsFile != null) {
            calculatePositions(PfssSettings.qualityReduction, PfssSettings.fixedColor);
        }
    }

    private void createBuffer(int len) {
        int numberOfLines = len / PfssSettings.POINTS_PER_LINE;
        vertices = Buffers.newDirectFloatBuffer((3 + 4) * (len + 2 * numberOfLines));<commit_msg>Reduce<commit_after>package org.helioviewer.jhv.plugins.pfss.data;

import java.awt.Color;
import java.io.ByteArrayInputStream;
import java.nio.FloatBuffer;

import nom.tam.fits.BasicHDU;
import nom.tam.fits.BinaryTableHDU;
import nom.tam.fits.Fits;

import org.helioviewer.jhv.base.astronomy.Position;
import org.helioviewer.jhv.base.astronomy.Sun;
import org.helioviewer.jhv.base.time.JHVDate;
import org.helioviewer.jhv.plugins.pfss.PfssSettings;

import com.jogamp.common.nio.Buffers;

public class PfssData {

    private enum FieldLineColor {
        OPENFIELDCOLOR(Color.RED), LOOPCOLOR(Color.WHITE), INSIDEFIELDCOLOR(Color.BLUE);

        public final Color color;

        FieldLineColor(Color _color) {
            color = _color;
        }
    }

    private final byte[] gzipFitsFile;

    public FloatBuffer vertices;
    public int lastQuality;
    public boolean lastFixedColor;

    private JHVDate dateObs;
    final long time;

    public PfssData(byte[] _gzipFitsFile, long _time) {
        gzipFitsFile = _gzipFitsFile;
        time = _time;
    }

    private void createBuffer(int len) {
        int numberOfLines = len / PfssSettings.POINTS_PER_LINE;
        vertices = Buffers.newDirectFloatBuffer((3 + 4) * (len + 2 * numberOfLines));
{'fraction_non_alphanumeric': 0.09504587155963302, 'fraction_numerical': 0.0022018348623853213, 'mean_word_length': 3.3338632750397457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1458631', 'n_tokens_mistral': 958, 'n_tokens_neox': 921, 'n_words': 174}