A method for preparing a photodetector array comprising an array substrate with a horizontal surface, and at least one first sensor and at least one second sensor on the horizontal surface of the array substrate, wherein the at least one first sensor is sensitive to radiation in a first wavelength range which comprises at least long-wavelength infrared, and the at least one second sensor is sensitive to radiation in a second wavelength range which comprises wavelengths shorter than long-wavelength infrared, characterized in that the at least one first sensor is a thermal photodetector and the at least one second sensor is a quantum photodetector, and that the method comprises the following steps: a) etching a vertical cavity (54, 64) in at least one first area (58, 78) on the horizontal surface of the array substrate, b) preparing the foundation of the thermal photodetector in the at least one first area on the horizontal surface of the array substrate, wherein the preparation comprises placing a layer of pyroelectric material (55, 65, 75) over the vertical cavity in the first area, so that it extends horizontally across the cavity, c) preparing the foundation of the quantum photodetector in at least one second area (59, 69, 79) of the horizontal surface of the array substrate, wherein the preparation comprises deposition of one or more of the following layers: a gate insulating layer, a photoactive semiconducting layer, a conductive gate electrode layer, d) depositing a layer of two-dimensional layered material on the horizontal surface of the array substrate so that it covers the foundation of the thermal photodetector at least in a part of each first area of the horizontal surface of the array substrate, and so that it covers the foundation of the quantum photodetector at least in a part of each second area of the horizontal surface of the array substrate, e) patterning the layer of two-dimensional layered material into at least two separate parts, so that one or more first parts (681, 781) of the layer of two-dimensional layered material cover at least a part of the foundation of the thermal photodetector, and one or more second parts (682, 782) of the layer of two-dimensional layered material cover at least a part of the foundation of the quantum photodetector, f) providing electrical connections (691, 692, 791, 792) to each first and second part of the two-dimensional layered material and depositing on each first part of the layer of two-dimensional material a top insulating layer and depositing on each top insulating layer a top electrode layer which extends from a transistor area within the first area to an adjacent area within the first area, so that the top electrode layer is in direct contact with the layer of pyroelectric material in the adjacent area. a) etching a vertical cavity (54, 64) in at least one first area (58, 78) on the horizontal surface of the array substrate, b) preparing the foundation of the thermal photodetector in the at least one first area on the horizontal surface of the array substrate, wherein the preparation comprises placing a layer of pyroelectric material (55, 65, 75) over the vertical cavity in the first area, so that it extends horizontally across the cavity, c) preparing the foundation of the quantum photodetector in at least one second area (59, 69, 79) of the horizontal surface of the array substrate, wherein the preparation comprises deposition of one or more of the following layers: a gate insulating layer, a photoactive semiconducting layer, a conductive gate electrode layer, d) depositing a layer of two-dimensional layered material on the horizontal surface of the array substrate so that it covers the foundation of the thermal photodetector at least in a part of each first area of the horizontal surface of the array substrate, and so that it covers the foundation of the quantum photodetector at least in a part of each second area of the horizontal surface of the array substrate, e) patterning the layer of two-dimensional layered material into at least two separate parts, so that one or more first parts (681, 781) of the layer of two-dimensional layered material cover at least a part of the foundation of the thermal photodetector, and one or more second parts (682, 782) of the layer of two-dimensional layered material cover at least a part of the foundation of the quantum photodetector, f) providing electrical connections (691, 692, 791, 792) to each first and second part of the two-dimensional layered material and depositing on each first part of the layer of two-dimensional material a top insulating layer and depositing on each top insulating layer a top electrode layer which extends from a transistor area within the first area to an adjacent area within the first area, so that the top electrode layer is in direct contact with the layer of pyroelectric material in the adjacent area.