Commit e0f73142 authored by Alfonso's avatar Alfonso
Browse files

mask

parent a8af4b6f
Loading
Loading
Loading
Loading

.vscode/settings.json

0 → 100644
+49 −0
Original line number Diff line number Diff line
{
    "files.associations": {
        "array": "cpp",
        "atomic": "cpp",
        "bit": "cpp",
        "*.tcc": "cpp",
        "cctype": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "deque": "cpp",
        "map": "cpp",
        "unordered_map": "cpp",
        "vector": "cpp",
        "exception": "cpp",
        "algorithm": "cpp",
        "functional": "cpp",
        "iterator": "cpp",
        "memory": "cpp",
        "memory_resource": "cpp",
        "numeric": "cpp",
        "optional": "cpp",
        "random": "cpp",
        "string": "cpp",
        "string_view": "cpp",
        "system_error": "cpp",
        "tuple": "cpp",
        "type_traits": "cpp",
        "utility": "cpp",
        "fstream": "cpp",
        "initializer_list": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "new": "cpp",
        "ostream": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "typeinfo": "cpp"
    }
}
 No newline at end of file
+9 −7
Original line number Diff line number Diff line
#printa tutte le info di un file fits
#sostituisci il path del file .fits

from astropy.io import fits
import numpy as np

# Configura numpy per visualizzare tutti i dati senza troncamenti
np.set_printoptions(threshold=np.inf)

# Percorso del file FITS
file_path = '/home/alfonso/Scrivania/THESEUS/XGIS-X_0deg_reqEOL_v8.rmf'
file_path = '/home/alfonso/Scrivania/THESEUS/xgis_m7-main/msk_55_4752313.fits'

# Apri il file FITS
with fits.open(file_path) as hdul:
@@ -12,8 +13,9 @@ with fits.open(file_path) as hdul:
    hdul.info()
    
    # Itera su tutte le HDU e stampa l'header e i dati
    for hdu in hdul:
        print(f"\nHeader HDU {hdul.index(hdu)}:")
    for idx, hdu in enumerate(hdul):
        print(f"\nHeader HDU {idx}:")
        print(hdu.header)
        print("\nDati:")
        print(hdu.data)
        print(hdu.data)  # Stampa i dati completi senza troncamenti
+4 −4
Original line number Diff line number Diff line
@@ -11,9 +11,9 @@ BUS_THICK = 20. # Bottom bus dummy thickness (in cm)
BUS_HEIGHT			    = 150.				    # Spacecraft bus height (in cm)
BUS_SIDE			    = 100.				    # Spacecraft bus side (in cm)
SDD_THICK				= 450.0				    # SDD thickness (in um)
MASK_X					= 56.1				    # X side of the coded mask (in cm)
MASK_Y					= 56.1				    # Y side of the coded mask (in cm)
MASK_THICK				= 1000.				    # Thickness of the coded mask (in um)
MASK_X					= 56.5	                # X side of the coded mask (in cm) # 56.1 old
MASK_Y					= 56.5		            # Y side of the coded mask (in cm)
MASK_THICK				= 500.		            # Thickness of the coded mask (in um) # 1000 old
MASK_FOCAL				= 63.				    # Focal distance btw. mask and detector (in cm)
COLL_UPPER_1_THICK	    = 1000.0				# Upper internal collimator thickness (in um)
COLL_UPPER_2_THICK	    = 250.0				    # Upper external collimator thickness (in um)
@@ -23,7 +23,7 @@ OPTICAL_COUPLER_THICK = 1.0 # Optical coupler thickness (in mm)
# Module parameters                          
N_SIDE					= 89				    # Number of scintillator bars per side (89x89=7921-81)
N_SLICES_PER_BAR		= 1				    	# Number of voxels (slices) for each scintillator bar
N_MASK_ELEM_PER_SIDE	= 16				    # Number of mask elements per side (+16 vuoti)
N_MASK_ELEM_PER_SIDE	= 55	                # Number of mask elements per side #16 old


# Materials
+14 −3
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@
#include "globals.hh"
#include "G4VPVParameterisation.hh"

#include "G4ThreeVector.hh"
#include <vector>
#include <utility>
#include <string>

class G4VPhysicalVolume;
class G4Box;

@@ -25,12 +30,13 @@ class G4BREPSolidPolyhedra;
class MaskParameterisation : public G4VPVParameterisation
{ 
    public:
        MaskParameterisation(G4double, G4double, G4int);
        MaskParameterisation(G4double side_length_X, G4double side_length_Y, G4int n_side, G4double gap, const std::string& filename);

        virtual	~MaskParameterisation();

        void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume* physVol) const;
        void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume* physVol) const override;

        int GetTotalZeros() const;

    private:  // Dummy declarations to get rid of warnings...
        void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*) const {}
@@ -50,7 +56,12 @@ class MaskParameterisation : public G4VPVParameterisation
    private:
        G4double fSideX;
        G4double fSideY;
        G4double fGap;
        G4int nSide;
        std::vector<std::pair<int, int>> zeroPositions;

        int LoadZeroPositions(const std::string& filename);

};


python/a.out

0 → 100755
+18.6 KiB

File added.

No diff preview for this file type.

Loading